4 #include <asm/page.h> /* for __va, __pa */
5 #include <asm/arch/io.h>
8 * Change virtual addresses to physical addresses and vv.
11 extern inline unsigned long virt_to_phys(volatile void * address)
16 extern inline void * phys_to_virt(unsigned long address)
21 extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
23 extern inline void * ioremap (unsigned long offset, unsigned long size)
25 return __ioremap(offset, size, 0);
28 extern void iounmap(void *addr);
31 * IO bus memory addresses are also 1:1 with the physical address
33 #define virt_to_bus virt_to_phys
34 #define bus_to_virt phys_to_virt
37 * readX/writeX() are used to access memory mapped devices. On some
38 * architectures the memory mapped IO stuff needs to be accessed
39 * differently. On the CRIS architecture, we just read/write the
40 * memory location directly.
42 #define readb(addr) (*(volatile unsigned char *) (addr))
43 #define readw(addr) (*(volatile unsigned short *) (addr))
44 #define readl(addr) (*(volatile unsigned int *) (addr))
45 #define readb_relaxed(addr) readb(addr)
46 #define readw_relaxed(addr) readw(addr)
47 #define readl_relaxed(addr) readl(addr)
48 #define __raw_readb readb
49 #define __raw_readw readw
50 #define __raw_readl readl
52 #define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b))
53 #define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b))
54 #define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b))
55 #define __raw_writeb writeb
56 #define __raw_writew writew
57 #define __raw_writel writel
61 #define memset_io(a,b,c) memset((void *)(a),(b),(c))
62 #define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
63 #define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
66 * Again, CRIS does not require mem IO specific function.
69 #define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void *)(b),(c),(d))
71 /* The following is junk needed for the arch-independent code but which
72 * we never use in the CRIS port
75 #define IO_SPACE_LIMIT 0xffff
90 * Convert a physical pointer to a virtual kernel pointer for /dev/mem
93 #define xlate_dev_mem_ptr(p) __va(p)
96 * Convert a virtual cached pointer to an uncached pointer
98 #define xlate_dev_kmem_ptr(p) p