linux/arch/powerpc/boot
Masahiro Yamada 9e005b761e powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h
The next commit will make the way of passing CONFIG options more robust.
Unfortunately, it would uncover another hidden issue; without this
commit, skiroot_defconfig would be broken like this:

|   WRAP    arch/powerpc/boot/zImage.pseries
| arch/powerpc/boot/wrapper.a(decompress.o): In function `bcj_powerpc.isra.10':
| decompress.c:(.text+0x720): undefined reference to `get_unaligned_be32'
| decompress.c:(.text+0x7a8): undefined reference to `put_unaligned_be32'
| make[1]: *** [arch/powerpc/boot/Makefile;383: arch/powerpc/boot/zImage.pseries] Error 1
| make: *** [arch/powerpc/Makefile;295: zImage] Error 2

skiroot_defconfig is the only defconfig that enables CONFIG_KERNEL_XZ
for ppc, which has never been correctly built before.

I figured out the root cause in lib/decompress_unxz.c:

| #ifdef CONFIG_PPC
| #      define XZ_DEC_POWERPC
| #endif

CONFIG_PPC is undefined here in the ppc bootwrapper because autoconf.h
is not included except by arch/powerpc/boot/serial.c

XZ_DEC_POWERPC is not defined, therefore, bcj_powerpc() is not compiled
for the bootwrapper.

With the next commit passing CONFIG_PPC correctly, we would realize that
{get,put}_unaligned_be32 was missing.

Unlike the other decompressors, the ppc bootwrapper duplicates all the
necessary helpers in arch/powerpc/boot/.

The other architectures define __KERNEL__ and pull in helpers for
building the decompressors.

If ppc bootwrapper had defined __KERNEL__, lib/xz/xz_private.h would
have included <asm/unaligned.h>:

| #ifdef __KERNEL__
| #       include <linux/xz.h>
| #       include <linux/kernel.h>
| #       include <asm/unaligned.h>

However, doing so would cause tons of definition conflicts since the
bootwrapper has duplicated everything.

I just added copies of {get,put}_unaligned_be32, following the
bootwrapper coding convention.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190705100144.28785-1-yamada.masahiro@socionext.com
2019-07-10 13:20:44 +10:00
..
dts powerpc/dts/fsl: add crypto node alias for B4 2019-05-03 02:54:57 +10:00
.gitignore powerpc/boot: Expose Kconfig symbols to wrapper 2018-10-13 22:21:25 +11:00
4xx.c powerpc/44x: Fix mask and shift to zero bug 2017-08-31 14:26:06 +10:00
4xx.h
44x.h
addnote.c powerpc/boot: Fix missing check of lseek() return value 2019-05-03 02:54:57 +10:00
bamboo.c
cpm-serial.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
crt0.S powerpc: Fix COFF zImage booting on old powermacs 2018-11-27 10:55:11 +11:00
crtsavres.S powerpc/64: Do not link crtsaveres.o in boot 2017-05-30 14:59:51 +10:00
cuboot-8xx.c
cuboot-52xx.c
cuboot-83xx.c
cuboot-85xx-cpm2.c
cuboot-85xx.c
cuboot-824x.c
cuboot-acadia.c
cuboot-amigaone.c
cuboot-bamboo.c
cuboot-ebony.c
cuboot-hotfoot.c
cuboot-katmai.c
cuboot-kilauea.c
cuboot-mpc7448hpc2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 40 2019-05-24 17:27:12 +02:00
cuboot-pq2.c
cuboot-rainier.c
cuboot-sam440ep.c
cuboot-sequoia.c
cuboot-taishan.c
cuboot-warp.c
cuboot-yosemite.c
cuboot.c
cuboot.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dcr.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
decompress.c powerpc/boot: Add support for XZ compression 2016-09-28 14:35:14 +10:00
devtree.c
div64.S
dummy.c
ebony.c
elf.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
elf_util.c powerpc/boot: Add little endian support to elf utils 2014-04-28 17:36:04 +10:00
ep88xc.c
ep405.c
ep8248e.c
epapr-wrapper.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
epapr.c powerpc/zImage: make the "OF" wrapper support ePAPR boot 2013-09-25 14:18:44 +10:00
fixed-head.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fixup-headers.sed powerpc/boot: Add sed script 2016-09-28 14:20:44 +10:00
fsl-soc.c
fsl-soc.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gamecube-head.S
gamecube.c
hack-coff.c
holly.c
install.sh
io.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
libfdt-wrapper.c powerpc/boot/fdt: Use unsigned long for pointer casts 2015-03-16 18:58:30 +11:00
libfdt_env.h libfdt: Ensure INT_MAX is defined in libfdt_env.h 2018-09-19 15:10:06 -07:00
main.c powerpc/boot: Fix the early OPAL console wrappers 2016-11-24 17:34:01 +11:00
Makefile powerpc/boot: Add lzo support for uImage 2019-07-05 02:06:38 +10:00
mktree.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
motload-head.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mpc8xx.c powerpc/boot: remove unused variable in mpc8xx 2018-06-04 00:39:17 +10:00
mpc8xx.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mpc52xx-psc.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mvme5100.c powerpc/embedded6xx: Add support for Motorola/Emerson MVME5100 2014-01-09 17:52:20 -06:00
mvme7100.c powerpc/86xx: Add support for Emerson/Artesyn MVME7100 2016-07-08 20:01:27 -05:00
ns16550.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
of.c powerpc/boot: Rework of_claim() to make it 64bit friendly 2014-04-28 17:35:43 +10:00
of.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ofconsole.c powerpc/boot: Add byteswapping routines in oflib 2014-04-28 17:35:35 +10:00
oflib.c powerpc/boot: Define a routine to enter prom 2014-04-28 17:36:08 +10:00
opal-calls.S powerpc/boot: Fix the early OPAL console wrappers 2016-11-24 17:34:01 +11:00
opal.c powerpc/boot: Fix opal console in boot wrapper 2018-10-13 22:21:25 +11:00
ops.h powerpc/boot: Remove support for Marvell MPSC serial controller 2018-06-04 00:39:22 +10:00
page.h powerpc: Fix _ALIGN_* errors due to type difference. 2015-10-09 08:02:25 +11:00
planetcore.c powerpc/boot: drop planetcore_set_serial_speed 2015-03-16 18:50:17 +11:00
planetcore.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ppc_asm.h powerpc/time: refactor MFTB() to limit number of ifdefs 2017-08-10 23:32:09 +10:00
ppcboot-hotfoot.h
ppcboot.h powerpc/86xx: Add support for Emerson/Artesyn MVME7100 2016-07-08 20:01:27 -05:00
pq2.c
pq2.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ps3-head.S powerpc/ps3: Fix system hang with GCC 5 builds 2016-11-30 23:19:59 +11:00
ps3-hvcall.S
ps3.c powerpc/ps3: Fix system hang with GCC 5 builds 2016-11-30 23:19:59 +11:00
pseries-head.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
README
redboot-8xx.c
redboot-83xx.c
redboot.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
reg.h
rs6000.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
serial.c powerpc/zImage: Also check for stdout-path 2018-12-22 21:47:23 +11:00
simple_alloc.c
simpleboot.c powerpc/simpleboot: fix comment 2014-08-26 09:35:57 +02:00
stdbool.h powerpc/boot: Add support for XZ compression 2016-09-28 14:35:14 +10:00
stdint.h powerpc/boot: Add support for XZ compression 2016-09-28 14:35:14 +10:00
stdio.c powerpc: boot: add strrchr function 2018-03-05 20:58:17 -06:00
stdio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
stdlib.c
stdlib.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
string.h powerpc: boot: add strrchr function 2018-03-05 20:58:17 -06:00
string.S
swab.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
treeboot-akebono.c powerpc: Fix misspellings in comments. 2016-03-01 19:27:20 +11:00
treeboot-bamboo.c
treeboot-currituck.c powerpc: Fix misspellings in comments. 2016-03-01 19:27:20 +11:00
treeboot-ebony.c
treeboot-iss4xx.c powerpc: Fix misspellings in comments. 2016-03-01 19:27:20 +11:00
treeboot-walnut.c
types.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
uartlite.c
ugecon.c
ugecon.h
util.S powerpc/time: refactor MFTB() to limit number of ifdefs 2017-08-10 23:32:09 +10:00
virtex.c
virtex405-head.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
wii-head.S
wii.c
wrapper powerpc/boot: Add lzo support for uImage 2019-07-05 02:06:38 +10:00
xz_config.h powerpc/boot: add {get, put}_unaligned_be32 to xz_config.h 2019-07-10 13:20:44 +10:00
zImage.coff.lds.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
zImage.lds.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
zImage.ps3.lds.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00

To extract the kernel vmlinux, System.map, .config or initrd from the zImage binary:

objcopy -j .kernel:vmlinux -O binary zImage vmlinux.gz
objcopy -j .kernel:System.map -O binary zImage System.map.gz
objcopy -j .kernel:.config -O binary zImage config.gz
objcopy -j .kernel:initrd -O binary zImage.initrd initrd.gz


	Peter