diff options
-rw-r--r-- | arch/blackfin/mach-bf533/include/mach/cdefBF532.h | 86 |
1 files changed, 42 insertions, 44 deletions
diff --git a/arch/blackfin/mach-bf533/include/mach/cdefBF532.h b/arch/blackfin/mach-bf533/include/mach/cdefBF532.h index 24ff2cb967f6..b148d2b7e479 100644 --- a/arch/blackfin/mach-bf533/include/mach/cdefBF532.h +++ b/arch/blackfin/mach-bf533/include/mach/cdefBF532.h | |||
@@ -134,50 +134,6 @@ | |||
134 | #define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T) | 134 | #define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T) |
135 | #define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val) | 135 | #define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val) |
136 | 136 | ||
137 | |||
138 | #if ANOMALY_05000311 | ||
139 | #define BFIN_WRITE_FIO_FLAG(name) \ | ||
140 | static __inline__ void bfin_write_FIO_FLAG_ ## name (unsigned short val)\ | ||
141 | {\ | ||
142 | unsigned long flags;\ | ||
143 | local_irq_save(flags);\ | ||
144 | bfin_write16(FIO_FLAG_ ## name,val);\ | ||
145 | bfin_read_CHIPID();\ | ||
146 | local_irq_restore(flags);\ | ||
147 | } | ||
148 | BFIN_WRITE_FIO_FLAG(D) | ||
149 | BFIN_WRITE_FIO_FLAG(C) | ||
150 | BFIN_WRITE_FIO_FLAG(S) | ||
151 | BFIN_WRITE_FIO_FLAG(T) | ||
152 | |||
153 | #define BFIN_READ_FIO_FLAG(name) \ | ||
154 | static __inline__ unsigned short bfin_read_FIO_FLAG_ ## name (void)\ | ||
155 | {\ | ||
156 | unsigned long flags;\ | ||
157 | unsigned short ret;\ | ||
158 | local_irq_save(flags);\ | ||
159 | ret = bfin_read16(FIO_FLAG_ ## name);\ | ||
160 | bfin_read_CHIPID();\ | ||
161 | local_irq_restore(flags);\ | ||
162 | return ret;\ | ||
163 | } | ||
164 | BFIN_READ_FIO_FLAG(D) | ||
165 | BFIN_READ_FIO_FLAG(C) | ||
166 | BFIN_READ_FIO_FLAG(S) | ||
167 | BFIN_READ_FIO_FLAG(T) | ||
168 | |||
169 | #else | ||
170 | #define bfin_write_FIO_FLAG_D(val) bfin_write16(FIO_FLAG_D,val) | ||
171 | #define bfin_write_FIO_FLAG_C(val) bfin_write16(FIO_FLAG_C,val) | ||
172 | #define bfin_write_FIO_FLAG_S(val) bfin_write16(FIO_FLAG_S,val) | ||
173 | #define bfin_write_FIO_FLAG_T(val) bfin_write16(FIO_FLAG_T,val) | ||
174 | #define bfin_read_FIO_FLAG_T() bfin_read16(FIO_FLAG_T) | ||
175 | #define bfin_read_FIO_FLAG_C() bfin_read16(FIO_FLAG_C) | ||
176 | #define bfin_read_FIO_FLAG_S() bfin_read16(FIO_FLAG_S) | ||
177 | #define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D) | ||
178 | #endif | ||
179 | |||
180 | |||
181 | /* DMA Controller */ | 137 | /* DMA Controller */ |
182 | #define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG) | 138 | #define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG) |
183 | #define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val) | 139 | #define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val) |
@@ -723,6 +679,48 @@ BFIN_READ_FIO_FLAG(T) | |||
723 | /* These need to be last due to the cdef/linux inter-dependencies */ | 679 | /* These need to be last due to the cdef/linux inter-dependencies */ |
724 | #include <asm/system.h> | 680 | #include <asm/system.h> |
725 | 681 | ||
682 | #if ANOMALY_05000311 | ||
683 | #define BFIN_WRITE_FIO_FLAG(name) \ | ||
684 | static inline void bfin_write_FIO_FLAG_##name(unsigned short val) \ | ||
685 | { \ | ||
686 | unsigned long flags; \ | ||
687 | local_irq_save(flags); \ | ||
688 | bfin_write16(FIO_FLAG_##name, val); \ | ||
689 | bfin_read_CHIPID(); \ | ||
690 | local_irq_restore(flags); \ | ||
691 | } | ||
692 | BFIN_WRITE_FIO_FLAG(D) | ||
693 | BFIN_WRITE_FIO_FLAG(C) | ||
694 | BFIN_WRITE_FIO_FLAG(S) | ||
695 | BFIN_WRITE_FIO_FLAG(T) | ||
696 | |||
697 | #define BFIN_READ_FIO_FLAG(name) \ | ||
698 | static inline u16 bfin_read_FIO_FLAG_##name(void) \ | ||
699 | { \ | ||
700 | unsigned long flags; \ | ||
701 | u16 ret; \ | ||
702 | local_irq_save(flags); \ | ||
703 | ret = bfin_read16(FIO_FLAG_##name); \ | ||
704 | bfin_read_CHIPID(); \ | ||
705 | local_irq_restore(flags); \ | ||
706 | return ret; \ | ||
707 | } | ||
708 | BFIN_READ_FIO_FLAG(D) | ||
709 | BFIN_READ_FIO_FLAG(C) | ||
710 | BFIN_READ_FIO_FLAG(S) | ||
711 | BFIN_READ_FIO_FLAG(T) | ||
712 | |||
713 | #else | ||
714 | #define bfin_write_FIO_FLAG_D(val) bfin_write16(FIO_FLAG_D, val) | ||
715 | #define bfin_write_FIO_FLAG_C(val) bfin_write16(FIO_FLAG_C, val) | ||
716 | #define bfin_write_FIO_FLAG_S(val) bfin_write16(FIO_FLAG_S, val) | ||
717 | #define bfin_write_FIO_FLAG_T(val) bfin_write16(FIO_FLAG_T, val) | ||
718 | #define bfin_read_FIO_FLAG_T() bfin_read16(FIO_FLAG_T) | ||
719 | #define bfin_read_FIO_FLAG_C() bfin_read16(FIO_FLAG_C) | ||
720 | #define bfin_read_FIO_FLAG_S() bfin_read16(FIO_FLAG_S) | ||
721 | #define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D) | ||
722 | #endif | ||
723 | |||
726 | /* Writing to PLL_CTL initiates a PLL relock sequence. */ | 724 | /* Writing to PLL_CTL initiates a PLL relock sequence. */ |
727 | static __inline__ void bfin_write_PLL_CTL(unsigned int val) | 725 | static __inline__ void bfin_write_PLL_CTL(unsigned int val) |
728 | { | 726 | { |