2 * DaVinci IO address definitions
4 * Copied from include/asm/arm/arch-omap/io.h
6 * 2007 (c) MontaVista Software, Inc. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
11 #ifndef __ASM_ARCH_IO_H
12 #define __ASM_ARCH_IO_H
14 #define IO_SPACE_LIMIT 0xffffffff
17 * ----------------------------------------------------------------------------
19 * ----------------------------------------------------------------------------
21 #define IO_PHYS 0x01c00000
22 #define IO_OFFSET 0xfd000000 /* Virtual IO = 0xfec00000 */
23 #define IO_SIZE 0x00400000
24 #define IO_VIRT (IO_PHYS + IO_OFFSET)
25 #define io_v2p(va) ((va) - IO_OFFSET)
26 #define __IO_ADDRESS(x) ((x) + IO_OFFSET)
29 * We don't actually have real ISA nor PCI buses, but there is so many
30 * drivers out there that might just work if we fake them...
32 #define __io(a) __typesafe_io(a)
33 #define __mem_pci(a) (a)
34 #define __mem_isa(a) (a)
36 #define IO_ADDRESS(pa) IOMEM(__IO_ADDRESS(pa))
41 #define IOMEM(x) ((void __force __iomem *)(x))
44 * Functions to access the DaVinci IO region
46 * NOTE: - Use davinci_read/write[bwl] for physical register addresses
47 * - Use __raw_read/write[bwl]() for virtual register addresses
48 * - Use IO_ADDRESS(phys_addr) to convert registers to virtual addresses
49 * - DO NOT use hardcoded virtual addresses to allow changing the
50 * IO address space again if needed
52 #define davinci_readb(a) __raw_readb(IO_ADDRESS(a))
53 #define davinci_readw(a) __raw_readw(IO_ADDRESS(a))
54 #define davinci_readl(a) __raw_readl(IO_ADDRESS(a))
56 #define davinci_writeb(v, a) __raw_writeb(v, IO_ADDRESS(a))
57 #define davinci_writew(v, a) __raw_writew(v, IO_ADDRESS(a))
58 #define davinci_writel(v, a) __raw_writel(v, IO_ADDRESS(a))
60 #endif /* __ASSEMBLER__ */
61 #endif /* __ASM_ARCH_IO_H */