commit: http://blackfin.uclinux.org/git/?p=linux-kernel;a=commitdiff;h=4af8637315add570fc5b3d5b6e51fa8a6a904fc4
branch: http://blackfin.uclinux.org/git/?p=linux-kernel;a=shortlog;h=refs/heads/trunk

Signed-off-by: Steven Miao <[email protected]>
Signed-off-by: Bob Liu <[email protected]>
---
 arch/blackfin/include/asm/io.h |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/arch/blackfin/include/asm/io.h b/arch/blackfin/include/asm/io.h
index dccae26..9a364e0 100644
--- a/arch/blackfin/include/asm/io.h
+++ b/arch/blackfin/include/asm/io.h
@@ -10,6 +10,7 @@
 #include <linux/compiler.h>
 #include <linux/types.h>
 #include <asm/byteorder.h>
+#include <asm/blackfin.h>
 
 #define DECLARE_BFIN_RAW_READX(size, type, asm, asm_sign) \
 static inline type __raw_read##size(const volatile void __iomem *addr) \
@@ -33,6 +34,31 @@ DECLARE_BFIN_RAW_READX(w, u16, w, (z))
 DECLARE_BFIN_RAW_READX(l, u32, , )
 #define __raw_readl __raw_readl
 
+#define DECLARE_BFIN_RAW_WRITEX(size, type) \
+static inline void __raw_write##size(type val, volatile void __iomem *addr) \
+{ \
+	unsigned int tmp = 0; \
+	unsigned int tmp_addr = (unsigned int)addr; \
+	int is_smc = 0; \
+	if ((tmp_addr & ~(ASYNC_BANK0_SIZE - 1)) == ASYNC_BANK0_BASE) { \
+		tmp = bfin_read32(SMC_B0CTL); \
+		bfin_write32(SMC_B0CTL, tmp | 0x2000); \
+		SSYNC(); \
+		is_smc = 1; \
+	} \
+	*(volatile type __force *) addr = (type) val; \
+	if (is_smc) { \
+		tmp = bfin_read32(SMC_B0CTL); \
+		bfin_write32(SMC_B0CTL, tmp & ~0x2000); \
+	} \
+}
+DECLARE_BFIN_RAW_WRITEX(b, u8)
+#define __raw_writeb __raw_writeb
+DECLARE_BFIN_RAW_WRITEX(w, u16)
+#define __raw_writew __raw_writew
+DECLARE_BFIN_RAW_WRITEX(l, u32)
+#define __raw_writel __raw_writel
+
 extern void outsb(unsigned long port, const void *addr, unsigned long count);
 extern void outsw(unsigned long port, const void *addr, unsigned long count);
 extern void outsw_8(unsigned long port, const void *addr, unsigned long count);
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to