aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot/wrapper')
-rwxr-xr-xarch/powerpc/boot/wrapper55
1 files changed, 55 insertions, 0 deletions
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index da77adc73078..65f685479175 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -144,6 +144,15 @@ miboot|uboot)
144cuboot*) 144cuboot*)
145 gzip= 145 gzip=
146 ;; 146 ;;
147ps3)
148 platformo="$object/ps3-head.o $object/ps3-hvcall.o $object/ps3.o"
149 lds=$object/zImage.ps3.lds
150 gzip=
151 ext=bin
152 objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data"
153 ksection=.kernel:vmlinux.bin
154 isection=.kernel:initrd
155 ;;
147esac 156esac
148 157
149vmz="$tmpdir/`basename \"$kernel\"`.$ext" 158vmz="$tmpdir/`basename \"$kernel\"`.$ext"
@@ -239,4 +248,50 @@ treeboot*)
239 fi 248 fi
240 exit 0 249 exit 0
241 ;; 250 ;;
251ps3)
252 # The ps3's loader supports loading gzipped binary images from flash
253 # rom to addr zero. The loader enters the image at addr 0x100. A
254 # bootwrapper overlay is use to arrange for the kernel to be loaded
255 # to addr zero and to have a suitable bootwrapper entry at 0x100.
256 # To construct the rom image, 0x100 bytes from offset 0x100 in the
257 # kernel is copied to the bootwrapper symbol __system_reset_kernel.
258 # The 0x100 bytes at the bootwrapper symbol __system_reset_overlay is
259 # then copied to offset 0x100. At runtime the bootwrapper program
260 # copies the 0x100 bytes at __system_reset_kernel to addr 0x100.
261
262 system_reset_overlay=0x`${CROSS}nm "$ofile" \
263 | grep ' __system_reset_overlay$' \
264 | cut -d' ' -f1`
265 system_reset_overlay=`printf "%d" $system_reset_overlay`
266 system_reset_kernel=0x`${CROSS}nm "$ofile" \
267 | grep ' __system_reset_kernel$' \
268 | cut -d' ' -f1`
269 system_reset_kernel=`printf "%d" $system_reset_kernel`
270 overlay_dest="256"
271 overlay_size="256"
272
273 rm -f "$object/otheros.bld"
274
275 ${CROSS}objcopy -O binary "$ofile" "$ofile.bin"
276
277 msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
278 skip=$overlay_dest seek=$system_reset_kernel \
279 count=$overlay_size bs=1 2>&1)
280
281 if [ $? -ne "0" ]; then
282 echo $msg
283 exit 1
284 fi
285
286 msg=$(dd if="$ofile.bin" of="$ofile.bin" conv=notrunc \
287 skip=$system_reset_overlay seek=$overlay_dest \
288 count=$overlay_size bs=1 2>&1)
289
290 if [ $? -ne "0" ]; then
291 echo $msg
292 exit 2
293 fi
294
295 gzip --force -9 --stdout "$ofile.bin" > "$object/otheros.bld"
296 ;;
242esac 297esac