bootwrapper: Add a firmware-independent simpleboot target.
PATCH 1/1 bootwrapper: Add a firmware-independent simpleboot target.
From: Grant Likely <[email protected]>
This target produces a flat binary rather than an ELF file, fixes the entry point at the beginning of the image, and takes a complete device tree with no fixups needed.
Signed-off-by Grant Likely <[email protected]>
---
This has been tested on a Xilinx Virtex 4 target with the image loaded into RAM via JTAG.
arch/powerpc/boot/Makefile | 9 +++- arch/powerpc/boot/simpleboot.c | 84 ++++++++++++++++++++++++++++++++++++ arch/powerpc/boot/virtex405-head.S | 30 +++++++++++++ arch/powerpc/boot/wrapper | 4 ++ 4 files changed, 126 insertions(+), 1 deletions(-)
arch/powerpc/boot/Makefile +8 -1
@@ -40,6 +40,7 @@ $(obj)/ebony.o: BOOTCFLAGS += -mcpu=405 $(obj)/cuboot-taishan.o: BOOTCFLAGS += -mcpu=405 $(obj)/cuboot-katmai.o: BOOTCFLAGS += -mcpu=405 $(obj)/treeboot-walnut.o: BOOTCFLAGS += -mcpu=405 +$(obj)/virtex405-head.o: BOOTCFLAGS += -mcpu=405 zlib := inffast.c inflate.c inftrees.c
@@ -64,7 +65,7 @@ src-plat := of.c cuboot-52xx.c cuboot-824x.c cuboot-83xx.c cuboot-85xx.c holly.c cuboot-bamboo.c cuboot-mpc7448hpc2.c cuboot-taishan.c \ fixed-head.S ep88xc.c ep405.c \ cuboot-katmai.c cuboot-rainier.c redboot-8xx.c ep8248e.c \ - cuboot-warp.c cuboot-85xx-cpm2.c + cuboot-warp.c cuboot-85xx-cpm2.c simpleboot.c virtex405-head.S src-boot := $(src-wlib) $(src-plat) empty.c src-boot := $(addprefix $(obj)/, $(src-boot))
@@ -305,6 +306,12 @@ $(obj)/uImage: vmlinux $(wrapperbits) $(obj)/cuImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits) $(call if_changed,wrap,cuboot-$*,$(dtstree)/$*.dts) +$(obj)/simpleImage.initrd.%: vmlinux $(dtstree)/%.dts $(wrapperbits) + $(call if_changed,wrap,simpleboot-$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz) + +$(obj)/simpleImage.%: vmlinux $(dtstree)/%.dts $(wrapperbits) + $(call if_changed,wrap,simpleboot-$*,$(dtstree)/$*.dts) + $(obj)/treeImage.initrd.%: vmlinux $(dtstree)/%.dts $(wrapperbits) $(call if_changed,wrap,treeboot-$*,$(dtstree)/$*.dts,,$(obj)/ramdisk.image.gz)
arch/powerpc/boot/simpleboot.c new file +84 -0
84 lines not on this page · raw message
arch/powerpc/boot/virtex405-head.S new file +30 -0
@@ -0,0 +1,30 @@ +#include "ppc_asm.h" + + .text + .global _zimage_start +_zimage_start: + + /* PPC errata 213: needed by Virtex-4 FX */ + mfccr0 0 + oris 0,0,0x50000000@h + mtccr0 0 + + /* + * Invalidate the data cache if the data cache is turned off. + * - The 405 core does not invalidate the data cache on power-up + * or reset but does turn off the data cache. We cannot assume + * that the cache contents are valid. + * - If the data cache is turned on this must have been done by + * a bootloader and we assume that the cache contents are + * valid. + */ + mfdccr r9 + cmplwi r9,0 + bne 2f + lis r9,0 + li r8,256 + mtctr r8 +1: dccci r0,r9 + addi r9,r9,0x20 + bdnz 1b +2: b _zimage_start_lib
arch/powerpc/boot/wrapper +4 -0
@@ -199,6 +199,10 @@ adder875-redboot) platformo="$object/fixed-head.o $object/redboot-8xx.o" binary=y ;; +simpleboot-virtex405-*) + platformo="$object/virtex405-head.o $object/simpleboot.o" + binary=y + ;; esac vmz="$tmpdir/`basename \"$kernel\"`.$ext"