Commit Graph

2902 Commits

Author SHA1 Message Date
Brooks Davis
a9332fb303 Merge from CheriBSD:
commit 6d3c4c0922
    Add terasic_mtl vt(4) framebuffer driver

    terasic_mtl can be built with syscons(4) and vt(4) attachments, selected
    at compile time.

commit 33240259b4
    Clear terasic_mtl text buffer on attach

commit d188c2d241
    Update terasic vt(4) driver for FreeBSD r269783

commit d1cc54eee8
    Safety belt to ensure vt(4) fb parameters are correct

commit 76e6d468ef
    Improve terasic_mtl_vt fdt parsing

    - Use OF_getencprop to avoid need for explicit endian handling
      (submitted by ray@freebsd.org)
    - Check for expected length and correct pointer type

commit 3e2524b899
    Correct device_printf usage

commit 9e53e3c8e0
    Switch framebuffer to match host endianness

    Xorg and xf86-video-scfb work much better with a native-endian
    framebuffer.

commit 0f49259d59
    Switch DE4 to vt(4) and enable kbdmux

commit 5bc96ebc89
    Add missing \n in device_printf calls

Submitted by:	emaste
Sponsored by:	DARPA, AFRL
2014-11-21 21:34:19 +00:00
Brooks Davis
7db6c5cde6 Merge from CheriBSD (3422ebe71b):
Rename beripic to beripic0.

MFC after:	1 week
Sponsored by:	DARPA, AFRL
2014-11-21 20:54:12 +00:00
Yoshihiro Takahashi
cf902afcac MFi386: r274398
Move NFS and TFTP filesystems before the synthetic filesystems (bzip,
  gzip, and split).
2014-11-15 03:34:34 +00:00
Warner Losh
5181481b9b Cleanup trailing newlines noticed while looking for other issues. 2014-11-14 21:08:51 +00:00
Andrew Turner
c57b131994 Add the FDT table GUID. This is used to pass the device tree blob from UEFI
to the loader in a similar way to the ACPI tables.

This will be used on arm64 but is not specific to the architecture.

Sponsored by:	The FreeBSD Foundation
2014-11-12 17:56:38 +00:00
Peter Grehan
d971cd47f6 Fix incorrect reading of 32-bit modinfo by 64-bit loaders.
The various structures in the mod_metadata set of a FreeBSD kernel and
modules contain pointers. The FreeBSD loader correctly deals with a
mismatch in loader and kernel pointer size (e.g. 32-bit i386/ppc
loader, loading 64-bit amd64/ppc64 kernels), but wasn't dealing with
the inverse case where a 64-bit loader was loading a 32-bit kernel.

Reported by:	ktcallbox@gmail.com with a bhyve/i386 and ZFS root install
Differential Revision:	https://reviews.freebsd.org/D1129
Reviewed by:	neel, jhb
MFC after:	1 week
2014-11-11 22:03:11 +00:00
John Baldwin
8b20d1c1c5 Move NFS and TFTP filesystems before the synthetic filesystems (bzip,
gzip, and split).  "Real" filesystems should always be listed first so
that the "bare" filename is tried before alternate filenames.  For PXE
booting in particular this can remove a lot of spurious pathname lookups.

While here, move splitfs to the bottom after the bzip and gzip filesystems
as it is the least often used.

Tested by:	Prokash Sinha <psinha@panasas.com>
MFC after:	1 week
2014-11-11 19:44:59 +00:00
Xin LI
8bcd603968 MFV r274273:
ZFS large block support.

Please note that booting from datasets that have recordsize greater
than 128KB is not supported (but it's Okay to enable the feature on
the pool).  This *may* remain unchanged because of memory constraint.

Limited safety belt is provided for mounted root filesystem but use
caution is advised.

Illumos issue:
    5027 zfs large block support

MFC after:	1 month
2014-11-10 08:20:21 +00:00
Alexander V. Chernikov
603eaf792b Renove faith(4) and faithd(8) from base. It looks like industry
have chosen different (and more traditional) stateless/statuful
NAT64 as translation mechanism. Last non-trivial commits to both
faith(4) and faithd(8) happened more than 12 years ago, so I assume
it is time to drop RFC3142 in FreeBSD.

