aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/boot/addnote.c2
-rw-r--r--arch/powerpc/boot/oflib.c15
-rwxr-xr-xarch/powerpc/boot/wrapper14
-rw-r--r--arch/powerpc/boot/zImage.coff.lds.S1
-rw-r--r--arch/powerpc/boot/zImage.lds.S1
5 files changed, 26 insertions, 7 deletions
diff --git a/arch/powerpc/boot/addnote.c b/arch/powerpc/boot/addnote.c
index 8041a9845ab7..b1e5611b2ab1 100644
--- a/arch/powerpc/boot/addnote.c
+++ b/arch/powerpc/boot/addnote.c
@@ -25,7 +25,7 @@ char arch[] = "PowerPC";
25#define N_DESCR 6 25#define N_DESCR 6
26unsigned int descr[N_DESCR] = { 26unsigned int descr[N_DESCR] = {
27 0xffffffff, /* real-mode = true */ 27 0xffffffff, /* real-mode = true */
28 0x00c00000, /* real-base, i.e. where we expect OF to be */ 28 0x02000000, /* real-base, i.e. where we expect OF to be */
29 0xffffffff, /* real-size */ 29 0xffffffff, /* real-size */
30 0xffffffff, /* virt-base */ 30 0xffffffff, /* virt-base */
31 0xffffffff, /* virt-size */ 31 0xffffffff, /* virt-size */
diff --git a/arch/powerpc/boot/oflib.c b/arch/powerpc/boot/oflib.c
index 95b8fd69a403..b0ec9cf3eaaf 100644
--- a/arch/powerpc/boot/oflib.c
+++ b/arch/powerpc/boot/oflib.c
@@ -168,8 +168,19 @@ void *of_claim(unsigned long virt, unsigned long size, unsigned long align)
168 168
169void *of_vmlinux_alloc(unsigned long size) 169void *of_vmlinux_alloc(unsigned long size)
170{ 170{
171 void *p = malloc(size); 171 unsigned long start = (unsigned long)_start, end = (unsigned long)_end;
172 172 void *addr;
173 void *p;
174
175 /* With some older POWER4 firmware we need to claim the area the kernel
176 * will reside in. Newer firmwares don't need this so we just ignore
177 * the return value.
178 */
179 addr = of_claim(start, end - start, 0);
180 printf("Trying to claim from 0x%lx to 0x%lx (0x%lx) got %p\r\n",
181 start, end, end - start, addr);
182
183 p = malloc(size);
173 if (!p) 184 if (!p)
174 fatal("Can't allocate memory for kernel image!\n\r"); 185 fatal("Can't allocate memory for kernel image!\n\r");
175 186
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index cb87a015be7c..df2358e9f1ca 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -138,14 +138,20 @@ objflags=-S
138tmp=$tmpdir/zImage.$$.o 138tmp=$tmpdir/zImage.$$.o
139ksection=.kernel:vmlinux.strip 139ksection=.kernel:vmlinux.strip
140isection=.kernel:initrd 140isection=.kernel:initrd
141link_address='0x400000'
141 142
142case "$platform" in 143case "$platform" in
143pmac|pseries|chrp) 144pseries)
145 platformo=$object/of.o
146 link_address='0x4000000'
147 ;;
148pmac|chrp)
144 platformo=$object/of.o 149 platformo=$object/of.o
145 ;; 150 ;;
146coff) 151coff)
147 platformo=$object/of.o 152 platformo=$object/of.o
148 lds=$object/zImage.coff.lds 153 lds=$object/zImage.coff.lds
154 link_address='0x500000'
149 ;; 155 ;;
150miboot|uboot) 156miboot|uboot)
151 # miboot and U-boot want just the bare bits, not an ELF binary 157 # miboot and U-boot want just the bare bits, not an ELF binary
@@ -190,6 +196,7 @@ ps3)
190 objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data" 196 objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data"
191 ksection=.kernel:vmlinux.bin 197 ksection=.kernel:vmlinux.bin
192 isection=.kernel:initrd 198 isection=.kernel:initrd
199 link_address=''
193 ;; 200 ;;
194ep88xc|ep405|ep8248e) 201ep88xc|ep405|ep8248e)
195 platformo="$object/fixed-head.o $object/$platform.o" 202 platformo="$object/fixed-head.o $object/$platform.o"
@@ -272,7 +279,10 @@ if [ -n "$dtb" ]; then
272fi 279fi
273 280
274if [ "$platform" != "miboot" ]; then 281if [ "$platform" != "miboot" ]; then
275 ${CROSS}ld -m elf32ppc -T $lds -o "$ofile" \ 282 if [ -n "$link_address" ] ; then
283 text_start="-Ttext $link_address --defsym _start=$link_address"
284 fi
285 ${CROSS}ld -m elf32ppc -T $lds $text_start -o "$ofile" \
276 $platformo $tmp $object/wrapper.a 286 $platformo $tmp $object/wrapper.a
277 rm $tmp 287 rm $tmp
278fi 288fi
diff --git a/arch/powerpc/boot/zImage.coff.lds.S b/arch/powerpc/boot/zImage.coff.lds.S
index fe87a90ce7f1..856dc78b14ef 100644
--- a/arch/powerpc/boot/zImage.coff.lds.S
+++ b/arch/powerpc/boot/zImage.coff.lds.S
@@ -3,7 +3,6 @@ ENTRY(_zimage_start_opd)
3EXTERN(_zimage_start_opd) 3EXTERN(_zimage_start_opd)
4SECTIONS 4SECTIONS
5{ 5{
6 . = (5*1024*1024);
7 _start = .; 6 _start = .;
8 .text : 7 .text :
9 { 8 {
diff --git a/arch/powerpc/boot/zImage.lds.S b/arch/powerpc/boot/zImage.lds.S
index f6e380fdb388..0962d62bdb50 100644
--- a/arch/powerpc/boot/zImage.lds.S
+++ b/arch/powerpc/boot/zImage.lds.S
@@ -3,7 +3,6 @@ ENTRY(_zimage_start)
3EXTERN(_zimage_start) 3EXTERN(_zimage_start)
4SECTIONS 4SECTIONS
5{ 5{
6 . = (4*1024*1024);
7 _start = .; 6 _start = .;
8 .text : 7 .text :
9 { 8 {