summaryrefslogtreecommitdiffstats
path: root/sys/boot/uboot/lib
Commit message (Collapse)AuthorAgeFilesLines
* MFC r293053, r293061, r293063, r293064, r293065, r293775, r293792:ian2016-01-241-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* MFC r283033, r283062, r283066, r283069:ian2015-05-251-0/+109
| | | | | | | | | | | 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.
* MFC r277962, r277988, r282661, r282727, r282731, r283013, r283035:ian2015-05-253-26/+94
| | | | | | | | | | | | | | | | | 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.
* MFC r280194:ian2015-05-241-1/+1
| | | | Fix fdt_platform_fixups() mem region handling.
* MFC 273927:andrew2014-12-143-6/+5
| | | | | | | | | | | | | | | | 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)
* MFC r263052, r263124, r263265, r263267... Enhance loaderdev env var.ian2014-04-294-4/+29
| | | | | | | | | | | | | | | | | 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.)
* MFC r262664, r262694:ian2014-04-293-3/+25
| | | | | | | | | | | | | 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.
* MFC r257127:loos2014-01-232-6/+0
| | | | | | | Remove all the instances of '#undef DEBUG' from kernel. Suggested by: rpaulo Approved by: adrian (mentor)
* Print kernel args as late as possible before jumping into kernel.kientzle2013-02-231-1/+1
|
* Clarify an error message. The addresses here arekientzle2013-02-181-1/+1
| | | | | really offsets within the primary mapped memory block (which may not start at address zero).
* Print kernel args when booting the kernel.kientzle2012-11-251-0/+1
|
* Add the flags parameter to the disk_open() function and DISK_F_NOCACHEae2012-10-211-1/+1
| | | | | flag, that disables the caching of partition tables metadata. Use this flag for floppies in the libi386/biosdisk driver.
* Almost each time when loader opens a file, this leads to callingae2012-09-291-0/+1
| | | | | | | | | | | | | | | | | | 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.
* Build disk.c only when DISK_SUPPORT is enabled.ae2012-09-091-1/+6
|
* Update uboot's disk driver to use new DISK API.ae2012-09-091-592/+98
|
* Use disk_fmtdev() and disk_parsedev() functions from the new DISK API.ae2012-09-091-62/+9
|
* Make struct uboot_devdesc compatible with struct disk_devdesc.ae2012-09-091-6/+3
|
* Determine kernel load address dynamically from u-boot memory map.kientzle2012-05-203-10/+46
| | | | | | | | | | | 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.
* Add architecture dependent code to support NAND Framework on Marvell SoCs.gber2012-05-182-0/+4
| | | | | Obtained from: Semihalf Supported by: FreeBSD Foundation, Juniper Networks
* Teach ubldr(8) about simple MBR partitioning.kientzle2012-05-013-2/+103
|
* Use the common/shared CRC-32 implementation instead of duplicating it.marius2012-03-212-69/+7
| | | | MFC after: 1 week
* MF tbemd: Minor tweaks, prefer MACHINE_CPUARCH generally to MACHINE_ARCH ↵imp2010-08-231-1/+1
| | | | (which simplifies some powerpc/powerpc64 ifs)
* Initial loader(8) support for Flattened Device Tree.raj2010-05-251-0/+4
| | | | | | | | | | 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
* Mostly revert r200691. U-Boot syscall() entry point returns 1 on success.raj2010-05-251-1/+1
|
* Use loader devices only when they initialized properly.raj2010-05-251-1/+1
|
* Minor style correction.raj2010-02-251-1/+1
|
* Fix handling of GPT disk partition index.raj2010-02-251-0/+8
| | | | | Obtained from: Semihalf MFC after: 1 week
* Fix ub_env_enum(): syscall() returns 0 when properly invoked.marcel2009-12-181-4/+3
|
* - Remove trailing ";" after if statementantoine2009-11-111-6/+1
| | | | | | | - Remove #if 0 section that was never needed/used Reviewed by: raj@ MFC after: 1 month
* Make GPT style partitiong endian-safe in U-Boot support library.raj2009-06-031-13/+28
| | | | | Submitted by: Piotr Ziecik Obtained from: Semihalf
* Fix NETIF_DEBUG compilation.marcel2009-05-301-8/+2
|
* GPT style partitioning for loader(8) with U-Boot support library (tested onraj2009-05-053-27/+243
| | | | | | ARM). Submitted by: Piotr Ziecik kosmo ! semihalf dot com
* Improve style(9) in PowerPC U-Boot support lib.raj2008-12-171-8/+9
|
* Initial storage functionality for U-Boot support library.raj2008-11-196-87/+424
| | | | | | | | - Only non-sliced bsdlabel style partitioning is currently supported (but provisions are made towards GPT support, which should follow soon) - Enable storage support in loader on ARM Obtained from: Semihalf
* Initial support of loader(8) for ARM machines running U-Boot.raj2008-10-141-1/+1
| | | | | | | | | | This uses the common U-Boot support lib (sys/boot/uboot, already used on FreeBSD/powerpc), and assumes the underlying firmware has the modern API for stand-alone apps enabled in the config (CONFIG_API). Only netbooting is supported at the moment. Obtained from: Marvell, Semihalf
* Minor style(9) fixes for U-Boot API glue.raj2008-10-044-25/+23
|
* U-Boot API glue improvements:raj2008-10-044-42/+45
| | | | | | | | - extend ub_dev_read() and ub_dev_recv() so that the actual len and all error codes can be passed and processed properly; unify behaviour of these routines - introduce syscall general error code (API_ESYSC)
* Improve loader support for U-Boot.raj2008-09-032-25/+109
| | | | | | | | | - add new diag commands: devinfo, sysinfo for U-Boot-style details about the system configuration - better memory info summary - style corrections Obtained from: Semihalf
* Move U-Boot compatibility library to WARNS=2 level.raj2008-09-037-33/+45
|
* style(9) & style.Makefile(9)obrien2008-03-1312-247/+287
| | | | Reviewed by: raj
* Eliminate artificial increasing of 'netdev_opens' counter in loader's ↵raj2008-03-126-79/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | net_open(). This was introduced as a workaround long time ago for some Alpha firmware (which is now gone), and actually prevented net_close() to ever be called. Certain firmwares (U-Boot) need local shutdown operations to be performed on a network controller upon transaction end: such platform-specific hooks are supposed to be called via netif_close() (from within net_close()). This change effectively reverts the following CVS commit: sys/boot/common/dev_net.c revision 1.7 date: 2000/05/13 15:40:46; author: dfr; state: Exp; lines: +2 -1 Only probe network settings on the first open of the network device. The alpha firmware takes a seriously long time to open the network device the first time. Also suppress excessive output while netbooting via loader, unless debugging. While there, make sys/boot/uboot more style(9) compliant. Reviewed by: imp Approved by: cognet (mentor)
* o Build libuboot with -msoft-float like everything else.marcel2008-02-233-50/+88
| | | | | | | o Move the API prototypes to a separate header (glue.h) o Allow the platform to hint libuboot about where to look for the API signature. The uboot_address variable is expected to be defined by the platform.
* Add the appropriate license information. This file is doublemarcel2008-02-231-1/+55
| | | | | | licensed under GPL and BSD. Thanks to: raj@
* MFp4 (e500):marcel2008-02-1613-0/+1699
Add support for U-Boot. This uses the U-Boot API as developed by Rafal and which is (will be) part of U-Boot 1.3.2 and later. Credits to: raj@
OpenPOWER on IntegriCloud