pinctrl_lark.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. /*
  2. * Copyright (c) 2020 Linaro Limited
  3. * SPDX-License-Identifier: Apache-2.0
  4. */
  5. #ifndef PINCTRL_LARK_H_
  6. #define PINCTRL_LARK_H_
  7. #define PIN_MFP_SET(pin, val) \
  8. {.pin_num = pin, \
  9. .mode = val}
  10. #define GPIO_CTL_MFP_SHIFT (0)
  11. #define GPIO_CTL_MFP_MASK (0x1f << GPIO_CTL_MFP_SHIFT)
  12. #define GPIO_CTL_MFP_GPIO (0x0 << GPIO_CTL_MFP_SHIFT)
  13. #define GPIO_CTL_MFP(x) (x << GPIO_CTL_MFP_SHIFT)
  14. #define GPIO_CTL_SMIT (0x1 << 5)
  15. #define GPIO_CTL_GPIO_OUTEN (0x1 << 6)
  16. #define GPIO_CTL_GPIO_INEN (0x1 << 7)
  17. #define GPIO_CTL_PULL_MASK (0xf << 8)
  18. #define GPIO_CTL_PULLUP_STRONG (0x1 << 8)
  19. #define GPIO_CTL_PULLDOWN (0x1 << 9)
  20. #define GPIO_CTL_PULLUP (0x1 << 11)
  21. #define GPIO_CTL_PADDRV_SHIFT (12)
  22. #define GPIO_CTL_PADDRV_LEVEL(x) ((x) << GPIO_CTL_PADDRV_SHIFT)
  23. #define GPIO_CTL_PADDRV_MASK GPIO_CTL_PADDRV_LEVEL(0x7)
  24. #define GPIO_CTL_INTC_EN (0x1 << 20)
  25. #define GPIO_CTL_INC_TRIGGER_SHIFT (21)
  26. #define GPIO_CTL_INC_TRIGGER(x) ((x) << GPIO_CTL_INC_TRIGGER_SHIFT)
  27. #define GPIO_CTL_INC_TRIGGER_MASK GPIO_CTL_INC_TRIGGER(0x7)
  28. #define GPIO_CTL_INC_TRIGGER_RISING_EDGE GPIO_CTL_INC_TRIGGER(0x0)
  29. #define GPIO_CTL_INC_TRIGGER_FALLING_EDGE GPIO_CTL_INC_TRIGGER(0x1)
  30. #define GPIO_CTL_INC_TRIGGER_DUAL_EDGE GPIO_CTL_INC_TRIGGER(0x2)
  31. #define GPIO_CTL_INC_TRIGGER_HIGH_LEVEL GPIO_CTL_INC_TRIGGER(0x3)
  32. #define GPIO_CTL_INC_TRIGGER_LOW_LEVEL GPIO_CTL_INC_TRIGGER(0x4)
  33. #define GPIO_CTL_INTC_MASK (0x1 << 25)
  34. /*********I2C mfp config*****************/
  35. #define MFP0_I2C 8
  36. #define MFP1_I2C 9
  37. #define I2C_MFP_CFG(x) (GPIO_CTL_MFP(x)|GPIO_CTL_PULLUP|GPIO_CTL_PADDRV_LEVEL(3))
  38. #define gpio74_i2c0_clk_node PIN_MFP_SET(74, I2C_MFP_CFG(MFP0_I2C))
  39. #define gpio22_i2c0_data_node PIN_MFP_SET(22, I2C_MFP_CFG(MFP0_I2C))
  40. #define gpio24_i2c0_clk_node PIN_MFP_SET(24, I2C_MFP_CFG(MFP0_I2C))
  41. #define gpio25_i2c0_data_node PIN_MFP_SET(25, I2C_MFP_CFG(MFP0_I2C))
  42. #define gpio28_i2c0_clk_node PIN_MFP_SET(28, I2C_MFP_CFG(MFP0_I2C))
  43. #define gpio29_i2c0_data_node PIN_MFP_SET(29, I2C_MFP_CFG(MFP0_I2C))
  44. #define gpio20_i2c1_clk_node PIN_MFP_SET(20, I2C_MFP_CFG(MFP1_I2C))
  45. #define gpio21_i2c1_data_node PIN_MFP_SET(21, I2C_MFP_CFG(MFP1_I2C))
  46. #define gpio18_i2c1_clk_node PIN_MFP_SET(18, I2C_MFP_CFG(MFP1_I2C))
  47. #define gpio19_i2c1_data_node PIN_MFP_SET(19, I2C_MFP_CFG(MFP1_I2C))
  48. #define gpio28_i2c1_clk_node PIN_MFP_SET(28, I2C_MFP_CFG(MFP1_I2C))
  49. #define gpio29_i2c1_data_node PIN_MFP_SET(29, I2C_MFP_CFG(MFP1_I2C))
  50. #define gpio57_i2c0_clk_node PIN_MFP_SET(57, I2C_MFP_CFG(MFP0_I2C))
  51. #define gpio58_i2c0_data_node PIN_MFP_SET(58, I2C_MFP_CFG(MFP0_I2C))
  52. #define gpio59_i2c1_clk_node PIN_MFP_SET(59, I2C_MFP_CFG(MFP1_I2C))
  53. #define gpio60_i2c1_data_node PIN_MFP_SET(60, I2C_MFP_CFG(MFP1_I2C))
  54. /*********I2CMT mfp config*****************/
  55. #define MFP0_I2CMT 26
  56. #define MFP1_I2CMT 27
  57. #define I2CMT_MFP_CFG(x) (GPIO_CTL_MFP(x)|GPIO_CTL_PULLUP_STRONG|GPIO_CTL_PADDRV_LEVEL(3))
  58. #define gpio22_i2cmt0_clk_node PIN_MFP_SET(22, I2CMT_MFP_CFG(MFP0_I2CMT))
  59. #define gpio23_i2cmt0_data_node PIN_MFP_SET(23, I2CMT_MFP_CFG(MFP0_I2CMT))
  60. #define gpio24_i2cmt0_clk_node PIN_MFP_SET(24, I2CMT_MFP_CFG(MFP0_I2CMT))
  61. #define gpio25_i2cmt0_data_node PIN_MFP_SET(25, I2CMT_MFP_CFG(MFP0_I2CMT))
  62. #define gpio49_i2cmt0_clk_node PIN_MFP_SET(49, I2CMT_MFP_CFG(MFP0_I2CMT))
  63. #define gpio50_i2cmt0_data_node PIN_MFP_SET(50, I2CMT_MFP_CFG(MFP0_I2CMT))
  64. #define gpio51_i2cmt1_clk_node PIN_MFP_SET(51, I2CMT_MFP_CFG(MFP1_I2CMT))
  65. #define gpio52_i2cmt1_data_node PIN_MFP_SET(52, I2CMT_MFP_CFG(MFP1_I2CMT))
  66. #define gpio59_i2cmt1_clk_node PIN_MFP_SET(59, I2CMT_MFP_CFG(MFP1_I2CMT))
  67. #define gpio60_i2cmt1_data_node PIN_MFP_SET(60, I2CMT_MFP_CFG(MFP1_I2CMT))
  68. /*********SPI mfp config*****************/
  69. #define MFP_SPI0 6
  70. #define MFP_SPI0_1 7
  71. #define MFP_SPI1 2
  72. #define MFP_SPI2 3
  73. #define MFP_SPI3 4
  74. #define SPI_MFP_CFG(x) (GPIO_CTL_MFP(x)|GPIO_CTL_PULLUP_STRONG|GPIO_CTL_PADDRV_LEVEL(3))
  75. #define SPI2_MFP_CFG(x) (GPIO_CTL_MFP(x)|GPIO_CTL_PULLUP_STRONG|GPIO_CTL_PADDRV_LEVEL(5))
  76. #define gpio24_spi1_ss_node PIN_MFP_SET(24, SPI_MFP_CFG(MFP_SPI1))
  77. #define gpio25_spi1_clk_node PIN_MFP_SET(25, SPI_MFP_CFG(MFP_SPI1))
  78. #define gpio26_spi1_miso_node PIN_MFP_SET(26, SPI_MFP_CFG(MFP_SPI1))
  79. #define gpio27_spi1_mosi_node PIN_MFP_SET(27, SPI_MFP_CFG(MFP_SPI1))
  80. #define gpio30_spi2_ss_node PIN_MFP_SET(30, SPI2_MFP_CFG(MFP_SPI2))
  81. #define gpio31_spi2_clk_node PIN_MFP_SET(31, SPI2_MFP_CFG(MFP_SPI2))
  82. #define gpio32_spi2_miso_node PIN_MFP_SET(32, SPI2_MFP_CFG(MFP_SPI2))
  83. #define gpio33_spi2_mosi_node PIN_MFP_SET(33, SPI2_MFP_CFG(MFP_SPI2))
  84. #define gpio20_spi3_ss_node PIN_MFP_SET(20, SPI2_MFP_CFG(MFP_SPI3))
  85. #define gpio21_spi3_clk_node PIN_MFP_SET(21, SPI2_MFP_CFG(MFP_SPI3))
  86. #define gpio22_spi3_miso_node PIN_MFP_SET(22, SPI2_MFP_CFG(MFP_SPI3))
  87. #define gpio23_spi3_mosi_node PIN_MFP_SET(23, SPI2_MFP_CFG(MFP_SPI3))
  88. /*********SPIMT mfp config*****************/
  89. #define MFP0_SPIMT 24
  90. #define MFP1_SPIMT 25
  91. #define SPIMT_MFP_CFG(x) (GPIO_CTL_MFP(x)|GPIO_CTL_PULLUP_STRONG|GPIO_CTL_PADDRV_LEVEL(3))
  92. #define gpio49_spimt0_ss_node PIN_MFP_SET(49, SPIMT_MFP_CFG(MFP0_SPIMT))
  93. #define gpio50_spimt0_clk_node PIN_MFP_SET(50, SPIMT_MFP_CFG(MFP0_SPIMT))
  94. #define gpio51_spimt0_miso_node PIN_MFP_SET(51, SPIMT_MFP_CFG(MFP0_SPIMT))
  95. #define gpio52_spimt0_mosi_node PIN_MFP_SET(52, SPIMT_MFP_CFG(MFP0_SPIMT))
  96. #define gpio61_spimt0_ss1_node PIN_MFP_SET(61, SPIMT_MFP_CFG(MFP0_SPIMT))
  97. #define gpio53_spimt1_ss_node PIN_MFP_SET(53, SPIMT_MFP_CFG(MFP1_SPIMT))
  98. #define gpio54_spimt1_clk_node PIN_MFP_SET(54, SPIMT_MFP_CFG(MFP1_SPIMT))
  99. #define gpio55_spimt1_miso_node PIN_MFP_SET(55, SPIMT_MFP_CFG(MFP1_SPIMT))
  100. #define gpio56_spimt1_mosi_node PIN_MFP_SET(56, SPIMT_MFP_CFG(MFP1_SPIMT))
  101. /* lcdc */
  102. #ifndef LCD_PADDRV_LEVEL
  103. # define LCD_PADDRV_LEVEL (3)
  104. #endif
  105. #define LCD_MFP_SEL (19 | GPIO_CTL_PADDRV_LEVEL(LCD_PADDRV_LEVEL))
  106. #define gpio30_lcd_ce0_hsync_node PIN_MFP_SET(30, (GPIO_CTL_MFP(LCD_MFP_SEL)|GPIO_CTL_PULLUP))
  107. #define gpio31_lcd_ce1_node PIN_MFP_SET(31, (GPIO_CTL_MFP(LCD_MFP_SEL)|GPIO_CTL_PULLUP))
  108. #define gpio32_lcd_rs_vsync_sda_node PIN_MFP_SET(32, LCD_MFP_SEL)
  109. #define gpio33_lcd_rde_lde_cdx_node PIN_MFP_SET(33, LCD_MFP_SEL)
  110. #define gpio34_lcd_wr_dclk_scl_node PIN_MFP_SET(34, LCD_MFP_SEL)
  111. #define gpio35_lcd_te_sdo_node PIN_MFP_SET(35, LCD_MFP_SEL)
  112. #define gpio14_lcd_d0_node PIN_MFP_SET(14, LCD_MFP_SEL)
  113. #define gpio15_lcd_d1_node PIN_MFP_SET(15, LCD_MFP_SEL)
  114. #define gpio16_lcd_d2_node PIN_MFP_SET(16, LCD_MFP_SEL)
  115. #define gpio17_lcd_d3_node PIN_MFP_SET(17, LCD_MFP_SEL)
  116. #define gpio18_lcd_d4_node PIN_MFP_SET(18, LCD_MFP_SEL)
  117. #define gpio19_lcd_d5_node PIN_MFP_SET(19, LCD_MFP_SEL)
  118. #define gpio20_lcd_d6_node PIN_MFP_SET(20, LCD_MFP_SEL)
  119. #define gpio21_lcd_d7_node PIN_MFP_SET(21, LCD_MFP_SEL)
  120. #define gpio14_lcd_ce0_hsync_node PIN_MFP_SET(14, (GPIO_CTL_MFP(LCD_MFP_SEL)|GPIO_CTL_PULLUP))
  121. #define gpio15_lcd_ce1_node PIN_MFP_SET(15, LCD_MFP_SEL)
  122. #define gpio16_lcd_d8_node PIN_MFP_SET(16, LCD_MFP_SEL)
  123. #define gpio17_lcd_d9_node PIN_MFP_SET(17, LCD_MFP_SEL)
  124. #define gpio18_lcd_d10_node PIN_MFP_SET(18, LCD_MFP_SEL)
  125. #define gpio19_lcd_d11_node PIN_MFP_SET(19, LCD_MFP_SEL)
  126. #define gpio20_lcd_d12_node PIN_MFP_SET(20, LCD_MFP_SEL)
  127. #define gpio21_lcd_d13_node PIN_MFP_SET(21, LCD_MFP_SEL)
  128. #define gpio22_lcd_d14_node PIN_MFP_SET(22, LCD_MFP_SEL)
  129. #define gpio23_lcd_d15_node PIN_MFP_SET(23, LCD_MFP_SEL)
  130. #define gpio24_lcd_d0_node PIN_MFP_SET(24, LCD_MFP_SEL)
  131. #define gpio25_lcd_d1_node PIN_MFP_SET(25, LCD_MFP_SEL)
  132. #define gpio26_lcd_d2_node PIN_MFP_SET(26, LCD_MFP_SEL)
  133. #define gpio27_lcd_d3_node PIN_MFP_SET(27, LCD_MFP_SEL)
  134. #define gpio28_lcd_d4_node PIN_MFP_SET(28, LCD_MFP_SEL)
  135. #define gpio29_lcd_d5_node PIN_MFP_SET(29, LCD_MFP_SEL)
  136. #define gpio30_lcd_d6_node PIN_MFP_SET(30, LCD_MFP_SEL)
  137. #define gpio31_lcd_d7_node PIN_MFP_SET(31, LCD_MFP_SEL)
  138. #define gpio32_lcd_rs_vsync_sda_node PIN_MFP_SET(32, LCD_MFP_SEL)
  139. #define gpio33_lcd_rde_lde_cdx_node PIN_MFP_SET(33, LCD_MFP_SEL)
  140. #define gpio34_lcd_wr_dclk_scl_node PIN_MFP_SET(34, LCD_MFP_SEL)
  141. #define gpio35_lcd_te_sdo_node PIN_MFP_SET(35, LCD_MFP_SEL)
  142. /* lcdc fpga 1.8v*/
  143. #define gpio30_lcd_ce0_hsync_node PIN_MFP_SET(30, (GPIO_CTL_MFP(LCD_MFP_SEL)|GPIO_CTL_PULLUP))
  144. #define gpio34_lcd_wr_dclk_scl_node PIN_MFP_SET(34, LCD_MFP_SEL)
  145. #define gpio14_lcd_d0_node PIN_MFP_SET(14, LCD_MFP_SEL)
  146. #define gpio15_lcd_d1_node PIN_MFP_SET(15, LCD_MFP_SEL)
  147. #define gpio16_lcd_d2_node PIN_MFP_SET(16, LCD_MFP_SEL)
  148. #define gpio17_lcd_d3_node PIN_MFP_SET(17, LCD_MFP_SEL)
  149. #define gpio18_lcd_d4_node PIN_MFP_SET(18, LCD_MFP_SEL)
  150. #define gpio19_lcd_d5_node PIN_MFP_SET(19, LCD_MFP_SEL)
  151. #define gpio20_lcd_d6_node PIN_MFP_SET(20, LCD_MFP_SEL)
  152. #define gpio21_lcd_d7_node PIN_MFP_SET(21, LCD_MFP_SEL)
  153. //#define gpio24_lcd_d10_node PIN_MFP_SET(24, LCD_MFP_SEL)
  154. //#define gpio25_lcd_d11_node PIN_MFP_SET(25, LCD_MFP_SEL)
  155. //#define gpio26_lcd_d12_node PIN_MFP_SET(26, LCD_MFP_SEL)
  156. //#define gpio27_lcd_d13_node PIN_MFP_SET(27, LCD_MFP_SEL)
  157. //#define gpio28_lcd_d14_node PIN_MFP_SET(28, LCD_MFP_SEL)
  158. //#define gpio29_lcd_d15_node PIN_MFP_SET(29, LCD_MFP_SEL)
  159. /* sd0 */
  160. #define SDC0_MFP_SEL 10
  161. #define SDC0_MFP_CFG_VAL (GPIO_CTL_MFP(SDC0_MFP_SEL)|GPIO_CTL_PULLUP|GPIO_CTL_PADDRV_LEVEL(5))
  162. //#define gpio0_sdc0_cmd_node PIN_MFP_SET(0, sdc0, cmd, SDC0_MFP_CFG_VAL)
  163. //#define gpio1_sdc0_clk_node PIN_MFP_SET(1, sdc0, clk, (GPIO_CTL_MFP(SDC0_MFP_SEL)|GPIO_CTL_PADDRV_LEVEL(3)))
  164. //#define gpio2_sdc0_d0_node PIN_MFP_SET(2, sdc0, d0, SDC0_MFP_CFG_VAL)
  165. //#define gpio3_sdc0_d1_node PIN_MFP_SET(3, sdc0, d1, SDC0_MFP_CFG_VAL)
  166. //#define gpio4_sdc0_d2_node PIN_MFP_SET(4, sdc0, d2, SDC0_MFP_CFG_VAL)
  167. //#define gpio5_sdc0_d3_node PIN_MFP_SET(5, sdc0, d3, SDC0_MFP_CFG_VAL)
  168. //#define gpio6_sdc0_d4_node PIN_MFP_SET(6, sdc0, d4, SDC0_MFP_CFG_VAL)
  169. //#define gpio7_sdc0_d5_node PIN_MFP_SET(7, sdc0, d5, SDC0_MFP_CFG_VAL)
  170. //#define gpio8_sdc0_d6_node PIN_MFP_SET(8, sdc0, d6, SDC0_MFP_CFG_VAL)
  171. //#define gpio9_sdc0_d7_node PIN_MFP_SET(9, sdc0, d7, SDC0_MFP_CFG_VAL)
  172. #define gpio11_sdc0_cmd_node PIN_MFP_SET(11, SDC0_MFP_CFG_VAL)
  173. #define gpio10_sdc0_clk_node PIN_MFP_SET(10, (GPIO_CTL_MFP(SDC0_MFP_SEL)|GPIO_CTL_PADDRV_LEVEL(3)))
  174. #define gpio12_sdc0_d0_node PIN_MFP_SET(12, SDC0_MFP_CFG_VAL)
  175. #define gpio13_sdc0_d1_node PIN_MFP_SET(13, SDC0_MFP_CFG_VAL)
  176. #define gpio8_sdc0_d2_node PIN_MFP_SET(8, SDC0_MFP_CFG_VAL)
  177. #define gpio9_sdc0_d3_node PIN_MFP_SET(9, SDC0_MFP_CFG_VAL)
  178. /* sd1 */
  179. #define SDC1_MFP_SEL 10
  180. #define SDC1_MFP_CFG_VAL (GPIO_CTL_MFP(SDC1_MFP_SEL)|GPIO_CTL_PULLUP|GPIO_CTL_PADDRV_LEVEL(5))
  181. #define gpio44_sdc1_cmd_node PIN_MFP_SET(44, SDC1_MFP_SEL)
  182. #define gpio43_sdc1_clk_node PIN_MFP_SET(43, (GPIO_CTL_MFP(SDC1_MFP_SEL)|GPIO_CTL_PADDRV_LEVEL(3)))
  183. #define gpio45_sdc1_d0_node PIN_MFP_SET(45, SDC1_MFP_CFG_VAL)
  184. #define gpio46_sdc1_d1_node PIN_MFP_SET(46, SDC1_MFP_CFG_VAL)
  185. #define gpio41_sdc1_d2_node PIN_MFP_SET(41, SDC1_MFP_CFG_VAL)
  186. #define gpio42_sdc1_d3_node PIN_MFP_SET(42, SDC1_MFP_CFG_VAL)
  187. /* uart0 */
  188. #define UART0_MFP_SEL 5
  189. #define UART0_MFP_CFG (GPIO_CTL_MFP(UART0_MFP_SEL)|GPIO_CTL_SMIT|GPIO_CTL_PULLUP_STRONG|GPIO_CTL_PADDRV_LEVEL(4))
  190. #define gpio10_uart0_tx_node PIN_MFP_SET(10, UART0_MFP_CFG)
  191. #define gpio11_uart0_rx_node PIN_MFP_SET(11, UART0_MFP_CFG)
  192. #define gpio28_uart0_tx_node PIN_MFP_SET(28, UART0_MFP_CFG)
  193. #define gpio29_uart0_rx_node PIN_MFP_SET(29, UART0_MFP_CFG)
  194. #define gpio37_uart0_tx_node PIN_MFP_SET(37, UART0_MFP_CFG)
  195. #define gpio38_uart0_rx_node PIN_MFP_SET(38, UART0_MFP_CFG)
  196. #define gpio63_uart0_tx_node PIN_MFP_SET(63, UART0_MFP_CFG)
  197. #define gpio62_uart0_rx_node PIN_MFP_SET(62, UART0_MFP_CFG)
  198. /* uart1 */
  199. #define UART1_MFP_SEL 6
  200. #define UART1_MFP_CFG (GPIO_CTL_MFP(UART1_MFP_SEL) | GPIO_CTL_SMIT | GPIO_CTL_PULLUP_STRONG | GPIO_CTL_PADDRV_LEVEL(4))
  201. #define gpio16_uart1_tx_node PIN_MFP_SET(16, UART1_MFP_CFG)
  202. #define gpio17_uart1_rx_node PIN_MFP_SET(17, UART1_MFP_CFG)
  203. /* uart2 */
  204. #define UART2_MFP_SEL 7
  205. #define UART2_MFP_CFG (GPIO_CTL_MFP(UART2_MFP_SEL) | GPIO_CTL_SMIT | GPIO_CTL_PULLUP_STRONG | GPIO_CTL_PADDRV_LEVEL(4))
  206. #define gpio20_uart2_tx_node PIN_MFP_SET(20, UART2_MFP_CFG)
  207. #define gpio21_uart2_rx_node PIN_MFP_SET(21, UART2_MFP_CFG)
  208. #define gpio26_uart2_tx_node PIN_MFP_SET(26, UART2_MFP_CFG)
  209. #define gpio27_uart2_rx_node PIN_MFP_SET(27, UART2_MFP_CFG)
  210. /* SPDIFTX */
  211. #define SPDIFTX_MFP_SEL 14
  212. #define SPDIFTX_MFP_CFG (GPIO_CTL_MFP(SPDIFTX_MFP_SEL)| GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(3))
  213. #define gpio9_spdiftx0_d0_node PIN_MFP_SET(9, SPDIFTX_MFP_CFG)
  214. #define gpio62_spdiftx0_d0_node PIN_MFP_SET(62, SPDIFTX_MFP_CFG)
  215. /* SPDIFRX */
  216. #define SPDIFRX_MFP_SEL 15
  217. #define SPDIFRX_MFP_CFG (GPIO_CTL_MFP(SPDIFRX_MFP_SEL)| GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(3))
  218. #define gpio13_spdifrx0_d0_node PIN_MFP_SET(13, SPDIFRX_MFP_CFG)
  219. #define gpio63_spdifrx0_d0_node PIN_MFP_SET(63, SPDIFRX_MFP_CFG)
  220. /* I2STX */
  221. #define I2STX_MFP_SEL 12
  222. #define I2STX_MFP_CFG (GPIO_CTL_MFP(I2STX_MFP_SEL)| GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(3))
  223. #define gpio39_i2stx0_d0_node PIN_MFP_SET(39, I2STX_MFP_CFG)
  224. #define gpio16_i2stx0_mclk_node PIN_MFP_SET(16, I2STX_MFP_CFG)
  225. #define gpio17_i2stx0_bclk_node PIN_MFP_SET(17, I2STX_MFP_CFG)
  226. #define gpio18_i2stx0_lrclk_node PIN_MFP_SET(18, I2STX_MFP_CFG)
  227. #define gpio9_i2stx0_d0_node PIN_MFP_SET(9, I2STX_MFP_CFG)
  228. #define gpio6_i2stx0_mclk_node PIN_MFP_SET(6, I2STX_MFP_CFG)
  229. #define gpio7_i2stx0_bclk_node PIN_MFP_SET(7, I2STX_MFP_CFG)
  230. #define gpio8_i2stx0_lrclk_node PIN_MFP_SET(8, I2STX_MFP_CFG)
  231. #define gpio49_i2stx0_mclk_node PIN_MFP_SET(49, I2STX_MFP_CFG)
  232. #define gpio50_i2stx0_bclk_node PIN_MFP_SET(50, I2STX_MFP_CFG)
  233. #define gpio51_i2stx0_lrclk_node PIN_MFP_SET(51, I2STX_MFP_CFG)
  234. #define gpio52_i2stx0_d0_node PIN_MFP_SET(52, I2STX_MFP_CFG)
  235. /* I2SRX */
  236. #define I2SRX_MFP_SEL 13
  237. #define I2SRX_MFP_CFG (GPIO_CTL_MFP(I2SRX_MFP_SEL)| GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(3))
  238. #define gpio43_i2srx0_d0_node PIN_MFP_SET(43, I2SRX_MFP_CFG)
  239. #define gpio19_i2srx0_mclk_node PIN_MFP_SET(19, I2SRX_MFP_CFG)
  240. #define gpio20_i2srx0_bclk_node PIN_MFP_SET(20, I2SRX_MFP_CFG)
  241. #define gpio21_i2srx0_lrclk_node PIN_MFP_SET(21, I2SRX_MFP_CFG)
  242. #define gpio9_i2srx0_d0_node PIN_MFP_SET(9, I2SRX_MFP_CFG)
  243. #define gpio40_i2srx0_mclk_node PIN_MFP_SET(40, I2SRX_MFP_CFG)
  244. #define gpio6_i2srx0_bclk_node PIN_MFP_SET(6, I2SRX_MFP_CFG)
  245. #define gpio7_i2srx0_lrclk_node PIN_MFP_SET(7, I2SRX_MFP_CFG)
  246. #define gpio53_i2srx0_mclk_node PIN_MFP_SET(53, I2SRX_MFP_CFG)
  247. #define gpio54_i2srx0_bclk_node PIN_MFP_SET(54, I2SRX_MFP_CFG)
  248. #define gpio55_i2srx0_lrclk_node PIN_MFP_SET(55, I2SRX_MFP_CFG)
  249. #define gpio56_i2srx0_d0_node PIN_MFP_SET(56, I2SRX_MFP_CFG)
  250. /* TP KEY */
  251. #define gpio12_tp_rst_node PIN_MFP_SET(12, GPIO_CTL_GPIO_OUTEN)
  252. #define gpio30_tp_rst_node PIN_MFP_SET(30, GPIO_CTL_GPIO_OUTEN)
  253. #define gpio13_tp_isr_node PIN_MFP_SET(13, GPIO_CTL_GPIO_OUTEN)
  254. #define gpio31_tp_isr_node PIN_MFP_SET(31, GPIO_CTL_GPIO_OUTEN)
  255. /* GPIO KEY */
  256. #define GPIOKEY_MFP_CFG (GPIO_CTL_SMIT | GPIO_CTL_PULLUP | GPIO_CTL_GPIO_INEN | GPIO_CTL_INTC_EN | GPIO_CTL_INC_TRIGGER_DUAL_EDGE)//(GPIO_CTL_SMIT | GPIO_INT_LEVEL | GPIO_PUD_PULL_UP | GPIO_DIR_IN | GPIO_INT_DEBOUNCE | GPIO_INT | GPIO_INT_EDGE|GPIO_INT_DOUBLE_EDGE)//
  257. #define gpio17_keygpio_key0_node PIN_MFP_SET(17, GPIOKEY_MFP_CFG)
  258. #define gpio18_keygpio_key1_node PIN_MFP_SET(18, GPIOKEY_MFP_CFG)
  259. #define gpio19_keygpio_key2_node PIN_MFP_SET(19, GPIOKEY_MFP_CFG)
  260. #define gpio20_keygpio_key3_node PIN_MFP_SET(20, GPIOKEY_MFP_CFG)
  261. #define gpio21_keygpio_key4_node PIN_MFP_SET(21, GPIOKEY_MFP_CFG)
  262. #define gpio22_keygpio_key5_node PIN_MFP_SET(22, GPIOKEY_MFP_CFG)
  263. #define gpio23_keygpio_key6_node PIN_MFP_SET(23, GPIOKEY_MFP_CFG)
  264. #define gpio24_keygpio_key7_node PIN_MFP_SET(24, GPIOKEY_MFP_CFG)
  265. #define gpio25_keygpio_key8_node PIN_MFP_SET(25, GPIOKEY_MFP_CFG)
  266. #define gpio26_keygpio_key9_node PIN_MFP_SET(26, GPIOKEY_MFP_CFG)
  267. /* PWM */
  268. #define PWM_MFP_CFG (0x12 | GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(3))
  269. #define PWM_PIN_MFP_SET(pin, chan, val) \
  270. {.pin_num = pin, \
  271. .pin_chan = chan, \
  272. .mode = val}
  273. #define gpio03_pwm_chan0_node PWM_PIN_MFP_SET(03, 0, PWM_MFP_CFG)
  274. #define gpio04_pwm_chan0_node PWM_PIN_MFP_SET(04, 0, PWM_MFP_CFG)
  275. #define gpio14_pwm_chan0_node PWM_PIN_MFP_SET(14, 0, PWM_MFP_CFG)
  276. #define gpio36_pwm_chan0_node PWM_PIN_MFP_SET(36, 0, PWM_MFP_CFG)
  277. #define gpio49_pwm_chan0_node PWM_PIN_MFP_SET(49, 0, PWM_MFP_CFG)
  278. #define gpio05_pwm_chan1_node PWM_PIN_MFP_SET(05, 1, PWM_MFP_CFG)
  279. #define gpio15_pwm_chan1_node PWM_PIN_MFP_SET(15, 1, PWM_MFP_CFG)
  280. #define gpio37_pwm_chan1_node PWM_PIN_MFP_SET(37, 1, PWM_MFP_CFG)
  281. #define gpio50_pwm_chan1_node PWM_PIN_MFP_SET(50, 1, PWM_MFP_CFG)
  282. #define gpio06_pwm_chan2_node PWM_PIN_MFP_SET(06, 2, PWM_MFP_CFG)
  283. #define gpio21_pwm_chan2_node PWM_PIN_MFP_SET(21, 2, PWM_MFP_CFG)
  284. #define gpio38_pwm_chan2_node PWM_PIN_MFP_SET(38, 2, PWM_MFP_CFG)
  285. #define gpio51_pwm_chan2_node PWM_PIN_MFP_SET(51, 2, PWM_MFP_CFG)
  286. #define gpio07_pwm_chan3_node PWM_PIN_MFP_SET(07, 3, PWM_MFP_CFG)
  287. #define gpio17_pwm_chan3_node PWM_PIN_MFP_SET(17, 3, PWM_MFP_CFG)
  288. #define gpio39_pwm_chan3_node PWM_PIN_MFP_SET(39, 3, PWM_MFP_CFG)
  289. #define gpio52_pwm_chan3_node PWM_PIN_MFP_SET(52, 3, PWM_MFP_CFG)
  290. #define gpio08_pwm_chan4_node PWM_PIN_MFP_SET(08, 4, PWM_MFP_CFG)
  291. #define gpio18_pwm_chan4_node PWM_PIN_MFP_SET(18, 4, PWM_MFP_CFG)
  292. #define gpio40_pwm_chan4_node PWM_PIN_MFP_SET(40, 4, PWM_MFP_CFG)
  293. #define gpio53_pwm_chan4_node PWM_PIN_MFP_SET(53, 4, PWM_MFP_CFG)
  294. #define gpio09_pwm_chan5_node PWM_PIN_MFP_SET(09, 5, PWM_MFP_CFG)
  295. #define gpio19_pwm_chan5_node PWM_PIN_MFP_SET(19, 5, PWM_MFP_CFG)
  296. #define gpio41_pwm_chan5_node PWM_PIN_MFP_SET(41, 5, PWM_MFP_CFG)
  297. #define gpio54_pwm_chan5_node PWM_PIN_MFP_SET(54, 5, PWM_MFP_CFG)
  298. #define gpio10_pwm_chan6_node PWM_PIN_MFP_SET(10, 6, PWM_MFP_CFG)
  299. #define gpio20_pwm_chan6_node PWM_PIN_MFP_SET(20, 6, PWM_MFP_CFG)
  300. #define gpio42_pwm_chan6_node PWM_PIN_MFP_SET(42, 6, PWM_MFP_CFG)
  301. #define gpio55_pwm_chan6_node PWM_PIN_MFP_SET(55, 6, PWM_MFP_CFG)
  302. #define gpio11_pwm_chan7_node PWM_PIN_MFP_SET(11, 7, PWM_MFP_CFG)
  303. #define gpio21_pwm_chan7_node PWM_PIN_MFP_SET(21, 7, PWM_MFP_CFG)
  304. #define gpio43_pwm_chan7_node PWM_PIN_MFP_SET(43, 7, PWM_MFP_CFG)
  305. #define gpio45_pwm_chan7_node PWM_PIN_MFP_SET(45, 7, PWM_MFP_CFG)
  306. #define gpio56_pwm_chan7_node PWM_PIN_MFP_SET(56, 7, PWM_MFP_CFG)
  307. #define gpio12_pwm_chan7_node PWM_PIN_MFP_SET(12, 8, PWM_MFP_CFG)
  308. #define gpio22_pwm_chan7_node PWM_PIN_MFP_SET(22, 8, PWM_MFP_CFG)
  309. #define gpio44_pwm_chan7_node PWM_PIN_MFP_SET(44, 8, PWM_MFP_CFG)
  310. #define gpio46_pwm_chan7_node PWM_PIN_MFP_SET(46, 8, PWM_MFP_CFG)
  311. #define gpio57_pwm_chan7_node PWM_PIN_MFP_SET(57, 8, PWM_MFP_CFG)
  312. /* SPI NOR */
  313. #define SPINOR_MFP_SEL 1
  314. #define SPINOR_MFP_CFG (GPIO_CTL_MFP(SPINOR_MFP_SEL)| GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(3))
  315. #define SPINOR_MFP_PU_CFG (GPIO_CTL_MFP(SPINOR_MFP_SEL)| GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(3) | GPIO_CTL_PULLUP)
  316. #define SPINOR_22_MFP_SEL 22
  317. #define SPINOR_22_MFP_CFG (GPIO_CTL_MFP(SPINOR_22_MFP_SEL)| GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(3))
  318. #define SPINOR_22_MFP_PU_CFG (GPIO_CTL_MFP(SPINOR_22_MFP_SEL)| GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(3) | GPIO_CTL_PULLUP)
  319. #define gpio0_spinor0_cs_node PIN_MFP_SET(0, SPINOR_MFP_CFG)
  320. #define gpio1_spinor0_miso_node PIN_MFP_SET(1, SPINOR_MFP_CFG)
  321. #define gpio2_spinor0_clk_node PIN_MFP_SET(2, SPINOR_MFP_CFG)
  322. #define gpio3_spinor0_mosi_node PIN_MFP_SET(3, SPINOR_MFP_CFG)
  323. #define gpio6_spinor0_io2_node PIN_MFP_SET(6, SPINOR_MFP_PU_CFG)
  324. #define gpio7_spinor0_io3_node PIN_MFP_SET(7, SPINOR_MFP_PU_CFG)
  325. /* HDMI CEC */
  326. #define CEC_MFP_SEL 21
  327. #define CEC_MFP_CFG (GPIO_CTL_MFP(CEC_MFP_SEL)| GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(3) | GPIO_CTL_PULLUP)
  328. #define gpio12_cec0_d0_node PIN_MFP_SET(12, CEC_MFP_CFG)
  329. /* ADC KEY */
  330. #define ADCKEY_MFP_SEL 28
  331. #define ADCKEY_MFP_CFG (GPIO_CTL_MFP(ADCKEY_MFP_SEL) | GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(3))
  332. #define gpio21_adckey_lradc3_node PIN_MFP_SET(21, ADCKEY_MFP_CFG)
  333. /* SPI NAND */
  334. #define SPINAND_MFP_SEL 4
  335. #define SPINAND_MFP_CFG (GPIO_CTL_MFP(SPINAND_MFP_SEL) | GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(7))
  336. #define SPINAND_MFP_PU_CFG (GPIO_CTL_MFP(SPINAND_MFP_SEL)| GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(7) | GPIO_CTL_PULLUP)
  337. //#define SPINAND_MFP_PU_CFG (GPIO_CTL_MFP(SPINAND_MFP_SEL)| GPIO_CTL_SMIT | GPIO_CTL_PADDRV_LEVEL(7))
  338. #define gpio8_spinand3_io2_node PIN_MFP_SET(8, SPINAND_MFP_PU_CFG)
  339. #define gpio9_spinand3_io3_node PIN_MFP_SET(9, SPINAND_MFP_PU_CFG)
  340. #define gpio10_spinand3_ss_node PIN_MFP_SET(10, SPINAND_MFP_CFG)
  341. #define gpio11_spinand3_clk_node PIN_MFP_SET(11, SPINAND_MFP_CFG)
  342. #define gpio12_spinand3_io1_node PIN_MFP_SET(12, SPINAND_MFP_CFG)
  343. #define gpio13_spinand3_io0_node PIN_MFP_SET(13, SPINAND_MFP_CFG)
  344. #endif /* PINCTRL_LARK_H_ */