From b18796d32a35ca4d996c584c3bb6d0a4f8a7d310 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 16 Apr 2008 05:52:29 +1000 Subject: [PATCH] [POWERPC] bootwrapper: Use physical address in PHDR for uImage Now that we properly set the physical address in the program header of the vmlinux ELF we can extract it to properly set the load and entry point for u-boot uImages. Before we always hard coded the load & entry point to 0. However there are situations that the kernel may be built with a non-zero physical address. We use objdump to extract the PHDR. We assume that there is only one PHDR in the vmlinux of type LOAD. Signed-off-by: Kumar Gala Signed-off-by: Paul Mackerras --- arch/powerpc/boot/wrapper | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index 14a01823ba53..d6c96d9ab291 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper @@ -230,10 +230,13 @@ if [ -n "$version" ]; then uboot_version="-n Linux-$version" fi +# physical offset of kernel image +membase=`${CROSS}objdump -p "$kernel" | grep -m 1 LOAD | awk '{print $7}'` + case "$platform" in uboot) rm -f "$ofile" - mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \ + mkimage -A ppc -O linux -T kernel -C gzip -a $membase -e $membase \ $uboot_version -d "$vmz" "$ofile" if [ -z "$cacheit" ]; then rm -f "$vmz" -- 2.20.1