Commit Graph

2751 Commits

Author SHA1 Message Date
emaste
c18b3c3a79 MFC r285246: Avoid creating invalid UEFI device path
The UEFI loader on the 10.1 release install disk (disc1) modifies an
existing EFI_DEVICE_PATH_PROTOCOL instance in an apparent attempt to
truncate the device path.  In doing so it creates an invalid device
path.

Perform the equivalent action without modification of structures
allocated by firmware.

PR:		197641
Submitted by:	Chris Ruffin <chris.ruffin at intel.com>
2015-07-28 12:45:08 +00:00
allanjude
e644fa27a1 MFC: r277949:
New function smbios_match to detect BIOS versions during boot

MFC: r277957:
	Fix order of functions in smbios.c (corrects r277949)

MFC: r281138:
	SMBIOS support for EFI

r281138 makes changes to the new unified EFI loader (r280950), which has not been merged to stable/10 (and likely won't be).
These changes were manually applied to the amd64 EFI loader (sys/boot/amd64/efi).
The changes to sys/boot/amd64/efi are a direct commit.

Reviewed by:	stas
Approved by:	re (gjb), marcel
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3129
2015-07-20 22:14:55 +00:00
loos
13177b16bb MFC r285138:
Install loader.rc with ARM u-boot loader (ubldr).

  loader.rc is the responsible to read and process loader.conf variables.

  This fix the issue of loader.conf being silently ignored.

Approved by:	re (gjb)
2015-07-08 23:50:04 +00:00
dteske
3822c7142e MFC r284672 (antoine):
Install version.4th.8 again
It was disconnected from installation in r281081, but was never removed
from the tree or added to ObsoleteFiles.inc
2015-06-23 03:56:05 +00:00
avg
9729619a52 MFC r284025,284032: dnode_read: handle hole blocks in zfs boot code
PR:		199804
2015-06-17 11:47:06 +00:00
avg
283a5c0b30 MFC r283939: userboot: enable bzipfs support 2015-06-12 11:41:33 +00:00
dteske
f38383848a MFC r268254 (jmg):
Add a hint that you can enable this by default if you want;
necessary if you want the keyboard break to work early in boot.
2015-06-03 22:24:57 +00:00
jhb
017f11d1f3 MFC 281887:
Reassign copyright statements on several files from Advanced
Computing Technologies LLC to Hudson River Trading LLC.
2015-06-02 19:20:39 +00:00
ian
a210991c80 MFC r283033, r283062, r283066, r283069:
Do not set preload_addr_relocate for ARM.

  Refactor net_getparams() to make it easier to get params from sources other
  than bootp and rarp.

  Add a routine to obtain netboot parameters from the U-Boot env vars

  Enable the NETIF_OPEN_CLOSE_ONCE option for ubldr.
2015-05-25 01:29:45 +00:00
ian
e82e4a2984 MFC r277962, r277988, r282661, r282727, r282731, r283013, r283035:
Add support for booting relocatable kernels on PowerPC.

  Add code to support loading relocatable kernels at offsets that are
  not zero.

  Move ubldr 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.)

  Create a relocatable instance of ubldr for ARM (ubldr.bin).

  Re-link ubldr when any of its libraries change.

  An ARM kernel can be loaded at any 2MB boundary, make ubldr aware of that.
2015-05-25 01:06:55 +00:00
ian
d6c6dd582e MFC r268838, r277644:
Add support for Toradex Apalis i.MX6 development board.

  Add support for imx6 audio transmitting, include drivers for:
  o Digital Audio Multiplexer (AUDMUX)
  o Smart Direct Memory Access Controller (SDMA)
  o Synchronous Serial Interface (SSI)
2015-05-24 18:59:45 +00:00
ian
e7adedb422 MFC r280194:
Fix fdt_platform_fixups() mem region handling.
2015-05-24 15:29:56 +00:00
gjb
59be327480 MFC r281011 (jkim):
Fix powerpc, powerpc64 build.

