diff options
Diffstat (limited to 'include/asm-blackfin/mach-bf533/cdefBF532.h')
-rw-r--r-- | include/asm-blackfin/mach-bf533/cdefBF532.h | 62 |
1 files changed, 48 insertions, 14 deletions
diff --git a/include/asm-blackfin/mach-bf533/cdefBF532.h b/include/asm-blackfin/mach-bf533/cdefBF532.h index 74f967b235e2..c803e14b529c 100644 --- a/include/asm-blackfin/mach-bf533/cdefBF532.h +++ b/include/asm-blackfin/mach-bf533/cdefBF532.h | |||
@@ -30,11 +30,9 @@ | |||
30 | 30 | ||
31 | #ifndef _CDEF_BF532_H | 31 | #ifndef _CDEF_BF532_H |
32 | #define _CDEF_BF532_H | 32 | #define _CDEF_BF532_H |
33 | /* | 33 | |
34 | #if !defined(__ADSPLPBLACKFIN__) | 34 | #include <asm/blackfin.h> |
35 | #warning cdefBF532.h should only be included for 532 compatible chips. | 35 | |
36 | #endif | ||
37 | */ | ||
38 | /*include all Core registers and bit definitions*/ | 36 | /*include all Core registers and bit definitions*/ |
39 | #include "defBF532.h" | 37 | #include "defBF532.h" |
40 | 38 | ||
@@ -65,7 +63,7 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val) | |||
65 | bfin_write32(SIC_IWR, IWR_ENABLE(0)); | 63 | bfin_write32(SIC_IWR, IWR_ENABLE(0)); |
66 | 64 | ||
67 | bfin_write16(VR_CTL, val); | 65 | bfin_write16(VR_CTL, val); |
68 | __builtin_bfin_ssync(); | 66 | SSYNC(); |
69 | 67 | ||
70 | local_irq_save(flags); | 68 | local_irq_save(flags); |
71 | asm("IDLE;"); | 69 | asm("IDLE;"); |
@@ -132,10 +130,6 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val) | |||
132 | /* General Purpose IO (0xFFC0 2400-0xFFC0 27FF) */ | 130 | /* General Purpose IO (0xFFC0 2400-0xFFC0 27FF) */ |
133 | #define bfin_read_FIO_DIR() bfin_read16(FIO_DIR) | 131 | #define bfin_read_FIO_DIR() bfin_read16(FIO_DIR) |
134 | #define bfin_write_FIO_DIR(val) bfin_write16(FIO_DIR,val) | 132 | #define bfin_write_FIO_DIR(val) bfin_write16(FIO_DIR,val) |
135 | #define bfin_read_FIO_FLAG_C() bfin_read16(FIO_FLAG_C) | ||
136 | #define bfin_write_FIO_FLAG_C(val) bfin_write16(FIO_FLAG_C,val) | ||
137 | #define bfin_read_FIO_FLAG_S() bfin_read16(FIO_FLAG_S) | ||
138 | #define bfin_write_FIO_FLAG_S(val) bfin_write16(FIO_FLAG_S,val) | ||
139 | #define bfin_read_FIO_MASKA_C() bfin_read16(FIO_MASKA_C) | 133 | #define bfin_read_FIO_MASKA_C() bfin_read16(FIO_MASKA_C) |
140 | #define bfin_write_FIO_MASKA_C(val) bfin_write16(FIO_MASKA_C,val) | 134 | #define bfin_write_FIO_MASKA_C(val) bfin_write16(FIO_MASKA_C,val) |
141 | #define bfin_read_FIO_MASKA_S() bfin_read16(FIO_MASKA_S) | 135 | #define bfin_read_FIO_MASKA_S() bfin_read16(FIO_MASKA_S) |
@@ -152,10 +146,6 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val) | |||
152 | #define bfin_write_FIO_BOTH(val) bfin_write16(FIO_BOTH,val) | 146 | #define bfin_write_FIO_BOTH(val) bfin_write16(FIO_BOTH,val) |
153 | #define bfin_read_FIO_INEN() bfin_read16(FIO_INEN) | 147 | #define bfin_read_FIO_INEN() bfin_read16(FIO_INEN) |
154 | #define bfin_write_FIO_INEN(val) bfin_write16(FIO_INEN,val) | 148 | #define bfin_write_FIO_INEN(val) bfin_write16(FIO_INEN,val) |
155 | #define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D) | ||
156 | #define bfin_write_FIO_FLAG_D(val) bfin_write16(FIO_FLAG_D,val) | ||
157 | #define bfin_read_FIO_FLAG_T() bfin_read16(FIO_FLAG_T) | ||
158 | #define bfin_write_FIO_FLAG_T(val) bfin_write16(FIO_FLAG_T,val) | ||
159 | #define bfin_read_FIO_MASKA_D() bfin_read16(FIO_MASKA_D) | 149 | #define bfin_read_FIO_MASKA_D() bfin_read16(FIO_MASKA_D) |
160 | #define bfin_write_FIO_MASKA_D(val) bfin_write16(FIO_MASKA_D,val) | 150 | #define bfin_write_FIO_MASKA_D(val) bfin_write16(FIO_MASKA_D,val) |
161 | #define bfin_read_FIO_MASKA_T() bfin_read16(FIO_MASKA_T) | 151 | #define bfin_read_FIO_MASKA_T() bfin_read16(FIO_MASKA_T) |
@@ -165,6 +155,50 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val) | |||
165 | #define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T) | 155 | #define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T) |
166 | #define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val) | 156 | #define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val) |
167 | 157 | ||
158 | |||
159 | #if ANOMALY_05000311 | ||
160 | #define BFIN_WRITE_FIO_FLAG(name) \ | ||
161 | static __inline__ void bfin_write_FIO_FLAG_ ## name (unsigned short val)\ | ||
162 | {\ | ||
163 | unsigned long flags;\ | ||
164 | local_irq_save(flags);\ | ||
165 | bfin_write16(FIO_FLAG_ ## name,val);\ | ||
166 | bfin_read_CHIPID();\ | ||
167 | local_irq_restore(flags);\ | ||
168 | } | ||
169 | BFIN_WRITE_FIO_FLAG(D) | ||
170 | BFIN_WRITE_FIO_FLAG(C) | ||
171 | BFIN_WRITE_FIO_FLAG(S) | ||
172 | BFIN_WRITE_FIO_FLAG(T) | ||
173 | |||
174 | #define BFIN_READ_FIO_FLAG(name) \ | ||
175 | static __inline__ unsigned short bfin_read_FIO_FLAG_ ## name (void)\ | ||
176 | {\ | ||
177 | unsigned long flags;\ | ||
178 | unsigned short ret;\ | ||
179 | local_irq_save(flags);\ | ||
180 | ret = bfin_read16(FIO_FLAG_ ## name);\ | ||
181 | bfin_read_CHIPID();\ | ||
182 | local_irq_restore(flags);\ | ||
183 | return ret;\ | ||
184 | } | ||
185 | BFIN_READ_FIO_FLAG(D) | ||
186 | BFIN_READ_FIO_FLAG(C) | ||
187 | BFIN_READ_FIO_FLAG(S) | ||
188 | BFIN_READ_FIO_FLAG(T) | ||
189 | |||
190 | #else | ||
191 | #define bfin_write_FIO_FLAG_D(val) bfin_write16(FIO_FLAG_D,val) | ||
192 | #define bfin_write_FIO_FLAG_C(val) bfin_write16(FIO_FLAG_C,val) | ||
193 | #define bfin_write_FIO_FLAG_S(val) bfin_write16(FIO_FLAG_S,val) | ||
194 | #define bfin_write_FIO_FLAG_T(val) bfin_write16(FIO_FLAG_T,val) | ||
195 | #define bfin_read_FIO_FLAG_T() bfin_read16(FIO_FLAG_T) | ||
196 | #define bfin_read_FIO_FLAG_C() bfin_read16(FIO_FLAG_C) | ||
197 | #define bfin_read_FIO_FLAG_S() bfin_read16(FIO_FLAG_S) | ||
198 | #define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D) | ||
199 | #endif | ||
200 | |||
201 | |||
168 | /* DMA Controller */ | 202 | /* DMA Controller */ |
169 | #define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG) | 203 | #define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG) |
170 | #define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val) | 204 | #define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val) |