No objections from:	net@
2014-11-09 21:33:01 +00:00
Marcel Moolenaar
6d426c10fb In alloc_pread() and kern_pread(), print errors only when DEBUG is
defined. An error is not fatal and is supposed to be handled by the
caller.

Obtained from:	Juniper Networks, Inc.
2014-11-05 04:18:41 +00:00
Marcel Moolenaar
dacdf5e0fc Change the order of the arguments to file_loadraw(). They were swapped
as of r262345 when file_loadraw() was made public and this little detail
got overlooked during porting.

Obtained from:	Juniper Networks, Inc.
2014-11-01 18:51:48 +00:00
Andrew Turner
8c81befd0b Start to allow platforms other than U-Boot to use the FDT code in loader by
moving U-Boot specific code from libfdt.a to a new libuboot_fdt.a. This
needs to be a new library for linking to work correctly.

Differential Revision:	https://reviews.freebsd.org/D1054
Reviewed by:	ian, rpaulo (earlier version)
MFC after:	1 week
2014-11-01 17:12:44 +00:00
Andrew Turner
47264cb680 Move the definitions of the fdt functions from a uboot header to a new fdt
header. There is nothing in the fdt spec that ties it to U-Boot.

While here sort and fix the signature of fdt_setup_fdtp.

MFC after:	1 week
2014-11-01 10:50:18 +00:00
Andrew Turner
85462455a5 The command name is a constant, use the correct type.
MFC after:	1 week
2014-10-31 18:35:03 +00:00
Andrew Turner
a7ac719d30 Clean up the types of a few strings to make them const when they are never
written to.
2014-10-31 18:20:39 +00:00
Doug Ambrisko
db0b8e10a7 Make UEFI booting of 4Kn disks work:
-	convert boot1.efi to corrrectly calculate the lba for what the
	media reports and convert the size based on what FreeBSD uses.
	The existing code would use the 512 byte lba and convert the
	size using 4K byte size.
      -	make fsck_msdosfs read the boot block as 4K so the read doesn't
	fail on a 4Kn drive since FreeBSD will error out parition reads
	of a block.  Make the bpbBytesPerSec check a multiple of 512 since
	it can be 512 or 4K depending on the disk.  This allows fsck to
	pass checking the EFI partition on a 4Kn disk.

To create the EFI file system I used:
	newfs_msdos -F 32 -S 4096 -c 1 -m 0xf8 <partition>
This works for booting 512 and 4Kn disks.

Caveat is that loader.efi cannot read the 4Kn EFI partition.  This isn't
critical right now since boot1.efi will read loader.efi from the ufs
partition.  It looks like loader.efi can be fixed via making some of the
512 bytes reads more flexible.  loader.efi doesn't have trouble reading
the ufs partition.  This is probably a simple fix.

I now have FreeBSD installed on a system with 4Kn drives and tested the
same code works on 512.

MFC after:	1 week
2014-10-30 15:52:01 +00:00
Ruslan Bukin
2d3f1b38a9 Provide a character device allowing us to access BERI memory regions.
Sponsored by:	DARPA, AFRL
2014-10-22 11:30:03 +00:00
Ruslan Bukin
8b62915e24 Add driver for Micrel KSZ9021 Gigabit Ethernet Transceiver (PHY).
Sponsored by:	DARPA, AFRL
2014-10-21 09:14:16 +00:00
Marcel Moolenaar
0067051fe7 Fully support constructors for the purpose of code coverage analysis.
This involves:
1.  Have the loader pass the start and size of the .ctors section to the
    kernel in 2 new metadata elements.
2.  Have the linker backends look for and record the start and size of
    the .ctors section in dynamically loaded modules.
3.  Have the linker backends call the constructors as part of the final
    work of initializing preloaded or dynamically loaded modules.

Note that LLVM appends the priority of the constructors to the name of
the .ctors section. Not so when compiling with GCC. The code currently
works for GCC and not for LLVM.

