aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/arm
Commit message (Collapse)AuthorAgeFilesLines
* Move sys/boot to stand. Fix all references to new locationWarner Losh2017-11-149-497/+0
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=325834
* Add loader.conf to the list of files that are MD.Warner Losh2017-11-131-0/+0
| | | | | | | | | | | | | | | | | | loader.conf is also different between machines. On arm it's a minimal one that's not quite compatible with the default one. On arm it's minimal for speed, which is good, but there's also extra things in it relative to the default on which break loading FDT which is bad. This doesn't address that issue, but instead ensures the minimal one for arm is used. A similar issue for mips exists, but since we can have a beri variant of /boot/loader and a uboot variant, I'm leaving that mess alone for the moment. Sponsored by: Netflix Notes: svn path=/head/; revision=325775
* Install the 4th files in sys/boot/forth instead of each loaderWarner Losh2017-11-101-19/+3
| | | | | | | | | | | | | | | | | | | | | | | | Also, move generation of loader.help into loader.mk. Set HELP_FILES= to disable this (so we only install one help file, for now). At the same time remove some duplicate -I lines. Fix several FILES= and CLEANFILES= into the += form since we're touching both of those in the .mk files. Make sure we only build one loader.help file per platform in a unified way (we were building many on some, with the last to install winning, though often they were the same text). Also, we're now installing loader.rc and menu.rc everywhere. arm and mips uboot installed these as menu.rc.sample, but there's no need since the loader.rc for those platforms doesn't do menu.rc processing by default. pcibios.4th is now installed everywhere, but will failsafe on non x86 platforms (it isn't loaded by default anywhere). These changes are too intertwined to do separately since aspects of each are required to have a bug-free commit. Sponsored by: Netflix Notes: svn path=/head/; revision=325694
* Remove LOADER_FDT_SUPPORT as a Makefile variable.Warner Losh2017-11-101-1/+0
| | | | | | | | | | | | | LOADER_FDT_SUPPORT was used inconsistently in the tree. In some places, it was used to control whether or not the user wanted FDT included, and in other places it was a command to include support. Remove it entirely. The former is now enabled -DWITH_FDT, while the latter is controlled by Makefiles defining HAVE_FDT. Supported by: Netflix Notes: svn path=/head/; revision=325689
* loader: set options before including bsd.init.mkRoger Pau Monné2017-11-081-11/+11
| | | | | | | | | | | | | | | | | bsd.init.mk ends up including defs.mk so the per-arch options must be set before including defs.mk, or else the global defaults will be used and the per-arch ones will be ignored. Although better, note that the usage of MK_FDT before the inclusion of bsd.init.mk is incorrect but doesn't lead to build errors. This circular dependency must be broken in order for this to work correctly. Reviewed by: imp Sponsored by: Citrix Systems R&D Notes: svn path=/head/; revision=325556
* Remove sys/boot/arm/at91 and ixp425Warner Losh2017-10-2572-10845/+0
| | | | | | | | | | | | | Remove at91 bootloader. It only worked on AT91RM9200, and only specific boards that were all EOLd 10 years ago. Remove ixp425. It doesn't build anymore and is for boards that were EOLd 8 years ago. Sponsored by: Netflix Notes: svn path=/head/; revision=324982
* Move BINDIR definition to defs.mk, and override where it isn't /bootWarner Losh2017-10-251-1/+0
| | | | | | | | | (those files already do that so weren't changed). Sponsored by: Netflix Notes: svn path=/head/; revision=324981
* Use BOOTDIR consistently. We need to include bsd.init.mk early to makeWarner Losh2017-10-251-6/+6
| | | | | | | | | | this happen. This will cause src.opts.mk to be included, so remove that. This needs to propigate through the sys/boot tree. Sponsored by: Netflix Notes: svn path=/head/; revision=324980
* Make at91 boot loader compile again.Warner Losh2017-10-221-1/+8
| | | | | | | No clue if it actually still works, but it might. Notes: svn path=/head/; revision=324878
* End source directories with SRC rather than a hodgepodge of namesWarner Losh2017-10-221-1/+1
| | | | | | | | | | | | | | BOOTDIR->BOOTSRC FICLDIR->FICLSRC LDR_MI->LDRSRC This matches the patterns used in the rest of the system a bit vetter. Suggested by: rgrimes@ Sponsored by: Netflix Notes: svn path=/head/; revision=324877
* Move fdt and uboot defines into common uboot.mk.Warner Losh2017-10-221-19/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=324876
* LOADER_foo_SUPPORTEDWarner Losh2017-10-161-45/+2
| | | | Notes: svn path=/head/; revision=324653
* Move all the ficl common code into ficl.mkWarner Losh2017-10-161-8/+0
| | | | | | | | There's a number of copies of basically identical code to enable building forth in /boot/loader. Move it all into ficl.mk. Notes: svn path=/head/; revision=324652
* Move common/Makefile.inc to sys/boot/loader.mk.Warner Losh2017-10-161-4/+2
| | | | | | | | | | | | Makefile.inc has a specific meaning in the tree, and common/Makefile.inc doesn't quite fit into that. Rename it to loader.mk and it will be a place to collect common things to all /boot/loader programs there. Sponsored by: Netflix Notes: svn path=/head/; revision=324649
* Define prototype for exit and ensure referencesWarner Losh2017-10-121-0/+3
| | | | | | | | | | | | Define a prototype for exit in stand.h. Provide a reference to exit in a few conf.c files to ensure that its definition gets pulled in early. Since exit() is a MD routine, it isn't defined in libsa. However, libsa tends to be listed last and will soon have panic() in it which calls exit(). The reference to exit early ensures that the MD exit is available to satisfy linking for static libraries. Notes: svn path=/head/; revision=324558
* Rather than laying whack-a-mole with including the path to stand.h,Warner Losh2017-10-101-2/+0
| | | | | | | | | | always include it. Remove places where we explicitly include it. This also helps reduce the 'cut-and-paste' factor of these Makefiles. Sponsored by: Netflix Notes: svn path=/head/; revision=324460
* Define LIBSA* and use them instead of overloaded LIBSTANDWarner Losh2017-10-091-3/+2
| | | | | | | | | | | LIBSA is the current stand alone library. LIBSA32 is the 32-bit version of the library. LIBSAU is the userboot version of libsa. Use the proper define instead of the more generic define. Sponsored by: Netflix Notes: svn path=/head/; revision=324452
* Define SASRC and use itWarner Losh2017-10-091-1/+1
| | | | | | | | | | | | Define SASRC to point to the current libstand sources. Include ../Makefile.inc early enough in a few places so we can .include "${SASRC}/Makefile" and have it work. Create a new pass-up Makefile.inc in sys/boot/userboot to allow this pattern to work. Sponsored by: Netflix Notes: svn path=/head/; revision=324450
* Prefer ${LIBSTAND} to -lstandWarner Losh2017-10-091-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=324449
* Revert r321969Enji Cooper2017-08-035-21/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My change had good intentions, but the implementation was incorrect: - printf was returning the number of characters in the format string plus the NUL, but failed in two regards implementation wise: -- the pathological case, printf(""), wasn't being handled properly since the pointer is always incremented, so the value returned would be off-by-one. -- printf(3) reports the number of characters printed post-conversion via vfprintf, etc. - putchar(3) should return the character printed or EOF, not the number of characters output to the screen. My goal in making the change (again) was to increase parity, but as bde pointed out these are freestanding functions, so they don't have to conform to libc/POSIX. I argued that the functions should be named differently since the implementation is different enough to warrant it and to allow boot2 code to be usable when linked against sys/boot and libstand and other libraries in base. I have no interest in pushing this change forward more though, as the original concern I had behind the change with zfsboottest was resolved in r321849 and r321852. The next person that updates the toolchain gets to deal with the inconsistency if it's flagged by a newer compiler. MFC after: 1 month Reported by: ed, markj Notes: svn path=/head/; revision=321991
* Fix the return types for printf and putchar to match their libc andEnji Cooper2017-08-035-16/+21
| | | | | | | | | | | | | | | POSIX equivalents Both printf and putchar return int, not void. This will allow code that leverages the libcalls and checks/rely on the return type to interchangeably between loader code and non-loader code. MFC after: 1 month Notes: svn path=/head/; revision=321969
* Link EFI/uboot loaders with -znotextEd Maste2017-07-011-0/+1
| | | | | | | | | | | | | | | By default LLD links with relocations disallowed against readonly sections (e.g., .text), but the 32-bit ARM EFI & uboot boot bits require such relocations. -znotext is either ignored as an unknown -z option (in-tree lld 2.17.50) or is already the default (GNU ld or GNU gold from ports) so we can just add it unconditionally to allow building with LLD. This is similar to the change in r320179 for the kernel link. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=320547
* Preserve the registers containing argc, argv, and return address valuesIan Lepore2017-04-011-0/+9
| | | | | | | | | | | | | passed in from u-boot across the call to self_reloc and any other early-init code, and restore them before calling main(). The self_reloc() routine uses r0 and r1 (and calling it uses lr), and depending on what values get left in them, main() would intermittantly lock up trying to interpret them as argc and argv values. This problem affected the self-relocatable ubldr.bin but not ubldr (the elf version). Notes: svn path=/head/; revision=316374
* self_reloc.c: Pass -Wno-error=maybe-uninitialized to gcc versions greater ↵Enji Cooper2017-03-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | than 4.2.1 self_reloc.c doesn't initialize `rel` in all cases in the C code, however, the value might be initialized properly on the stack in the assembly code. For right now (because this doesn't seem to be breaking anything and my initializing the stack value could break something since it's called from assembly code) disable the warning for self_reloc.c. More investigation should be done to determine the appropriate response to this warning (either intialize the value or find a smarter way to deal with the warning). A long MFC timeout is being set for this change to allow a better solution for the issue to be developed in that time period. MFC after: 2 months Reported by: Jenkins (FreeBSD-head-amd64-gcc job) Tested with: amd64-gcc-6.3.0 (devel/amd64-xtoolchain-gcc) Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316119
* Split the ficl CFLAGS when they refer to an arch-specific include path.Pedro F. Giffuni2017-03-011-1/+2
| | | | | | | | | | This is a minimal attempt to keep consistency in the Makefiles so that moving ficl to somwehere like contrib will be less error prone. MFC after: 1 week Notes: svn path=/head/; revision=314505
* Deduplicate loader vers.c Makefile rulesEd Maste2016-12-191-4/+1
| | | | | | | | | | | | | | The Makefile rule to create vers.c for loader version info was previously duplicated in each of the various loader Makefiles. Instead, share a common rule in Makefile.inc. Reviewed by: bapt MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8841 Notes: svn path=/head/; revision=310267
* Add -fPIC to the ubldr build. Without this the self relocation code willAndrew Turner2016-12-151-0/+2
| | | | | | | | | | try to use an absolute address in a switch statement, jumping to an invalid memory location. Sponsored by: ABT Systems Ltd Notes: svn path=/head/; revision=310124
* Stop closing the network device when netbooting for loaders using the commonBaptiste Daroussin2016-10-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | dev_net.c code. The NETIF_OPEN_CLOSE_ONCE flag was added in r201932 to prevent that behaviour on some architectures (sparc64 and powerpc64) the default was left to always open and close the device for each open and close of a file by the loader because it was necessary for u-boot on arm. Since it has been added, the flag was turned on for every arches including the u-boot loader for arm. This also fixes netbooting on RPi3 (tested by gonzo@) For the loader.efi it greatly speeds up netbooting Reviewed by: emaste, gonzo, tsoome Approved by: gonzo MFC after: 1 month Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D8230 Notes: svn path=/head/; revision=307238
* sys/boot: spelling fixes in comments.Pedro F. Giffuni2016-04-304-10/+10
| | | | | | | No functional change. Notes: svn path=/head/; revision=298826
* Cleanup unnecessary semicolons from the kernel.Pedro F. Giffuni2016-04-101-1/+1
| | | | | | | Found with devel/coccinelle. Notes: svn path=/head/; revision=297793
* Align the start of the text segment to an 8-byte boundary. This fixesIan Lepore2016-04-091-2/+3
| | | | | | | | | | | | | | | alignment aborts in ubldr.bin for RPi that started happening with clang 3.8 (earlier clang apparently didn't generate strd instructions that trigger the alignment fault). The abort happened in ubldr.bin and not ubldr (elf version) because the elf headers are 0xf4 bytes long, and stripping them off left everything 4-byte aligned. While here, also stop aligning the data segment to a page boundary, align it to 8 bytes instead (aligning to a page just needlessly makes the file bigger); pointed out by andrew@. Notes: svn path=/head/; revision=297758
* RBX_ defines are in rbx.h, move it there.Warner Losh2016-01-262-72/+2
| | | | | | | Differential Revision: https://reviews.freebsd.org/D5038 Notes: svn path=/head/; revision=294766
* Move all the separate copies of the same strings into paths.h. There'sWarner Losh2016-01-262-8/+4
| | | | | | | | | nothing machine specific about these. Differential Revision: https://reviews.freebsd.org/D5038 Notes: svn path=/head/; revision=294765
* Revert r293903Steven Hartland2016-01-141-2/+0
| | | | | | | | | | Revert r293903 as EFI shouldn't be built on this platform that the this was reported on. Sponsored by: Multiplay Notes: svn path=/head/; revision=294028
* Fix GCC warnings causing build failure after r293724Steven Hartland2016-01-141-0/+2
| | | | | | | | | | | | | | Disable some compiler warnings for GCC (non-standard compiler) fixing build failures introduced by r293724, which enabled WARNS in the EFI boot code, when compiling with none standard compiler (GCC). Raised by: ian MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Notes: svn path=/head/; revision=293903
* move the prototype to the lib.h header.. This makes more sense, andJohn-Mark Gurney2015-07-182-2/+2
| | | | | | | it's an API between boot2.c and arm_init.S which calls it.. Notes: svn path=/head/; revision=285683
* other fixes to make boot2 compile for IXP... Properly end the asmJohn-Mark Gurney2015-07-182-0/+4
| | | | | | | | | | sections, and for some reason, main needs a prototype... If someone has a better fix, I'm all ears... Pointed out by: Berislav Purgar Notes: svn path=/head/; revision=285682
* revert r278579, this is in a different compile environment than theJohn-Mark Gurney2015-07-181-1/+1
| | | | | | | | | kernel, and needs to be named cpu_id... Pointed out by: Berislav Purgar Notes: svn path=/head/; revision=285681
* Install loader.rc with ARM u-boot loader (ubldr).Luiz Otavio O Souza2015-07-041-3/+2
| | | | | | | | | | | loader.rc is the responsible to read and process loader.conf variables. This fix the issue of loader.conf being silently ignored. MFC after: 3 days Notes: svn path=/head/; revision=285138
* Enable the NETIF_OPEN_CLOSE_ONCE option for ubldr. This keeps the networkIan Lepore2015-05-181-0/+2
| | | | | | | | | interface open continuously instead of closing it after each filesystem access and reopening it before the next (causing it to re-obtain network params each time). This vastly speeds up netbooting. Notes: svn path=/head/; revision=283069
* Re-link ubldr when any of its libraries change.Ian Lepore2015-05-161-2/+2
| | | | Notes: svn path=/head/; revision=283013
* Create a relocatable instance of ubldr for ARM. The original ubldr,Ian Lepore2015-05-102-25/+63
| | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=282731
* Move the text section to the start of the output file, so that when youIan Lepore2015-05-081-9/+9
| | | | | | | | 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.) Notes: svn path=/head/; revision=282661
* Revert .PATH changes to fix mips build.Jung-uk Kim2015-04-031-0/+1
| | | | | | | | Reported by: bz Pointy hat to: jkim Notes: svn path=/head/; revision=281009
* Install newly added brand-*.4th and logo-*.4th files and reduce duplication.Jung-uk Kim2015-04-021-6/+1
| | | | | | | | Reviewed by: dteske Pointy hat to: dteske Notes: svn path=/head/; revision=281002
* Summary: Update CPU identification call to recent version.George V. Neville-Neil2015-02-111-1/+1
| | | | Notes: svn path=/head/; revision=278579
* Create a custom /boot/defaults/loader.conf for ARM. This differs from theIan Lepore2015-01-031-0/+13
| | | | | | | | | | | | | | | | | standard file in the following ways: - modules_path includes /boot/dtb - It doesn't contain 533 lines, of which 500 are either commented out, empty, or something_which_doesnt_work_on_arm_anyway=NO The standard defaults file takes 40+ seconds to process on an arm beaglebone board. This one takes just a couple seconds. This gets installed instead of the original because of the .PATH magic in the makefile. Notes: svn path=/head/; revision=276632
* Convert a couple lingering NO_FORTH conditionals to test MK_FORTH.Ian Lepore2014-12-231-1/+1
| | | | Notes: svn path=/head/; revision=276145
* Start to allow platforms other than U-Boot to use the FDT code in loader byAndrew Turner2014-11-011-2/+3
| | | | | | | | | | | | 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 after: 1 week Notes: svn path=/head/; revision=273934
* Remove MK_ARM_EABI, the armeb issues have been fixed. The code to supportAndrew Turner2014-10-011-2/+0
| | | | | | | | | | | | | | | the oabi is still in the tree, but it is expected this will be removed as developers work on surrounding code. With this commit the ARM EABI is the only supported supported ABI by FreeBSD on ARMa 32-bit processors. X-MFC after: never Relnotes: yes Differential Revision: https://reviews.freebsd.org/D876 Notes: svn path=/head/; revision=272350