1
2
3
4 #ifndef __ASM_CSKY_IO_H
5 #define __ASM_CSKY_IO_H
6
7 #include <asm/pgtable.h>
8 #include <linux/types.h>
9 #include <linux/version.h>
10
11
12
13
14
15
16
17
18
19
20
21
22 #define readb(c) ({ u8 __v = readb_relaxed(c); rmb(); __v; })
23 #define readw(c) ({ u16 __v = readw_relaxed(c); rmb(); __v; })
24 #define readl(c) ({ u32 __v = readl_relaxed(c); rmb(); __v; })
25
26 #ifdef CONFIG_CPU_HAS_CACHEV2
27 #define writeb(v,c) ({ wmb(); writeb_relaxed((v),(c)); })
28 #define writew(v,c) ({ wmb(); writew_relaxed((v),(c)); })
29 #define writel(v,c) ({ wmb(); writel_relaxed((v),(c)); })
30 #else
31 #define writeb(v,c) ({ wmb(); writeb_relaxed((v),(c)); mb(); })
32 #define writew(v,c) ({ wmb(); writew_relaxed((v),(c)); mb(); })
33 #define writel(v,c) ({ wmb(); writel_relaxed((v),(c)); mb(); })
34 #endif
35
36
37
38
39 extern void __iomem *ioremap_cache(phys_addr_t addr, size_t size);
40 extern void __iomem *__ioremap(phys_addr_t addr, size_t size, pgprot_t prot);
41 extern void iounmap(void *addr);
42
43 #define ioremap(addr, size) __ioremap((addr), (size), pgprot_noncached(PAGE_KERNEL))
44 #define ioremap_wc(addr, size) __ioremap((addr), (size), pgprot_writecombine(PAGE_KERNEL))
45 #define ioremap_nocache(addr, size) ioremap((addr), (size))
46 #define ioremap_cache ioremap_cache
47
48 #include <asm-generic/io.h>
49
50 #endif