aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/include/asm/io.h
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-01-18 04:42:20 -0500
committerVineet Gupta <vgupta@synopsys.com>2013-02-15 12:45:54 -0500
commit1162b0701b14ba112d4e3fe5c27c694caf983539 (patch)
tree4255ede27a8c75378ec6c2e5cccc64fac7e41c0a /arch/arc/include/asm/io.h
parentfbd7053a7854b12b0fdc415089c59baabf25c625 (diff)
ARC: I/O and DMA Mappings
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/include/asm/io.h')
-rw-r--r--arch/arc/include/asm/io.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/arch/arc/include/asm/io.h b/arch/arc/include/asm/io.h
new file mode 100644
index 000000000000..d20051bbbf02
--- /dev/null
+++ b/arch/arc/include/asm/io.h
@@ -0,0 +1,103 @@
1/*
2 * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _ASM_ARC_IO_H
10#define _ASM_ARC_IO_H
11
12#include <linux/types.h>
13#include <asm/byteorder.h>
14#include <asm/page.h>
15
16#define PCI_IOBASE ((void __iomem *)0)
17
18extern void __iomem *ioremap(unsigned long physaddr, unsigned long size);
19extern void iounmap(const void __iomem *addr);
20
21#define ioremap_nocache(phy, sz) ioremap(phy, sz)
22#define ioremap_wc(phy, sz) ioremap(phy, sz)
23
24/* Change struct page to physical address */
25#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
26
27#define __raw_readb __raw_readb
28static inline u8 __raw_readb(const volatile void __iomem *addr)
29{
30 u8 b;
31
32 __asm__ __volatile__(
33 " ldb%U1 %0, %1 \n"
34 : "=r" (b)
35 : "m" (*(volatile u8 __force *)addr)
36 : "memory");
37
38 return b;
39}
40
41#define __raw_readw __raw_readw
42static inline u16 __raw_readw(const volatile void __iomem *addr)
43{
44 u16 s;
45
46 __asm__ __volatile__(
47 " ldw%U1 %0, %1 \n"
48 : "=r" (s)
49 : "m" (*(volatile u16 __force *)addr)
50 : "memory");
51
52 return s;
53}
54
55#define __raw_readl __raw_readl
56static inline u32 __raw_readl(const volatile void __iomem *addr)
57{
58 u32 w;
59
60 __asm__ __volatile__(
61 " ld%U1 %0, %1 \n"
62 : "=r" (w)
63 : "m" (*(volatile u32 __force *)addr)
64 : "memory");
65
66 return w;
67}
68
69#define __raw_writeb __raw_writeb
70static inline void __raw_writeb(u8 b, volatile void __iomem *addr)
71{
72 __asm__ __volatile__(
73 " stb%U1 %0, %1 \n"
74 :
75 : "r" (b), "m" (*(volatile u8 __force *)addr)
76 : "memory");
77}
78
79#define __raw_writew __raw_writew
80static inline void __raw_writew(u16 s, volatile void __iomem *addr)
81{
82 __asm__ __volatile__(
83 " stw%U1 %0, %1 \n"
84 :
85 : "r" (s), "m" (*(volatile u16 __force *)addr)
86 : "memory");
87
88}
89
90#define __raw_writel __raw_writel
91static inline void __raw_writel(u32 w, volatile void __iomem *addr)
92{
93 __asm__ __volatile__(
94 " st%U1 %0, %1 \n"
95 :
96 : "r" (w), "m" (*(volatile u32 __force *)addr)
97 : "memory");
98
99}
100
101#include <asm-generic/io.h>
102
103#endif /* _ASM_ARC_IO_H */