diff options
Diffstat (limited to 'include/asm-arm/arch-ixp23xx/io.h')
| -rw-r--r-- | include/asm-arm/arch-ixp23xx/io.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/include/asm-arm/arch-ixp23xx/io.h b/include/asm-arm/arch-ixp23xx/io.h new file mode 100644 index 000000000000..18415a81ac74 --- /dev/null +++ b/include/asm-arm/arch-ixp23xx/io.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | /* | ||
| 2 | * include/asm-arm/arch-ixp23xx/io.h | ||
| 3 | * | ||
| 4 | * Original Author: Naeem M Afzal <naeem.m.afzal@intel.com> | ||
| 5 | * Maintainer: Deepak Saxena <dsaxena@plexity.net> | ||
| 6 | * | ||
| 7 | * Copyright (C) 2003-2005 Intel Corp. | ||
| 8 | * Copyright (C) 2005 MontaVista Software, Inc | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #ifndef __ASM_ARCH_IO_H | ||
| 16 | #define __ASM_ARCH_IO_H | ||
| 17 | |||
| 18 | #define IO_SPACE_LIMIT 0xffffffff | ||
| 19 | |||
| 20 | #define __io(p) ((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT)) | ||
| 21 | #define __mem_pci(a) (a) | ||
| 22 | |||
| 23 | #include <linux/kernel.h> /* For BUG */ | ||
| 24 | |||
| 25 | static inline void __iomem * | ||
| 26 | ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned long flags) | ||
| 27 | { | ||
| 28 | if (addr >= IXP23XX_PCI_MEM_START && | ||
| 29 | addr <= IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE) { | ||
| 30 | if (addr + size > IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE) | ||
| 31 | return NULL; | ||
| 32 | |||
| 33 | return (void __iomem *) | ||
| 34 | ((addr - IXP23XX_PCI_MEM_START) + IXP23XX_PCI_MEM_VIRT); | ||
| 35 | } | ||
| 36 | |||
| 37 | return __ioremap(addr, size, flags); | ||
| 38 | } | ||
| 39 | |||
| 40 | static inline void | ||
| 41 | ixp23xx_iounmap(void __iomem *addr) | ||
| 42 | { | ||
| 43 | if ((((u32)addr) >= IXP23XX_PCI_MEM_VIRT) && | ||
| 44 | (((u32)addr) < IXP23XX_PCI_MEM_VIRT + IXP23XX_PCI_MEM_SIZE)) | ||
| 45 | return; | ||
| 46 | |||
| 47 | __iounmap(addr); | ||
| 48 | } | ||
| 49 | |||
| 50 | #define __arch_ioremap(a,s,f) ixp23xx_ioremap(a,s,f) | ||
| 51 | #define __arch_iounmap(a) ixp23xx_iounmap(a) | ||
| 52 | |||
| 53 | |||
| 54 | #endif | ||
