Skip to content

Commit

Permalink
[POWERPC] bootwrapper: Use physical address in PHDR for uImage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kumar Gala authored and Paul Mackerras committed Apr 16, 2008
1 parent 366234f commit b18796d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/powerpc/boot/wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b18796d

Please sign in to comment.