mfp-pxa25x.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __ASM_ARCH_MFP_PXA25X_H
  3. #define __ASM_ARCH_MFP_PXA25X_H
  4. #include "mfp-pxa2xx.h"
  5. /* GPIO */
  6. #define GPIO2_GPIO MFP_CFG_IN(GPIO2, AF0)
  7. #define GPIO3_GPIO MFP_CFG_IN(GPIO3, AF0)
  8. #define GPIO4_GPIO MFP_CFG_IN(GPIO4, AF0)
  9. #define GPIO5_GPIO MFP_CFG_IN(GPIO5, AF0)
  10. #define GPIO6_GPIO MFP_CFG_IN(GPIO6, AF0)
  11. #define GPIO7_GPIO MFP_CFG_IN(GPIO7, AF0)
  12. #define GPIO8_GPIO MFP_CFG_IN(GPIO8, AF0)
  13. #define GPIO1_RST MFP_CFG_IN(GPIO1, AF1)
  14. /* Crystal and Clock Signals */
  15. #define GPIO10_RTCCLK MFP_CFG_OUT(GPIO10, AF1, DRIVE_LOW)
  16. #define GPIO70_RTCCLK MFP_CFG_OUT(GPIO70, AF1, DRIVE_LOW)
  17. #define GPIO7_48MHz MFP_CFG_OUT(GPIO7, AF1, DRIVE_LOW)
  18. #define GPIO11_3_6MHz MFP_CFG_OUT(GPIO11, AF1, DRIVE_LOW)
  19. #define GPIO71_3_6MHz MFP_CFG_OUT(GPIO71, AF1, DRIVE_LOW)
  20. #define GPIO12_32KHz MFP_CFG_OUT(GPIO12, AF1, DRIVE_LOW)
  21. #define GPIO72_32kHz MFP_CFG_OUT(GPIO72, AF1, DRIVE_LOW)
  22. /* SDRAM and Static Memory I/O Signals */
  23. #define GPIO15_nCS_1 MFP_CFG_OUT(GPIO15, AF2, DRIVE_HIGH)
  24. #define GPIO78_nCS_2 MFP_CFG_OUT(GPIO78, AF2, DRIVE_HIGH)
  25. #define GPIO79_nCS_3 MFP_CFG_OUT(GPIO79, AF2, DRIVE_HIGH)
  26. #define GPIO80_nCS_4 MFP_CFG_OUT(GPIO80, AF2, DRIVE_HIGH)
  27. #define GPIO33_nCS_5 MFP_CFG_OUT(GPIO33, AF2, DRIVE_HIGH)
  28. /* Miscellaneous I/O and DMA Signals */
  29. #define GPIO18_RDY MFP_CFG_IN(GPIO18, AF1)
  30. #define GPIO20_DREQ_0 MFP_CFG_IN(GPIO20, AF1)
  31. #define GPIO19_DREQ_1 MFP_CFG_IN(GPIO19, AF1)
  32. /* Alternate Bus Master Mode I/O Signals */
  33. #define GPIO13_MBGNT MFP_CFG_OUT(GPIO13, AF2, DRIVE_LOW)
  34. #define GPIO73_MBGNT MFP_CFG_OUT(GPIO73, AF1, DRIVE_LOW)
  35. #define GPIO14_MBREQ MFP_CFG_IN(GPIO14, AF1)
  36. #define GPIO66_MBREQ MFP_CFG_IN(GPIO66, AF1)
  37. /* PC CARD */
  38. #define GPIO52_nPCE_1 MFP_CFG_OUT(GPIO52, AF2, DRIVE_HIGH)
  39. #define GPIO53_nPCE_2 MFP_CFG_OUT(GPIO53, AF2, DRIVE_HIGH)
  40. #define GPIO55_nPREG MFP_CFG_OUT(GPIO55, AF2, DRIVE_HIGH)
  41. #define GPIO50_nPIOR MFP_CFG_OUT(GPIO50, AF2, DRIVE_HIGH)
  42. #define GPIO51_nPIOW MFP_CFG_OUT(GPIO51, AF2, DRIVE_HIGH)
  43. #define GPIO49_nPWE MFP_CFG_OUT(GPIO49, AF2, DRIVE_HIGH)
  44. #define GPIO48_nPOE MFP_CFG_OUT(GPIO48, AF2, DRIVE_HIGH)
  45. #define GPIO57_nIOIS16 MFP_CFG_IN(GPIO57, AF1)
  46. #define GPIO56_nPWAIT MFP_CFG_IN(GPIO56, AF1)
  47. #define GPIO54_nPSKTSEL MFP_CFG_OUT(GPIO54, AF2, DRIVE_HIGH)
  48. /* FFUART */
  49. #define GPIO34_FFUART_RXD MFP_CFG_IN(GPIO34, AF1)
  50. #define GPIO35_FFUART_CTS MFP_CFG_IN(GPIO35, AF1)
  51. #define GPIO36_FFUART_DCD MFP_CFG_IN(GPIO36, AF1)
  52. #define GPIO37_FFUART_DSR MFP_CFG_IN(GPIO37, AF1)
  53. #define GPIO38_FFUART_RI MFP_CFG_IN(GPIO38, AF1)
  54. #define GPIO39_FFUART_TXD MFP_CFG_OUT(GPIO39, AF2, DRIVE_HIGH)
  55. #define GPIO40_FFUART_DTR MFP_CFG_OUT(GPIO40, AF2, DRIVE_HIGH)
  56. #define GPIO41_FFUART_RTS MFP_CFG_OUT(GPIO41, AF2, DRIVE_HIGH)
  57. /* BTUART */
  58. #define GPIO42_BTUART_RXD MFP_CFG_IN(GPIO42, AF1)
  59. #define GPIO43_BTUART_TXD MFP_CFG_OUT(GPIO43, AF2, DRIVE_HIGH)
  60. #define GPIO44_BTUART_CTS MFP_CFG_IN(GPIO44, AF1)
  61. #define GPIO45_BTUART_RTS MFP_CFG_OUT(GPIO45, AF2, DRIVE_HIGH)
  62. /* STUART */
  63. #define GPIO46_STUART_RXD MFP_CFG_IN(GPIO46, AF2)
  64. #define GPIO47_STUART_TXD MFP_CFG_OUT(GPIO47, AF1, DRIVE_HIGH)
  65. /* HWUART */
  66. #define GPIO42_HWUART_RXD MFP_CFG_IN(GPIO42, AF3)
  67. #define GPIO43_HWUART_TXD MFP_CFG_OUT(GPIO43, AF3, DRIVE_HIGH)
  68. #define GPIO44_HWUART_CTS MFP_CFG_IN(GPIO44, AF3)
  69. #define GPIO45_HWUART_RTS MFP_CFG_OUT(GPIO45, AF3, DRIVE_HIGH)
  70. #define GPIO48_HWUART_TXD MFP_CFG_OUT(GPIO48, AF1, DRIVE_HIGH)
  71. #define GPIO49_HWUART_RXD MFP_CFG_IN(GPIO49, AF1)
  72. #define GPIO50_HWUART_CTS MFP_CFG_IN(GPIO50, AF1)
  73. #define GPIO51_HWUART_RTS MFP_CFG_OUT(GPIO51, AF1, DRIVE_HIGH)
  74. /* FICP */
  75. #define GPIO46_FICP_RXD MFP_CFG_IN(GPIO46, AF1)
  76. #define GPIO47_FICP_TXD MFP_CFG_OUT(GPIO47, AF2, DRIVE_HIGH)
  77. /* PWM 0/1 */
  78. #define GPIO16_PWM0_OUT MFP_CFG_OUT(GPIO16, AF2, DRIVE_LOW)
  79. #define GPIO17_PWM1_OUT MFP_CFG_OUT(GPIO17, AF2, DRIVE_LOW)
  80. /* AC97 */
  81. #define GPIO28_AC97_BITCLK MFP_CFG_IN(GPIO28, AF1)
  82. #define GPIO29_AC97_SDATA_IN_0 MFP_CFG_IN(GPIO29, AF1)
  83. #define GPIO30_AC97_SDATA_OUT MFP_CFG_OUT(GPIO30, AF2, DRIVE_LOW)
  84. #define GPIO31_AC97_SYNC MFP_CFG_OUT(GPIO31, AF2, DRIVE_LOW)
  85. #define GPIO32_AC97_SDATA_IN_1 MFP_CFG_IN(GPIO32, AF1)
  86. /* I2S */
  87. #define GPIO28_I2S_BITCLK_IN MFP_CFG_IN(GPIO28, AF2)
  88. #define GPIO28_I2S_BITCLK_OUT MFP_CFG_OUT(GPIO28, AF1, DRIVE_LOW)
  89. #define GPIO29_I2S_SDATA_IN MFP_CFG_IN(GPIO29, AF2)
  90. #define GPIO30_I2S_SDATA_OUT MFP_CFG_OUT(GPIO30, AF1, DRIVE_LOW)
  91. #define GPIO31_I2S_SYNC MFP_CFG_OUT(GPIO31, AF1, DRIVE_LOW)
  92. #define GPIO32_I2S_SYSCLK MFP_CFG_OUT(GPIO32, AF1, DRIVE_LOW)
  93. /* SSP 1 */
  94. #define GPIO23_SSP1_SCLK MFP_CFG_OUT(GPIO23, AF2, DRIVE_LOW)
  95. #define GPIO24_SSP1_SFRM MFP_CFG_OUT(GPIO24, AF2, DRIVE_LOW)
  96. #define GPIO25_SSP1_TXD MFP_CFG_OUT(GPIO25, AF2, DRIVE_LOW)
  97. #define GPIO26_SSP1_RXD MFP_CFG_IN(GPIO26, AF1)
  98. #define GPIO27_SSP1_EXTCLK MFP_CFG_IN(GPIO27, AF1)
  99. /* SSP 2 - NSSP */
  100. #define GPIO81_SSP2_CLK_OUT MFP_CFG_OUT(GPIO81, AF1, DRIVE_LOW)
  101. #define GPIO81_SSP2_CLK_IN MFP_CFG_IN(GPIO81, AF1)
  102. #define GPIO82_SSP2_FRM_OUT MFP_CFG_OUT(GPIO82, AF1, DRIVE_LOW)
  103. #define GPIO82_SSP2_FRM_IN MFP_CFG_IN(GPIO82, AF1)
  104. #define GPIO83_SSP2_TXD MFP_CFG_OUT(GPIO83, AF1, DRIVE_LOW)
  105. #define GPIO83_SSP2_RXD MFP_CFG_IN(GPIO83, AF2)
  106. #define GPIO84_SSP2_TXD MFP_CFG_OUT(GPIO84, AF1, DRIVE_LOW)
  107. #define GPIO84_SSP2_RXD MFP_CFG_IN(GPIO84, AF2)
  108. /* MMC */
  109. #define GPIO6_MMC_CLK MFP_CFG_OUT(GPIO6, AF1, DRIVE_LOW)
  110. #define GPIO8_MMC_CS0 MFP_CFG_OUT(GPIO8, AF1, DRIVE_LOW)
  111. #define GPIO9_MMC_CS1 MFP_CFG_OUT(GPIO9, AF1, DRIVE_LOW)
  112. #define GPIO34_MMC_CS0 MFP_CFG_OUT(GPIO34, AF2, DRIVE_LOW)
  113. #define GPIO39_MMC_CS1 MFP_CFG_OUT(GPIO39, AF1, DRIVE_LOW)
  114. #define GPIO53_MMC_CLK MFP_CFG_OUT(GPIO53, AF1, DRIVE_LOW)
  115. #define GPIO54_MMC_CLK MFP_CFG_OUT(GPIO54, AF1, DRIVE_LOW)
  116. #define GPIO69_MMC_CLK MFP_CFG_OUT(GPIO69, AF1, DRIVE_LOW)
  117. #define GPIO67_MMC_CS0 MFP_CFG_OUT(GPIO67, AF1, DRIVE_LOW)
  118. #define GPIO68_MMC_CS1 MFP_CFG_OUT(GPIO68, AF1, DRIVE_LOW)
  119. /* LCD */
  120. #define GPIO58_LCD_LDD_0 MFP_CFG_OUT(GPIO58, AF2, DRIVE_LOW)
  121. #define GPIO59_LCD_LDD_1 MFP_CFG_OUT(GPIO59, AF2, DRIVE_LOW)
  122. #define GPIO60_LCD_LDD_2 MFP_CFG_OUT(GPIO60, AF2, DRIVE_LOW)
  123. #define GPIO61_LCD_LDD_3 MFP_CFG_OUT(GPIO61, AF2, DRIVE_LOW)
  124. #define GPIO62_LCD_LDD_4 MFP_CFG_OUT(GPIO62, AF2, DRIVE_LOW)
  125. #define GPIO63_LCD_LDD_5 MFP_CFG_OUT(GPIO63, AF2, DRIVE_LOW)
  126. #define GPIO64_LCD_LDD_6 MFP_CFG_OUT(GPIO64, AF2, DRIVE_LOW)
  127. #define GPIO65_LCD_LDD_7 MFP_CFG_OUT(GPIO65, AF2, DRIVE_LOW)
  128. #define GPIO66_LCD_LDD_8 MFP_CFG_OUT(GPIO66, AF2, DRIVE_LOW)
  129. #define GPIO67_LCD_LDD_9 MFP_CFG_OUT(GPIO67, AF2, DRIVE_LOW)
  130. #define GPIO68_LCD_LDD_10 MFP_CFG_OUT(GPIO68, AF2, DRIVE_LOW)
  131. #define GPIO69_LCD_LDD_11 MFP_CFG_OUT(GPIO69, AF2, DRIVE_LOW)
  132. #define GPIO70_LCD_LDD_12 MFP_CFG_OUT(GPIO70, AF2, DRIVE_LOW)
  133. #define GPIO71_LCD_LDD_13 MFP_CFG_OUT(GPIO71, AF2, DRIVE_LOW)
  134. #define GPIO72_LCD_LDD_14 MFP_CFG_OUT(GPIO72, AF2, DRIVE_LOW)
  135. #define GPIO73_LCD_LDD_15 MFP_CFG_OUT(GPIO73, AF2, DRIVE_LOW)
  136. #define GPIO74_LCD_FCLK MFP_CFG_OUT(GPIO74, AF2, DRIVE_LOW)
  137. #define GPIO75_LCD_LCLK MFP_CFG_OUT(GPIO75, AF2, DRIVE_LOW)
  138. #define GPIO76_LCD_PCLK MFP_CFG_OUT(GPIO76, AF2, DRIVE_LOW)
  139. #define GPIO77_LCD_BIAS MFP_CFG_OUT(GPIO77, AF2, DRIVE_LOW)
  140. #ifdef CONFIG_CPU_PXA26x
  141. /* GPIO */
  142. #define GPIO85_GPIO MFP_CFG_IN(GPIO85, AF0)
  143. #define GPIO86_GPIO MFP_CFG_IN(GPIO86, AF1)
  144. #define GPIO87_GPIO MFP_CFG_IN(GPIO87, AF1)
  145. #define GPIO88_GPIO MFP_CFG_IN(GPIO88, AF1)
  146. #define GPIO89_GPIO MFP_CFG_IN(GPIO89, AF1)
  147. /* SDRAM */
  148. #define GPIO86_nSDCS2 MFP_CFG_OUT(GPIO86, AF0, DRIVE_HIGH)
  149. #define GPIO87_nSDCS3 MFP_CFG_OUT(GPIO87, AF0, DRIVE_HIGH)
  150. #define GPIO88_RDnWR MFP_CFG_OUT(GPIO88, AF0, DRIVE_HIGH)
  151. /* USB */
  152. #define GPIO9_USB_RCV MFP_CFG_IN(GPIO9, AF1)
  153. #define GPIO32_USB_VP MFP_CFG_IN(GPIO32, AF2)
  154. #define GPIO34_USB_VM MFP_CFG_IN(GPIO34, AF2)
  155. #define GPIO39_USB_VPO MFP_CFG_OUT(GPIO39, AF3, DRIVE_LOW)
  156. #define GPIO56_USB_VMO MFP_CFG_OUT(GPIO56, AF1, DRIVE_LOW)
  157. #define GPIO57_USB_nOE MFP_CFG_OUT(GPIO57, AF1, DRIVE_HIGH)
  158. /* ASSP */
  159. #define GPIO28_ASSP_BITCLK_IN MFP_CFG_IN(GPIO28, AF3)
  160. #define GPIO28_ASSP_BITCLK_OUT MFP_CFG_OUT(GPIO28, AF3, DRIVE_LOW)
  161. #define GPIO29_ASSP_RXD MFP_CFG_IN(GPIO29, AF3)
  162. #define GPIO30_ASSP_TXD MFP_CFG_OUT(GPIO30, AF3, DRIVE_LOW)
  163. #define GPIO31_ASSP_SFRM_IN MFP_CFG_IN(GPIO31, AF1)
  164. #define GPIO31_ASSP_SFRM_OUT MFP_CFG_OUT(GPIO31, AF3, DRIVE_LOW)
  165. /* AC97 */
  166. #define GPIO89_AC97_nRESET MFP_CFG_OUT(GPIO89, AF0, DRIVE_HIGH)
  167. #endif /* CONFIG_CPU_PXA26x */
  168. /* commonly used pin configurations */
  169. #define GPIOxx_LCD_16BPP \
  170. GPIO58_LCD_LDD_0, \
  171. GPIO59_LCD_LDD_1, \
  172. GPIO60_LCD_LDD_2, \
  173. GPIO61_LCD_LDD_3, \
  174. GPIO62_LCD_LDD_4, \
  175. GPIO63_LCD_LDD_5, \
  176. GPIO64_LCD_LDD_6, \
  177. GPIO65_LCD_LDD_7, \
  178. GPIO66_LCD_LDD_8, \
  179. GPIO67_LCD_LDD_9, \
  180. GPIO68_LCD_LDD_10, \
  181. GPIO69_LCD_LDD_11, \
  182. GPIO70_LCD_LDD_12, \
  183. GPIO71_LCD_LDD_13, \
  184. GPIO72_LCD_LDD_14, \
  185. GPIO73_LCD_LDD_15
  186. #define GPIOxx_LCD_DSTN_16BPP \
  187. GPIOxx_LCD_16BPP, \
  188. GPIO74_LCD_FCLK, \
  189. GPIO75_LCD_LCLK, \
  190. GPIO76_LCD_PCLK
  191. #define GPIOxx_LCD_TFT_16BPP \
  192. GPIOxx_LCD_16BPP, \
  193. GPIO74_LCD_FCLK, \
  194. GPIO75_LCD_LCLK, \
  195. GPIO76_LCD_PCLK, \
  196. GPIO77_LCD_BIAS
  197. #endif /* __ASM_ARCH_MFP_PXA25X_H */