diff options
Diffstat (limited to 'arch/blackfin/mach-common/head.S')
-rw-r--r-- | arch/blackfin/mach-common/head.S | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/arch/blackfin/mach-common/head.S b/arch/blackfin/mach-common/head.S index 698d4c05947e..f826f6b9f917 100644 --- a/arch/blackfin/mach-common/head.S +++ b/arch/blackfin/mach-common/head.S | |||
@@ -30,8 +30,6 @@ ENTRY(__init_clear_bss) | |||
30 | rts; | 30 | rts; |
31 | ENDPROC(__init_clear_bss) | 31 | ENDPROC(__init_clear_bss) |
32 | 32 | ||
33 | #define INITIAL_STACK (L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12) | ||
34 | |||
35 | ENTRY(__start) | 33 | ENTRY(__start) |
36 | /* R0: argument of command line string, passed from uboot, save it */ | 34 | /* R0: argument of command line string, passed from uboot, save it */ |
37 | R7 = R0; | 35 | R7 = R0; |
@@ -126,30 +124,30 @@ ENTRY(__start) | |||
126 | * below | 124 | * below |
127 | */ | 125 | */ |
128 | GET_PDA(p0, r0); | 126 | GET_PDA(p0, r0); |
129 | r7 = [p0 + PDA_RETX]; | 127 | r6 = [p0 + PDA_RETX]; |
130 | p1.l = _init_saved_retx; | 128 | p1.l = _init_saved_retx; |
131 | p1.h = _init_saved_retx; | 129 | p1.h = _init_saved_retx; |
132 | [p1] = r7; | 130 | [p1] = r6; |
133 | 131 | ||
134 | r7 = [p0 + PDA_DCPLB]; | 132 | r6 = [p0 + PDA_DCPLB]; |
135 | p1.l = _init_saved_dcplb_fault_addr; | 133 | p1.l = _init_saved_dcplb_fault_addr; |
136 | p1.h = _init_saved_dcplb_fault_addr; | 134 | p1.h = _init_saved_dcplb_fault_addr; |
137 | [p1] = r7; | 135 | [p1] = r6; |
138 | 136 | ||
139 | r7 = [p0 + PDA_ICPLB]; | 137 | r6 = [p0 + PDA_ICPLB]; |
140 | p1.l = _init_saved_icplb_fault_addr; | 138 | p1.l = _init_saved_icplb_fault_addr; |
141 | p1.h = _init_saved_icplb_fault_addr; | 139 | p1.h = _init_saved_icplb_fault_addr; |
142 | [p1] = r7; | 140 | [p1] = r6; |
143 | 141 | ||
144 | r7 = [p0 + PDA_SEQSTAT]; | 142 | r6 = [p0 + PDA_SEQSTAT]; |
145 | p1.l = _init_saved_seqstat; | 143 | p1.l = _init_saved_seqstat; |
146 | p1.h = _init_saved_seqstat; | 144 | p1.h = _init_saved_seqstat; |
147 | [p1] = r7; | 145 | [p1] = r6; |
148 | #endif | 146 | #endif |
149 | 147 | ||
150 | /* Initialize stack pointer */ | 148 | /* Initialize stack pointer */ |
151 | sp.l = lo(INITIAL_STACK); | 149 | sp.l = _init_thread_union; |
152 | sp.h = hi(INITIAL_STACK); | 150 | sp.h = _init_thread_union; |
153 | fp = sp; | 151 | fp = sp; |
154 | usp = sp; | 152 | usp = sp; |
155 | 153 | ||
@@ -189,7 +187,15 @@ ENTRY(__start) | |||
189 | /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ | 187 | /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ |
190 | call _bfin_relocate_l1_mem; | 188 | call _bfin_relocate_l1_mem; |
191 | #ifdef CONFIG_BFIN_KERNEL_CLOCK | 189 | #ifdef CONFIG_BFIN_KERNEL_CLOCK |
190 | /* Only use on-chip scratch space for stack when absolutely required | ||
191 | * to avoid Anomaly 05000227 ... we know the init_clocks() func only | ||
192 | * uses L1 text and stack space and no other memory region. | ||
193 | */ | ||
194 | # define KERNEL_CLOCK_STACK (L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12) | ||
195 | sp.l = lo(KERNEL_CLOCK_STACK); | ||
196 | sp.h = hi(KERNEL_CLOCK_STACK); | ||
192 | call _init_clocks; | 197 | call _init_clocks; |
198 | sp = usp; /* usp hasnt been touched, so restore from there */ | ||
193 | #endif | 199 | #endif |
194 | 200 | ||
195 | /* This section keeps the processor in supervisor mode | 201 | /* This section keeps the processor in supervisor mode |
@@ -243,9 +249,7 @@ ENTRY(_real_start) | |||
243 | call _cmdline_init; | 249 | call _cmdline_init; |
244 | 250 | ||
245 | /* Load the current thread pointer and stack */ | 251 | /* Load the current thread pointer and stack */ |
246 | sp.l = _init_thread_union; | 252 | p1 = THREAD_SIZE + 4 (z); /* +4 is for reti loading */ |
247 | sp.h = _init_thread_union; | ||
248 | p1 = THREAD_SIZE (z); | ||
249 | sp = sp + p1; | 253 | sp = sp + p1; |
250 | usp = sp; | 254 | usp = sp; |
251 | fp = sp; | 255 | fp = sp; |