Commit Graph

3114 Commits

Author SHA1 Message Date
Luiz Otavio O Souza
6a4b96ad82 Add support for the power button on BeagleBone Black.
Shutdown and turn off the board when the power button is pressed.

Submitted by:	Michal Meloun <meloun@miracle.cz>
Relnotes:	yes
2015-05-13 01:10:28 +00:00
Ian Lepore
31825f28cf Create a relocatable instance of ubldr for ARM. The original ubldr,
static-linked to run at a fixed position, is still installed to maintain
compatibility with existing configurations.  The makefile now also creates
and installs ubldr.bin, a stripped binary (no elf headers) with an entry
point offset of 0 that can be loaded by u-boot at any address and launched
with "go ${loadaddr}".

To use ubldr.bin, U-Boot must still be built with the CONFIG_API option,
but no longer needs the CONFIG_ELF option.
2015-05-10 19:14:28 +00:00
Ian Lepore
16bf8dd6dc Don't check the return value from self_reloc(), it can't fail and doesn't
return a value.

Despite what I said in my prior commit, it turns out this one platform
was checking the return value from the old self-reloc code (which returned
a hard-coded 0).
2015-05-10 13:30:21 +00:00
Ian Lepore
5b1c03fd13 The self-relocation code is not efi-specific, move it to boot/common.
The function was defined as taking 4 parameters and returning EFI_STATUS,
but all existing callers (in asm code) passed only two parameters and don't
use the return value. The function signature now matches that usage, and
doesn't refer to efi-specific types.

Parameters and variables now use the cannonical typenames set up by elf.h
(Elf_Word, Elf_Addr, etc) instead of raw C types. Hopefully this will
prevent suprises as new platforms come along and use this code.

The function was renamed from _reloc() to self_reloc() to emphasize its
difference from the other elf relocation code found in boot/common.

Differential Revision:	https://reviews.freebsd.org/D2490
2015-05-10 13:24:26 +00:00
Ian Lepore
148e6c42e4 Move the text section to the start of the output file, so that when you
create a stripped .bin file from it the entry point is the first byte of
the file.  (Will allow "load $addr $file ; go $addr" in u-boot.)
2015-05-08 19:43:53 +00:00
Ganbold Tsagaankhuu
2a77d72739 The interrupt-parent is set globally so it's unnecessary to also set it at each node.
Differential Revision:	https://reviews.freebsd.org/D2471
Submitted by:		John Wehle
2015-05-08 04:22:11 +00:00
Luiz Otavio O Souza
962940ce6c Add the SMP support for Raspberry Pi 2 (BCM2836).
Tested with the build of some ports and a buildworld.

Submitted by:	Daisuke Aoyama <aoyama@peach.ne.jp>
2015-05-07 22:11:44 +00:00
Andrew Turner
3bbcb38d72 Add FDT to the list of known GUIDs. 2015-05-05 11:07:43 +00:00
Andrew Turner
5031d03e5a Disable the use of floating-point and vector registers in the loader. They
need the vfp unit to be enabled which may not be the case.
2015-05-05 11:00:50 +00:00
Andrew Turner
9e460d0453 When cross-building ${LIBSTAND} may be set to the host copy. Point to the
version built with the toolchain.

Differential Revision:	https://reviews.freebsd.org/D2312
Submitted by:	jhb
2015-05-05 10:32:59 +00:00
Andreas Tobler
4916c80e88 Fix the loader for sparc64.
The commit from r279799 missed the adaptation of md_load in
sparc64/loader/main.c. This resulted in Memory Address Align issues at the
early boot stage.

Tested on a netbooted Fire 120.
2015-05-01 20:35:09 +00:00
Scott Long
affc4a4bff Improve support for blacklisting bad memory locations. The user can supply
a text file with a list of physical memory addresses to exclude, and have it
loaded at boot time via the provided example in loader.conf.  The tunable
'vm.blacklist' remains, but using an external file means that there's no
practical limit to the size of the list.  This change also improves the
scanning algorithm for processing the list, scanning the list only once
instead of scanning it for every page in the system.  Both the sysctl and
the file can be unsorted and contain duplicates so long as each entry is
numeric (decimal or hex) and is separated by a space, comma, or newline
character.  The sysctl 'vm.page_blacklist' is now provided to report what
memory locations were successfully excluded.

Reviewed by:	imp, emax
Obtained from:	Netflix, Inc.
MFC after:	3 days
2015-04-29 15:57:14 +00:00
Scott Long
710dc398a2 Small change in header order to allow this to compile.
Obtained from:	Netflix, Inc.
MFC after:	3 days
2015-04-27 07:38:46 +00:00
Luiz Otavio O Souza
b7ce14b99c Fix the gpio-leds node to match the LEDs on RPI2.
The 'pwr' LED is connected to GPIO pin 35 (active high) and the 'act' LED
is connected to GPIO pin 47 (active high).

