| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use 64-bit math when finding a block of ram to hold the kernel. This fixes
a problem on 32-bit systems which have ram occupying the end of the physical
address space -- for example, a block of ram at 0x80000000 with a size of
0x80000000 was overflowing 32 bit math and ending up with a calculated size
of zero.
Use 64-bit math when processing the lists of physical and excluded memory
to generate the phys_avail and dump_avail arrays.
Work around problems that happen when there is ram at the end of the
physical address space.
Cast pointer through uintptr_t on the way to uint64_t to squelch a warning.
Reword the comment to better describe what I found while researching the
problem that led to this temporary workaround (and also so I can properly
cite the PR in the commit this time).
Cast using uintfptr_t and eliminate the cast to uint64_t which is uneeded
because rounding down cannot increase the number of bits needed to express
the result.
Go back to using uintptr_t, because code that actually compiles is
infinitely less buggy than code that is theoretically correct in some
alternate universe.
PR: 201614
|
|
|
|
|
|
|
| |
Fix the error checking for the ubenv command. This moves the check for an
empty ldvar (which amounts to the varname string starting with '=') into
the if block that manipulates ldvar, which avoids later referencing ldvar
when it was never initialized.
|
|
|
|
|
|
|
|
|
|
| |
Print more detailed info about the disk and partition chosen for booting.
No behavioral changes, just cosmetics.
Remove stray unescaped `%` in `Booting from ...` informational message.
Enhance the "ubenv import" command to allow importing a u-boot env var
directly into a loader (and thus kernel) env var.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fix fdt_platform_fixups() mem region handling.
|
|
|
|
| |
Allow whitspace to appear between device name and unit number in loaderdev.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Enhance the mechanism that lets you configure the ubldr boot device by
setting the u-boot environment variable loaderdev=. It used to accept only
'disk' or 'net'. Now it allows specification of unit, slice, and partition
as well. In addition to the generic 'disk' it also accepts specific
storage device types such as 'mmc' or 'sata'.
If there isn't a loaderdev env var, the historical behavior is maintained.
It will use the first storage device it finds, or a network device if
no working storage device exists.
99% of the work on this was done by Patrick Kelsey, but I made some
changes, so if anything goes wrong, blame me.
(Indeed, the 3 followup commits fixed things I got wrong on the first.)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prevent fdt data loaded from a file from overwriting the kernel environment,
by having uboot_autoload() do the fdt setup (which may load a file) rather
than waiting until we're actually in the process of launching the kernel.
As part of making this happen...
- Define LOADER_FDT_SUPPORT on the uboot/lib compile command line when
MK_FDT is set.
- Make fdt_setup_fdtb() public.
- Declare public fdt_whatever() functions in a header instead of using
scattered extern decls in .c files.
|
|
|
|
|
|
| |
If a "loaderdev=<device>" env variable is set and the named device
exists, it is used. If the device doesn't exist, fall back to the
historic "probe" loop that prefers disk devices over network devices.
|
|
|
|
|
|
|
| |
Remove all the instances of '#undef DEBUG' from kernel.
Suggested by: rpaulo
Approved by: adrian (mentor)
|
| |
|
|
|
|
|
| |
really offsets within the primary mapped memory block
(which may not start at address zero).
|
|
|
|
| |
Approved by: cognet (mentor)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add "fdt addr" subcommand that lets you specify preloaded blob address
- Do not pre-initialize blob for "fdt addr"
- Do not try to load dtb every time fdt subcommand is issued,
do it only once
- Change the way DTB is passed to kernel. With introduction of "fdt addr"
actual blob address can be not virtual but physical or reside in
area higher then 64Mb. ubldr should create copy of it in kernel area
and pass pointer to this newly allocated buffer which is guaranteed to work
in kernel after switching on MMU.
- Convert memreserv FDT info to "memreserv" property of root node
FDT uses /memreserve/ data to notify OS about reserved memory areas.
Technically it's not real property, it's just data blob, sequence
of <start, size> pairs where both start and size are 64-bit integers.
It doesn't fit nicely with OF API we use in kernel, so in order to unify
thing ubldr converts this data to "memreserve" property using the same
format for addresses and sizes as /memory node.
|
| |
|
|
|
|
|
| |
flag, that disables the caching of partition tables metadata.
Use this flag for floppies in the libi386/biosdisk driver.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
disk_open(). Very often this is called several times for one file.
This leads to reading partition table metadata for each call. To
reduce the number of disk I/O we have a simple block cache, but it
is very dumb and more than half of I/O operations related to reading
metadata, misses this cache.
Introduce new cache layer to resolve this problem. It is independent
and doesn't need initialization like bcache, and will work by default
for all loaders which use the new DISK API. A successful disk_open()
call to each new disk or partition produces new entry in the cache.
Even more, when disk was already open, now opening of any nested
partitions does not require reading top level partition table.
So, if without this cache, partition table metadata was read around
20-50 times during boot, now it reads only once. This affects the booting
from GPT and MBR from the UFS.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The generic ELF loading code maps the kernel into low memory
by subtracting KERN_BASE. So the copyin/copyout/readin functions
are always called with low addresses. This code finds the largest
DRAM block from the U-Boot memory map and adds that base to
the addresses.
In particular, this fixes ubldr on AM3358, which has DRAM
mapped to 0x80000000 at power-on.
|
|
|
|
|
| |
Obtained from: Semihalf
Supported by: FreeBSD Foundation, Juniper Networks
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code previously assumed that copyin/copyout did no
address translation and that the device tree blob could
be manipulated in-place (with only a few adjustments for
the ELF loader offset). This isn't possible on all platforms,
so the revised code uses copyout() to copy the device tree
blob into a heap-allocated buffer and then updates the
device tree with copyout(). This isn't ideal, since it
bloats the loader memory usage, but seems the only feasible
approach (short of rewriting all of the fdt manipulation
routines).
|
|
|
|
|
| |
This change is specific to BeagleBone; I need to figure out how to
generalize this before committing.
|
|
|
|
|
| |
In particular, on the AM335x, which comes up with no memory
mapped to low addresses, dereferencing the NULL causes a crash.
|
| |
|
|
|
|
| |
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
| |
Enable using the statically embedded blob from the kernel, if present. The KLD
loaded DTB takes precedence, but they are both recognized and handled in the
same way.
Submitted by: Lukasz Wojcik
Obtained from: Semihalf
MFC after: 1 week
|
|
|
|
|
| |
we can also use the upstream binutils linker where we have to have a unique
name for the FreeBSD emulation.
|
|
|
|
| |
(which simplifies some powerpc/powerpc64 ifs)
|
|
|
|
|
| |
64-bit PowerPC kernels are loaded by a 32-bit loader, since nearly all
powerpc64 firmwares execute in 32-bit mode.
|
|
|
|
|
| |
For FDT-enabled platforms the device tree is a modern replacement for bootinfo
config data.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
o This is disabled by default for now, and can be enabled using WITH_FDT at
build time.
o Tested with ARM and PowerPC.
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Obtained from: Semihalf
MFC after: 1 week
|
|
|
|
|
| |
Obtained from: Semihalf
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
| |
This lets modules loaded dynamically in loader(8) work for U-Boot-based
platforms.
MFC after: 1 week
|
|
|
|
|
|
|
| |
- Remove #if 0 section that was never needed/used
Reviewed by: raj@
MFC after: 1 month
|
|
|
|
|
| |
Submitted by: Piotr Ziecik
Obtained from: Semihalf
|