Skip to contentSkip to conversation

Change the default link address for pSeries zImage kernels.

PATCH In review Tony Breeds 3 participants 4 messages Apr 25, 2008 – Apr 28, 2008 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Change the default link address for pSeries zImage kernels.

Currently we set the start of the .text section to be 4Mb for pSeries. In situations where the zImage is > 8Mb we'll fail to boot (due to overlapping with OF). Move .text in a pSeries zImage from 4MB to 64MB (well past OF).

---
- Compile tested for *_defconfig with only pSeries chaning it's link address.
- Boot tested on POWER6

 arch/powerpc/boot/wrapper           |   14 ++++++++++++--
 arch/powerpc/boot/zImage.coff.lds.S |    1 -
 arch/powerpc/boot/zImage.lds.S      |    1 -
 3 files changed, 12 insertions(+), 4 deletions(-)
arch/powerpc/boot/wrapper +12 -2
index d6c96d9..b5dfc1f 100755
@@ -138,14 +138,20 @@ objflags=-S
 tmp=$tmpdir/zImage.$$.o
 ksection=.kernel:vmlinux.strip
 isection=.kernel:initrd
+link_address='0x400000'
 
 case "$platform" in
-pmac|pseries|chrp)
+pseries)
+    platformo=$object/of.o
+    link_address='0x4000000'
+    ;;
+pmac|chrp)
     platformo=$object/of.o
     ;;
 coff)
     platformo=$object/of.o
     lds=$object/zImage.coff.lds
+    link_address='0x500000'
     ;;
 miboot|uboot)
     # miboot and U-boot want just the bare bits, not an ELF binary
@@ -190,6 +196,7 @@ ps3)
     objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data"
     ksection=.kernel:vmlinux.bin
     isection=.kernel:initrd
+    link_address=''
     ;;
 ep88xc|ep405|ep8248e)
     platformo="$object/fixed-head.o $object/$platform.o"
@@ -268,7 +275,10 @@ if [ -n "$dtb" ]; then
 fi
 
 if [ "$platform" != "miboot" ]; then
-    ${CROSS}ld -m elf32ppc -T $lds -o "$ofile" \
+    if [ -n "$link_address" ] ; then
+        text_start="-Ttext $link_address"
+    fi
+    ${CROSS}ld -m elf32ppc -T $lds $text_start -o "$ofile" \
 	$platformo $tmp $object/wrapper.a
     rm $tmp
 fi
arch/powerpc/boot/zImage.coff.lds.S +0 -1
index fe87a90..856dc78 100644
@@ -3,7 +3,6 @@ ENTRY(_zimage_start_opd)
 EXTERN(_zimage_start_opd)
 SECTIONS
 {
-  . = (5*1024*1024);
   _start = .;
   .text      :
   {
arch/powerpc/boot/zImage.lds.S +0 -1
index f6e380f..0962d62 100644
@@ -3,7 +3,6 @@ ENTRY(_zimage_start)
 EXTERN(_zimage_start)
 SECTIONS
 {
-  . = (4*1024*1024);
   _start = .;
   .text      :
   {
Signature · 7 lines
1.5.5.1


Yours Tony

  linux.conf.au    http://www.marchsouth.org/
  Jan 19 - 24 2009 The Australian Linux Technical Conference!
#1 lore raw
Quoted 10 lines · Tony Breeds

Currently we set the start of the .text section to be 4Mb for pSeries. In situations where the zImage is > 8Mb we'll fail to boot (due to overlapping with OF). Move .text in a pSeries zImage from 4MB to 64MB (well past OF).

---
- Compile tested for *_defconfig with only pSeries chaning it's link address.
- Boot tested on POWER6

Considering how bad OF can be on some machines, I'd like this to be boot-tested on a wider range of machines. Also, it might depend on the OF real-base setting as well...

At least, we should be able to test at ozlabs on cell blades, POWER4 bare metal (ie "SMP mode"), POWER5 and POWER5+.

Cheers,
Ben.

#2 lore raw
Quoted 13 lines · On Fri, 25 Apr 2008 16:12:50 +1000 Benjamin Herrenschmidt…
Quoted 10 lines · Tony Breeds

Currently we set the start of the .text section to be 4Mb for pSeries. In situations where the zImage is > 8Mb we'll fail to boot (due to overlapping with OF). Move .text in a pSeries zImage from 4MB to 64MB (well past OF).

---
- Compile tested for *_defconfig with only pSeries chaning it's link address.
- Boot tested on POWER6

Quoted 6 lines

Considering how bad OF can be on some machines, I'd like this to be boot-tested on a wider range of machines. Also, it might depend on the OF real-base setting as well...

At least, we should be able to test at ozlabs on cell blades, POWER4 bare metal (ie "SMP mode"), POWER5 and POWER5+.

And given that all the embedded boards use zImage.lds.S, we should probably test it there. I'll try to test on 4xx for both treeImage and U-Boot today.

josh

#3 lore raw
In reply to Benjamin Herrenschmidt
Quoted 6 lines · Benjamin Herrenschmidt

Considering how bad OF can be on some machines, I'd like this to be boot-tested on a wider range of machines. Also, it might depend on the OF real-base setting as well...

At least, we should be able to test at ozlabs on cell blades, POWER4 bare metal (ie "SMP mode"), POWER5 and POWER5+.

Hmm okay it fails on POWER4, I'll see what can be done there.

Yours Tony

linux.conf.au http://www.marchsouth.org/
Jan 19 - 24 2009 The Australian Linux Technical Conference!