Remove the GPIO pin 47 from reserved pins list, previously it was used to
signaling the SD Card presence and now it is used by act LED.
2015-04-23 18:36:36 +00:00
Luiz Otavio O Souza
b7dee41fd4 Enable the watchdog on RPI2.
The watchdog is used to reset the SoC on cpu_reset().

Without this, RPI2 will not reboot when asked to.
2015-04-23 14:58:39 +00:00
John Baldwin
179fa75e6e Reassign copyright statements on several files from Advanced
Computing Technologies LLC to Hudson River Trading LLC.

Approved by:	Hudson River Trading LLC (who owns ACT LLC)
MFC after:	1 week
2015-04-23 14:22:20 +00:00
Ed Maste
15222dc5d6 Reduce diffs between the three copies of libstand's Makefile
This should be a non-functional change.  A future change should
address the functional differences between these three and converge
on a single source.

Differential Revision:	https://reviews.freebsd.org/D2058
Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
2015-04-23 14:04:33 +00:00
Luiz Otavio O Souza
88d1700334 Fix the SDHCI clock frequency for RPI2, the default clock (for the newer
firmware versions) is 250MHz.
2015-04-22 17:35:58 +00:00
Devin Teske
43d4f8c4c6 Add "GELI Passphrase:" prompt to boot loader.
A new loader.conf(5) option of geom_eli_passphrase_prompt="YES" will now
allow you to enter your geli(8) root-mount credentials prior to invoking
the kernel.

See check-password.4th(8) for details.

Differential Revision:	https://reviews.freebsd.org/D2105
Reviewed by:	imp, kmoore
Discussed on:	-current
MFC after:	3 days
X-MFC-to:	stable/10
Relnotes:	yes
2015-04-16 20:53:15 +00:00
Andrew Turner
3f06facc8a * Remove the wfi when the efi loader returns, it's unneeded and is not
available on older designs.
* Enable the efi loader on arm
2015-04-14 14:15:14 +00:00
Andrew Turner
0cafabf97f Add support for arm64 to loader.efi and boot1.efi
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2015-04-14 13:55:01 +00:00
Andrew Turner
30dd368aa7 Fix the arm64 MACHINE_CPUARCH value in the efi fdt glue code.
Sponsored by:	The FreeBSD Foundation
2015-04-14 10:41:57 +00:00
Andrew Turner
c93a8403be Use MACHINE in the efi loader when it is what we mean, it may not be the
same as MACHINE_CPUARCH, it just happened to be the case the architectures
this code currently supports.

Sponsored by:	The FreeBSD Foundation
2015-04-14 10:40:37 +00:00
Andrew Turner
2d790e26e5 Create the correct symlinks for the machine directory, and only create the
x86 symlink on i386 and amd64. Before this incorrect symlinks were being
created on armi and i386.

Differential Revision:	https://reviews.freebsd.org/D2283
Reviewed by:	emaste, imp
Sponsored by:	The FreeBSD Foundation
2015-04-13 16:00:09 +00:00
Andrew Turner
3d08016fc4 Add fdt support to the arm loader.efi 2015-04-11 11:00:53 +00:00
Andrew Turner
cc0ab6997e Only add -fPIC to CFLAGS and -Wl,-znocombreloc to LDFLAGS on x86, they
shouldn't be used on arm.
2015-04-11 10:36:48 +00:00
Andrew Turner
d4926f83a8 Move reloc.c to the top level Makefile as it has become generic. 2015-04-11 10:21:26 +00:00
Andrew Turner
43e9209c57 Update the arm efi ldscript to generate a valid efi binary 2015-04-11 10:07:58 +00:00
Ganbold Tsagaankhuu
498c473a94 This modifies the FreeBSD Amlogic DTS files to use the GNU files
as the base.

Submitted by:	John Wehle
Reviewed by:	imp
2015-04-11 08:27:38 +00:00
Ganbold Tsagaankhuu
7a24f0a21f The GNU files don't include a DTS for the aml8726-m8b (which has
cortex-a5 cores unlike the aml8726-m8 which has cortex-a9 cores).

Submitted by:	John Wehle
Reviewed by:	imp
2015-04-11 08:25:53 +00:00
Ed Maste
5ec8fa0ee4 Add build support for i386 loader.efi
Kernel changes are required for this to be useful but this will allow
others to experiment.

Differential Revision:	https://reviews.freebsd.org/D2276
2015-04-10 18:49:43 +00:00
Ed Maste
dea6bf66ea Limit EFI framebuffer metadata to amd64 for now
The i386 loader.efi does not yet exist. Avoid dealing with vt and
framebuffer issues there until the initial bootstrapping is done.
2015-04-10 18:08:09 +00:00
Andrew Turner
b6e1ffd447 Port the EFI reloc codeto work on arm64. This used the rela relocation
table so wiill need the addend included in the relocation calculation.

