2 * BF561 coreB bootstrap file
4 * Copyright 2007-2009 Analog Devices Inc.
5 * Philippe Gerum <rpm@xenomai.org>
7 * Licensed under the GPL-2 or later.
10 #include <linux/linkage.h>
11 #include <linux/init.h>
12 #include <asm/blackfin.h>
13 #include <asm/asm-offsets.h>
14 #include <asm/trace.h>
17 * This code must come first as CoreB is hardcoded (in hardware)
18 * to start at the beginning of its L1 instruction memory.
20 .section .l1.text.head
22 /* Lay the initial stack into the L1 scratch area of Core B */
23 #define INITIAL_STACK (COREB_L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12)
25 ENTRY(_coreb_trampoline_start)
26 /* Set the SYSCFG register */
28 SYSCFG = R0; /*Enable Cycle Counter and Nesting Of Interrupts(3rd Bit)*/
31 /*Clear Out All the data and pointer Registers*/
54 /* Clear Out All the DAG Registers*/
70 trace_buffer_init(p0,r0);
72 /* Turn off the icache */
73 p0.l = LO(IMEM_CONTROL);
74 p0.h = HI(IMEM_CONTROL);
79 /* Disabling of CPLBs should be proceeded by a CSYNC */
84 /* Turn off the dcache */
85 p0.l = LO(DMEM_CONTROL);
86 p0.h = HI(DMEM_CONTROL);
91 /* Disabling of CPLBs should be proceeded by a CSYNC */
96 /* in case of double faults, save a few things */
97 p0.l = _init_retx_coreb;
98 p0.h = _init_retx_coreb;
102 #ifdef CONFIG_DEBUG_DOUBLEFAULT
103 /* Only save these if we are storing them,
104 * This happens here, since L1 gets clobbered
108 r7 = [p0 + PDA_DF_RETX];
109 p1.l = _init_saved_retx_coreb;
110 p1.h = _init_saved_retx_coreb;
113 r7 = [p0 + PDA_DF_DCPLB];
114 p1.l = _init_saved_dcplb_fault_addr_coreb;
115 p1.h = _init_saved_dcplb_fault_addr_coreb;
118 r7 = [p0 + PDA_DF_ICPLB];
119 p1.l = _init_saved_icplb_fault_addr_coreb;
120 p1.h = _init_saved_icplb_fault_addr_coreb;
123 r7 = [p0 + PDA_DF_SEQSTAT];
124 p1.l = _init_saved_seqstat_coreb;
125 p1.h = _init_saved_seqstat_coreb;
129 /* Initialize stack pointer */
130 sp.l = lo(INITIAL_STACK);
131 sp.h = hi(INITIAL_STACK);
135 /* This section keeps the processor in supervisor mode
136 * during core B startup. Branches to the idle task.
139 /* EVT15 = _real_start */
159 #if defined(ANOMALY_05000281)
166 ENDPROC(_coreb_trampoline_start)
168 #ifdef CONFIG_HOTPLUG_CPU
171 sp.l = lo(INITIAL_STACK);
172 sp.h = hi(INITIAL_STACK);
181 R0 = IWR_DISABLE_ALL;
182 P0.H = hi(SYSMMR_BASE);
183 P0.L = lo(SYSMMR_BASE);
184 [P0 + (SICB_IWR0 - SYSMMR_BASE)] = R0;
185 [P0 + (SICB_IWR1 - SYSMMR_BASE)] = R0;
188 p0.h = hi(COREB_L1_CODE_START);
189 p0.l = lo(COREB_L1_CODE_START);
198 p0.l = lo(WDOGB_CTL);
199 p0.h = hi(WDOGB_CTL);
201 w[p0] = r0; /* Clear the watchdog. */
205 * switch to IDLE stack.
207 p0.l = _secondary_stack;
208 p0.h = _secondary_stack;
212 #ifdef CONFIG_HOTPLUG_CPU
213 p0.l = _hotplug_coreb;
214 p0.h = _hotplug_coreb;
222 #ifdef CONFIG_HOTPLUG_CPU
225 call _secondary_start_kernel;
228 ENDPROC(_coreb_start)