aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/head_fsl_booke.S
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2011-07-25 07:29:33 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-09-19 19:19:47 -0400
commit6dece0eb69b2a28e18d104bc5d707f1cb673f5e0 (patch)
treea5f3fcffc289d71cb31152e7d07f14da49607643 /arch/powerpc/kernel/head_fsl_booke.S
parent6c493685f1b209dd4ae41eb52c818cf12da20def (diff)
powerpc/32: Pass device tree address as u64 to machine_init
u64 is used rather than phys_addr_t to keep things simple, as this is called from assembly code. Update callers to pass a 64-bit address in r3/r4. Other unused register assignments that were once parameters to machine_init are dropped. For FSL BookE, look up the physical address of the device tree from the effective address passed in r3 by the loader. This is required for situations where memory does not start at zero (due to AMP or IOMMU-less virtualization), and thus the IMA doesn't start at zero, and thus the device tree effective address does not equal the physical address. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/head_fsl_booke.S')
-rw-r--r--arch/powerpc/kernel/head_fsl_booke.S42
1 files changed, 26 insertions, 16 deletions
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 4ea9bfbf67e9..e1c699f3b7a7 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -63,17 +63,30 @@ _ENTRY(_start);
63 * of abatron_pteptrs 63 * of abatron_pteptrs
64 */ 64 */
65 nop 65 nop
66/* 66
67 * Save parameters we are passed 67 /* Translate device tree address to physical, save in r30/r31 */
68 */ 68 mfmsr r16
69 mr r31,r3 69 mfspr r17,SPRN_PID
70 mr r30,r4 70 rlwinm r17,r17,16,0x3fff0000 /* turn PID into MAS6[SPID] */
71 mr r29,r5 71 rlwimi r17,r16,28,0x00000001 /* turn MSR[DS] into MAS6[SAS] */
72 mr r28,r6 72 mtspr SPRN_MAS6,r17
73 mr r27,r7 73
74 li r25,0 /* phys kernel start (low) */ 74 tlbsx 0,r3 /* must succeed */
75 li r24,0 /* CPU number */ 75
76 li r23,0 /* phys kernel start (high) */ 76 mfspr r16,SPRN_MAS1
77 mfspr r20,SPRN_MAS3
78 rlwinm r17,r16,25,0x1f /* r17 = log2(page size) */
79 li r18,1024
80 slw r18,r18,r17 /* r18 = page size */
81 addi r18,r18,-1
82 and r19,r3,r18 /* r19 = page offset */
83 andc r31,r20,r18 /* r3 = page base */
84 or r31,r31,r19 /* r3 = devtree phys addr */
85 mfspr r30,SPRN_MAS7
86
87 li r25,0 /* phys kernel start (low) */
88 li r24,0 /* CPU number */
89 li r23,0 /* phys kernel start (high) */
77 90
78/* We try to not make any assumptions about how the boot loader 91/* We try to not make any assumptions about how the boot loader
79 * setup or used the TLBs. We invalidate all mappings from the 92 * setup or used the TLBs. We invalidate all mappings from the
@@ -198,11 +211,8 @@ _ENTRY(__early_start)
198/* 211/*
199 * Decide what sort of machine this is and initialize the MMU. 212 * Decide what sort of machine this is and initialize the MMU.
200 */ 213 */
201 mr r3,r31 214 mr r3,r30
202 mr r4,r30 215 mr r4,r31
203 mr r5,r29
204 mr r6,r28
205 mr r7,r27
206 bl machine_init 216 bl machine_init
207 bl MMU_init 217 bl MMU_init
208 218