Sponsored by:	The FreeBSD Foundation
2015-04-10 09:15:35 +00:00
Ed Maste
b291974d25 Remove EOL whitespace from i386 EFI loader source 2015-04-09 19:48:42 +00:00
Andrew Turner
23c48d2315 Print error values with hex to make it easier to find the EFI error type. 2015-04-09 10:15:47 +00:00
Andrew Turner
8ab49d66d2 Only use -fPIC when building boot1.efi for x86.
Sponsored by:	The FreeBSD Foundation
2015-04-09 10:08:10 +00:00
Andrew Turner
3252a3c107 Add the arm64 machine dependent parts of ficl. This is not machine
dependent, as most copies of these files are identical, but unfortunately
this is still needed.

Sponsored by:	The FreeBSD Foundation
2015-04-09 10:00:26 +00:00
Devin Teske
a7ec487755 Re-do proper mode-endings. Antithesis of r281176-281179 which reverted
earlier migration away from sloppy mode-endings (r280925,280974-280976)
due to a red-herring in diagnosing HardenedBSD boot lockup.

Thanks to:	lattera (shawn.webb@hardenedbsd<dot>org)
MFC after:	3 days
X-MFC-to:	stable/10
X-MFC-with:	r280925,280974-280976,281176-281179
2015-04-08 20:10:42 +00:00
Devin Teske
ea1401b9a9 Fix a bootlock condition if/when loader_logo is set in loader.conf(5)
NB: This deeply effected HardenedBSD which had a default value set.

Embarassingly, I allowed the `type' primitive to be passed -1/-1 for
c-addr/u stack input (the effect of which is to pull INT_MAX bytes
from character address negative one in which hilarity ensues over a
black screen in full-on bootlock). Much thanks to Shawn Webb [lattera]
for helping me diagnose.

NB: The mode-ending revisions were initially suspected (and reverted)
but proved to be a red-herring. Proper mode endings will be returning.

Thanks to:	lattera (@HardenedBSD [<dot><com>])
Reported by:	lattera
MFC after:	3 days
X-MFC-to:	stable/10
2015-04-08 19:12:38 +00:00
Ed Maste
0c8a72c0d2 Add EFI boot1 for i386
loader.efi still needs work, but boot1.efi now builds.

Differential Revision:	https://reviews.freebsd.org/D2244
Reviewed by:	rpaulo
Sponsored by:	The FreeBSD Foundation
2015-04-07 21:41:26 +00:00
Ed Maste
c6f6755c90 EFI: use common reloc.c for all architectures
Much of this file is common to the architectures we support, so share
an implementation by adding a little #ifdef-ery.

Differential Revision:	https://reviews.freebsd.org/D2241
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
2015-04-07 21:34:49 +00:00
Devin Teske
2df04ab49b Eliminate literal escape sequences from *.rc
Suggested by:	alfred
MFC after:	3 days
X-MFC-to:	stable/10
X-MFC-with:	r280976, r281179
2015-04-06 23:37:04 +00:00
Devin Teske
e076835f9c Partially revert r280976: Back to previous mode-endings based on feedback
Reported by:	lattera
MFC after:	3 days
X-MFC-to:	stable/10
X-MFC-with:	r280976
2015-04-06 23:22:54 +00:00
Devin Teske
be77d1d90c Partially revert r280975: Back to previous mode-endings based on feedback
Reported by:	lattera
MFC after:	3 days
X-MFC-to:	stable/10
X-MFC-with:	r280975
2015-04-06 23:16:03 +00:00
Devin Teske
72bd569df0 Partially revert r280974: Back to previous mode-endings based on feedback
MFC after:	3 days
X-MFC-to:	stable/10
X-MFC-with:	r290974
Reported by:	lattera
2015-04-06 23:13:16 +00:00
Devin Teske
9390da3689 Partially revert r280925: Back to previous mode-endings based on feedback
MFC after:	3 days
X-MFC-with:	r280925
Reported by:	lattera
2015-04-06 23:10:47 +00:00
Andrew Turner
533e5098de Make global variabled only used in this file static. 2015-04-06 19:58:28 +00:00
Andrew Turner
63d071445e Add support to the efi boot1 and loader for 32-bit ARM. This will be used
by the future qemu virt support.

Differential Revision:	https://reviews.freebsd.org/D2238
Reviewed by:	emaste
2015-04-06 15:50:20 +00:00
Rui Paulo
bb09480677 SMBIOS support for EFI.
MFC after:	1 week
2015-04-06 06:55:47 +00:00
Andrew Turner
45304e75b9 Move boot1.efi to the global CLEANFILES list, it's not x86 specific. 2015-04-05 18:57:58 +00:00