Commit Graph

3366 Commits

Author SHA1 Message Date
Bryan Drewery
a774e11017 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-03-21 18:02:26 +00:00
Ian Lepore
98acd232ad If the dhcp server provided an interface-mtu option, transcribe the value
to the boot.netif.mtu env var, which will be picked up by pre-existing code
in nfs_mountroot() and used to configure the interface accordingly.

This should bring the same functionality when the bootp/dhcp work is done
by loader(8) as r297150 does for the in-kernel BOOTP case.
2016-03-21 15:06:50 +00:00
Allan Jude
b996592c3e Implement GELI (AES-XTS and AES-CBC only) in gptboot and gptzfsboot
Allows booting from a GELI encrypted root file system, via UFS or ZFS

Reviewed by:	gnn, smh (previous version), delphij (previous version)
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D4593
2016-03-16 23:12:19 +00:00
Michal Meloun
ef2ee5d07a Import basic support for Nvidia Jetson TK1 board and tegra124 SoC.
The following pheripherals are supported: UART, MMC, AHCI, EHCI, PCIe, I2C,
PMIC, GPIO, CPU temperature and clock.

Note: The PCIe driver is pure mash at this moment. It will be reworked
immediately when both D5237 and D2579 enter the current tree.
2016-03-16 13:01:48 +00:00
Warner Losh
735a5d0b0b ms_abi is supported with gcc 4.5 or newer, so build it with gcc if it
is 4.5 or newer.
2016-03-15 05:17:31 +00:00
Wojciech Macek
ca8e20784a Make MPIC compatible with ARM_INTRNG
After ARM_INTRNG introduction, MPIC code needed several modifications:
- IRQ resource and its handler added
-  several DEVMETHODs of INTRNG interface implemented
-  defines enhanced to ensure code compiles as well for AXP as for A38X
- added dummy MSI_IRQ, ERR_IRQ defines for Armada38x
- MPIC driver was added to files.armada38x, ARM_INTRNG option enabled in
  kernconf file and regs of MPIC corrected in dts file.

Instead of modifying Armada38X DTS, offsets to CPU registers defined in
driver were changed. That required restoring 'reg' property of mpic node
in ArmadaXP to state compliant with Linux DTS.

Additionally, required ARM_INTRNG definitions were added to mv_common.c.

Submitted by:          Bartosz Szczepanek <bsz@semihalf.com>
Obtained from:         Semihalf
Sponsored by:          Stormshield
Reviewed by:           adrian, andrew, ian, skra
Approved by:           cognet (mentor)
Differential Revision: https://reviews.freebsd.org/D5030
2016-03-14 07:05:41 +00:00
Jared McNeill
e9a37ecaab Add HDMI device nodes to Banana Pi dts.
PR:		207912
Approved by:	gonzo (mentor)
2016-03-13 01:49:36 +00:00
Ed Maste
6d51bbb52a boot/efi: Prefer nm to objdump
Both objdump and nm are equally capable of reporting undefined symbols.

This gets us a step closer to building without binutils as we have an nm
implementation from ELF Tool Chain.

