at32ap700x.h 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. /*
  2. * Pin definitions for AT32AP7000.
  3. *
  4. * Copyright (C) 2006 Atmel Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASM_ARCH_AT32AP700X_H__
  11. #define __ASM_ARCH_AT32AP700X_H__
  12. #define GPIO_PERIPH_A 0
  13. #define GPIO_PERIPH_B 1
  14. /*
  15. * Pin numbers identifying specific GPIO pins on the chip. They can
  16. * also be converted to IRQ numbers by passing them through
  17. * gpio_to_irq().
  18. */
  19. #define GPIO_PIOA_BASE (0)
  20. #define GPIO_PIOB_BASE (GPIO_PIOA_BASE + 32)
  21. #define GPIO_PIOC_BASE (GPIO_PIOB_BASE + 32)
  22. #define GPIO_PIOD_BASE (GPIO_PIOC_BASE + 32)
  23. #define GPIO_PIOE_BASE (GPIO_PIOD_BASE + 32)
  24. #define GPIO_PIN_PA(N) (GPIO_PIOA_BASE + (N))
  25. #define GPIO_PIN_PB(N) (GPIO_PIOB_BASE + (N))
  26. #define GPIO_PIN_PC(N) (GPIO_PIOC_BASE + (N))
  27. #define GPIO_PIN_PD(N) (GPIO_PIOD_BASE + (N))
  28. #define GPIO_PIN_PE(N) (GPIO_PIOE_BASE + (N))
  29. /*
  30. * DMAC peripheral hardware handshaking interfaces, used with dw_dmac
  31. */
  32. #define DMAC_MCI_RX 0
  33. #define DMAC_MCI_TX 1
  34. #define DMAC_DAC_TX 2
  35. #define DMAC_AC97_A_RX 3
  36. #define DMAC_AC97_A_TX 4
  37. #define DMAC_AC97_B_RX 5
  38. #define DMAC_AC97_B_TX 6
  39. #define DMAC_DMAREQ_0 7
  40. #define DMAC_DMAREQ_1 8
  41. #define DMAC_DMAREQ_2 9
  42. #define DMAC_DMAREQ_3 10
  43. /* HSB master IDs */
  44. #define HMATRIX_MASTER_CPU_DCACHE 0
  45. #define HMATRIX_MASTER_CPU_ICACHE 1
  46. #define HMATRIX_MASTER_PDC 2
  47. #define HMATRIX_MASTER_ISI 3
  48. #define HMATRIX_MASTER_USBA 4
  49. #define HMATRIX_MASTER_LCDC 5
  50. #define HMATRIX_MASTER_MACB0 6
  51. #define HMATRIX_MASTER_MACB1 7
  52. #define HMATRIX_MASTER_DMACA_M0 8
  53. #define HMATRIX_MASTER_DMACA_M1 9
  54. /* HSB slave IDs */
  55. #define HMATRIX_SLAVE_SRAM0 0
  56. #define HMATRIX_SLAVE_SRAM1 1
  57. #define HMATRIX_SLAVE_PBA 2
  58. #define HMATRIX_SLAVE_PBB 3
  59. #define HMATRIX_SLAVE_EBI 4
  60. #define HMATRIX_SLAVE_USBA 5
  61. #define HMATRIX_SLAVE_LCDC 6
  62. #define HMATRIX_SLAVE_DMACA 7
  63. /* Bits in HMATRIX SFR4 (EBI) */
  64. #define HMATRIX_EBI_SDRAM_ENABLE (1 << 1)
  65. #define HMATRIX_EBI_NAND_ENABLE (1 << 3)
  66. #define HMATRIX_EBI_CF0_ENABLE (1 << 4)
  67. #define HMATRIX_EBI_CF1_ENABLE (1 << 5)
  68. #define HMATRIX_EBI_PULLUP_DISABLE (1 << 8)
  69. /*
  70. * Base addresses of controllers that may be accessed early by
  71. * platform code.
  72. */
  73. #define PM_BASE 0xfff00000
  74. #define HMATRIX_BASE 0xfff00800
  75. #define SDRAMC_BASE 0xfff03800
  76. /* LCDC on port C */
  77. #define ATMEL_LCDC_PC_CC (1ULL << 19)
  78. #define ATMEL_LCDC_PC_HSYNC (1ULL << 20)
  79. #define ATMEL_LCDC_PC_PCLK (1ULL << 21)
  80. #define ATMEL_LCDC_PC_VSYNC (1ULL << 22)
  81. #define ATMEL_LCDC_PC_DVAL (1ULL << 23)
  82. #define ATMEL_LCDC_PC_MODE (1ULL << 24)
  83. #define ATMEL_LCDC_PC_PWR (1ULL << 25)
  84. #define ATMEL_LCDC_PC_DATA0 (1ULL << 26)
  85. #define ATMEL_LCDC_PC_DATA1 (1ULL << 27)
  86. #define ATMEL_LCDC_PC_DATA2 (1ULL << 28)
  87. #define ATMEL_LCDC_PC_DATA3 (1ULL << 29)
  88. #define ATMEL_LCDC_PC_DATA4 (1ULL << 30)
  89. #define ATMEL_LCDC_PC_DATA5 (1ULL << 31)
  90. /* LCDC on port D */
  91. #define ATMEL_LCDC_PD_DATA6 (1ULL << 0)
  92. #define ATMEL_LCDC_PD_DATA7 (1ULL << 1)
  93. #define ATMEL_LCDC_PD_DATA8 (1ULL << 2)
  94. #define ATMEL_LCDC_PD_DATA9 (1ULL << 3)
  95. #define ATMEL_LCDC_PD_DATA10 (1ULL << 4)
  96. #define ATMEL_LCDC_PD_DATA11 (1ULL << 5)
  97. #define ATMEL_LCDC_PD_DATA12 (1ULL << 6)
  98. #define ATMEL_LCDC_PD_DATA13 (1ULL << 7)
  99. #define ATMEL_LCDC_PD_DATA14 (1ULL << 8)
  100. #define ATMEL_LCDC_PD_DATA15 (1ULL << 9)
  101. #define ATMEL_LCDC_PD_DATA16 (1ULL << 10)
  102. #define ATMEL_LCDC_PD_DATA17 (1ULL << 11)
  103. #define ATMEL_LCDC_PD_DATA18 (1ULL << 12)
  104. #define ATMEL_LCDC_PD_DATA19 (1ULL << 13)
  105. #define ATMEL_LCDC_PD_DATA20 (1ULL << 14)
  106. #define ATMEL_LCDC_PD_DATA21 (1ULL << 15)
  107. #define ATMEL_LCDC_PD_DATA22 (1ULL << 16)
  108. #define ATMEL_LCDC_PD_DATA23 (1ULL << 17)
  109. /* LCDC on port E */
  110. #define ATMEL_LCDC_PE_CC (1ULL << (32 + 0))
  111. #define ATMEL_LCDC_PE_DVAL (1ULL << (32 + 1))
  112. #define ATMEL_LCDC_PE_MODE (1ULL << (32 + 2))
  113. #define ATMEL_LCDC_PE_DATA0 (1ULL << (32 + 3))
  114. #define ATMEL_LCDC_PE_DATA1 (1ULL << (32 + 4))
  115. #define ATMEL_LCDC_PE_DATA2 (1ULL << (32 + 5))
  116. #define ATMEL_LCDC_PE_DATA3 (1ULL << (32 + 6))
  117. #define ATMEL_LCDC_PE_DATA4 (1ULL << (32 + 7))
  118. #define ATMEL_LCDC_PE_DATA8 (1ULL << (32 + 8))
  119. #define ATMEL_LCDC_PE_DATA9 (1ULL << (32 + 9))
  120. #define ATMEL_LCDC_PE_DATA10 (1ULL << (32 + 10))
  121. #define ATMEL_LCDC_PE_DATA11 (1ULL << (32 + 11))
  122. #define ATMEL_LCDC_PE_DATA12 (1ULL << (32 + 12))
  123. #define ATMEL_LCDC_PE_DATA16 (1ULL << (32 + 13))
  124. #define ATMEL_LCDC_PE_DATA17 (1ULL << (32 + 14))
  125. #define ATMEL_LCDC_PE_DATA18 (1ULL << (32 + 15))
  126. #define ATMEL_LCDC_PE_DATA19 (1ULL << (32 + 16))
  127. #define ATMEL_LCDC_PE_DATA20 (1ULL << (32 + 17))
  128. #define ATMEL_LCDC_PE_DATA21 (1ULL << (32 + 18))
  129. #define ATMEL_LCDC(PORT, PIN) (ATMEL_LCDC_##PORT##_##PIN)
  130. #define ATMEL_LCDC_PRI_24B_DATA ( \
  131. ATMEL_LCDC(PC, DATA0) | ATMEL_LCDC(PC, DATA1) | \
  132. ATMEL_LCDC(PC, DATA2) | ATMEL_LCDC(PC, DATA3) | \
  133. ATMEL_LCDC(PC, DATA4) | ATMEL_LCDC(PC, DATA5) | \
  134. ATMEL_LCDC(PD, DATA6) | ATMEL_LCDC(PD, DATA7) | \
  135. ATMEL_LCDC(PD, DATA8) | ATMEL_LCDC(PD, DATA9) | \
  136. ATMEL_LCDC(PD, DATA10) | ATMEL_LCDC(PD, DATA11) | \
  137. ATMEL_LCDC(PD, DATA12) | ATMEL_LCDC(PD, DATA13) | \
  138. ATMEL_LCDC(PD, DATA14) | ATMEL_LCDC(PD, DATA15) | \
  139. ATMEL_LCDC(PD, DATA16) | ATMEL_LCDC(PD, DATA17) | \
  140. ATMEL_LCDC(PD, DATA18) | ATMEL_LCDC(PD, DATA19) | \
  141. ATMEL_LCDC(PD, DATA20) | ATMEL_LCDC(PD, DATA21) | \
  142. ATMEL_LCDC(PD, DATA22) | ATMEL_LCDC(PD, DATA23))
  143. #define ATMEL_LCDC_ALT_24B_DATA ( \
  144. ATMEL_LCDC(PE, DATA0) | ATMEL_LCDC(PE, DATA1) | \
  145. ATMEL_LCDC(PE, DATA2) | ATMEL_LCDC(PE, DATA3) | \
  146. ATMEL_LCDC(PE, DATA4) | ATMEL_LCDC(PC, DATA5) | \
  147. ATMEL_LCDC(PD, DATA6) | ATMEL_LCDC(PD, DATA7) | \
  148. ATMEL_LCDC(PE, DATA8) | ATMEL_LCDC(PE, DATA9) | \
  149. ATMEL_LCDC(PE, DATA10) | ATMEL_LCDC(PE, DATA11) | \
  150. ATMEL_LCDC(PE, DATA12) | ATMEL_LCDC(PD, DATA13) | \
  151. ATMEL_LCDC(PD, DATA14) | ATMEL_LCDC(PD, DATA15) | \
  152. ATMEL_LCDC(PE, DATA16) | ATMEL_LCDC(PE, DATA17) | \
  153. ATMEL_LCDC(PE, DATA18) | ATMEL_LCDC(PE, DATA19) | \
  154. ATMEL_LCDC(PE, DATA20) | ATMEL_LCDC(PE, DATA21) | \
  155. ATMEL_LCDC(PD, DATA22) | ATMEL_LCDC(PD, DATA23))
  156. #define ATMEL_LCDC_PRI_18B_DATA ( \
  157. ATMEL_LCDC(PC, DATA2) | ATMEL_LCDC(PC, DATA3) | \
  158. ATMEL_LCDC(PC, DATA4) | ATMEL_LCDC(PC, DATA5) | \
  159. ATMEL_LCDC(PD, DATA6) | ATMEL_LCDC(PD, DATA7) | \
  160. ATMEL_LCDC(PD, DATA10) | ATMEL_LCDC(PD, DATA11) | \
  161. ATMEL_LCDC(PD, DATA12) | ATMEL_LCDC(PD, DATA13) | \
  162. ATMEL_LCDC(PD, DATA14) | ATMEL_LCDC(PD, DATA15) | \
  163. ATMEL_LCDC(PD, DATA18) | ATMEL_LCDC(PD, DATA19) | \
  164. ATMEL_LCDC(PD, DATA20) | ATMEL_LCDC(PD, DATA21) | \
  165. ATMEL_LCDC(PD, DATA22) | ATMEL_LCDC(PD, DATA23))
  166. #define ATMEL_LCDC_ALT_18B_DATA ( \
  167. ATMEL_LCDC(PE, DATA2) | ATMEL_LCDC(PE, DATA3) | \
  168. ATMEL_LCDC(PE, DATA4) | ATMEL_LCDC(PC, DATA5) | \
  169. ATMEL_LCDC(PD, DATA6) | ATMEL_LCDC(PD, DATA7) | \
  170. ATMEL_LCDC(PE, DATA10) | ATMEL_LCDC(PE, DATA11) | \
  171. ATMEL_LCDC(PE, DATA12) | ATMEL_LCDC(PD, DATA13) | \
  172. ATMEL_LCDC(PD, DATA14) | ATMEL_LCDC(PD, DATA15) | \
  173. ATMEL_LCDC(PE, DATA18) | ATMEL_LCDC(PE, DATA19) | \
  174. ATMEL_LCDC(PE, DATA20) | ATMEL_LCDC(PE, DATA21) | \
  175. ATMEL_LCDC(PD, DATA22) | ATMEL_LCDC(PD, DATA23))
  176. #define ATMEL_LCDC_PRI_15B_DATA ( \
  177. ATMEL_LCDC(PC, DATA3) | ATMEL_LCDC(PC, DATA4) | \
  178. ATMEL_LCDC(PC, DATA5) | ATMEL_LCDC(PD, DATA6) | \
  179. ATMEL_LCDC(PD, DATA7) | \
  180. ATMEL_LCDC(PD, DATA11) | ATMEL_LCDC(PD, DATA12) | \
  181. ATMEL_LCDC(PD, DATA13) | ATMEL_LCDC(PD, DATA14) | \
  182. ATMEL_LCDC(PD, DATA15) | \
  183. ATMEL_LCDC(PD, DATA19) | ATMEL_LCDC(PD, DATA20) | \
  184. ATMEL_LCDC(PD, DATA21) | ATMEL_LCDC(PD, DATA22) | \
  185. ATMEL_LCDC(PD, DATA23))
  186. #define ATMEL_LCDC_ALT_15B_DATA ( \
  187. ATMEL_LCDC(PE, DATA3) | ATMEL_LCDC(PE, DATA4) | \
  188. ATMEL_LCDC(PC, DATA5) | ATMEL_LCDC(PD, DATA6) | \
  189. ATMEL_LCDC(PD, DATA7) | \
  190. ATMEL_LCDC(PE, DATA11) | ATMEL_LCDC(PE, DATA12) | \
  191. ATMEL_LCDC(PD, DATA13) | ATMEL_LCDC(PD, DATA14) | \
  192. ATMEL_LCDC(PD, DATA15) | \
  193. ATMEL_LCDC(PE, DATA19) | ATMEL_LCDC(PE, DATA20) | \
  194. ATMEL_LCDC(PE, DATA21) | ATMEL_LCDC(PD, DATA22) | \
  195. ATMEL_LCDC(PD, DATA23))
  196. #define ATMEL_LCDC_PRI_CONTROL ( \
  197. ATMEL_LCDC(PC, CC) | ATMEL_LCDC(PC, DVAL) | \
  198. ATMEL_LCDC(PC, MODE) | ATMEL_LCDC(PC, PWR))
  199. #define ATMEL_LCDC_ALT_CONTROL ( \
  200. ATMEL_LCDC(PE, CC) | ATMEL_LCDC(PE, DVAL) | \
  201. ATMEL_LCDC(PE, MODE) | ATMEL_LCDC(PC, PWR))
  202. #define ATMEL_LCDC_CONTROL ( \
  203. ATMEL_LCDC(PC, HSYNC) | ATMEL_LCDC(PC, VSYNC) | \
  204. ATMEL_LCDC(PC, PCLK))
  205. #define ATMEL_LCDC_PRI_24BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_PRI_24B_DATA)
  206. #define ATMEL_LCDC_ALT_24BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_24B_DATA)
  207. #define ATMEL_LCDC_PRI_18BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_PRI_18B_DATA)
  208. #define ATMEL_LCDC_ALT_18BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_18B_DATA)
  209. #define ATMEL_LCDC_PRI_15BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_PRI_15B_DATA)
  210. #define ATMEL_LCDC_ALT_15BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_15B_DATA)
  211. /* Bitmask for all EBI data (D16..D31) pins on port E */
  212. #define ATMEL_EBI_PE_DATA_ALL (0x0000FFFF)
  213. #endif /* __ASM_ARCH_AT32AP700X_H__ */