aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/powerpc
Commit message (Collapse)AuthorAgeFilesLines
* Move sys/boot to stand. Fix all references to new locationWarner Losh2017-11-1456-7453/+0
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=325834
* Install the 4th files in sys/boot/forth instead of each loaderWarner Losh2017-11-105-50/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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-104-15/+9
| | | | | | | | | | | | | 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
* FDT support doesn't make sense for ps3. There's no support in the ps3Warner Losh2017-11-101-8/+1
| | | | | | | | | | port for FDT, and it's unlikely to grow support for that anytime soon. When it does, support can be added back easily enough. Supported by: Netflix Notes: svn path=/head/; revision=325688
* Remove all the empty help files from the powerpc build.Warner Losh2017-11-108-8/+4
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=325687
* loader: set options before including bsd.init.mkRoger Pau Monné2017-11-084-42/+42
| | | | | | | | | | | | | | | | | 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
* Powerpc is a 32-bit boot loader.Warner Losh2017-11-065-12/+8
| | | | | | | | | | | | Stop building libsa32 on powerpc. Build everything on powerpc64 -m32. Transition to using LIBSA from LIBSA32. This elimiantes the useless build of libsa on powerpc64 (nothing used to use it) and should be a more direct way of saying this. Sponsored by: Netflix Notes: svn path=/head/; revision=325478
* Use defs.mk defins in most MD codeWarner Losh2017-10-305-55/+44
| | | | | | | | | | | | Use defines from defs.mk in most MD code (the biggest exception is x86, which will be its own commit due to its size). Prefer including bsd.init.mk over the variations (../Makefile.inc and src.opts.mk being the two biggest ones). Sponsored by: Netflix Notes: svn path=/head/; revision=325114
* Move BINDIR definition to defs.mk, and override where it isn't /bootWarner Losh2017-10-255-5/+0
| | | | | | | | | (those files already do that so weren't changed). Sponsored by: Netflix Notes: svn path=/head/; revision=324981
* Prefer SRCTOP paths for bits we're grabbing from libc.Warner Losh2017-10-221-1/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=324879
* End source directories with SRC rather than a hodgepodge of namesWarner Losh2017-10-224-4/+4
| | | | | | | | | | | | | | 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-17/+1
| | | | | | | Sponsored by: Netflix Notes: svn path=/head/; revision=324876
* LOADER_foo_SUPPORTEDWarner Losh2017-10-164-124/+5
| | | | Notes: svn path=/head/; revision=324653
* Move all the ficl common code into ficl.mkWarner Losh2017-10-164-33/+1
| | | | | | | | 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-164-16/+16
| | | | | | | | | | | | 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-122-0/+6
| | | | | | | | | | | | 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
* Move ufsread.cWarner Losh2017-10-121-2/+3
| | | | | | | | | | | Move ufsread.c from sys/boot/common (which used to be all the common files for /boot/loader, but grew to be all the common files for sys/boot, but that's now sys/boot/libsa's job) to sys/boot/libsa. Sponsored by: Netflix Notes: svn path=/head/; revision=324556
* Rather than laying whack-a-mole with including the path to stand.h,Warner Losh2017-10-104-12/+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-094-12/+8
| | | | | | | | | | | 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-094-4/+4
| | | | | | | | | | | | 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
* loader: F_READ/F_WRITE should be checked against masked flagToomas Soome2017-04-182-0/+2
| | | | | | | | | | | | | | | | | | The work to make it possible to avoid bcache via using F_NORA modifier did miss the fact that not all loader platforms are using the bcache, and so it is possible the modifier is not cleared, as bcache strategy function is not used. For fix, we make sure the checks are dont with masked flag. This patch does fix boot for platforms which do not use bcache. Reported by: emaste Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D10422 Notes: svn path=/head/; revision=317097
* Split the ficl CFLAGS when they refer to an arch-specific include path.Pedro F. Giffuni2017-03-014-4/+8
| | | | | | | | | | 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
* dosfs support in libstand is broken since r298230Toomas Soome2016-12-303-7/+7
| | | | | | | | | | | | | | | | | | | | | | Apparently the libstand dosfs optimization is a bit too optimistic and did introduce possible memory corruption. This patch is backing out the bad part and since this results in dosfs reading full blocks now, we can also remove extra offset argument from dv_strategy callback. The analysis of the issue and the backout patch is provided by Mikhail Kupchik. PR: 214423 Submitted by: Mikhail Kupchik Reported by: Mikhail Kupchik Reviewed by: bapt, allanjude Approved by: allanjude (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D8644 Notes: svn path=/head/; revision=310850
* Deduplicate loader vers.c Makefile rulesEd Maste2016-12-194-16/+4
| | | | | | | | | | | | | | 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
* Reduce boot loader version string duplicationEd Maste2016-12-182-14/+4
| | | | | | | | | | | | | Instead of repeating "%s, Revision %s" "(%s %s)" in each loader, just create the full version string in vers.c Reviewed by: bapt MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8823 Notes: svn path=/head/; revision=310225
* dd is currently a bootstrap tool. It really doesn't have any businessWarner Losh2016-12-021-2/+2
| | | | | | | | | | | | | | | being a bootstrap tool. However, for reproducible build output, FreeBSD added dd status=none because it was otherwise difficult to suppress the status information, but retain any errors that might happen. There's no real reason that dd has to be a build tool, other than we use status=none unconditional. Remove dd from a bootstrap tool entirely by only using status=none when available. This may also help efforts to build the system on non-FreeBSD hosts as well. Differential Revision: https://reviews.freebsd.org/D8605 Notes: svn path=/head/; revision=309412
* Loader paged/pageable data is not always paged.Toomas Soome2016-11-083-7/+9
| | | | | | | | | | | | | | | | | | | This change does modify devsw dv_print() to return the int value, enabling walkers to interrupt the walk on non zero value from dv_print(). This will allow the pager_print actually to stop displaying data on user input, and additionally pager is used in various *dev_print callbacks, where it was missing. For test, lsdev [-v] command should display data by screenfuls and should stop when the key 'q' is pressed on pager prompt. Reviewed by: allanjude Approved by: allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D5461 Notes: svn path=/head/; revision=308434
* Create a new MACHINE_ARCH for Freescale PowerPC e500v2Justin Hibbits2016-10-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The Freescale e500v2 PowerPC core does not use a standard FPU. Instead, it uses a Signal Processing Engine (SPE)--a DSP-style vector processor unit, which doubles as a FPU. The PowerPC SPE ABI is incompatible with the stock powerpc ABI, so a new MACHINE_ARCH was created to deal with this. Additionaly, the SPE opcodes overlap with Altivec, so these are mutually exclusive. Taking advantage of this fact, a new file, powerpc/booke/spe.c, was created with the same function set as in powerpc/powerpc/altivec.c, so it becomes effectively a drop-in replacement. setjmp/longjmp were modified to save the upper 32-bits of the now-64-bit GPRs (upper 32-bits are only accessible by the SPE). Note: This does _not_ support the SPE in the e500v1, as the e500v1 SPE does not support double-precision floating point. Also, without a new MACHINE_ARCH it would be impossible to provide binary packages which utilize the SPE. Additionally, no work has been done to support ports, work is needed for this. This also means no newer gcc can yet be used. However, gcc's powerpc support has been refactored which would make adding a powerpcspe-freebsd target very easy. Test Plan: This was lightly tested on a RouterBoard RB800 and an AmigaOne A1222 (P1022-based) board, compiled against the new ABI. Base system utilities (/bin/sh, /bin/ls, etc) still function appropriately, the system is able to boot multiuser. Reviewed By: bdrewery, imp Relnotes: yes Differential Revision: https://reviews.freebsd.org/D5683 Notes: svn path=/head/; revision=307761
* Stop closing the network device when netbooting for loaders using the commonBaptiste Daroussin2016-10-133-13/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* The getsecs() function is implemented in platform- and bootfw-specificStephen J. Kiernan2016-09-222-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | files and, in a number of these places, there were problems with how they were declared. Some used int return instead of time_t. On some architectures the bit width of time_t did not naturally fit into an integer and could lead to some unexpected behavior. (For example, 32-bit ARM builds uses a 64-bit time_t.) Make sure the function prototypes always specify void for the argument list when they do not have any arguemnts, otherwise some compilers can complain about the prototype. Reported by: Kevin Zheng Reviewed by: sjg Approved by: sjg (mentor) Obtained from: Juniper Networks, Inc. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D7463 Notes: svn path=/head/; revision=306159
* Increase the boot1 file size on the HFS boot image.Justin Hibbits2016-09-163-14/+14
| | | | | | | | | | The boot1.elf is too fat for 30k, it's not 32k on powerpc64, and 34k on powerpc. Without this, boot1 will fail with odd behaviors. MFC after: 1 day Notes: svn path=/head/; revision=305894
* Some versions of SLOF do not append the partition number to the bootNathan Whitehorn2016-08-301-20/+31
| | | | | | | | | | | | | | device argument to the stage-1 bootloader. In such cases, boot1 would only try to read the entire device rather than checking for partitions. Instead of panic'ing, fall back to reading the partitions as normal in such situations. This was preventing boot of installed systems on some versions of PowerKVM. PR: kern/211599 MFC after: 2 days Notes: svn path=/head/; revision=305036
* Clean up some FDT-related code in the PowerPC bootloader, improving errorNathan Whitehorn2016-07-011-13/+25
| | | | | | | | | | checking and robustness. Prevents errors and crashes in FDT commands on PowerMac G5 systems. Approved by: re (gjb) Notes: svn path=/head/; revision=302312
* sys/boot: make use of the howmany() macro when available.Pedro F. Giffuni2016-04-261-1/+1
| | | | | | | | We have a howmany() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Notes: svn path=/head/; revision=298645
* A new implementation of the loader block cacheAllan Jude2016-04-183-7/+7
| | | | | | | | | | | | | | | | | | | | The block cache implementation in loader has proven to be almost useless, and in worst case even slowing down the disk reads due to insufficient cache size and extra memory copy. Also the current cache implementation does not cache reads from CDs, or work with zfs built on top of multiple disks. Instead of an LRU, this code uses a simple hash (O(1) read from cache), and instead of a single global cache, a separate cache per block device. The cache also implements limited read-ahead to increase performance. To simplify read ahead management, the read ahead will not wrap over bcache end, so in worst case, single block physical read will be performed to fill the last block in bcache. Booting from a virtual CD over IPMI: 0ms latency, before: 27 second, after: 7 seconds 60ms latency, before: over 12 minutes, after: under 5 minutes. Submitted by: Toomas Soome <tsoome@me.com> Reviewed by: delphij (previous version), emaste (previous version) Relnotes: yes Differential Revision: https://reviews.freebsd.org/D4713 Notes: svn path=/head/; revision=298230
* Move all the separate copies of the same strings into paths.h. There'sWarner Losh2016-01-261-3/+2
| | | | | | | | | nothing machine specific about these. Differential Revision: https://reviews.freebsd.org/D5038 Notes: svn path=/head/; revision=294765
* Remove hidden "Not ufs" printfs from boot codeSteven Hartland2016-01-091-4/+0
| | | | | | | | | | | | Remove the printf("Not ufs\n") from the boot code which was hidden by the local printf implementations, allowing these to have that code removed too. MFC after: 2 weeks X-MFC-With: r293268 Sponsored by: Multiplay Notes: svn path=/head/; revision=293461
* Clean up PowerPC bootloader compiler flags to fix the build with GCC 5.2Nathan Whitehorn2015-12-032-2/+1
| | | | | | | and binutils 2.25. Notes: svn path=/head/; revision=291667
* Allow loader to load 64-bit ELFv2 PowerPC kernels.Nathan Whitehorn2015-12-012-4/+12
| | | | Notes: svn path=/head/; revision=291598
* The Linux kexec boot loader doesn't need a font built in to it. This gotNathan Whitehorn2015-11-191-5/+0
| | | | | | | copied-and-pasted from the PS3 loader. Notes: svn path=/head/; revision=291048
* Remove guards around overwriting loader.rc and menu.rcAllan Jude2015-08-063-21/+3
| | | | | | | | | | | | | | | | | There have been .local version of each for user modifications for some time This allows users to receive future updates to these files PR: 183765 Submitted by: Bertram Scharpf, Nikolai Lifanov (patch) Reviewed by: dteske, loos, eadler Approved by: bapt (mentor) MFC after: 1 month Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3176 Notes: svn path=/head/; revision=286368
* Fix fallouts from r284590Baptiste Daroussin2015-06-193-0/+3
| | | | | | | Reported by: kib Notes: svn path=/head/; revision=284597
* Fix powerpc/ps3 build, too.Jung-uk Kim2015-04-031-0/+1
| | | | Notes: svn path=/head/; revision=281011
* Revert .PATH changes to fix mips build.Jung-uk Kim2015-04-032-0/+2
| | | | | | | | 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-023-18/+3
| | | | | | | | Reviewed by: dteske Pointy hat to: dteske Notes: svn path=/head/; revision=281002
* Provide a shim layer in loader to condense the Open Firmware device tree toNathan Whitehorn2015-03-093-9/+235
| | | | | | | | | | an FDT. This is how Linux and OS X boot and can avoid some issues with using Open Firmware at runtime. The code is highly experimental and disabled by default; it can be turned on by setting the loader environment variable "usefdt" to a non-NULL value. Notes: svn path=/head/; revision=279799
* Allow this to work with disks greater than 4 GB and with names not beginningNathan Whitehorn2015-02-013-12/+19
| | | | | | | with "s". Notes: svn path=/head/; revision=278020
* Relocate kernel to high address space (a static + 64 MB for now) to avoidNathan Whitehorn2015-01-314-10/+29
| | | | | | | | conflicts with the Linux host kernel. This lets you kexec an unmodified GENERIC64. Notes: svn path=/head/; revision=277997
* Add FDT reservations for memory areas used by OPAL or RTAS runtime firmware.Nathan Whitehorn2015-01-311-5/+25
| | | | | | | This allows a kexec'ed kernel to boot multiuser under PHYP. Notes: svn path=/head/; revision=277991
* Add kexec-based Linux shim loader for use with the firmware petitbootNathan Whitehorn2015-01-0515-1/+1694
| | | | | | | | | | | | | | loader on PS3 and POWER8 systems. This is reasonably portable to other architectures, especially FDT-based ones, if similar features are useful elsewhere. Netboot support is missing for now and will be added in a future commit, at which time loader.ps3 will be garbage collected. Done at: Hackathon Notes: svn path=/head/; revision=276688