Reviewed by:	bdrewery
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D5613
2016-03-12 21:44:33 +00:00
Andrew Turner
cc91c4c7b4 Print the correct size of loader.efi when failing to load it into memory.
Obtained from:	AsiaBSDCon
Sponsored by:	ABT Systems Ltd
2016-03-12 06:50:16 +00:00
Bryan Drewery
a09f4b4d12 Add more .NOMETA missed in r291320
Sponsored by:	EMC / Isilon Storage Division
2016-03-11 23:45:51 +00:00
Bryan Drewery
1a17ca5f2a Revert r269030. CLEANFILES is already added to .NOPATH since r241298.
Sponsored by:	EMC / Isilon Storage Division
2016-03-11 23:45:45 +00:00
Stanislav Galabov
08190ef7de Improve U-Boot API detection
Until now, ubldr has been trying to locate the U-Boot API using a hint
address (U-Boot's current stack pointer), aligning it to 1MiB and going
over a 3MiB (or 1MiB in case of MIPS) memory region searching for a
valid API signature.

This change introduces an alternative way of doing this, namely the
following:
- both U-Boot's bootelf and go commands actually pass argc and argv to
  the entry point (e.g., ubldr's start function, but they should also
  be passed over to main() transparently)
- so, instead of trying to go and look for a valid API signature, we
  look at the parameters passed to main()
- if there's an option '-a' with argument, which is a valid hexadecimal
  unsigned  long number (x), we try to verify whether we have a valid
  API signature at address x. If so - we use it. If not - we fallback
  to the original way of locating the API signature.

The U-Boot change, which causes the API structure address to be
exported as an environment variable, was committed to mainline U-Boot
as commit 22aa61f707574dd569296f521fcfc46a05f51c48

Reviewed by:	andrew, adrian
Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D5492
2016-03-09 11:45:48 +00:00
Ed Maste
91ca23befa boot1.efi: use += to append to LDFLAGS
This is for consistency with loader.efi's Makefile and simplifies some
out-of-tree experimentation.
2016-03-08 17:45:56 +00:00
Dimitry Andric
20893a44b7 Since kernel modules can now contain sections of type SHT_AMD64_UNWIND,
the boot loader should not skip over these anymore while loading images.
Otherwise the kernel can still panic when it doesn't find the .eh_frame
section belonging to the .rela.eh_frame section.

Unfortunately this will require installing boot loaders from sys/boot
before attempting to boot with a new kernel.

Reviewed by:	kib
MFC after:	2 weeks
X-MFC-With:	r296419
2016-03-06 15:57:43 +00:00
Dimitry Andric
a36b180a7f Merge ^/head r296369 through r296409. 2016-03-05 15:34:54 +00:00
Stanislav Galabov
7345458d37 Fix ubldr build failure on mipsn32 and mipsn32el targets.
Approved by:	adrian (mentor)
2016-03-04 05:36:53 +00:00
Dimitry Andric
82aa34e6fa Merge ^/head r296007 through r296368. 2016-03-03 23:15:46 +00:00
Ed Maste
fa078c432f userboot: use MK_CTF=no to disable CTF
The NO_ form (e.g. NO_CTF) is deprecated.
2016-02-29 17:54:55 +00:00
Stanislav Galabov
55d11ce3bd Fix build failure introduced by r296182
Approved by:	adrian (mentor)
2016-02-29 09:03:07 +00:00
Stanislav Galabov
a1b701d82b This review aims at introducing ubldr (loader with U-Boot interface) for MIPS
(32 and 64-bit, LE and BE).
The changes were tested with QEMU's 'mips' target.

Most of the implementation was lifted from the ARM version, the appropriate
MIPS-specific things were implemented.

With these changes I am able to go all the way through the u-boot->ubldr->kernel
boot chain in QEMU on all combinations of bit-ness and endian-ness.

For the tests I've used FAT32 disk images (as FAT32 is supported by U-boot),
which include /boot/kernel/kernel and /boot/kernel/ubldr.bin

In U-boot I do:
fatload ide 0 <LOAD_ADDR> /boot/kernel/ubldr.bin; go <LOAD_ADDR>
where LOAD_ADDR is 80800000 for 32-bit and ffffffff80800000 for 64-bit

Then it's the usual ubldr that takes over and loads and starts a kernel.

Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D5313
2016-02-29 07:47:04 +00:00
Stanislav Galabov
b981b8bd86 These changes attempt to put things in order before the introduction of MIPS
ubldr.

The changes are mostly dealing with removing unnecessary casts from the U-Boot
API (we're passing only pointers, no obvious reason to cast them to uint32_t),
cleaning up some compiler warnings and using the proper printf format
specifiers in order to be able to compile cleanly for both 32-bit and 64-bit
MIPS targets.

Reviewed by:	imp
Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D5312
2016-02-29 07:27:49 +00:00
Marcel Moolenaar
7eb9cc0975 Add vm_set_register() and vm_set_desc() callbacks. These callbacks
translate directly into calls to their namesake API functions in
libvmmapi.

It is an improvement over the existing setreg(), setmsr(), setcr()
setgdt() and exec() callbacks in that the new additions give full
control and don't assume we're booting FreeBSD, like exec() and
don't assume one only wants to set the value of RSP, like setreg().
2016-02-26 16:00:16 +00:00
Marcel Moolenaar
8265d91646 Check that the userboot version is at least 3, rather than
3 exactly. The structure may be of a newer version and as
long as it is backward compatible with 3, we can work with
it.

While here: whitespace nits.
2016-02-26 15:52:55 +00:00
Stanislav Galabov
de867427d8 So far bsd.stand.mk wasn't included in the following files:
sys/boot/fdt/Makefile
sys/boot/uboot/fdt/Makefile
sys/boot/uboot/lib/Makefile

This causes compilation issues on MIPS due to trying to link PIC with non-PIC
code. This revision includes bsd.stand.mk in the above files.

Reviewed by:	imp
Approved by:	adrian (mentor)
Sponsored by:	Smartcom - Bulgaria AD
Differential Revision:	https://reviews.freebsd.org/D5311
2016-02-26 08:16:44 +00:00
Stanislav Galabov
8b2db3b713 Currently BERI's loader is including the 32-bit version of the FICL MIPS sysdep.h (sys/boot/ficl/mips/sysdep.h) instead of the 64-bit version (sys/boot/ficl/mips64/sysdep.h).
Although this may not be an issue in practice, it would be more correct if the 64-bit version was used. Also, using the 64-bit version would make it easier to add support for 64-bit ubldr on MIPS.

Approved by:	adrian (mentor)
Differential Revision:	https://reviews.freebsd.org/D5310
2016-02-26 08:06:25 +00:00
Jared McNeill
dd03610a2e Add Allwinner A20 HDMI support.
The HDMI driver will attach a framebuffer device when a display is
connected. If the EDID can be read and contains a preferred mode, it
will be used. Otherwise the framebuffer will default to 800x600.

In addition, if the EDID contains a CEA-861 extension block and the
"basic audio" flag is set, audio playback at 48kHz 16-bit stereo is
enabled on the controller.

Reviewed by:		andrew
Approved by:		gonzo (mentor)
Differential Revision:	https://reviews.freebsd.org/D5383
2016-02-25 20:17:18 +00:00
Dimitry Andric
14e9c9161c Merge ^/head r295902 through r296006. 2016-02-24 21:38:51 +00:00
Bryan Drewery
bd18fd57db DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:11 +00:00
Ruslan Bukin
17696c12f5 Add support for symmetric multiprocessing (SMP).
Tested on Spike simulator with 2 and 16 cores (tlb enabled),
so set MAXCPU to 16 at this time.

This uses FDT data to get information about CPUs
(code based on arm64 mp_machdep).

Invalidate entire TLB cache as it is the only way yet.

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-02-24 16:50:34 +00:00
Maxim Sobolev
5497acc527 Obsolete mkulzma(8) and geom_uncompress(4), their functionality
is now provided by mkuzip(8) and geom_uzip(4) respectively.

MFC after:	1 month
2016-02-24 00:39:36 +00:00
Ruslan Bukin
cea32c0742 o Grab physical memory regions information from the device tree.
o Increase memory size.
2016-02-23 14:21:46 +00:00
Dimitry Andric
76f3831738 Merge ^/head r295845 through r295901. 2016-02-22 22:21:53 +00:00
Ian Lepore
0d2550a169 If the user has set a u-boot env var named rootpath, automatically
import it into the loader(8) env as dhcp.root-path, so that it overrides
any dhcp/bootp server-provided path.

Now if you have a dhcp server available you can easily net-boot a u-boot
system even if you don't control the dhcp server config, by setting just
two variables in the u-boot env:

  loaderdev=net
  rootpath=<nfsserverip>:<pathname>

Previously you had to either accept all the dhcp parameters from the
server without the ability to locally provide the rootpath, or you had
to forego dhcp and set more vars (ipaddr, netmask, serverip, rootpath).
2016-02-22 18:53:55 +00:00
Andrew Turner
fe3232f39a Make efi_time and EFI_GetTimeOfDay static, neither are used by other parts
of the efi code.

Sponsored by:	ABT Systems Ltd
2016-02-21 21:20:23 +00:00
Dimitry Andric
9893f787ec Merge ^/head r295601 through r295844. 2016-02-21 13:49:26 +00:00
Andrew Turner
f4cd39e3b2 Add a missing call to dev_cleanup from the arm64 loader.efi.
Sponsored by:	ABT Systems Ltd
2016-02-20 17:29:04 +00:00
Ed Maste
796a99fc5c Remove dd xfer stats emitted during buildworld
They result in gratuitous differences when comparing build log output.
2016-02-18 14:17:28 +00:00
Andrew Turner
4b68de9c1a Move the Allwinner kernels to use fdt_pinctrl. This will read the pin
configuration from the FDT data, then set the pins into the requested
state. As part of this the gpio controller now reports the correct number
of pins instead of returning the number of bank * 32.

To allow for a future consolidated kernel we add the SOC_ALLWINNER_A10 and
SOC_ALLWINNER_A20 kernel options. These need to be set as appropriate for
the SoC the kernel will boot on.

Submitted by:	Emmanuel Vadot <manu@bidouilliste.com>
Differential Revision:	https://reviews.freebsd.org/D5177
2016-02-17 18:28:03 +00:00
Andrew Turner
ba9b71631d Add an analog audio driver for the audio codec found on the Allwinner
A10/A20 SoC. Based loosely on the submitters NetBSD driver, tested on
Cubieboard 2. Playback and capture are supported.

Submitted by:	Jared McNeill <jmcneill@invisible.ca>
Differential Revision:	https://reviews.freebsd.org/D5202
2016-02-16 11:45:46 +00:00
Svatopluk Kraus
95b2d200ef Temporary overwrite bad definition of elm interrupt property in Linux
dts files. It may be removed once it will be fixed upstream.

This is done just to supresses a warning during dtb evaluation as
there is no elm driver in tree at present.
2016-02-16 11:38:38 +00:00
Bryan Drewery
9d8a81b4e4 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-02-16 02:14:30 +00:00
Andrew Turner
501ce0d86b Add support for the Allwinner DMA controller. This will be used by the at
least the audio codec driver currently in review.

Submitted by:	Jared McNeill <jmcneill@invisible.ca>
Differential Revision:	https://reviews.freebsd.org/D5050
2016-02-15 19:56:35 +00:00
Dimitry Andric
43a7fce37a Similar to r293384 and r293426, for sys/boot, also use the new -mno-movt
flag with clang >= 3.8.0 targeting arm.
2016-02-11 20:16:11 +00:00
Ruslan Bukin
cfddfe4cd5 o Move non-generic kernel configuration out from GENERIC.
o Add kernel configuration for QEMU.

Both SPIKE and QEMU kernel configs are temporary (until
we will be able to obtain DTB from loader).

Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
2016-02-11 13:28:52 +00:00
Andrew Turner
907fe11655 Update of the Allwinner drivers to:
* Use the Linux compat string
 * Use EARLY_DRIVER_MODULE to attach at the right time
 * Add a generic A10 kernel config file
 * A20 now use generic_timer
 * Add two new dts files for Olimex boards
 * Update our custom DTS file for A10 and A20 to use the same compatible
   property names as the vendor ones.

Submitted by:	Emmanuel Vadot <manu@bidouilliste.com>
Differential Revision:	https://reviews.freebsd.org/D4792
2016-02-10 09:19:29 +00:00
Andrew Turner
35ad131a2a Don't set the offset when loading the kernel on the arm loader.efi. The
copyin and copyout code handle virtual addresses such that they will take
a virtual address and convert it into a valid physical address. It may
also mean we fail to boot as the elf files load address could be 0.

Sponsored by:	ABT Systems Ltd
2016-02-09 09:39:30 +00:00
Andrew Turner
214d450501 Stop clang from generating movt/movw sequences. These don't get relocated
so will access data from an unrelocated address. This is only needed for
self relocating code on ARMv7, however this is true for both ubldr and
loader.efi, the only two loaders we support on ARMv7.

While here also force the fpu to be none as is done in libstand.

Sponsored by:	ABT Systems Ltd
2016-02-09 00:15:41 +00:00
Andrew Turner
aeffd7b7ea Ensure the bss is aligned to a 4-byte address as we use 4-byte aligned
stores to clear it.

While here reduce the alignment of the data from 4k to 16 byte aligned.
This should be more than enough, without wasting too much space.

Sponsored by:	ABT Systems Ltd
2016-02-09 00:01:43 +00:00
Pedro F. Giffuni
595b2caa3f ficl: Replace rand(3) with random(3).
Be a little more consistent with random(3) and push an
unsigned value.

Again, this has no effect as this code doesn't get compiled
for the boot code.
2016-02-08 20:03:14 +00:00
Pedro F. Giffuni
9868276d3b ficl: Replace rand(3) with random(3).
While the later is a better random generator than the former, the main
reason of the change is that random() has a better chance to work with
libstand(3).

At this time we don't include random number generators in bootforth
so this has no effect.
2016-02-08 19:45:55 +00:00