]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] bootwrapper: Use physical address in PHDR for uImage
authorKumar Gala <galak@kernel.crashing.org>
Tue, 15 Apr 2008 19:52:29 +0000 (05:52 +1000)
committerPaul Mackerras <paulus@samba.org>
Wed, 16 Apr 2008 21:46:14 +0000 (07:46 +1000)
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 <galak@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/boot/wrapper

index 14a01823ba53f6a190f546b2cbf1a5562c936d99..d6c96d9ab29177513788e06ead0dddc45e8f3501 100755 (executable)
@@ -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"