aboutsummaryrefslogtreecommitdiff
path: root/stand/powerpc
Commit message (Collapse)AuthorAgeFilesLines
* powerpc/loader: Size the CAS PVR array correctlyJustin Hibbits2026-01-171-1/+1
| | | | | Fixes: 895eeb492 ("powerpc/loader: Add CAS support for older CPUs") MFC after: 1 week
* powerpc/loader: Add CAS support for older CPUsJustin Hibbits2026-01-171-0/+6
| | | | | | | | QEMU creates a "ibm,arch-vec-5-platform-support" property for all pseries emulations. Add POWER7 and POWER6 to the CAS list, more can be added later as needed/desired. MFC after: 1 week
* stand: remove powerpcspe linker scriptMinsoo Choo2026-01-091-3/+0
| | | | | | | Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me> Reviewed by: emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1914 (cherry picked from commit 9c72e8e3500408f7ce5fc7be500dd3efc0307674)
* loader: Use C99 initializations for file_formatWarner Losh2025-12-282-8/+6
| | | | | | For greppability, use C99 initializers for the struct file_format. Sponsored by: Netflix
* loader: Fix powerpc64le by working around slof bug in qemu/slofWarner Losh2025-12-281-1/+1
| | | | | | | | | | | | | | | | | | | Fix powerpc 64 little endian booting by adding some padding. Due to https://gitlab.com/slof/slof/-/blob/master/lib/libelf/elf32.c?ref_type=heads#L114 https://gitlab.com/slof/slof/-/blob/master/lib/libelf/elf32.c?ref_type=heads#L150 using <= instead of <, slof used to loop over the phdrs. It overruns by 1 and so on little endian it swizzles the first 32 bytes of .text. Work around this by adding 32 bytes of padding after the headers. We should fix this in slof, but it's in the just released QEMU 10.2, so we have to pad things here for now. Now powerpc64le + qemu works. MFC After: 3 days (maybe EN too) Reviewed by: adrian, jhibbits Sponsored by: Netflix
* machine/stdarg.h -> sys/stdarg.hBrooks Davis2025-06-111-1/+3
| | | | | | | | | | | | | Switch to using sys/stdarg.h for va_list type and va_* builtins. Make an attempt to insert the include in a sensible place. Where style(9) was followed this is easy, where it was ignored, aim for the first block of sys/*.h headers and don't get too fussy or try to fix other style bugs. Reviewed by: imp Exp-run by: antoine (PR 286274) Pull Request: https://github.com/freebsd/freebsd-src/pull/1595
* 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
* ports/filesystems: Fix falloutAlexander Ziaee2025-01-271-1/+1
| | | | | | | | | | | | | A new filesystems category was created in the ports tree, with 142 filesystem related ports moved to there, some of them renamed. Update all references in the src tree to the new locations. PR: 283881 Fixes: ports:6e2da9672f79f44 (filesystems: add new category) MFC after: 1 month Reviewed by: fuz, mhorne, bapt Accepted by: mhorne (mentor) Differential Revision: https://reviews.freebsd.org/D48406
* stand: use globals for the kernel and module typesAhmad Khalifa2025-01-242-2/+2
| | | | | Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1394
* loader/powerpc: Add some CAS support for newer POWER CPUsJustin Hibbits2024-10-111-2/+8
| | | | | | * Add PVR bits for POWER10 and POWER11 * Initialize the `err` outvar, in case it's not touched on success by the hypervisor, to prevent spurious errors.
* loader: Bump all versions to 3.0Warner Losh2024-07-291-0/+1
| | | | | | | | | | | | | Each incompatible change we make, we bump the major version. We've not done the bump in a while, so sync everybody to 3.0. Anything older than 3.0 will be given a warning that their boot loader is too old. We check only the major version, though, so minor versions can still be bumped for individual loaders (though I honestly doubt we'll ever need to do that again). Sponsored by: Netflix Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D45888
* stand: Remove obsolete junkWarner Losh2024-07-291-4/+0
| | | | | | | | | | We long ago changed newvers.sh to make these comments bogus. Remove them since every single one of them is broken after the $FreeBSD$ removal. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D45879
* Remove residual blank line at start of MakefileWarner Losh2024-07-154-4/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* boot1.chrp: Include memsetWarner Losh2024-06-141-1/+1
| | | | | | | | | Normally, memset isn't used. However for OPT_INIT_ALL=zero it is. Always include it since we're not space constrained and latter-day loaders won't include a copy if it's not actually used. Reviewed by: emaste Sponsored by: Netflix
* loader/powerpc: Share ldscriptWarner Losh2024-02-257-150/+13
| | | | | | | | | | | | | Share ldscript between the different ppc versions. There's two different scripts since we build 32-bit binaries for all types of powerpc, but have little endian and big endian variations that are different by only two lines. Set the output format and include the rest. Move to foo.ldscript as well. Sponsored by: Netflix Reviewed by: tsoome, kevans Differential Revision: https://reviews.freebsd.org/D44058
* libsa: Remove redundant sys/cdefs.hWarner Losh2024-02-226-6/+0
| | | | Sponsored by: Netflix
* loader: Remove gfx_fb_stub.c, it's no longer neededWarner Losh2024-02-161-3/+1
| | | | | | | | | | Now that we draw in the gfx bindings for all our interpreters only when graphics support is compiled in, we can eliminate this from all the loaders that don't have graphics support. Sponsored by: Netflix Reviewed by: kevans, jhb Differential Revision: https://reviews.freebsd.org/D43905
* stand: Automated cleanup of cdefs and other formattingWarner Losh2023-11-272-2/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* stand: Rename LIBFDT to LIBSAFDTMark Johnston2023-11-071-2/+2
| | | | | | | | | | | Preemptively address a collision with LIBFDT (to be added in the future) from src.libnames.mk, which gets included via bsd.progs.mk. No functional change intended. Reviewed by: imp MFC after: 1 week Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D42486
* loader: add target for dirdeps buildStephen J. Kiernan2023-11-021-0/+12
| | | | | | | | Update dependencies for the loader variations used for each architecture. Reviewed by: sjg Differential Revision: https://reviews.freebsd.org/D39741
* Remove $FreeBSD$: one-line bare tagWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-166-7/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-168-16/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-162-2/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* generate-hfs.sh: don't embed $FreeBSD$ in generated codeWarner Losh2023-08-161-2/+0
| | | | Sponsored by: Netflix
* Mark usage function as __dead2 in programs where it does not returnAlfonso Gregory2023-07-071-1/+1
| | | | | | | | In most cases, usage does not return, so mark them as __dead2. For the cases where they do return, they have not been marked __dead2. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/735
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* loader: always install help filesMitchell Horne2023-02-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Address two issues with current help file logic: The existing condition prevents the common help file from being installed when there are no additional help files defined. This results in no loader.help on EFI platforms, for example. Second, due to the fact that we build and install multiple loader types, each successive install will clobber the previous loader.help. The result is that we could lose type-specific commands, or possibly list them in loaders that do not have such commands. Instead, give each loader type a uniquely named help file. The EFI loader will look for /boot/loader.help.efi, userboot will look for /boot/loader.help.userboot, etc. The interpreter variant has no effect on which help file is loaded. This leaves the old /boot/loader.help unused. Some credit for the final approach goes to Mathieu <sigsys@gmail.com> for their version of the fix in https://reviews.freebsd.org/D22951. PR: 267134 Reported by: Daniel O'Connor <darius@dons.net.au> Reviewed by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28591
* 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: update prototypes for md_load and md_load64Warner Losh2022-12-052-0/+2
| | | | | | | | | | | These are declared as extern in a number of files (some with the wrong return type). Centralize this in modinfo.h and remove a few extra stray declarations as well that are no longer used. No functional change. Note: I've not tried to cope with the bi_load() functions which are the same logical thing. These will be handled separately. Sponsored by: Netflix
* stand/ofw: Subclass devnet to cope with ofw's unique needsWarner Losh2022-11-301-1/+1
| | | | | | | | | We need to match devices in a slightly special way: We have to look up the path and see if the device is a 'network' device in order to use it. Sponsored by: Netflix Tested by: grehan@ (with tweaks to my original patch) Differential Revision: https://reviews.freebsd.org/D37557
* 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
* loader: fix powerpc64le ofw loaderAlfredo Dal'Ava Junior2022-07-291-0/+1
| | | | | | | | | | | | | This is similar to 5d48fb3b16c1496bf415fee620c61cc944b0326d. With LLVM14 the .data.rel.ro ELF section appears after .data, making loader behave erractly and kernel is not loaded. This patch makes ensures the correct order. Based on discussion at: https://github.com/llvm/llvm-project/issues/56306 MFC after: 1 day Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
* loader: fix powerpc* ofw loaderAlfredo Dal'Ava Junior2022-07-011-0/+1
| | | | | | | | | | | | | | With the introduction of llvm14, the powerpc* loader used on ofw/pseries for 32 and 64 bit architectures puts the .data.rel.ro section after .data section. This caused a crash kernel didn't boot. Bisect pointed to change https://reviews.llvm.org/D111717 but problem could be fixed by adding a section description to make it appear in the expected order. This patch is based on discussion at: https://github.com/llvm/llvm-project/issues/56306 MFC after: 1 day Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
* stand: s/libstand/libsa/g to catch up with renameWarner Losh2022-04-301-1/+1
| | | | | | | We renamed libstand to libsa years ago with the move from sys/boot to stand. Catch up in the comments. Sponsored by: Netflix
* kboot: Move powerpc kboot to top levelWarner Losh2021-12-3013-1622/+0
| | | | | | | | As the first step at making this more generic, move kboot to top level. Sponsored by: Netflix Reviewed by: luporl, tsoome Differential Revision: https://reviews.freebsd.org/D33513
* stand/uboot: reorgWarner Losh2021-12-157-504/+0
| | | | | | | | | | | | | | | | | | | Build uboot ubldr and friends like we build efi binaries o move everything to be under stand/uboot o md code goes in arch/$ARCH o move everything over from the library - Had to rename console.c, disk.c and module.c due to conflicts o update version to 1.5 to reflect the new way of building This results in a more consistent build system and should represent no functional change, apart from powerpc version getting new help file. Also, moved to exlcuding uboot on powerpc64le by using BROKEN_OPTION instead of the incidental exclusion we had before due to Makefile reorgs. Sponsored by: Netflix Feedback by: stevek, jrtc27 Differential Revision: https://reviews.freebsd.org/D33362
* loader: move all gfx_fb.c stubs to common/gfx_fb_stub.cWarner Losh2021-12-144-162/+4
| | | | | | | | | All these files are the same, modulo one comment. Move them all into common/gfx_fb_stub.c and adjust Makefiles accordingly. Sponsored by: Netflix Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D33428
* loader/kboot: minor style nitWarner Losh2021-12-131-1/+0
| | | | | | Kill trailing white space. Sponsored by: Netflix
* kboot: remove host_seekWarner Losh2021-12-092-10/+0
| | | | | | | host_llseek has replaced all instances of host_seek, so retire the latter. It's unused. Sponsored by: Netflix
* kboot: simplify _startWarner Losh2021-12-091-12/+1
| | | | | | | | _start can be implemented directly like this. The code generated is identical. It's also portable. Reviewed by: md5 Sponsored by: Netflix
* powerpc64: tell kernel when radix is not availableLeandro Lupori2021-10-221-2/+8
| | | | | | | | If CAS detects that radix is not supported, set radix_mmu to 0 to avoid the kernel trying to use it and panic. MFC after: 2 weeks Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
* powerpc64le: stand fixesLeandro Lupori2021-10-208-22/+371
| | | | | | | | | | | | | | | | | | | | | | 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: make radix with superpages defaultLeandro Lupori2021-10-141-3/+3
| | | | | | | | | | As Radix MMU with superpages enabled is now stable, make it the default choice on supported hardware (POWER9 and above), since its performance is greater than that of HPT MMU. Reviewed by: alfredo, jhibbits Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D30797
* 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
* powerpc64: change CAS to support Radix MMULeandro Lupori2021-09-151-46/+74
| | | | | | | | | | | | | | | | | Use radix_mmu environment variable to select between Hash or Radix MMU, when performing the CAS method call. This matches kernel's behavior, by selecting Hash MMU by default and Radix if radix_mmu is not zero, to make sure that both loader and kernel always select the same MMU. The device tree is queried to detect Radix/GTSE support and to find out if CAS is supported, making the old CPU version and HV bit checks unnecessary now. Reviewed by: jhibbits MFC after: 2 weeks Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D31951
* loader: implement mount/unmount rootfsToomas Soome2021-09-082-1/+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
* Disable PIE for powerpc bootloaders.Marcin Wojtas2021-02-244-0/+8
| | | | | | | | | | | | | Bootloaders for powerpc are not built as position independent code. Since bsd.prog.mk is used for building, when PIE is enabled, the PIE flags are added and that causes the build to fail. Adding MK_PIE=no stops bsd.prog.mk from adding PIE specific flags. Submitted by: Dawid Gorecki <dgr@semihalf.com> Reviewed by: emaste Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D28893