io.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * arch/arm/mach-ixp23xx/include/mach/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. #ifndef __ASM_ARCH_IO_H
  15. #define __ASM_ARCH_IO_H
  16. #define IO_SPACE_LIMIT 0xffffffff
  17. #define __io(p) ((void __iomem*)((p) + IXP23XX_PCI_IO_VIRT))
  18. #define __mem_pci(a) (a)
  19. static inline void __iomem *
  20. ixp23xx_ioremap(unsigned long addr, unsigned long size, unsigned int mtype)
  21. {
  22. if (addr >= IXP23XX_PCI_MEM_START &&
  23. addr <= IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE) {
  24. if (addr + size > IXP23XX_PCI_MEM_START + IXP23XX_PCI_MEM_SIZE)
  25. return NULL;
  26. return (void __iomem *)
  27. ((addr - IXP23XX_PCI_MEM_START) + IXP23XX_PCI_MEM_VIRT);
  28. }
  29. return __arm_ioremap(addr, size, mtype);
  30. }
  31. static inline void
  32. ixp23xx_iounmap(void __iomem *addr)
  33. {
  34. if ((((u32)addr) >= IXP23XX_PCI_MEM_VIRT) &&
  35. (((u32)addr) < IXP23XX_PCI_MEM_VIRT + IXP23XX_PCI_MEM_SIZE))
  36. return;
  37. __iounmap(addr);
  38. }
  39. #define __arch_ioremap(a,s,f) ixp23xx_ioremap(a,s,f)
  40. #define __arch_iounmap(a) ixp23xx_iounmap(a)
  41. #endif