io.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright 2004-2007 Freescale Semiconductor, Inc. All Rights Reserved.
  3. */
  4. /*
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #ifndef __ASM_ARCH_MXC_IO_H__
  10. #define __ASM_ARCH_MXC_IO_H__
  11. /* Allow IO space to be anywhere in the memory */
  12. #define IO_SPACE_LIMIT 0xffffffff
  13. #ifdef CONFIG_ARCH_MX3
  14. #define __arch_ioremap __mx3_ioremap
  15. #define __arch_iounmap __iounmap
  16. static inline void __iomem *
  17. __mx3_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
  18. {
  19. if (mtype == MT_DEVICE) {
  20. /* Access all peripherals below 0x80000000 as nonshared device
  21. * but leave l2cc alone.
  22. */
  23. if ((phys_addr < 0x80000000) && ((phys_addr < 0x30000000) ||
  24. (phys_addr >= 0x30000000 + SZ_1M)))
  25. mtype = MT_DEVICE_NONSHARED;
  26. }
  27. return __arm_ioremap(phys_addr, size, mtype);
  28. }
  29. #endif
  30. /* io address mapping macro */
  31. #define __io(a) __typesafe_io(a)
  32. #define __mem_pci(a) (a)
  33. #endif