mxc.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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_H__
  10. #define __ASM_ARCH_MXC_H__
  11. #ifndef __ASM_ARCH_MXC_HARDWARE_H__
  12. #error "Do not include directly."
  13. #endif
  14. /*
  15. *****************************************
  16. * GPT Register definitions *
  17. *****************************************
  18. */
  19. #define MXC_GPT_GPTCR IO_ADDRESS(GPT1_BASE_ADDR + 0x00)
  20. #define MXC_GPT_GPTPR IO_ADDRESS(GPT1_BASE_ADDR + 0x04)
  21. #define MXC_GPT_GPTSR IO_ADDRESS(GPT1_BASE_ADDR + 0x08)
  22. #define MXC_GPT_GPTIR IO_ADDRESS(GPT1_BASE_ADDR + 0x0C)
  23. #define MXC_GPT_GPTOCR1 IO_ADDRESS(GPT1_BASE_ADDR + 0x10)
  24. #define MXC_GPT_GPTOCR2 IO_ADDRESS(GPT1_BASE_ADDR + 0x14)
  25. #define MXC_GPT_GPTOCR3 IO_ADDRESS(GPT1_BASE_ADDR + 0x18)
  26. #define MXC_GPT_GPTICR1 IO_ADDRESS(GPT1_BASE_ADDR + 0x1C)
  27. #define MXC_GPT_GPTICR2 IO_ADDRESS(GPT1_BASE_ADDR + 0x20)
  28. #define MXC_GPT_GPTCNT IO_ADDRESS(GPT1_BASE_ADDR + 0x24)
  29. /*!
  30. * GPT Control register bit definitions
  31. */
  32. #define GPTCR_FO3 (1 << 31)
  33. #define GPTCR_FO2 (1 << 30)
  34. #define GPTCR_FO1 (1 << 29)
  35. #define GPTCR_OM3_SHIFT 26
  36. #define GPTCR_OM3_MASK (7 << GPTCR_OM3_SHIFT)
  37. #define GPTCR_OM3_DISCONNECTED (0 << GPTCR_OM3_SHIFT)
  38. #define GPTCR_OM3_TOGGLE (1 << GPTCR_OM3_SHIFT)
  39. #define GPTCR_OM3_CLEAR (2 << GPTCR_OM3_SHIFT)
  40. #define GPTCR_OM3_SET (3 << GPTCR_OM3_SHIFT)
  41. #define GPTCR_OM3_GENERATE_LOW (7 << GPTCR_OM3_SHIFT)
  42. #define GPTCR_OM2_SHIFT 23
  43. #define GPTCR_OM2_MASK (7 << GPTCR_OM2_SHIFT)
  44. #define GPTCR_OM2_DISCONNECTED (0 << GPTCR_OM2_SHIFT)
  45. #define GPTCR_OM2_TOGGLE (1 << GPTCR_OM2_SHIFT)
  46. #define GPTCR_OM2_CLEAR (2 << GPTCR_OM2_SHIFT)
  47. #define GPTCR_OM2_SET (3 << GPTCR_OM2_SHIFT)
  48. #define GPTCR_OM2_GENERATE_LOW (7 << GPTCR_OM2_SHIFT)
  49. #define GPTCR_OM1_SHIFT 20
  50. #define GPTCR_OM1_MASK (7 << GPTCR_OM1_SHIFT)
  51. #define GPTCR_OM1_DISCONNECTED (0 << GPTCR_OM1_SHIFT)
  52. #define GPTCR_OM1_TOGGLE (1 << GPTCR_OM1_SHIFT)
  53. #define GPTCR_OM1_CLEAR (2 << GPTCR_OM1_SHIFT)
  54. #define GPTCR_OM1_SET (3 << GPTCR_OM1_SHIFT)
  55. #define GPTCR_OM1_GENERATE_LOW (7 << GPTCR_OM1_SHIFT)
  56. #define GPTCR_IM2_SHIFT 18
  57. #define GPTCR_IM2_MASK (3 << GPTCR_IM2_SHIFT)
  58. #define GPTCR_IM2_CAPTURE_DISABLE (0 << GPTCR_IM2_SHIFT)
  59. #define GPTCR_IM2_CAPTURE_RISING (1 << GPTCR_IM2_SHIFT)
  60. #define GPTCR_IM2_CAPTURE_FALLING (2 << GPTCR_IM2_SHIFT)
  61. #define GPTCR_IM2_CAPTURE_BOTH (3 << GPTCR_IM2_SHIFT)
  62. #define GPTCR_IM1_SHIFT 16
  63. #define GPTCR_IM1_MASK (3 << GPTCR_IM1_SHIFT)
  64. #define GPTCR_IM1_CAPTURE_DISABLE (0 << GPTCR_IM1_SHIFT)
  65. #define GPTCR_IM1_CAPTURE_RISING (1 << GPTCR_IM1_SHIFT)
  66. #define GPTCR_IM1_CAPTURE_FALLING (2 << GPTCR_IM1_SHIFT)
  67. #define GPTCR_IM1_CAPTURE_BOTH (3 << GPTCR_IM1_SHIFT)
  68. #define GPTCR_SWR (1 << 15)
  69. #define GPTCR_FRR (1 << 9)
  70. #define GPTCR_CLKSRC_SHIFT 6
  71. #define GPTCR_CLKSRC_MASK (7 << GPTCR_CLKSRC_SHIFT)
  72. #define GPTCR_CLKSRC_NOCLOCK (0 << GPTCR_CLKSRC_SHIFT)
  73. #define GPTCR_CLKSRC_HIGHFREQ (2 << GPTCR_CLKSRC_SHIFT)
  74. #define GPTCR_CLKSRC_CLKIN (3 << GPTCR_CLKSRC_SHIFT)
  75. #define GPTCR_CLKSRC_CLK32K (7 << GPTCR_CLKSRC_SHIFT)
  76. #define GPTCR_STOPEN (1 << 5)
  77. #define GPTCR_DOZEN (1 << 4)
  78. #define GPTCR_WAITEN (1 << 3)
  79. #define GPTCR_DBGEN (1 << 2)
  80. #define GPTCR_ENMOD (1 << 1)
  81. #define GPTCR_ENABLE (1 << 0)
  82. #define GPTSR_OF1 (1 << 0)
  83. #define GPTSR_OF2 (1 << 1)
  84. #define GPTSR_OF3 (1 << 2)
  85. #define GPTSR_IF1 (1 << 3)
  86. #define GPTSR_IF2 (1 << 4)
  87. #define GPTSR_ROV (1 << 5)
  88. #define GPTIR_OF1IE GPTSR_OF1
  89. #define GPTIR_OF2IE GPTSR_OF2
  90. #define GPTIR_OF3IE GPTSR_OF3
  91. #define GPTIR_IF1IE GPTSR_IF1
  92. #define GPTIR_IF2IE GPTSR_IF2
  93. #define GPTIR_ROVIE GPTSR_ROV
  94. /*
  95. *****************************************
  96. * AVIC Registers *
  97. *****************************************
  98. */
  99. #define AVIC_BASE IO_ADDRESS(AVIC_BASE_ADDR)
  100. #define AVIC_INTCNTL (AVIC_BASE + 0x00) /* int control reg */
  101. #define AVIC_NIMASK (AVIC_BASE + 0x04) /* int mask reg */
  102. #define AVIC_INTENNUM (AVIC_BASE + 0x08) /* int enable number reg */
  103. #define AVIC_INTDISNUM (AVIC_BASE + 0x0C) /* int disable number reg */
  104. #define AVIC_INTENABLEH (AVIC_BASE + 0x10) /* int enable reg high */
  105. #define AVIC_INTENABLEL (AVIC_BASE + 0x14) /* int enable reg low */
  106. #define AVIC_INTTYPEH (AVIC_BASE + 0x18) /* int type reg high */
  107. #define AVIC_INTTYPEL (AVIC_BASE + 0x1C) /* int type reg low */
  108. #define AVIC_NIPRIORITY7 (AVIC_BASE + 0x20) /* norm int priority lvl7 */
  109. #define AVIC_NIPRIORITY6 (AVIC_BASE + 0x24) /* norm int priority lvl6 */
  110. #define AVIC_NIPRIORITY5 (AVIC_BASE + 0x28) /* norm int priority lvl5 */
  111. #define AVIC_NIPRIORITY4 (AVIC_BASE + 0x2C) /* norm int priority lvl4 */
  112. #define AVIC_NIPRIORITY3 (AVIC_BASE + 0x30) /* norm int priority lvl3 */
  113. #define AVIC_NIPRIORITY2 (AVIC_BASE + 0x34) /* norm int priority lvl2 */
  114. #define AVIC_NIPRIORITY1 (AVIC_BASE + 0x38) /* norm int priority lvl1 */
  115. #define AVIC_NIPRIORITY0 (AVIC_BASE + 0x3C) /* norm int priority lvl0 */
  116. #define AVIC_NIVECSR (AVIC_BASE + 0x40) /* norm int vector/status */
  117. #define AVIC_FIVECSR (AVIC_BASE + 0x44) /* fast int vector/status */
  118. #define AVIC_INTSRCH (AVIC_BASE + 0x48) /* int source reg high */
  119. #define AVIC_INTSRCL (AVIC_BASE + 0x4C) /* int source reg low */
  120. #define AVIC_INTFRCH (AVIC_BASE + 0x50) /* int force reg high */
  121. #define AVIC_INTFRCL (AVIC_BASE + 0x54) /* int force reg low */
  122. #define AVIC_NIPNDH (AVIC_BASE + 0x58) /* norm int pending high */
  123. #define AVIC_NIPNDL (AVIC_BASE + 0x5C) /* norm int pending low */
  124. #define AVIC_FIPNDH (AVIC_BASE + 0x60) /* fast int pending high */
  125. #define AVIC_FIPNDL (AVIC_BASE + 0x64) /* fast int pending low */
  126. #define SYSTEM_PREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x20)
  127. #define SYSTEM_SREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x24)
  128. #define IIM_PROD_REV_SH 3
  129. #define IIM_PROD_REV_LEN 5
  130. #endif /* __ASM_ARCH_MXC_H__ */