aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/head_32.S
diff options
context:
space:
mode:
authorDale Farnsworth <dale@farnsworth.org>2008-12-17 05:09:13 -0500
committerPaul Mackerras <paulus@samba.org>2008-12-22 23:13:29 -0500
commitccdcef72c249c289898b164eada89a61855b9287 (patch)
tree4a60305aaaa89949b2f979226cc192d8d5a3eb2c /arch/powerpc/kernel/head_32.S
parent01695a9687e5a8d78589605037cc7828a5b67ac9 (diff)
powerpc/32: Add the ability for a classic ppc kernel to be loaded at 32M
Add the ability for a classic ppc kernel to be loaded at an address of 32MB. This done by fixing a few places that assume we are loaded at address 0, and by changing several uses of KERNELBASE to use PAGE_OFFSET, instead. Signed-off-by: Dale Farnsworth <dale@farnsworth.org> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/head_32.S')
-rw-r--r--arch/powerpc/kernel/head_32.S11
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index 266061924654..a1c4cfd25ded 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -183,7 +183,8 @@ __after_mmu_off:
183 bl reloc_offset 183 bl reloc_offset
184 mr r26,r3 184 mr r26,r3
185 addis r4,r3,KERNELBASE@h /* current address of _start */ 185 addis r4,r3,KERNELBASE@h /* current address of _start */
186 cmpwi 0,r4,0 /* are we already running at 0? */ 186 lis r5,PHYSICAL_START@h
187 cmplw 0,r4,r5 /* already running at PHYSICAL_START? */
187 bne relocate_kernel 188 bne relocate_kernel
188/* 189/*
189 * we now have the 1st 16M of ram mapped with the bats. 190 * we now have the 1st 16M of ram mapped with the bats.
@@ -811,13 +812,13 @@ giveup_altivec:
811 812
812/* 813/*
813 * This code is jumped to from the startup code to copy 814 * This code is jumped to from the startup code to copy
814 * the kernel image to physical address 0. 815 * the kernel image to physical address PHYSICAL_START.
815 */ 816 */
816relocate_kernel: 817relocate_kernel:
817 addis r9,r26,klimit@ha /* fetch klimit */ 818 addis r9,r26,klimit@ha /* fetch klimit */
818 lwz r25,klimit@l(r9) 819 lwz r25,klimit@l(r9)
819 addis r25,r25,-KERNELBASE@h 820 addis r25,r25,-KERNELBASE@h
820 li r3,0 /* Destination base address */ 821 lis r3,PHYSICAL_START@h /* Destination base address */
821 li r6,0 /* Destination offset */ 822 li r6,0 /* Destination offset */
822 li r5,0x4000 /* # bytes of memory to copy */ 823 li r5,0x4000 /* # bytes of memory to copy */
823 bl copy_and_flush /* copy the first 0x4000 bytes */ 824 bl copy_and_flush /* copy the first 0x4000 bytes */
@@ -1188,11 +1189,11 @@ mmu_off:
1188 1189
1189/* 1190/*
1190 * Use the first pair of BAT registers to map the 1st 16MB 1191 * Use the first pair of BAT registers to map the 1st 16MB
1191 * of RAM to KERNELBASE. From this point on we can't safely 1192 * of RAM to PAGE_OFFSET. From this point on we can't safely
1192 * call OF any more. 1193 * call OF any more.
1193 */ 1194 */
1194initial_bats: 1195initial_bats:
1195 lis r11,KERNELBASE@h 1196 lis r11,PAGE_OFFSET@h
1196 mfspr r9,SPRN_PVR 1197 mfspr r9,SPRN_PVR
1197 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */ 1198 rlwinm r9,r9,16,16,31 /* r9 = 1 for 601, 4 for 604 */
1198 cmpwi 0,r9,1 1199 cmpwi 0,r9,1