2 * File: arch/blackfin/mach-bf561/secondary.S
3 * Based on: arch/blackfin/mach-bf561/head.S
4 * Author: Philippe Gerum <rpm@xenomai.org>
6 * Copyright 2007 Analog Devices Inc.
8 * Description: BF561 coreB bootstrap file
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, see the file COPYING, or write
22 * to the Free Software Foundation, Inc.,
23 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include <linux/linkage.h>
27 #include <linux/init.h>
28 #include <asm/blackfin.h>
29 #include <asm/asm-offsets.h>
33 /* Lay the initial stack into the L1 scratch area of Core B */
34 #define INITIAL_STACK (COREB_L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12)
36 ENTRY(_coreb_trampoline_start)
37 /* Set the SYSCFG register */
39 SYSCFG = R0; /*Enable Cycle Counter and Nesting Of Interrupts(3rd Bit)*/
42 /*Clear Out All the data and pointer Registers*/
65 /* Clear Out All the DAG Registers*/
81 /* Turn off the icache */
82 p0.l = LO(IMEM_CONTROL);
83 p0.h = HI(IMEM_CONTROL);
88 /* Anomaly 05000125 */
89 #ifdef ANOMALY_05000125
95 #ifdef ANOMALY_05000125
99 /* Turn off the dcache */
100 p0.l = LO(DMEM_CONTROL);
101 p0.h = HI(DMEM_CONTROL);
106 /* Anomaly 05000125 */
107 #ifdef ANOMALY_05000125
113 #ifdef ANOMALY_05000125
117 /* in case of double faults, save a few things */
118 p0.l = _init_retx_coreb;
119 p0.h = _init_retx_coreb;
123 #ifdef CONFIG_DEBUG_DOUBLEFAULT
124 /* Only save these if we are storing them,
125 * This happens here, since L1 gets clobbered
129 r7 = [p0 + PDA_RETX];
130 p1.l = _init_saved_retx_coreb;
131 p1.h = _init_saved_retx_coreb;
134 r7 = [p0 + PDA_DCPLB];
135 p1.l = _init_saved_dcplb_fault_addr_coreb;
136 p1.h = _init_saved_dcplb_fault_addr_coreb;
139 r7 = [p0 + PDA_ICPLB];
140 p1.l = _init_saved_icplb_fault_addr_coreb;
141 p1.h = _init_saved_icplb_fault_addr_coreb;
144 r7 = [p0 + PDA_SEQSTAT];
145 p1.l = _init_saved_seqstat_coreb;
146 p1.h = _init_saved_seqstat_coreb;
150 /* Initialize stack pointer */
151 sp.l = lo(INITIAL_STACK);
152 sp.h = hi(INITIAL_STACK);
156 /* This section keeps the processor in supervisor mode
157 * during core B startup. Branches to the idle task.
160 /* EVT15 = _real_start */
180 #if defined(ANOMALY_05000281)
187 ENDPROC(_coreb_trampoline_start)
188 ENTRY(_coreb_trampoline_end)
193 p0.l = lo(WDOGB_CTL);
194 p0.h = hi(WDOGB_CTL);
196 w[p0] = r0; /* Clear the watchdog. */
200 * switch to IDLE stack.
202 p0.l = _secondary_stack;
203 p0.h = _secondary_stack;
210 call _secondary_start_kernel;
213 ENDPROC(_coreb_start)