aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf561/head.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/mach-bf561/head.S')
-rw-r--r--arch/blackfin/mach-bf561/head.S102
1 files changed, 25 insertions, 77 deletions
diff --git a/arch/blackfin/mach-bf561/head.S b/arch/blackfin/mach-bf561/head.S
index 38650a628980..96a3d456fb6d 100644
--- a/arch/blackfin/mach-bf561/head.S
+++ b/arch/blackfin/mach-bf561/head.S
@@ -33,6 +33,7 @@
33#include <asm/trace.h> 33#include <asm/trace.h>
34 34
35#if CONFIG_BFIN_KERNEL_CLOCK 35#if CONFIG_BFIN_KERNEL_CLOCK
36#include <asm/mach-common/clocks.h>
36#include <asm/mach/mem_init.h> 37#include <asm/mach/mem_init.h>
37#endif 38#endif
38 39
@@ -50,10 +51,12 @@ __INIT
50ENTRY(__start) 51ENTRY(__start)
51 /* R0: argument of command line string, passed from uboot, save it */ 52 /* R0: argument of command line string, passed from uboot, save it */
52 R7 = R0; 53 R7 = R0;
53 /* Set the SYSCFG register: 54 /* Enable Cycle Counter and Nesting Of Interrupts */
54 * Enable Cycle Counter and Nesting Of Interrupts (3rd Bit) 55#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES
55 */ 56 R0 = SYSCFG_SNEN;
56 R0 = 0x36; 57#else
58 R0 = SYSCFG_SNEN | SYSCFG_CCEN;
59#endif
57 SYSCFG = R0; 60 SYSCFG = R0;
58 R0 = 0; 61 R0 = 0;
59 62
@@ -95,43 +98,42 @@ ENTRY(__start)
95 M2 = r0; 98 M2 = r0;
96 M3 = r0; 99 M3 = r0;
97 100
98 trace_buffer_start(p0,r0); 101 trace_buffer_init(p0,r0);
99 P0 = R1; 102 P0 = R1;
100 R0 = R1; 103 R0 = R1;
101 104
102 /* Turn off the icache */ 105 /* Turn off the icache */
103 p0.l = (IMEM_CONTROL & 0xFFFF); 106 p0.l = LO(IMEM_CONTROL);
104 p0.h = (IMEM_CONTROL >> 16); 107 p0.h = HI(IMEM_CONTROL);
105 R1 = [p0]; 108 R1 = [p0];
106 R0 = ~ENICPLB; 109 R0 = ~ENICPLB;
107 R0 = R0 & R1; 110 R0 = R0 & R1;
108 111
109 /* Anomaly 05000125 */ 112#if ANOMALY_05000125
110#ifdef ANOMALY_05000125
111 CLI R2; 113 CLI R2;
112 SSYNC; 114 SSYNC;
113#endif 115#endif
114 [p0] = R0; 116 [p0] = R0;
115 SSYNC; 117 SSYNC;
116#ifdef ANOMALY_05000125 118#if ANOMALY_05000125
117 STI R2; 119 STI R2;
118#endif 120#endif
119 121
120 /* Turn off the dcache */ 122 /* Turn off the dcache */
121 p0.l = (DMEM_CONTROL & 0xFFFF); 123 p0.l = LO(DMEM_CONTROL);
122 p0.h = (DMEM_CONTROL >> 16); 124 p0.h = HI(DMEM_CONTROL);
123 R1 = [p0]; 125 R1 = [p0];
124 R0 = ~ENDCPLB; 126 R0 = ~ENDCPLB;
125 R0 = R0 & R1; 127 R0 = R0 & R1;
126 128
127 /* Anomaly 05000125 */ 129 /* Anomaly 05000125 */
128#ifdef ANOMALY_05000125 130#if ANOMALY_05000125
129 CLI R2; 131 CLI R2;
130 SSYNC; 132 SSYNC;
131#endif 133#endif
132 [p0] = R0; 134 [p0] = R0;
133 SSYNC; 135 SSYNC;
134#ifdef ANOMALY_05000125 136#if ANOMALY_05000125
135 STI R2; 137 STI R2;
136#endif 138#endif
137 139
@@ -167,6 +169,12 @@ ENTRY(__start)
167 fp = sp; 169 fp = sp;
168 usp = sp; 170 usp = sp;
169 171
172#ifdef CONFIG_EARLY_PRINTK
173 SP += -12;
174 call _init_early_exception_vectors;
175 SP += 12;
176#endif
177
170 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ 178 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
171 call _bf53x_relocate_l1_mem; 179 call _bf53x_relocate_l1_mem;
172#if CONFIG_BFIN_KERNEL_CLOCK 180#if CONFIG_BFIN_KERNEL_CLOCK
@@ -220,7 +228,7 @@ ENTRY(__start)
220 p0.l = .LWAIT_HERE; 228 p0.l = .LWAIT_HERE;
221 p0.h = .LWAIT_HERE; 229 p0.h = .LWAIT_HERE;
222 reti = p0; 230 reti = p0;
223#if defined(ANOMALY_05000281) 231#if ANOMALY_05000281
224 nop; nop; nop; 232 nop; nop; nop;
225#endif 233#endif
226 rti; 234 rti;
@@ -372,8 +380,8 @@ ENTRY(_start_dma_code)
372 w[p0] = r0.l; 380 w[p0] = r0.l;
373 ssync; 381 ssync;
374 382
375 p0.l = (EBIU_SDBCTL & 0xFFFF); 383 p0.l = LO(EBIU_SDBCTL);
376 p0.h = (EBIU_SDBCTL >> 16); /* SDRAM Memory Bank Control Register */ 384 p0.h = HI(EBIU_SDBCTL); /* SDRAM Memory Bank Control Register */
377 r0 = mem_SDBCTL; 385 r0 = mem_SDBCTL;
378 w[p0] = r0.l; 386 w[p0] = r0.l;
379 ssync; 387 ssync;
@@ -404,66 +412,6 @@ ENTRY(_start_dma_code)
404ENDPROC(_start_dma_code) 412ENDPROC(_start_dma_code)
405#endif /* CONFIG_BFIN_KERNEL_CLOCK */ 413#endif /* CONFIG_BFIN_KERNEL_CLOCK */
406 414
407ENTRY(_bfin_reset)
408 /* No more interrupts to be handled*/
409 CLI R6;
410 SSYNC;
411
412#if defined(CONFIG_BFIN_SHARED_FLASH_ENET)
413 p0.h = hi(FIO_INEN);
414 p0.l = lo(FIO_INEN);
415 r0.l = ~(PF1 | PF0);
416 w[p0] = r0.l;
417
418 p0.h = hi(FIO_DIR);
419 p0.l = lo(FIO_DIR);
420 r0.l = (PF1 | PF0);
421 w[p0] = r0.l;
422
423 p0.h = hi(FIO_FLAG_C);
424 p0.l = lo(FIO_FLAG_C);
425 r0.l = (PF1 | PF0);
426 w[p0] = r0.l;
427#endif
428
429 /* Clear the IMASK register */
430 p0.h = hi(IMASK);
431 p0.l = lo(IMASK);
432 r0 = 0x0;
433 [p0] = r0;
434
435 /* Clear the ILAT register */
436 p0.h = hi(ILAT);
437 p0.l = lo(ILAT);
438 r0 = [p0];
439 [p0] = r0;
440 SSYNC;
441
442 /* make sure SYSCR is set to use BMODE */
443 P0.h = hi(SYSCR);
444 P0.l = lo(SYSCR);
445 R0.l = 0x20; /* on BF561, disable core b */
446 W[P0] = R0.l;
447 SSYNC;
448
449 /* issue a system soft reset */
450 P1.h = hi(SWRST);
451 P1.l = lo(SWRST);
452 R1.l = 0x0007;
453 W[P1] = R1;
454 SSYNC;
455
456 /* clear system soft reset */
457 R0.l = 0x0000;
458 W[P0] = R0;
459 SSYNC;
460
461 /* issue core reset */
462 raise 1;
463
464 RTS;
465ENDPROC(_bfin_reset)
466
467.data 415.data
468 416
469/* 417/*