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>
17 /* Lay the initial stack into the L1 scratch area of Core B */
18 #define INITIAL_STACK (COREB_L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12)
20 ENTRY(_coreb_trampoline_start)
21 /* Set the SYSCFG register */
23 SYSCFG = R0; /*Enable Cycle Counter and Nesting Of Interrupts(3rd Bit)*/
26 /*Clear Out All the data and pointer Registers*/
49 /* Clear Out All the DAG Registers*/
65 /* Turn off the icache */
66 p0.l = LO(IMEM_CONTROL);
67 p0.h = HI(IMEM_CONTROL);
72 /* Disabling of CPLBs should be proceeded by a CSYNC */
77 /* Turn off the dcache */
78 p0.l = LO(DMEM_CONTROL);
79 p0.h = HI(DMEM_CONTROL);
84 /* Disabling of CPLBs should be proceeded by a CSYNC */
89 /* in case of double faults, save a few things */
90 p0.l = _init_retx_coreb;
91 p0.h = _init_retx_coreb;
95 #ifdef CONFIG_DEBUG_DOUBLEFAULT
96 /* Only save these if we are storing them,
97 * This happens here, since L1 gets clobbered
101 r7 = [p0 + PDA_DF_RETX];
102 p1.l = _init_saved_retx_coreb;
103 p1.h = _init_saved_retx_coreb;
106 r7 = [p0 + PDA_DF_DCPLB];
107 p1.l = _init_saved_dcplb_fault_addr_coreb;
108 p1.h = _init_saved_dcplb_fault_addr_coreb;
111 r7 = [p0 + PDA_DF_ICPLB];
112 p1.l = _init_saved_icplb_fault_addr_coreb;
113 p1.h = _init_saved_icplb_fault_addr_coreb;
116 r7 = [p0 + PDA_DF_SEQSTAT];
117 p1.l = _init_saved_seqstat_coreb;
118 p1.h = _init_saved_seqstat_coreb;
122 /* Initialize stack pointer */
123 sp.l = lo(INITIAL_STACK);
124 sp.h = hi(INITIAL_STACK);
128 /* This section keeps the processor in supervisor mode
129 * during core B startup. Branches to the idle task.
132 /* EVT15 = _real_start */
152 #if defined(ANOMALY_05000281)
159 ENDPROC(_coreb_trampoline_start)
160 ENTRY(_coreb_trampoline_end)
165 p0.l = lo(WDOGB_CTL);
166 p0.h = hi(WDOGB_CTL);
168 w[p0] = r0; /* Clear the watchdog. */
172 * switch to IDLE stack.
174 p0.l = _secondary_stack;
175 p0.h = _secondary_stack;
182 call _secondary_start_kernel;
185 ENDPROC(_coreb_start)