Submitted by:	Dmitry Mikulin <dmitrym@juniper.net>
Obtained from:	Juniper Networks, Inc.
2014-10-20 17:04:03 +00:00
Ian Lepore
db8aa5fd6d The U-Boot README says fdt_addr_r is the right env var for fdt data
loaded into ram, but vendors also use fdtaddr and fdt_addr.  Check the
recommended variable first and fall back to the others.
2014-10-20 01:52:17 +00:00
Ruslan Bukin
b0da449e60 Add driver for BERI soft processor 'ring buffer' device.
Ring device provides a way for communicate to BERI
peripherals such as BERI debug unit and console.

Sponsored by:	DARPA, AFRL
2014-10-19 16:26:49 +00:00
Rui Paulo
5aed7446fe AM335X FDT: use the oma3-wdt string for compatibility with Linux.
Submitted by:	andrew
MFC after:	1 week
2014-10-18 16:34:52 +00:00
Rui Paulo
b406729896 AM335x FDT: add an entry for the watchdog.
MFC after:	1 week
2014-10-18 07:40:38 +00:00
Jens Schweikhardt
632d4e706a Correct grammos.
MFC after:	3 weeks
2014-10-15 17:55:10 +00:00
Ruslan Bukin
d4d630aebe o Add machine-dependent SMP part
o Enable SMP

Sponsored by:	DARPA, AFRL
2014-10-10 14:35:51 +00:00
Baptiste Daroussin
66c8095956 Rename elf*-powerpc into elf*-powerpc-freebsd in binutils
The powerpc support was the only supported architecture not prepending the elf format name
with "-freebsd" in base this change makes it consistent with other architectures.
On newer version of binutils the powerpc format is also prepended with "-freebsd".

Also modify the kernel ldscripts in that regards.

As a result it is now possible cross build the kernel on powerpc using newer binutils

Differential Revision:	https://reviews.freebsd.org/D926
Differential Revision:	https://reviews.freebsd.org/D928
2014-10-10 06:24:09 +00:00
Marcel Moolenaar
511037bd43 Properly NUL-terminate the on-stack buffer for reading /boot.config
or /boot/config. In qemu, on a warm boot, the stack is not all zeroes
and we parse beyond the file's contents.

Obtained from:	Juniper Networks, Inc.
2014-10-09 01:54:32 +00:00
Andrey V. Elsukov
5c6af4bbf5 Fix comment.
MFC after:	1 week
2014-10-08 12:33:31 +00:00
Ruslan Bukin
41709d23c4 Add driver for Synopsys DesignWare Mobile Storage Host Controller.
Sponsored by:	DARPA, AFRL
2014-10-07 17:39:30 +00:00
Andrey V. Elsukov
4118113fc1 Rework bootparttest to use more code from sys/boot.
Use disk_open() call to emulate loader behavior.
2014-10-05 06:04:47 +00:00
Andrey V. Elsukov
34f50f4c34 Add a bit more debug messages. 2014-10-05 06:00:22 +00:00
Andrey V. Elsukov
f24c6fe478 Add GUID of FreeBSD slice to GPT scheme.
MFC after:	1 week
2014-10-03 21:46:07 +00:00
Andrew Turner
6d4766c1b8 Remove MK_ARM_EABI, the armeb issues have been fixed. The code to support
the oabi is still in the tree, but it is expected this will be removed
as developers work on surrounding code.

With this commit the ARM EABI is the only supported supported ABI by
FreeBSD on ARMa 32-bit processors.

