mx25.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __MACH_MX25_H__
  2. #define __MACH_MX25_H__
  3. #define MX25_AIPS1_BASE_ADDR 0x43F00000
  4. #define MX25_AIPS1_BASE_ADDR_VIRT 0xFC000000
  5. #define MX25_AIPS1_SIZE SZ_1M
  6. #define MX25_AIPS2_BASE_ADDR 0x53F00000
  7. #define MX25_AIPS2_BASE_ADDR_VIRT 0xFC200000
  8. #define MX25_AIPS2_SIZE SZ_1M
  9. #define MX25_AVIC_BASE_ADDR 0x68000000
  10. #define MX25_AVIC_BASE_ADDR_VIRT 0xFC400000
  11. #define MX25_AVIC_SIZE SZ_1M
  12. #define MX25_IOMUXC_BASE_ADDR (MX25_AIPS1_BASE_ADDR + 0xac000)
  13. #define MX25_CRM_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x80000)
  14. #define MX25_GPT1_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0x90000)
  15. #define MX25_WDOG_BASE_ADDR (MX25_AIPS2_BASE_ADDR + 0xdc000)
  16. #define MX25_GPIO1_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0xcc000)
  17. #define MX25_GPIO2_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0xd0000)
  18. #define MX25_GPIO3_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0xa4000)
  19. #define MX25_GPIO4_BASE_ADDR_VIRT (MX25_AIPS2_BASE_ADDR_VIRT + 0x9c000)
  20. #define MX25_AIPS1_IO_ADDRESS(x) \
  21. (((x) - MX25_AIPS1_BASE_ADDR) + MX25_AIPS1_BASE_ADDR_VIRT)
  22. #define MX25_AIPS2_IO_ADDRESS(x) \
  23. (((x) - MX25_AIPS2_BASE_ADDR) + MX25_AIPS2_BASE_ADDR_VIRT)
  24. #define MX25_AVIC_IO_ADDRESS(x) \
  25. (((x) - MX25_AVIC_BASE_ADDR) + MX25_AVIC_BASE_ADDR_VIRT)
  26. #define __in_range(addr, name) ((addr) >= name##_BASE_ADDR && (addr) < name##_BASE_ADDR + name##_SIZE)
  27. #define MX25_IO_ADDRESS(x) \
  28. (void __force __iomem *) \
  29. (__in_range(x, MX25_AIPS1) ? MX25_AIPS1_IO_ADDRESS(x) : \
  30. __in_range(x, MX25_AIPS2) ? MX25_AIPS2_IO_ADDRESS(x) : \
  31. __in_range(x, MX25_AVIC) ? MX25_AVIC_IO_ADDRESS(x) : \
  32. 0xDEADBEEF)
  33. #define UART1_BASE_ADDR 0x43f90000
  34. #define UART2_BASE_ADDR 0x43f94000
  35. #endif /* __MACH_MX25_H__ */