diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2008-08-06 05:23:50 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-08-06 05:23:50 -0400 |
commit | 17e89bcfa12f71b840361da07fe6c2f9c48d0605 (patch) | |
tree | c5ab94b397bcdfc5ffe0363f24ff83e012e8801a /arch/blackfin/mach-common | |
parent | 67618fd8748a5d83f6bdcd578c8e748c3f47c4d4 (diff) |
Blackfin arch: unify the duplicated portions of __start and split mach-specific pieces into _mach_early_start where they will be easier to trim over time
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/mach-common')
-rw-r--r-- | arch/blackfin/mach-common/head.S | 131 |
1 files changed, 129 insertions, 2 deletions
diff --git a/arch/blackfin/mach-common/head.S b/arch/blackfin/mach-common/head.S index 6a989a031ed6..2c69ad49894e 100644 --- a/arch/blackfin/mach-common/head.S +++ b/arch/blackfin/mach-common/head.S | |||
@@ -14,13 +14,140 @@ | |||
14 | #include <asm/thread_info.h> | 14 | #include <asm/thread_info.h> |
15 | #include <asm/trace.h> | 15 | #include <asm/trace.h> |
16 | 16 | ||
17 | __INIT | ||
18 | |||
19 | #define INITIAL_STACK (L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12) | ||
20 | |||
21 | ENTRY(__start) | ||
22 | /* R0: argument of command line string, passed from uboot, save it */ | ||
23 | R7 = R0; | ||
24 | /* Enable Cycle Counter and Nesting Of Interrupts */ | ||
25 | #ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES | ||
26 | R0 = SYSCFG_SNEN; | ||
27 | #else | ||
28 | R0 = SYSCFG_SNEN | SYSCFG_CCEN; | ||
29 | #endif | ||
30 | SYSCFG = R0; | ||
31 | R0 = 0; | ||
32 | |||
33 | /* Clear Out All the data and pointer Registers */ | ||
34 | R1 = R0; | ||
35 | R2 = R0; | ||
36 | R3 = R0; | ||
37 | R4 = R0; | ||
38 | R5 = R0; | ||
39 | R6 = R0; | ||
40 | |||
41 | P0 = R0; | ||
42 | P1 = R0; | ||
43 | P2 = R0; | ||
44 | P3 = R0; | ||
45 | P4 = R0; | ||
46 | P5 = R0; | ||
47 | |||
48 | LC0 = r0; | ||
49 | LC1 = r0; | ||
50 | L0 = r0; | ||
51 | L1 = r0; | ||
52 | L2 = r0; | ||
53 | L3 = r0; | ||
54 | |||
55 | /* Clear Out All the DAG Registers */ | ||
56 | B0 = r0; | ||
57 | B1 = r0; | ||
58 | B2 = r0; | ||
59 | B3 = r0; | ||
60 | |||
61 | I0 = r0; | ||
62 | I1 = r0; | ||
63 | I2 = r0; | ||
64 | I3 = r0; | ||
65 | |||
66 | M0 = r0; | ||
67 | M1 = r0; | ||
68 | M2 = r0; | ||
69 | M3 = r0; | ||
70 | |||
71 | trace_buffer_init(p0,r0); | ||
72 | P0 = R1; | ||
73 | R0 = R1; | ||
74 | |||
75 | /* Turn off the icache */ | ||
76 | p0.l = LO(IMEM_CONTROL); | ||
77 | p0.h = HI(IMEM_CONTROL); | ||
78 | R1 = [p0]; | ||
79 | R0 = ~ENICPLB; | ||
80 | R0 = R0 & R1; | ||
81 | [p0] = R0; | ||
82 | SSYNC; | ||
83 | |||
84 | /* Turn off the dcache */ | ||
85 | p0.l = LO(DMEM_CONTROL); | ||
86 | p0.h = HI(DMEM_CONTROL); | ||
87 | R1 = [p0]; | ||
88 | R0 = ~ENDCPLB; | ||
89 | R0 = R0 & R1; | ||
90 | [p0] = R0; | ||
91 | SSYNC; | ||
92 | |||
93 | /* Let each Blackfin family do its own thing */ | ||
94 | call _mach_early_start; | ||
95 | |||
96 | /* Initialize stack pointer */ | ||
97 | sp.l = lo(INITIAL_STACK); | ||
98 | sp.h = hi(INITIAL_STACK); | ||
99 | fp = sp; | ||
100 | usp = sp; | ||
101 | |||
102 | #ifdef CONFIG_EARLY_PRINTK | ||
103 | call _init_early_exception_vectors; | ||
104 | #endif | ||
105 | |||
106 | /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ | ||
107 | call _bf53x_relocate_l1_mem; | ||
108 | #ifdef CONFIG_BFIN_KERNEL_CLOCK | ||
109 | call _start_dma_code; | ||
110 | #endif | ||
111 | |||
112 | /* This section keeps the processor in supervisor mode | ||
113 | * during kernel boot. Switches to user mode at end of boot. | ||
114 | * See page 3-9 of Hardware Reference manual for documentation. | ||
115 | */ | ||
116 | |||
117 | /* EVT15 = _real_start */ | ||
118 | |||
119 | p0.l = lo(EVT15); | ||
120 | p0.h = hi(EVT15); | ||
121 | p1.l = _real_start; | ||
122 | p1.h = _real_start; | ||
123 | [p0] = p1; | ||
124 | csync; | ||
125 | |||
126 | p0.l = lo(IMASK); | ||
127 | p0.h = hi(IMASK); | ||
128 | p1.l = IMASK_IVG15; | ||
129 | p1.h = 0x0; | ||
130 | [p0] = p1; | ||
131 | csync; | ||
132 | |||
133 | raise 15; | ||
134 | p0.l = .LWAIT_HERE; | ||
135 | p0.h = .LWAIT_HERE; | ||
136 | reti = p0; | ||
137 | #if ANOMALY_05000281 | ||
138 | nop; nop; nop; | ||
139 | #endif | ||
140 | rti; | ||
141 | |||
142 | .LWAIT_HERE: | ||
143 | jump .LWAIT_HERE; | ||
144 | ENDPROC(__start) | ||
145 | |||
17 | /* A little BF561 glue ... */ | 146 | /* A little BF561 glue ... */ |
18 | #ifndef WDOG_CTL | 147 | #ifndef WDOG_CTL |
19 | # define WDOG_CTL WDOGA_CTL | 148 | # define WDOG_CTL WDOGA_CTL |
20 | #endif | 149 | #endif |
21 | 150 | ||
22 | __INIT | ||
23 | |||
24 | ENTRY(_real_start) | 151 | ENTRY(_real_start) |
25 | /* Enable nested interrupts */ | 152 | /* Enable nested interrupts */ |
26 | [--sp] = reti; | 153 | [--sp] = reti; |