diff options
Diffstat (limited to 'arch/blackfin/mach-common/cacheinit.S')
-rw-r--r-- | arch/blackfin/mach-common/cacheinit.S | 89 |
1 files changed, 11 insertions, 78 deletions
diff --git a/arch/blackfin/mach-common/cacheinit.S b/arch/blackfin/mach-common/cacheinit.S index 7924a90d9658..9d475623b724 100644 --- a/arch/blackfin/mach-common/cacheinit.S +++ b/arch/blackfin/mach-common/cacheinit.S | |||
@@ -38,104 +38,37 @@ | |||
38 | 38 | ||
39 | .text | 39 | .text |
40 | 40 | ||
41 | #ifdef ANOMALY_05000125 | ||
41 | #if defined(CONFIG_BLKFIN_CACHE) | 42 | #if defined(CONFIG_BLKFIN_CACHE) |
42 | ENTRY(_bfin_icache_init) | 43 | ENTRY(_bfin_write_IMEM_CONTROL) |
43 | 44 | ||
44 | /* Initialize Instruction CPLBS */ | ||
45 | |||
46 | I0.L = (ICPLB_ADDR0 & 0xFFFF); | ||
47 | I0.H = (ICPLB_ADDR0 >> 16); | ||
48 | |||
49 | I1.L = (ICPLB_DATA0 & 0xFFFF); | ||
50 | I1.H = (ICPLB_DATA0 >> 16); | ||
51 | |||
52 | I2.L = _icplb_table; | ||
53 | I2.H = _icplb_table; | ||
54 | |||
55 | r1 = -1; /* end point comparison */ | ||
56 | r3 = 15; /* max counter */ | ||
57 | |||
58 | /* read entries from table */ | ||
59 | |||
60 | .Lread_iaddr: | ||
61 | R0 = [I2++]; | ||
62 | CC = R0 == R1; | ||
63 | IF CC JUMP .Lidone; | ||
64 | [I0++] = R0; | ||
65 | |||
66 | .Lread_idata: | ||
67 | R2 = [I2++]; | ||
68 | [I1++] = R2; | ||
69 | R3 = R3 + R1; | ||
70 | CC = R3 == R1; | ||
71 | IF !CC JUMP .Lread_iaddr; | ||
72 | |||
73 | .Lidone: | ||
74 | /* Enable Instruction Cache */ | 45 | /* Enable Instruction Cache */ |
75 | P0.l = (IMEM_CONTROL & 0xFFFF); | 46 | P0.l = (IMEM_CONTROL & 0xFFFF); |
76 | P0.h = (IMEM_CONTROL >> 16); | 47 | P0.h = (IMEM_CONTROL >> 16); |
77 | R1 = [P0]; | ||
78 | R0 = (IMC | ENICPLB); | ||
79 | R0 = R0 | R1; | ||
80 | 48 | ||
81 | /* Anomaly 05000125 */ | 49 | /* Anomaly 05000125 */ |
82 | CLI R2; | 50 | CLI R1; |
83 | SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */ | 51 | SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */ |
84 | .align 8; | 52 | .align 8; |
85 | [P0] = R0; | 53 | [P0] = R0; |
86 | SSYNC; | 54 | SSYNC; |
87 | STI R2; | 55 | STI R1; |
88 | RTS; | 56 | RTS; |
89 | 57 | ||
90 | ENDPROC(_bfin_icache_init) | 58 | ENDPROC(_bfin_write_IMEM_CONTROL) |
91 | #endif | 59 | #endif |
92 | 60 | ||
93 | #if defined(CONFIG_BLKFIN_DCACHE) | 61 | #if defined(CONFIG_BLKFIN_DCACHE) |
94 | ENTRY(_bfin_dcache_init) | 62 | ENTRY(_bfin_write_DMEM_CONTROL) |
95 | 63 | CLI R1; | |
96 | /* Initialize Data CPLBS */ | ||
97 | |||
98 | I0.L = (DCPLB_ADDR0 & 0xFFFF); | ||
99 | I0.H = (DCPLB_ADDR0 >> 16); | ||
100 | |||
101 | I1.L = (DCPLB_DATA0 & 0xFFFF); | ||
102 | I1.H = (DCPLB_DATA0 >> 16); | ||
103 | |||
104 | I2.L = _dcplb_table; | ||
105 | I2.H = _dcplb_table; | ||
106 | |||
107 | R1 = -1; /* end point comparison */ | ||
108 | R3 = 15; /* max counter */ | ||
109 | |||
110 | /* read entries from table */ | ||
111 | .Lread_daddr: | ||
112 | R0 = [I2++]; | ||
113 | cc = R0 == R1; | ||
114 | IF CC JUMP .Lddone; | ||
115 | [I0++] = R0; | ||
116 | |||
117 | .Lread_ddata: | ||
118 | R2 = [I2++]; | ||
119 | [I1++] = R2; | ||
120 | R3 = R3 + R1; | ||
121 | CC = R3 == R1; | ||
122 | IF !CC JUMP .Lread_daddr; | ||
123 | .Lddone: | ||
124 | P0.L = (DMEM_CONTROL & 0xFFFF); | ||
125 | P0.H = (DMEM_CONTROL >> 16); | ||
126 | R1 = [P0]; | ||
127 | |||
128 | R0 = DMEM_CNTR; | ||
129 | |||
130 | R0 = R0 | R1; | ||
131 | /* Anomaly 05000125 */ | ||
132 | CLI R2; | ||
133 | SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */ | 64 | SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */ |
134 | .align 8; | 65 | .align 8; |
135 | [P0] = R0; | 66 | [P0] = R0; |
136 | SSYNC; | 67 | SSYNC; |
137 | STI R2; | 68 | STI R1; |
138 | RTS; | 69 | RTS; |
139 | 70 | ||
140 | ENDPROC(_bfin_dcache_init) | 71 | ENDPROC(_bfin_write_DMEM_CONTROL) |
72 | #endif | ||
73 | |||
141 | #endif | 74 | #endif |