aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-05-29 16:05:03 -0400
committerMike Frysinger <vapier@gentoo.org>2011-07-23 01:10:42 -0400
commitb648072d3ef5d68cc9fa392dae19f8adc82231b7 (patch)
tree6447f40520b2797a83de9b7d9b90d700b87dcb06 /arch/blackfin
parent2f7d63f909900c555baf36a4c6a11e9bf8e1af18 (diff)
Blackfin: SMP: optimize start up code a bit
This just imports all of the optimization work done in the common startup code. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/mach-bf561/secondary.S132
1 files changed, 54 insertions, 78 deletions
diff --git a/arch/blackfin/mach-bf561/secondary.S b/arch/blackfin/mach-bf561/secondary.S
index 4c462838f4e1..348c9191d19f 100644
--- a/arch/blackfin/mach-bf561/secondary.S
+++ b/arch/blackfin/mach-bf561/secondary.S
@@ -23,74 +23,56 @@
23#define INITIAL_STACK (COREB_L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12) 23#define INITIAL_STACK (COREB_L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12)
24 24
25ENTRY(_coreb_trampoline_start) 25ENTRY(_coreb_trampoline_start)
26 /* Set the SYSCFG register */ 26 /* Enable Cycle Counter and Nesting Of Interrupts */
27 R0 = 0x36; 27#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
28 SYSCFG = R0; /*Enable Cycle Counter and Nesting Of Interrupts(3rd Bit)*/ 28 R0 = SYSCFG_SNEN;
29 R0 = 0; 29#else
30 30 R0 = SYSCFG_SNEN | SYSCFG_CCEN;
31 /*Clear Out All the data and pointer Registers*/ 31#endif
32 R1 = R0; 32 SYSCFG = R0;
33 R2 = R0;
34 R3 = R0;
35 R4 = R0;
36 R5 = R0;
37 R6 = R0;
38 R7 = R0;
39
40 P0 = R0;
41 P1 = R0;
42 P2 = R0;
43 P3 = R0;
44 P4 = R0;
45 P5 = R0;
46
47 LC0 = r0;
48 LC1 = r0;
49 L0 = r0;
50 L1 = r0;
51 L2 = r0;
52 L3 = r0;
53
54 /* Clear Out All the DAG Registers*/
55 B0 = r0;
56 B1 = r0;
57 B2 = r0;
58 B3 = r0;
59
60 I0 = r0;
61 I1 = r0;
62 I2 = r0;
63 I3 = r0;
64
65 M0 = r0;
66 M1 = r0;
67 M2 = r0;
68 M3 = r0;
69 33
70 trace_buffer_init(p0,r0); 34 /* Optimization register tricks: keep a base value in the
35 * reserved P registers so we use the load/store with an
36 * offset syntax. R0 = [P5 + <constant>];
37 * P5 - core MMR base
38 * R6 - 0
39 */
40 r6 = 0;
41 p5.l = 0;
42 p5.h = hi(COREMMR_BASE);
71 43
72 /* Turn off the icache */ 44 /* Zero out registers required by Blackfin ABI */
73 p0.l = LO(IMEM_CONTROL);
74 p0.h = HI(IMEM_CONTROL);
75 R1 = [p0];
76 R0 = ~ENICPLB;
77 R0 = R0 & R1;
78 45
79 /* Disabling of CPLBs should be proceeded by a CSYNC */ 46 /* Disable circular buffers */
47 L0 = r6;
48 L1 = r6;
49 L2 = r6;
50 L3 = r6;
51
52 /* Disable hardware loops in case we were started by 'go' */
53 LC0 = r6;
54 LC1 = r6;
55
56 /*
57 * Clear ITEST_COMMAND and DTEST_COMMAND registers,
58 * Leaving these as non-zero can confuse the emulator
59 */
60 [p5 + (DTEST_COMMAND - COREMMR_BASE)] = r6;
61 [p5 + (ITEST_COMMAND - COREMMR_BASE)] = r6;
80 CSYNC; 62 CSYNC;
81 [p0] = R0; 63
64 trace_buffer_init(p0,r0);
65
66 /* Turn off the icache */
67 r1 = [p5 + (IMEM_CONTROL - COREMMR_BASE)];
68 BITCLR (r1, ENICPLB_P);
69 [p5 + (IMEM_CONTROL - COREMMR_BASE)] = r1;
82 SSYNC; 70 SSYNC;
83 71
84 /* Turn off the dcache */ 72 /* Turn off the dcache */
85 p0.l = LO(DMEM_CONTROL); 73 r1 = [p5 + (DMEM_CONTROL - COREMMR_BASE)];
86 p0.h = HI(DMEM_CONTROL); 74 BITCLR (r1, ENDCPLB_P);
87 R1 = [p0]; 75 [p5 + (DMEM_CONTROL - COREMMR_BASE)] = r1;
88 R0 = ~ENDCPLB;
89 R0 = R0 & R1;
90
91 /* Disabling of CPLBs should be proceeded by a CSYNC */
92 CSYNC;
93 [p0] = R0;
94 SSYNC; 76 SSYNC;
95 77
96 /* in case of double faults, save a few things */ 78 /* in case of double faults, save a few things */
@@ -105,25 +87,25 @@ ENTRY(_coreb_trampoline_start)
105 * below 87 * below
106 */ 88 */
107 GET_PDA(p0, r0); 89 GET_PDA(p0, r0);
108 r7 = [p0 + PDA_DF_RETX]; 90 r5 = [p0 + PDA_DF_RETX];
109 p1.l = _init_saved_retx_coreb; 91 p1.l = _init_saved_retx_coreb;
110 p1.h = _init_saved_retx_coreb; 92 p1.h = _init_saved_retx_coreb;
111 [p1] = r7; 93 [p1] = r5;
112 94
113 r7 = [p0 + PDA_DF_DCPLB]; 95 r5 = [p0 + PDA_DF_DCPLB];
114 p1.l = _init_saved_dcplb_fault_addr_coreb; 96 p1.l = _init_saved_dcplb_fault_addr_coreb;
115 p1.h = _init_saved_dcplb_fault_addr_coreb; 97 p1.h = _init_saved_dcplb_fault_addr_coreb;
116 [p1] = r7; 98 [p1] = r5;
117 99
118 r7 = [p0 + PDA_DF_ICPLB]; 100 r5 = [p0 + PDA_DF_ICPLB];
119 p1.l = _init_saved_icplb_fault_addr_coreb; 101 p1.l = _init_saved_icplb_fault_addr_coreb;
120 p1.h = _init_saved_icplb_fault_addr_coreb; 102 p1.h = _init_saved_icplb_fault_addr_coreb;
121 [p1] = r7; 103 [p1] = r5;
122 104
123 r7 = [p0 + PDA_DF_SEQSTAT]; 105 r5 = [p0 + PDA_DF_SEQSTAT];
124 p1.l = _init_saved_seqstat_coreb; 106 p1.l = _init_saved_seqstat_coreb;
125 p1.h = _init_saved_seqstat_coreb; 107 p1.h = _init_saved_seqstat_coreb;
126 [p1] = r7; 108 [p1] = r5;
127#endif 109#endif
128 110
129 /* Initialize stack pointer */ 111 /* Initialize stack pointer */
@@ -138,19 +120,13 @@ ENTRY(_coreb_trampoline_start)
138 120
139 /* EVT15 = _real_start */ 121 /* EVT15 = _real_start */
140 122
141 p0.l = lo(EVT15);
142 p0.h = hi(EVT15);
143 p1.l = _coreb_start; 123 p1.l = _coreb_start;
144 p1.h = _coreb_start; 124 p1.h = _coreb_start;
145 [p0] = p1; 125 [p5 + (EVT15 - COREMMR_BASE)] = p1;
146 csync; 126 csync;
147 127
148 p0.l = lo(IMASK); 128 r0 = EVT_IVG15 (z);
149 p0.h = hi(IMASK); 129 sti r0;
150 p1.l = IMASK_IVG15;
151 p1.h = 0x0;
152 [p0] = p1;
153 csync;
154 130
155 raise 15; 131 raise 15;
156 p0.l = .LWAIT_HERE; 132 p0.l = .LWAIT_HERE;