diff options
author | Geoff Levand <geoffrey.levand@am.sony.com> | 2008-03-27 16:41:45 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-04-01 05:43:07 -0400 |
commit | 5761eaa3a5ae3c7ea796add73b86176b7c963cca (patch) | |
tree | 8b2b5f292059738216202b4b5480cdc02bd925d0 /arch/powerpc/boot/ps3-head.S | |
parent | 23afcb4e0061c591776a3350db89512d085397c2 (diff) |
[POWERPC] PS3: Bootwrapper improvements
Improve the debugging support of the PS3 bootwraper code:
o Increase the size of the PS3 bootwrapper overlay from 256 to 512 bytes to
allow for more debugging code in the overlay.
o Use the dot symbol to set the size of __system_reset_overlay. The
assembler will then emit an error if the overlay code is too big.
o Remove some unused instructions.
o Update the text describing the PS3 bootwrapper overlay.
o Add a check for null pointer writes.
o Change hcall return value from s64.
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot/ps3-head.S')
-rw-r--r-- | arch/powerpc/boot/ps3-head.S | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/arch/powerpc/boot/ps3-head.S b/arch/powerpc/boot/ps3-head.S index a55c2735f759..b6fcbaf5027b 100644 --- a/arch/powerpc/boot/ps3-head.S +++ b/arch/powerpc/boot/ps3-head.S | |||
@@ -27,8 +27,9 @@ | |||
27 | /* | 27 | /* |
28 | * __system_reset_overlay - The PS3 first stage entry. | 28 | * __system_reset_overlay - The PS3 first stage entry. |
29 | * | 29 | * |
30 | * The bootwraper build script copies the 0x100 bytes at symbol | 30 | * The bootwraper build script copies the 512 bytes at symbol |
31 | * __system_reset_overlay to offset 0x100 of the rom image. | 31 | * __system_reset_overlay to offset 0x100 of the rom image. This symbol |
32 | * must occupy 512 or less bytes. | ||
32 | * | 33 | * |
33 | * The PS3 has a single processor with two threads. | 34 | * The PS3 has a single processor with two threads. |
34 | */ | 35 | */ |
@@ -47,8 +48,6 @@ __system_reset_overlay: | |||
47 | 48 | ||
48 | mfspr r3, 0x88 | 49 | mfspr r3, 0x88 |
49 | cntlzw. r3, r3 | 50 | cntlzw. r3, r3 |
50 | li r4, 0 | ||
51 | li r5, 0 | ||
52 | beq 1f | 51 | beq 1f |
53 | 52 | ||
54 | /* Secondary goes to __secondary_hold in kernel. */ | 53 | /* Secondary goes to __secondary_hold in kernel. */ |
@@ -57,8 +56,14 @@ __system_reset_overlay: | |||
57 | mtctr r4 | 56 | mtctr r4 |
58 | bctr | 57 | bctr |
59 | 58 | ||
60 | /* Primary delays then goes to _zimage_start in wrapper. */ | ||
61 | 1: | 59 | 1: |
60 | /* Save the value at addr zero for a null pointer write check later. */ | ||
61 | |||
62 | li r4, 0 | ||
63 | lwz r3, 0(r4) | ||
64 | |||
65 | /* Primary delays then goes to _zimage_start in wrapper. */ | ||
66 | |||
62 | or 31, 31, 31 /* db16cyc */ | 67 | or 31, 31, 31 /* db16cyc */ |
63 | or 31, 31, 31 /* db16cyc */ | 68 | or 31, 31, 31 /* db16cyc */ |
64 | 69 | ||
@@ -67,16 +72,18 @@ __system_reset_overlay: | |||
67 | mtctr r4 | 72 | mtctr r4 |
68 | bctr | 73 | bctr |
69 | 74 | ||
75 | . = __system_reset_overlay + 512 | ||
76 | |||
70 | /* | 77 | /* |
71 | * __system_reset_kernel - Place holder for the kernel reset vector. | 78 | * __system_reset_kernel - Place holder for the kernel reset vector. |
72 | * | 79 | * |
73 | * The bootwrapper build script copies 0x100 bytes from offset 0x100 | 80 | * The bootwrapper build script copies 512 bytes from offset 0x100 |
74 | * of the rom image to the symbol __system_reset_kernel. At runtime | 81 | * of the rom image to the symbol __system_reset_kernel. At runtime |
75 | * the bootwrapper program copies the 0x100 bytes at __system_reset_kernel | 82 | * the bootwrapper program copies the 512 bytes at __system_reset_kernel |
76 | * to ram address 0x100. This symbol must occupy 0x100 bytes. | 83 | * to ram address 0x100. This symbol must occupy 512 bytes. |
77 | */ | 84 | */ |
78 | 85 | ||
79 | .globl __system_reset_kernel | 86 | .globl __system_reset_kernel |
80 | __system_reset_kernel: | 87 | __system_reset_kernel: |
81 | 88 | ||
82 | . = __system_reset_kernel + 0x100 | 89 | . = __system_reset_kernel + 512 |