/* * DaVinci IO address definitions * * Copied from include/asm/arm/arch-omap/io.h * * 2007 (c) MontaVista Software, Inc. This file is licensed under * the terms of the GNU General Public License version 2. This program * is licensed "as is" without any warranty of any kind, whether express * or implied. */ #ifndef __ASM_ARCH_IO_H #define __ASM_ARCH_IO_H #include #define IO_SPACE_LIMIT 0xffffffff /* * ---------------------------------------------------------------------------- * I/O mapping * ---------------------------------------------------------------------------- */ #ifndef _DEFINE_IO_MACROS_ #define _DEFINE_IO_MACROS_ #define IO_PHYS 0x01c00000 #define IO_OFFSET 0xfd000000 /* Virtual IO = 0xfec00000 */ #define IO_SIZE 0x00400000 #define IO_VIRT (IO_PHYS + IO_OFFSET) #define io_v2p(va) ((va) - IO_OFFSET) #define __IO_ADDRESS(x) ((x) + IO_OFFSET) #endif /*--- #ifndef _DEFINE_IO_MACROS_ ---*/ /* * We don't actually have real ISA nor PCI buses, but there is so many * drivers out there that might just work if we fake them... */ #ifndef PCIO_BASE #define PCIO_BASE 0 #define __io(a) ((void __iomem *)(PCIO_BASE + (a))) #define __mem_pci(a) (a) #define __mem_isa(a) (a) #endif /*--- #ifndef PCIO_BASE ---*/ #ifndef __mem_pci #error "__mem_pci ist nicht definiert" #endif /*--- #ifndef __mem_pci ---*/ #ifndef IO_ADDRESS #define IO_ADDRESS(pa) IOMEM(__IO_ADDRESS(pa)) #endif /*--- #ifndef IO_ADDRESS ---*/ #ifdef __ASSEMBLER__ #define IOMEM(x) x #else #define IOMEM(x) ((void __force __iomem *)(x)) /* * Functions to access the Puma5 IO region * * NOTE: - Use davinci_read/write[bwl] for physical register addresses * - Use __raw_read/write[bwl]() for virtual register addresses * - Use IO_ADDRESS(phys_addr) to convert registers to virtual addresses * - DO NOT use hardcoded virtual addresses to allow changing the * IO address space again if needed */ #define puma5_readb(a) __raw_readb(IO_ADDRESS(a)) #define puma5_readw(a) __raw_readw(IO_ADDRESS(a)) #define puma5_readl(a) __raw_readl(IO_ADDRESS(a)) #define puma5_writeb(v, a) __raw_writeb(v, IO_ADDRESS(a)) #define puma5_writew(v, a) __raw_writew(v, IO_ADDRESS(a)) #define puma5_writel(v, a) __raw_writel(v, IO_ADDRESS(a)) #endif /* __ASSEMBLER__ */ #endif /* __ASM_ARCH_IO_H */