aboutsummaryrefslogtreecommitdiff
path: root/stand/powerpc/ofw/main.c
Commit message (Collapse)AuthorAgeFilesLines
* stand/powerpc/ofw: Initialize archsw at compile timeWarner Losh2025-05-261-8/+15
| | | | | | There's no real reason to do this at runtime. Sponsored by: Netflix
* stand/powerpc/ofw: Remove bogus end declWarner Losh2025-05-261-2/+0
| | | | | | | This likely used to be needed for some code here, or maybe it's been here since it was copied from elsewhere that did neeed it. Remove it. Sponsored by: Netflix
* libsa: Remove redundant sys/cdefs.hWarner Losh2024-02-221-1/+0
| | | | Sponsored by: Netflix
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* stand: Create common gen_setcurrdev and replace codeWarner Losh2023-01-111-3/+3
| | | | | | | | | | Replace 4 identical copies of *_setcurrdev with gen_setcurrdev to avoid having to create a 5th copy. uboot_setcurrdev is actually different and needs to remain separate (even though it's quite similar). Sponsored by: Netflix Reviewed by: fuz@fuz.su, kevans Differential Revision: https://reviews.freebsd.org/D38003
* stand: create devinitWarner Losh2022-11-301-6/+1
| | | | | | | | devinit() marches through all the devices, calling the inint routines if any exist. Replace all the identical copies of this code. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D37349
* powerpc64le: stand fixesLeandro Lupori2021-10-201-3/+34
| | | | | | | | | | | | | | | | | | | | | | Fix boot1 and loader on PowerPC64 little-endian (LE). Due to endian issues, boot1 couldn't find the UFS boot partition and loader wasn't able to load the kernel. Most of the issues happened because boot1 and loader were BE binaries trying to access LE UFS partitions and because loader expects the kernel ELF image to use the same endian as itself. To fix these issues, boot1 and loader are now built as LE binaries on PPC64LE. To support this, the functions that call OpenFirmware were enhanced to correctly perform endian conversion on its input and output arguments and to change the CPU into BE mode before making the calls, as OpenFirmware always runs in BE. Besides that, some other small fixes were needed. Submitted by: bdragon (initial version) Reviewed by: alfredo, jhibbits Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D32160
* powerpc64: fix loader regressionLeandro Lupori2021-09-211-11/+11
| | | | | | | | | | | | | | After b4cb3fe0e39a, loader started crashing on PowerPC64, with a Program Exception (700) error. The problem was that archsw was used before being initialized, with the new mount feature. This change fixes the issue by initializing archsw earlier, before setting currdev, that triggers the mount. Reviewed by: tsoome MFC after: 1 month X-MFC-With: b4cb3fe0e39a Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D32027
* loader: implement mount/unmount rootfsToomas Soome2021-09-081-0/+3
| | | | | | | | | We want to keep our root file system open to preserve bcache segment between file accesses, thus reducing physical disk IO. Reviewed by: imp, allanjude, kevans (previous version) Differential Revision: https://reviews.freebsd.org/D30848 MFC after: 1 month
* stand/ficl 64-bit compatibilityBrandon Bergren2020-09-141-1/+1
| | | | | | | | | | | | | | | | | | | Currently, the only thing that prevents a functioning 64-bit FICL build is a few integer types that were intended to be fixed-width. Changing them to C99 integer types allows building a functioning 64-bit FICL. While this isn't applicable to the default settings of any in-tree loaders, it is necessary for a future Petitboot loader, due to the requirement that it be compiled as a 64-bit program. Reviewed by: tsoome, imp (earlier revision) Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D26364 Notes: svn path=/head/; revision=365724
* [PPC64] Implement CASLeandro Lupori2019-07-311-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Guest PPC OSs running under a hypervisor may communicate the features they support, in order for the hypervisor to expose a virtualized machine in the way the client (guest OS) expects (see LoPAPR 1.1 - B.6.2.3). This is done by calling the "/ibm,client-architecture-support" (CAS) method, informing supported features in option vectors. Until now, FreeBSD wasn't using CAS, but instead relied on hypervisor/QEMU's defaults. The problem is that, without CAS, it is very inconvenient to run POWER9 VMs on a POWER9 host running with radix enabled. This happens because, in this case, the QEMU default is to present the guest OS a dual MMU (HPT/RPT), instead of presenting a regular HPT MMU, as FreeBSD expects, resulting in an early panic. The known workarounds required either changing the host to disable radix or passing a flag to QEMU to run in a POWER8 compatible mode. With CAS, FreeBSD is now able to communicate that it wants an HPT MMU, independent of the host setup, which now makes FreeBSD work on POWER9/pseries, with KVM enabled and without hugepages (support added in a previous commit). As CAS is invoked through OpenFirmware's call-method interface, it needs to be performed early, when OpenFirmware is still operational. Besides, now that FDT is the default way to inspect the device tree on PPC, OFW call-method feature will be unavailable by default, when control is passed to the kernel. Because of this, the call to CAS is being performed at the loader, instead of at the kernel. To avoid regressions with old platforms, this change uses CAS only on POWER8/POWER9. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D20827 Notes: svn path=/head/; revision=350485
* bootprog_info is generated in vers.c. Move it's definition toWarner Losh2018-06-141-1/+0
| | | | | | | | | bootstrap.h and remove all the redundant copies. Sponsored by: Netflix Notes: svn path=/head/; revision=335117
* Prefer uintXX_t to u_intXX_tWarner Losh2018-03-131-2/+2
| | | | | | | | | A foolish consistency is the hobgoblin of little minds, adored by little statesmen and philosophers and divines. With consistency a great soul has simply nothing to do. -- Ralph Waldo Emerson Notes: svn path=/head/; revision=330864
* Where we can, pass the kernel an FDT facsimile of the OF device tree ratherNathan Whitehorn2018-03-041-0/+21
| | | | | | | | | | | | | | | | than a pointer to Open Firmware by default. This eliminates a number of potentially unsafe calls to firmware from the kernel and provides better performance. This feature is meant to be expanded until it is on by default unconditionally and, ideally, we can then garbage-collect the nightmare pile of hacks required to call into Open Firmware from a live kernel. Reviewed by: jhibbits Notes: svn path=/head/; revision=330371
* Move "common" Open Firmware parts of the loader used only on PowerPC toNathan Whitehorn2018-03-031-0/+179
the powerpc/ subdirectory. These have never used by SPARC and we have no other (and almost certainly will have no other) Open Firmware platforms. This makes the directory structure simpler and lets us avoid some cargo-cult MI patterns on code that is, and always was, architecture-specific. Notes: svn path=/head/; revision=330365