X-MFC after:	never
Relnotes:	yes
Differential Revision: https://reviews.freebsd.org/D876
2014-10-01 08:26:51 +00:00
Yoshihiro Takahashi
4ac1175e89 MFi386: r261567
Switch from lib/libstand to sys/boot/libstand32.
2014-09-28 13:34:43 +00:00
Yoshihiro Takahashi
2c4969da8d MFi386: r268974
Supress clang warning for FreeBSD printf %b and %D formats.
2014-09-28 13:13:18 +00:00
Yoshihiro Takahashi
f40e4b0c6d MFi386: r261520
Drop the 3rd clause from all 3 clause BSD licenses.
2014-09-28 12:25:27 +00:00
Yoshihiro Takahashi
985b2f8cd1 Reduce diffs against i386. 2014-09-28 12:13:51 +00:00
Yoshihiro Takahashi
a580f768cf Remove extra '\'. 2014-09-28 12:12:54 +00:00
Alexander Kabaev
23667f089d Remove obsolete compatibility glue and improve firewire code readability.
Commit my version of style(9) pass over the firewire code. Now that
other people have started changing the code carrying this is as a
local patch is not longer a viable option.

MFC after:	1 month
2014-09-27 16:50:21 +00:00
Ruslan Bukin
5d43fd685b Add driver for Synopsys DesignWare 3504-0 Universal 10/100/1000
Ethernet MAC.

Sponsored by:	DARPA, AFRL
2014-09-25 18:03:14 +00:00
Ed Maste
7797431f9a Remove duplicated header content
I fail at patch(1).

MFC after:	3 days
2014-09-25 13:31:08 +00:00
Ed Maste
3bcd280e3b Switch to text mode in UEFI boot
The loader previously failed to display on MacBooks and other systems
where the UEFI firmware remained in graphics mode.

Submitted by:	Rafael Espíndola
2014-09-18 13:59:36 +00:00
Ed Maste
7f4b01c1fa Wrap long lines introduced in r268227 2014-09-18 13:00:03 +00:00
Andriy Gapon
ce2907df79 add gptzfsboot.8, zfsboot.8 and zfsloader.8 manual pages
Many thanks to Warren Block for his reviews, corrections and additions.

Reviewed by:	Warren Block <wblock@FreeBSD.org>
MFC after:	1 week
2014-09-15 06:21:28 +00:00
Doug Ambrisko
cb8a626055 Add support for serial and null console to UEFI boot loader. 2014-09-12 17:32:28 +00:00
Ruslan Bukin
6ca0b78179 Add Reset Manager driver. This driver provides generic way to reset
and provides sysctl tunables for enable/disable FPGA<->HPS bridges.

Sponsored by:	DARPA, AFRL
2014-09-11 18:12:28 +00:00
Warner Losh
dd56e3b6bc Add support for calling pcibios routines from the
bootloader. Implement the following routines:
	pcibios-device-count	count the number of instances of a devid
	pcibios-read-config	read pci config space
	pcibios-write-config	write pci config space
	pcibios-find-devclass	find the nth device with a given devclass
	pcibios-find-device	find the nth device with a given devid
	pcibios-locator		convert bus device function ti pcibios locator
These commands are thin wrappers over their PCI BIOS 2.1 counterparts. More
informaiton, such as it is, can be found in the standard.

Export a nunmber of pcibios.X variables into the environment to report
what the PCI IDENTIFY command returned.

Also implmenet a new command line primitive (pci-device-count), but don't
include it by default just yet, since it depends on the recently added
words and any errors here can render a system unbootable.

This is intended to allow the boot loader to do special things based
on the hardware it finds. This could be have special settings that are
optimized for the specific cards, or even loading special drivers. It
goes without saying that writing to pci config space should not be
done without a just cause and a sound mind.

Sponsored by:	Netflix
2014-09-10 21:07:00 +00:00
Ian Lepore
6966304042 Add a 'ubenv import' command to import environment variables from the
u-boot env into the loader(8) env (which also gets them into the kernel
env).  You can import selected variables or the whole environment.  Each
u-boot var=value becomes uboot.var=value in the loader env.  You can also
use 'ubenv show' to display uboot vars without importing them.
2014-09-08 19:19:10 +00:00
Ruslan Bukin
34a0189341 Add FPGA Manager driver. This driver allows to program FPGA core
from FreeBSD userspace running on ARM core.

Sponsored by:	DARPA, AFRL
2014-09-06 08:48:57 +00:00
Ian Lepore
9cbece6f0d Stop setting the iomux device status to disabled, now that we have a driver. 2014-09-04 19:52:17 +00:00