Sponsored by:	The FreeBSD Foundation
2015-05-22 16:38:55 +00:00
dteske
8bc086afd3 MFC revisions 277693,278335,280382-280385,280923-280926,280931,
280933-280939,280974-280976,281002,281009,281081,281176-281180,
281271,281275,281616 (described in-breif below):
r277693: Font fix (des)
r278335: Revert that
r280382: Whitespace, comments, and copyright update
r280383: Prevent inadvertent bootlock condition
r280384: Increase max passowrd length from 16 to 255 chars
r280385: Add missing variable hints to loader.conf(5) defaults
r280923: Whitespace
r280924: Comments
r280925: Optimize bootmsg to use fg/bg/me from screen.4th
r280926: Whitespace and cleanup
r280931: Comments
r280933: Move beastie to logo-*.4th; brands to brand-*.4th
r280934: Add remainder of supported ANSI escape sequences
r280935: Securely overwrite (zero) user input after password checks
r280936: Use equals for ASCII double frames
r280937: Solve dreaded "dictionary full" issue
r280938: Add "GELI Passphrase:" prompt to boot loader
r280939: Revert that (premature commit)
r280974: Use fg/b/me from screen.4th instead of literals
r280975: Eliminate literal escape sequences from *.4th
r280976: Use ^[[m mode-ending versus ^[[37m
r281002: Install newly added brand-*.4th and logo-*.4th files (jkim)
r281009: Revert .PATH changes to fix mips build (jkim)
r281081: Make sure forth manpages are only installed once (bapt)
r281176: Back to previous mode-endings based on feedback
r281177: Back to previous mode-endings based on feedback
r281178: Back to previous mode-endings based on feedback
r281179: Back to previous mode-endings based on feedback
r281180: Eliminate literal escape sequences from *.rc
r281271: Fix a bootlock condition if loader_version is set
NB: Commit message of r281271 has a typo, s/_logo/_version/
r281275: Re-do proper mode-endings
r281616: Add "GELI Passphrase:" prompt to boot loader

Relnotes:	Added "GELI Passphrase:" prompt to boot loader
2015-04-22 01:08:40 +00:00
jhb
a251dcdd5c MFC 279950:
Enable bzipfs support in the EFI loader.
- Add bzipfs to the list of supported filesystems in the EFI loader.
- Increase the heap size allocated for the EFI loader from 2MB to 3MB.
2015-04-09 19:51:55 +00:00
jhb
107a51b87f MFC 279949:
The System V ABI for amd64 allows functions to use space in a 128 byte
redzone below the stack pointer for scratch space and requires
interrupt and signal frames to avoid overwriting it. However, EFI uses
the Windows ABI which does not support this. As a result, interrupt
handlers in EFI push their interrupt frames directly on top of the
stack pointer. If the compiler used the red zone in a function in the
EFI loader, then a device interrupt that occurred while that function
was running could trash its local variables.  In practice this happens
fairly reliable when using gzipfs as an interrupt during decompression
can trash the local variables in the inflate_table() function
resulting in corrupted output or hangs.

Fix this by disabling the redzone for amd64 EFI binaries. This
requires building not only the loader but any libraries used by the
loader without redzone support.

Thanks to Jilles for pointing me at the redzone once I found the stack
corruption.
2015-04-09 19:36:06 +00:00
jhb
de91cfb164 MFC 279929:
Allow the EFI loader to work with large kernels and/or modules
(for example, a large mfsroot).  Note that for EFI the kernel and
modules (as well as other metadata files such as splash screens or
memory disk images) are loaded into a statically-sized staging area.
When the EFI loader exits it copies this staging area down to the
location the kernel expects to run at.
- Add bounds checking to the copy routines to fail attempts to access
  memory outside of the staging area.  Previously loading a combined
  kernel + modules larger than the staging size (32MB) would overflow
  the staging area trashing whatever memory was afterwards.  Under
  Intel's OVMF firmware for qemu this resulted in fatal faults in the
  firmware itself.  Now the attempt will fail with ENOMEM.
- Allow the staging area size to be configured at compile time via
  an EFI_STAGING_SIZE variable in src.conf or on the command line.
  It accepts the size of the staging area in MB.  The default size
  remains 32MB.
2015-04-09 19:03:11 +00:00
dim
2da35800ba MFC r280980:
Ensure the cross assembler, linker and objcopy are used for the build32
stage, just like for the regular world stage.

Reviewed by:	rodrigc, imp, bapt, emaste
Differential Revision: https://reviews.freebsd.org/D2187
2015-04-09 06:38:32 +00:00
mav
bf16a17b0e MFC r279275: Fix potential NULL dereference.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2015-03-11 09:49:06 +00:00
dim
024c8e7e83 MFC r279598:
When compiling boot2 with gcc on i386 and pc98, only use the custom flag
-mno-align-long-strings when compiling with base gcc.  This is checked
by comparing the version number against 4.2.1, which is not exactly
right, but good enough.  (There is no other way to check whether we are
using the non-standard gcc in base, as far as I know.)

Reported by:	rodrigc
2015-03-08 22:50:45 +00:00
loos
6dec850dfa MFC r278915:
Set the #address-cells and #size-cells properties on I2C controllers of
Raspberry-pi.

This fixes the issues on dtc(1) while compiling I2C addresses set with
"reg" property.
2015-03-03 17:03:41 +00:00
emaste
224ab7ed88 MFC part of r273865: fix boot1.efi for block size != 512
r273865 is part of the work for supporting 4Kn drives, but it turns out
the underlying bug can actually cause corruption of the UEFI system
table in any case where block size is not 512.

Relevant portion of the original commit message:

  convert boot1.efi to corrrectly calculate the lba for what the
  media reports and convert the size based on what FreeBSD uses.
  existing code would use the 512 byte lba and convert the
  using 4K byte size.

PR:		197881
Reviewed by:	Chris Ruffin
2015-02-24 22:11:07 +00:00
ian
0d3280506b MFC r278032:
Do not skip setting the memory 'reg' property if the fdt data already
  contains one.
2015-02-13 23:43:59 +00:00
ian
f406596440 MFC r276632: Create a custom /boot/defaults/loader.conf for ARM. 2015-02-13 15:16:55 +00:00
ian
44aea37041 MFC r276306: Use proper markup for quotes. 2015-02-12 21:15:28 +00:00
ian
4830d3556d MFC r275779, r275963, r276101, r276161, r276297:
Move ofw_cpu.c to sys/dev/ofw so that it can be used by other
  architectures.

  Add driver for CPU frequency/voltage control on the Raspberry Pi.

  On initialization, do not use bcm_mbox_intr() to read the pending messages.
  This fixes the hang that happens on boot while initializing the cpufreq on
  Raspberry Pi.
2015-02-12 00:25:33 +00:00
ian
660c9e142d MFC r276145: Convert lingering NO_FORTH conditionals to test MK_FORTH. 2015-02-11 23:05:58 +00:00
ian
f8178723e9 MFC r276079, r276087:
Add a divisor parameter to twiddle() so that callers can request that
  output only happen on every Nth call.

  Add a new loader(8) variable, twiddle_divisor, allowing control over the
  output frequency of the "twiddle" IO progress indicator.
2015-02-11 22:55:24 +00:00
ian
fc47f4b0ff MFC r266943, r266950, r267390:
Add support for Exynos 5420 Octa - 8-core (big.LITTLE) ARM machine
  Enable SMP for both Exynos5 models we support.
2015-02-11 22:35:32 +00:00
loos
ba803d12f9 MFC r277042:
Add support to turn off Beaglebone with poweroff(8) or shutdown(8) -p.

To cut off the power we need to start the shutdown sequence by writing
the OFF bit on PMIC.

Once the PMIC is programmed the SoC needs to toggle the PMIC_PWR_ENABLE
pin when it is ready for the PMIC to cut off the power.  This is done by
triggering the ALARM2 interrupt on SoC RTC.

The RTC driver only works in power management mode which means it won't
provide any kind of time keeping functionality.  It only implements a way
to trigger the ALARM2 interrupt when requested.
2015-02-02 12:48:13 +00:00
loos
d3f0aee2c6 MFC r277208:
Fix the PMIC node name to match the PMIC i2c address.

Remove an extra blank line.

No functional changes.
2015-02-02 11:26:52 +00:00
jhb
11512d9430 MFC 274398,274537:
Move NFS and TFTP filesystems before the synthetic filesystems (bzip,
gzip, and split).
2015-01-30 18:55:05 +00:00
ngie
d4c625976a MFC r264400,r265836:
r264400:

  NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
  and finish the job. ncurses is now the only Makefile in the tree that
  uses it since it wasn't a simple mechanical change, and will be
  addressed in a future commit.

r265836:

  Remove last two NO_MAN= in the tree. In both of these cases, MAN= is
  what is needed.
2014-12-31 23:25:37 +00:00
ian
cea961188c r276026:
Allow whitspace to appear between device name and unit number in loaderdev.
2014-12-27 05:10:07 +00:00
delphij
1ad38ed4f0 MFC r274337,r274673,274681,r275515:
ZFS large block support.  The default recordsize remains at 128KB.

A new tunable/sysctl variable, vfs.zfs.max_recordsize is added to
allow adjusting the permitted maximum record size, or
zfs_max_recordsize, with a default of 1MB.  ZFS will not allow
setting recordsize greater than zfs_max_recordsize as a safety
belt, because larger recordsize means greater read and write
latency and more memory usage.

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).

Limited safety belt is provided for mounted root filesystem but use
caution when using a larger value.

Illumos issue:
    5027 zfs large block support
2014-12-22 20:58:51 +00:00
andrew
35401942c2 MFC 273927:
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 273934:

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)
2014-12-14 15:33:45 +00:00
andrew
26961b2547 MFC r273913:
Clean up the types of a few strings to make them const when they are never
written to.

MFC r273914:

The command name is a constant, use the correct type.
2014-12-14 15:03:11 +00:00
brooks
f27f3e0e8e MFC r274818:
Merge from CheriBSD (3422ebe71b6c06fe78b1be73623b240c219e08e3):

Rename beripic to beripic0.

Sponsored by:	DARPA, AFRL
2014-12-02 20:28:05 +00:00
grehan
2c63daa4b3 MFC r274407
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.
2014-11-24 01:25:19 +00:00
ian
cdce53b945 MFC r268836: Fix a typo in a gpio node name. 2014-11-08 04:18:33 +00:00
nyan
8dd879bfaf MFC: r268474 and r268476 (by imp)
- Merge the clang support from i386.
  - Compile boot2 with clang on pc98.

MFC: r272250 (by nyan)
  - Reduce diffs against i386.
2014-11-03 12:07:04 +00:00
nyan
2b45887284 MFC: r268475 (by imp)
Make SERIAL support optional again. Enable it for i386 because a huge
  percentage of machines has a 16550. Disable it for pc98 since only a
  tiny fraction of them have one.
2014-11-03 11:58:32 +00:00
nyan
027712baa4 MFC: r272256
Switch from lib/libstand to sys/boot/libstand32.
2014-11-03 11:08:00 +00:00
nyan
85b0a19937 MFC: r272255
Supress clang warning for FreeBSD printf %b and %D formats.
2014-11-03 11:01:12 +00:00
nyan
c2e8bf4779 MFC: r272252
Drop the 3rd clause from all 3 clause BSD licenses.
2014-11-03 10:38:03 +00:00
ian
46597f7cad MFC r273298:
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-26 04:13:08 +00:00
ian
3eae765afa MFC r271285:
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).
2014-10-26 02:53:23 +00:00
ian
6bda1023a0 MFC r271097, r271100, r271101, r271102, r271124:
- Add a basic iomux driver for imx6.
 - Implement the same public interface in imx51 and imx6 iomux
 - The iomux driver is no longer optional, remove it from kernel configs.
 - Implement the imx_iomux_get/set_gpr() interface for imx6.
 - Stop setting the iomux device status to disabled, now that we have a driver.
2014-10-26 02:44:41 +00:00
ian
caa088c379 MFC r268973, r268977: Rename i.MX I2C driver file, enable it on imx6. 2014-10-26 02:40:34 +00:00
ian
bb76782ad5 MFC r268834, r268835:
o Enable GPIO device driver for i.MX6.
   It was originally written for i.MX5 and compatible with newer chip.
 o Extend device tree information
 o style(9) fixes
 o Rename gpio driver file.
2014-10-26 02:37:42 +00:00