]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
powerpc64le: stand fixes
authorLeandro Lupori <luporl@FreeBSD.org>
Wed, 20 Oct 2021 18:48:33 +0000 (15:48 -0300)
committerLeandro Lupori <luporl@FreeBSD.org>
Fri, 5 Nov 2021 14:29:40 +0000 (11:29 -0300)
commit8a62b07bce7ba43caa7a345be30ab3a8afc220b0
tree081770dca87e7f4145006004c9bf4880054d24b9
parent84800daacf331192138b226db7d839a46fb2d642
powerpc64le: stand fixes

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

(cherry picked from commit f83288645cd9726c24ca67292fbc3abb4eb65a36)
12 files changed:
stand/common/load_elf.c
stand/defs.mk
stand/libofw/openfirm.c
stand/libofw/openfirm.h
stand/powerpc/Makefile
stand/powerpc/boot1.chrp/boot1.c
stand/powerpc/ofw/Makefile
stand/powerpc/ofw/cas.c
stand/powerpc/ofw/ldscript.powerpcle [new file with mode: 0644]
stand/powerpc/ofw/main.c
stand/powerpc/ofw/ofwfdt.c
stand/powerpc/ofw/trampolineLE.S [new file with mode: 0644]