diff options
author | Michael Hennerich <michael.hennerich@analog.com> | 2007-09-12 02:50:28 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-09-12 02:50:28 -0400 |
commit | 4b3f058a7a34a10d99937e86bb28da118710ca9a (patch) | |
tree | d88611659c502f5deeea07f198e722cd7318447a | |
parent | eabb5a5e0b1ff6b7d36ac80bf39773fa6a0fc872 (diff) |
Blackfin arch: Add ANOMALY_05000311 Workaround - for those who doesnt use the generic GPIO driver
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
-rw-r--r-- | include/asm-blackfin/mach-bf533/cdefBF532.h | 52 |
1 files changed, 44 insertions, 8 deletions
diff --git a/include/asm-blackfin/mach-bf533/cdefBF532.h b/include/asm-blackfin/mach-bf533/cdefBF532.h index 40c1ad39dcab..c803e14b529c 100644 --- a/include/asm-blackfin/mach-bf533/cdefBF532.h +++ b/include/asm-blackfin/mach-bf533/cdefBF532.h | |||
@@ -130,10 +130,6 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val) | |||
130 | /* General Purpose IO (0xFFC0 2400-0xFFC0 27FF) */ | 130 | /* General Purpose IO (0xFFC0 2400-0xFFC0 27FF) */ |
131 | #define bfin_read_FIO_DIR() bfin_read16(FIO_DIR) | 131 | #define bfin_read_FIO_DIR() bfin_read16(FIO_DIR) |
132 | #define bfin_write_FIO_DIR(val) bfin_write16(FIO_DIR,val) | 132 | #define bfin_write_FIO_DIR(val) bfin_write16(FIO_DIR,val) |
133 | #define bfin_read_FIO_FLAG_C() bfin_read16(FIO_FLAG_C) | ||
134 | #define bfin_write_FIO_FLAG_C(val) bfin_write16(FIO_FLAG_C,val) | ||
135 | #define bfin_read_FIO_FLAG_S() bfin_read16(FIO_FLAG_S) | ||
136 | #define bfin_write_FIO_FLAG_S(val) bfin_write16(FIO_FLAG_S,val) | ||
137 | #define bfin_read_FIO_MASKA_C() bfin_read16(FIO_MASKA_C) | 133 | #define bfin_read_FIO_MASKA_C() bfin_read16(FIO_MASKA_C) |
138 | #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) |
139 | #define bfin_read_FIO_MASKA_S() bfin_read16(FIO_MASKA_S) | 135 | #define bfin_read_FIO_MASKA_S() bfin_read16(FIO_MASKA_S) |
@@ -150,10 +146,6 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val) | |||
150 | #define bfin_write_FIO_BOTH(val) bfin_write16(FIO_BOTH,val) | 146 | #define bfin_write_FIO_BOTH(val) bfin_write16(FIO_BOTH,val) |
151 | #define bfin_read_FIO_INEN() bfin_read16(FIO_INEN) | 147 | #define bfin_read_FIO_INEN() bfin_read16(FIO_INEN) |
152 | #define bfin_write_FIO_INEN(val) bfin_write16(FIO_INEN,val) | 148 | #define bfin_write_FIO_INEN(val) bfin_write16(FIO_INEN,val) |
153 | #define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D) | ||
154 | #define bfin_write_FIO_FLAG_D(val) bfin_write16(FIO_FLAG_D,val) | ||
155 | #define bfin_read_FIO_FLAG_T() bfin_read16(FIO_FLAG_T) | ||
156 | #define bfin_write_FIO_FLAG_T(val) bfin_write16(FIO_FLAG_T,val) | ||
157 | #define bfin_read_FIO_MASKA_D() bfin_read16(FIO_MASKA_D) | 149 | #define bfin_read_FIO_MASKA_D() bfin_read16(FIO_MASKA_D) |
158 | #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) |
159 | #define bfin_read_FIO_MASKA_T() bfin_read16(FIO_MASKA_T) | 151 | #define bfin_read_FIO_MASKA_T() bfin_read16(FIO_MASKA_T) |
@@ -163,6 +155,50 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val) | |||
163 | #define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T) | 155 | #define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T) |
164 | #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) |
165 | 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 | |||
166 | /* DMA Controller */ | 202 | /* DMA Controller */ |
167 | #define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG) | 203 | #define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG) |
168 | #define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val) | 204 | #define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val) |