2 * linux/include/asm-arm/arch-nexuspci/io.h
4 * Copyright (C) 1997-1999 Russell King
5 * Copyright (C) 2000 FutureTV Labs Ltd.
7 #ifndef __ASM_ARM_ARCH_IO_H
8 #define __ASM_ARM_ARCH_IO_H
10 #define IO_SPACE_LIMIT 0xffff
13 * Translation of various region addresses to virtual addresses
15 #define __io(a) (PCIO_BASE + (a))
17 #define __mem_pci(a) ((unsigned long)(a))
18 #define __mem_isa(a) (PCIMEM_BASE + (unsigned long)(a))
21 static inline unsigned long ___mem_pci(unsigned long a)
23 /* PCI addresses must have been ioremapped */
24 if (a <= 0xc0000000 || a >= 0xe0000000)
29 static inline unsigned long ___mem_isa(unsigned long a)
31 BUG_ON(a >= 16*1048576);
32 return PCIMEM_BASE + a;
34 #define __mem_pci(a) ___mem_pci((unsigned long)(a))
35 #define __mem_isa(a) ___mem_isa((unsigned long)(a))
39 * ioremap support - validate a PCI memory address,
40 * and convert a PCI memory address to a physical
41 * address for the page tables.
43 #define iomem_valid_addr(iomem,sz) \
44 ((iomem) < 0x80000000 && (iomem) + (sz) <= 0x80000000)
45 #define iomem_to_phys(iomem) ((iomem) + PLX_MEM_START)
47 #define __arch_ioremap(off,sz,nocache) \
49 unsigned long _off = (off), _size = (sz); \
50 void *_ret = (void *)0; \
51 if (iomem_valid_addr(_off, _size)) \
52 _ret = __ioremap(iomem_to_phys(_off),_size,0); \
56 #define __arch_iounmap __iounmap