1 // SPDX-License-Identifier: GPL-2.0+
3 * OWL S900 Pinctrl driver
5 * Copyright (c) 2014 Actions Semi Inc.
6 * Author: David Liu <liuwei@actions-semi.com>
8 * Copyright (c) 2018 Linaro Ltd.
9 * Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
12 #include <linux/module.h>
14 #include <linux/platform_device.h>
15 #include <linux/pinctrl/pinctrl.h>
16 #include "pinctrl-owl.h"
18 /* Pinctrl registers offset */
19 #define MFCTL0 (0x0040)
20 #define MFCTL1 (0x0044)
21 #define MFCTL2 (0x0048)
22 #define MFCTL3 (0x004C)
23 #define PAD_PULLCTL0 (0x0060)
24 #define PAD_PULLCTL1 (0x0064)
25 #define PAD_PULLCTL2 (0x0068)
26 #define PAD_ST0 (0x006C)
27 #define PAD_ST1 (0x0070)
28 #define PAD_CTL (0x0074)
29 #define PAD_DRV0 (0x0080)
30 #define PAD_DRV1 (0x0084)
31 #define PAD_DRV2 (0x0088)
32 #define PAD_SR0 (0x0270)
33 #define PAD_SR1 (0x0274)
34 #define PAD_SR2 (0x0278)
36 #define _GPIOA(offset) (offset)
37 #define _GPIOB(offset) (32 + (offset))
38 #define _GPIOC(offset) (64 + (offset))
39 #define _GPIOD(offset) (76 + (offset))
40 #define _GPIOE(offset) (106 + (offset))
41 #define _GPIOF(offset) (138 + (offset))
43 #define NUM_GPIOS (_GPIOF(7) + 1)
44 #define _PIN(offset) (NUM_GPIOS + (offset))
46 #define ETH_TXD0 _GPIOA(0)
47 #define ETH_TXD1 _GPIOA(1)
48 #define ETH_TXEN _GPIOA(2)
49 #define ETH_RXER _GPIOA(3)
50 #define ETH_CRS_DV _GPIOA(4)
51 #define ETH_RXD1 _GPIOA(5)
52 #define ETH_RXD0 _GPIOA(6)
53 #define ETH_REF_CLK _GPIOA(7)
54 #define ETH_MDC _GPIOA(8)
55 #define ETH_MDIO _GPIOA(9)
56 #define SIRQ0 _GPIOA(10)
57 #define SIRQ1 _GPIOA(11)
58 #define SIRQ2 _GPIOA(12)
59 #define I2S_D0 _GPIOA(13)
60 #define I2S_BCLK0 _GPIOA(14)
61 #define I2S_LRCLK0 _GPIOA(15)
62 #define I2S_MCLK0 _GPIOA(16)
63 #define I2S_D1 _GPIOA(17)
64 #define I2S_BCLK1 _GPIOA(18)
65 #define I2S_LRCLK1 _GPIOA(19)
66 #define I2S_MCLK1 _GPIOA(20)
67 #define ERAM_A5 _GPIOA(21)
68 #define ERAM_A6 _GPIOA(22)
69 #define ERAM_A7 _GPIOA(23)
70 #define ERAM_A8 _GPIOA(24)
71 #define ERAM_A9 _GPIOA(25)
72 #define ERAM_A10 _GPIOA(26)
73 #define ERAM_A11 _GPIOA(27)
74 #define SD0_D0 _GPIOA(28)
75 #define SD0_D1 _GPIOA(29)
76 #define SD0_D2 _GPIOA(30)
77 #define SD0_D3 _GPIOA(31)
79 #define SD1_D0 _GPIOB(0)
80 #define SD1_D1 _GPIOB(1)
81 #define SD1_D2 _GPIOB(2)
82 #define SD1_D3 _GPIOB(3)
83 #define SD0_CMD _GPIOB(4)
84 #define SD0_CLK _GPIOB(5)
85 #define SD1_CMD _GPIOB(6)
86 #define SD1_CLK _GPIOB(7)
87 #define SPI0_SCLK _GPIOB(8)
88 #define SPI0_SS _GPIOB(9)
89 #define SPI0_MISO _GPIOB(10)
90 #define SPI0_MOSI _GPIOB(11)
91 #define UART0_RX _GPIOB(12)
92 #define UART0_TX _GPIOB(13)
93 #define UART2_RX _GPIOB(14)
94 #define UART2_TX _GPIOB(15)
95 #define UART2_RTSB _GPIOB(16)
96 #define UART2_CTSB _GPIOB(17)
97 #define UART4_RX _GPIOB(18)
98 #define UART4_TX _GPIOB(19)
99 #define I2C0_SCLK _GPIOB(20)
100 #define I2C0_SDATA _GPIOB(21)
101 #define I2C1_SCLK _GPIOB(22)
102 #define I2C1_SDATA _GPIOB(23)
103 #define I2C2_SCLK _GPIOB(24)
104 #define I2C2_SDATA _GPIOB(25)
105 #define CSI0_DN0 _GPIOB(26)
106 #define CSI0_DP0 _GPIOB(27)
107 #define CSI0_DN1 _GPIOB(28)
108 #define CSI0_DP1 _GPIOB(29)
109 #define CSI0_CN _GPIOB(30)
110 #define CSI0_CP _GPIOB(31)
112 #define CSI0_DN2 _GPIOC(0)
113 #define CSI0_DP2 _GPIOC(1)
114 #define CSI0_DN3 _GPIOC(2)
115 #define CSI0_DP3 _GPIOC(3)
116 #define SENSOR0_PCLK _GPIOC(4)
117 #define CSI1_DN0 _GPIOC(5)
118 #define CSI1_DP0 _GPIOC(6)
119 #define CSI1_DN1 _GPIOC(7)
120 #define CSI1_DP1 _GPIOC(8)
121 #define CSI1_CN _GPIOC(9)
122 #define CSI1_CP _GPIOC(10)
123 #define SENSOR0_CKOUT _GPIOC(11)
125 #define LVDS_OEP _GPIOD(0)
126 #define LVDS_OEN _GPIOD(1)
127 #define LVDS_ODP _GPIOD(2)
128 #define LVDS_ODN _GPIOD(3)
129 #define LVDS_OCP _GPIOD(4)
130 #define LVDS_OCN _GPIOD(5)
131 #define LVDS_OBP _GPIOD(6)
132 #define LVDS_OBN _GPIOD(7)
133 #define LVDS_OAP _GPIOD(8)
134 #define LVDS_OAN _GPIOD(9)
135 #define LVDS_EEP _GPIOD(10)
136 #define LVDS_EEN _GPIOD(11)
137 #define LVDS_EDP _GPIOD(12)
138 #define LVDS_EDN _GPIOD(13)
139 #define LVDS_ECP _GPIOD(14)
140 #define LVDS_ECN _GPIOD(15)
141 #define LVDS_EBP _GPIOD(16)
142 #define LVDS_EBN _GPIOD(17)
143 #define LVDS_EAP _GPIOD(18)
144 #define LVDS_EAN _GPIOD(19)
145 #define DSI_DP3 _GPIOD(20)
146 #define DSI_DN3 _GPIOD(21)
147 #define DSI_DP1 _GPIOD(22)
148 #define DSI_DN1 _GPIOD(23)
149 #define DSI_CP _GPIOD(24)
150 #define DSI_CN _GPIOD(25)
151 #define DSI_DP0 _GPIOD(26)
152 #define DSI_DN0 _GPIOD(27)
153 #define DSI_DP2 _GPIOD(28)
154 #define DSI_DN2 _GPIOD(29)
156 #define NAND0_D0 _GPIOE(0)
157 #define NAND0_D1 _GPIOE(1)
158 #define NAND0_D2 _GPIOE(2)
159 #define NAND0_D3 _GPIOE(3)
160 #define NAND0_D4 _GPIOE(4)
161 #define NAND0_D5 _GPIOE(5)
162 #define NAND0_D6 _GPIOE(6)
163 #define NAND0_D7 _GPIOE(7)
164 #define NAND0_DQS _GPIOE(8)
165 #define NAND0_DQSN _GPIOE(9)
166 #define NAND0_ALE _GPIOE(10)
167 #define NAND0_CLE _GPIOE(11)
168 #define NAND0_CEB0 _GPIOE(12)
169 #define NAND0_CEB1 _GPIOE(13)
170 #define NAND0_CEB2 _GPIOE(14)
171 #define NAND0_CEB3 _GPIOE(15)
172 #define NAND1_D0 _GPIOE(16)
173 #define NAND1_D1 _GPIOE(17)
174 #define NAND1_D2 _GPIOE(18)
175 #define NAND1_D3 _GPIOE(19)
176 #define NAND1_D4 _GPIOE(20)
177 #define NAND1_D5 _GPIOE(21)
178 #define NAND1_D6 _GPIOE(22)
179 #define NAND1_D7 _GPIOE(23)
180 #define NAND1_DQS _GPIOE(24)
181 #define NAND1_DQSN _GPIOE(25)
182 #define NAND1_ALE _GPIOE(26)
183 #define NAND1_CLE _GPIOE(27)
184 #define NAND1_CEB0 _GPIOE(28)
185 #define NAND1_CEB1 _GPIOE(29)
186 #define NAND1_CEB2 _GPIOE(30)
187 #define NAND1_CEB3 _GPIOE(31)
189 #define PCM1_IN _GPIOF(0)
190 #define PCM1_CLK _GPIOF(1)
191 #define PCM1_SYNC _GPIOF(2)
192 #define PCM1_OUT _GPIOF(3)
193 #define UART3_RX _GPIOF(4)
194 #define UART3_TX _GPIOF(5)
195 #define UART3_RTSB _GPIOF(6)
196 #define UART3_CTSB _GPIOF(7)
199 #define SGPIO0 _PIN(0)
200 #define SGPIO1 _PIN(1)
201 #define SGPIO2 _PIN(2)
202 #define SGPIO3 _PIN(3)
204 #define NUM_PADS (_PIN(3) + 1)
206 /* Pad names as specified in datasheet */
207 static const struct pinctrl_pin_desc s900_pads[] = {
208 PINCTRL_PIN(ETH_TXD0, "eth_txd0"),
209 PINCTRL_PIN(ETH_TXD1, "eth_txd1"),
210 PINCTRL_PIN(ETH_TXEN, "eth_txen"),
211 PINCTRL_PIN(ETH_RXER, "eth_rxer"),
212 PINCTRL_PIN(ETH_CRS_DV, "eth_crs_dv"),
213 PINCTRL_PIN(ETH_RXD1, "eth_rxd1"),
214 PINCTRL_PIN(ETH_RXD0, "eth_rxd0"),
215 PINCTRL_PIN(ETH_REF_CLK, "eth_ref_clk"),
216 PINCTRL_PIN(ETH_MDC, "eth_mdc"),
217 PINCTRL_PIN(ETH_MDIO, "eth_mdio"),
218 PINCTRL_PIN(SIRQ0, "sirq0"),
219 PINCTRL_PIN(SIRQ1, "sirq1"),
220 PINCTRL_PIN(SIRQ2, "sirq2"),
221 PINCTRL_PIN(I2S_D0, "i2s_d0"),
222 PINCTRL_PIN(I2S_BCLK0, "i2s_bclk0"),
223 PINCTRL_PIN(I2S_LRCLK0, "i2s_lrclk0"),
224 PINCTRL_PIN(I2S_MCLK0, "i2s_mclk0"),
225 PINCTRL_PIN(I2S_D1, "i2s_d1"),
226 PINCTRL_PIN(I2S_BCLK1, "i2s_bclk1"),
227 PINCTRL_PIN(I2S_LRCLK1, "i2s_lrclk1"),
228 PINCTRL_PIN(I2S_MCLK1, "i2s_mclk1"),
229 PINCTRL_PIN(PCM1_IN, "pcm1_in"),
230 PINCTRL_PIN(PCM1_CLK, "pcm1_clk"),
231 PINCTRL_PIN(PCM1_SYNC, "pcm1_sync"),
232 PINCTRL_PIN(PCM1_OUT, "pcm1_out"),
233 PINCTRL_PIN(ERAM_A5, "eram_a5"),
234 PINCTRL_PIN(ERAM_A6, "eram_a6"),
235 PINCTRL_PIN(ERAM_A7, "eram_a7"),
236 PINCTRL_PIN(ERAM_A8, "eram_a8"),
237 PINCTRL_PIN(ERAM_A9, "eram_a9"),
238 PINCTRL_PIN(ERAM_A10, "eram_a10"),
239 PINCTRL_PIN(ERAM_A11, "eram_a11"),
240 PINCTRL_PIN(LVDS_OEP, "lvds_oep"),
241 PINCTRL_PIN(LVDS_OEN, "lvds_oen"),
242 PINCTRL_PIN(LVDS_ODP, "lvds_odp"),
243 PINCTRL_PIN(LVDS_ODN, "lvds_odn"),
244 PINCTRL_PIN(LVDS_OCP, "lvds_ocp"),
245 PINCTRL_PIN(LVDS_OCN, "lvds_ocn"),
246 PINCTRL_PIN(LVDS_OBP, "lvds_obp"),
247 PINCTRL_PIN(LVDS_OBN, "lvds_obn"),
248 PINCTRL_PIN(LVDS_OAP, "lvds_oap"),
249 PINCTRL_PIN(LVDS_OAN, "lvds_oan"),
250 PINCTRL_PIN(LVDS_EEP, "lvds_eep"),
251 PINCTRL_PIN(LVDS_EEN, "lvds_een"),
252 PINCTRL_PIN(LVDS_EDP, "lvds_edp"),
253 PINCTRL_PIN(LVDS_EDN, "lvds_edn"),
254 PINCTRL_PIN(LVDS_ECP, "lvds_ecp"),
255 PINCTRL_PIN(LVDS_ECN, "lvds_ecn"),
256 PINCTRL_PIN(LVDS_EBP, "lvds_ebp"),
257 PINCTRL_PIN(LVDS_EBN, "lvds_ebn"),
258 PINCTRL_PIN(LVDS_EAP, "lvds_eap"),
259 PINCTRL_PIN(LVDS_EAN, "lvds_ean"),
260 PINCTRL_PIN(SD0_D0, "sd0_d0"),
261 PINCTRL_PIN(SD0_D1, "sd0_d1"),
262 PINCTRL_PIN(SD0_D2, "sd0_d2"),
263 PINCTRL_PIN(SD0_D3, "sd0_d3"),
264 PINCTRL_PIN(SD1_D0, "sd1_d0"),
265 PINCTRL_PIN(SD1_D1, "sd1_d1"),
266 PINCTRL_PIN(SD1_D2, "sd1_d2"),
267 PINCTRL_PIN(SD1_D3, "sd1_d3"),
268 PINCTRL_PIN(SD0_CMD, "sd0_cmd"),
269 PINCTRL_PIN(SD0_CLK, "sd0_clk"),
270 PINCTRL_PIN(SD1_CMD, "sd1_cmd"),
271 PINCTRL_PIN(SD1_CLK, "sd1_clk"),
272 PINCTRL_PIN(SPI0_SCLK, "spi0_sclk"),
273 PINCTRL_PIN(SPI0_SS, "spi0_ss"),
274 PINCTRL_PIN(SPI0_MISO, "spi0_miso"),
275 PINCTRL_PIN(SPI0_MOSI, "spi0_mosi"),
276 PINCTRL_PIN(UART0_RX, "uart0_rx"),
277 PINCTRL_PIN(UART0_TX, "uart0_tx"),
278 PINCTRL_PIN(UART2_RX, "uart2_rx"),
279 PINCTRL_PIN(UART2_TX, "uart2_tx"),
280 PINCTRL_PIN(UART2_RTSB, "uart2_rtsb"),
281 PINCTRL_PIN(UART2_CTSB, "uart2_ctsb"),
282 PINCTRL_PIN(UART3_RX, "uart3_rx"),
283 PINCTRL_PIN(UART3_TX, "uart3_tx"),
284 PINCTRL_PIN(UART3_RTSB, "uart3_rtsb"),
285 PINCTRL_PIN(UART3_CTSB, "uart3_ctsb"),
286 PINCTRL_PIN(UART4_RX, "uart4_rx"),
287 PINCTRL_PIN(UART4_TX, "uart4_tx"),
288 PINCTRL_PIN(I2C0_SCLK, "i2c0_sclk"),
289 PINCTRL_PIN(I2C0_SDATA, "i2c0_sdata"),
290 PINCTRL_PIN(I2C1_SCLK, "i2c1_sclk"),
291 PINCTRL_PIN(I2C1_SDATA, "i2c1_sdata"),
292 PINCTRL_PIN(I2C2_SCLK, "i2c2_sclk"),
293 PINCTRL_PIN(I2C2_SDATA, "i2c2_sdata"),
294 PINCTRL_PIN(CSI0_DN0, "csi0_dn0"),
295 PINCTRL_PIN(CSI0_DP0, "csi0_dp0"),
296 PINCTRL_PIN(CSI0_DN1, "csi0_dn1"),
297 PINCTRL_PIN(CSI0_DP1, "csi0_dp1"),
298 PINCTRL_PIN(CSI0_CN, "csi0_cn"),
299 PINCTRL_PIN(CSI0_CP, "csi0_cp"),
300 PINCTRL_PIN(CSI0_DN2, "csi0_dn2"),
301 PINCTRL_PIN(CSI0_DP2, "csi0_dp2"),
302 PINCTRL_PIN(CSI0_DN3, "csi0_dn3"),
303 PINCTRL_PIN(CSI0_DP3, "csi0_dp3"),
304 PINCTRL_PIN(DSI_DP3, "dsi_dp3"),
305 PINCTRL_PIN(DSI_DN3, "dsi_dn3"),
306 PINCTRL_PIN(DSI_DP1, "dsi_dp1"),
307 PINCTRL_PIN(DSI_DN1, "dsi_dn1"),
308 PINCTRL_PIN(DSI_CP, "dsi_cp"),
309 PINCTRL_PIN(DSI_CN, "dsi_cn"),
310 PINCTRL_PIN(DSI_DP0, "dsi_dp0"),
311 PINCTRL_PIN(DSI_DN0, "dsi_dn0"),
312 PINCTRL_PIN(DSI_DP2, "dsi_dp2"),
313 PINCTRL_PIN(DSI_DN2, "dsi_dn2"),
314 PINCTRL_PIN(SENSOR0_PCLK, "sensor0_pclk"),
315 PINCTRL_PIN(CSI1_DN0, "csi1_dn0"),
316 PINCTRL_PIN(CSI1_DP0, "csi1_dp0"),
317 PINCTRL_PIN(CSI1_DN1, "csi1_dn1"),
318 PINCTRL_PIN(CSI1_DP1, "csi1_dp1"),
319 PINCTRL_PIN(CSI1_CN, "csi1_cn"),
320 PINCTRL_PIN(CSI1_CP, "csi1_cp"),
321 PINCTRL_PIN(SENSOR0_CKOUT, "sensor0_ckout"),
322 PINCTRL_PIN(NAND0_D0, "nand0_d0"),
323 PINCTRL_PIN(NAND0_D1, "nand0_d1"),
324 PINCTRL_PIN(NAND0_D2, "nand0_d2"),
325 PINCTRL_PIN(NAND0_D3, "nand0_d3"),
326 PINCTRL_PIN(NAND0_D4, "nand0_d4"),
327 PINCTRL_PIN(NAND0_D5, "nand0_d5"),
328 PINCTRL_PIN(NAND0_D6, "nand0_d6"),
329 PINCTRL_PIN(NAND0_D7, "nand0_d7"),
330 PINCTRL_PIN(NAND0_DQS, "nand0_dqs"),
331 PINCTRL_PIN(NAND0_DQSN, "nand0_dqsn"),
332 PINCTRL_PIN(NAND0_ALE, "nand0_ale"),
333 PINCTRL_PIN(NAND0_CLE, "nand0_cle"),
334 PINCTRL_PIN(NAND0_CEB0, "nand0_ceb0"),
335 PINCTRL_PIN(NAND0_CEB1, "nand0_ceb1"),
336 PINCTRL_PIN(NAND0_CEB2, "nand0_ceb2"),
337 PINCTRL_PIN(NAND0_CEB3, "nand0_ceb3"),
338 PINCTRL_PIN(NAND1_D0, "nand1_d0"),
339 PINCTRL_PIN(NAND1_D1, "nand1_d1"),
340 PINCTRL_PIN(NAND1_D2, "nand1_d2"),
341 PINCTRL_PIN(NAND1_D3, "nand1_d3"),
342 PINCTRL_PIN(NAND1_D4, "nand1_d4"),
343 PINCTRL_PIN(NAND1_D5, "nand1_d5"),
344 PINCTRL_PIN(NAND1_D6, "nand1_d6"),
345 PINCTRL_PIN(NAND1_D7, "nand1_d7"),
346 PINCTRL_PIN(NAND1_DQS, "nand1_dqs"),
347 PINCTRL_PIN(NAND1_DQSN, "nand1_dqsn"),
348 PINCTRL_PIN(NAND1_ALE, "nand1_ale"),
349 PINCTRL_PIN(NAND1_CLE, "nand1_cle"),
350 PINCTRL_PIN(NAND1_CEB0, "nand1_ceb0"),
351 PINCTRL_PIN(NAND1_CEB1, "nand1_ceb1"),
352 PINCTRL_PIN(NAND1_CEB2, "nand1_ceb2"),
353 PINCTRL_PIN(NAND1_CEB3, "nand1_ceb3"),
354 PINCTRL_PIN(SGPIO0, "sgpio0"),
355 PINCTRL_PIN(SGPIO1, "sgpio1"),
356 PINCTRL_PIN(SGPIO2, "sgpio2"),
357 PINCTRL_PIN(SGPIO3, "sgpio3")
360 enum s900_pinmux_functions {
416 static unsigned int lvds_oxx_uart4_mfp_pads[] = { LVDS_OAP, LVDS_OAN };
417 static unsigned int lvds_oxx_uart4_mfp_funcs[] = { S900_MUX_ERAM,
420 static unsigned int rmii_mdc_mfp_pads[] = { ETH_MDC };
421 static unsigned int rmii_mdc_mfp_funcs[] = { S900_MUX_ETH_RMII,
425 static unsigned int rmii_mdio_mfp_pads[] = { ETH_MDIO };
426 static unsigned int rmii_mdio_mfp_funcs[] = { S900_MUX_ETH_RMII,
431 static unsigned int sirq0_mfp_pads[] = { SIRQ0 };
432 static unsigned int sirq0_mfp_funcs[] = { S900_MUX_SIRQ0,
434 static unsigned int sirq1_mfp_pads[] = { SIRQ1 };
435 static unsigned int sirq1_mfp_funcs[] = { S900_MUX_SIRQ1,
438 static unsigned int rmii_txd0_mfp_pads[] = { ETH_TXD0 };
439 static unsigned int rmii_txd0_mfp_funcs[] = { S900_MUX_ETH_RMII,
445 static unsigned int rmii_txd1_mfp_pads[] = { ETH_TXD1 };
446 static unsigned int rmii_txd1_mfp_funcs[] = { S900_MUX_ETH_RMII,
453 static unsigned int rmii_txen_mfp_pads[] = { ETH_TXEN };
454 static unsigned int rmii_txen_mfp_funcs[] = { S900_MUX_ETH_RMII,
462 static unsigned int rmii_rxer_mfp_pads[] = { ETH_RXER };
463 static unsigned int rmii_rxer_mfp_funcs[] = { S900_MUX_ETH_RMII,
471 static unsigned int rmii_crs_dv_mfp_pads[] = { ETH_CRS_DV };
472 static unsigned int rmii_crs_dv_mfp_funcs[] = { S900_MUX_ETH_RMII,
477 static unsigned int rmii_rxd1_mfp_pads[] = { ETH_RXD1 };
478 static unsigned int rmii_rxd1_mfp_funcs[] = { S900_MUX_ETH_RMII,
485 static unsigned int rmii_rxd0_mfp_pads[] = { ETH_RXD0 };
486 static unsigned int rmii_rxd0_mfp_funcs[] = { S900_MUX_ETH_RMII,
494 static unsigned int rmii_ref_clk_mfp_pads[] = { ETH_REF_CLK };
495 static unsigned int rmii_ref_clk_mfp_funcs[] = { S900_MUX_ETH_RMII,
500 static unsigned int i2s_d0_mfp_pads[] = { I2S_D0 };
501 static unsigned int i2s_d0_mfp_funcs[] = { S900_MUX_I2S0,
503 static unsigned int i2s_d1_mfp_pads[] = { I2S_D1 };
504 static unsigned int i2s_d1_mfp_funcs[] = { S900_MUX_I2S1,
508 static unsigned int i2s_lr_m_clk0_mfp_pads[] = { I2S_LRCLK0,
510 static unsigned int i2s_lr_m_clk0_mfp_funcs[] = { S900_MUX_I2S0,
515 static unsigned int i2s_bclk0_mfp_pads[] = { I2S_BCLK0 };
516 static unsigned int i2s_bclk0_mfp_funcs[] = { S900_MUX_I2S0,
518 static unsigned int i2s_bclk1_mclk1_mfp_pads[] = { I2S_BCLK1,
521 static unsigned int i2s_bclk1_mclk1_mfp_funcs[] = { S900_MUX_I2S1,
524 static unsigned int pcm1_in_out_mfp_pads[] = { PCM1_IN,
526 static unsigned int pcm1_in_out_mfp_funcs[] = { S900_MUX_PCM1,
530 static unsigned int pcm1_clk_mfp_pads[] = { PCM1_CLK };
531 static unsigned int pcm1_clk_mfp_funcs[] = { S900_MUX_PCM1,
535 static unsigned int pcm1_sync_mfp_pads[] = { PCM1_SYNC };
536 static unsigned int pcm1_sync_mfp_funcs[] = { S900_MUX_PCM1,
541 static unsigned int eram_a5_mfp_pads[] = { ERAM_A5 };
542 static unsigned int eram_a5_mfp_funcs[] = { S900_MUX_UART4,
548 static unsigned int eram_a6_mfp_pads[] = { ERAM_A6 };
549 static unsigned int eram_a6_mfp_funcs[] = { S900_MUX_UART4,
556 static unsigned int eram_a7_mfp_pads[] = { ERAM_A7 };
557 static unsigned int eram_a7_mfp_funcs[] = { S900_MUX_RESERVED,
564 static unsigned int eram_a8_mfp_pads[] = { ERAM_A8 };
565 static unsigned int eram_a8_mfp_funcs[] = { S900_MUX_RESERVED,
571 static unsigned int eram_a9_mfp_pads[] = { ERAM_A9 };
572 static unsigned int eram_a9_mfp_funcs[] = { S900_MUX_USB20,
578 static unsigned int eram_a10_mfp_pads[] = { ERAM_A10 };
579 static unsigned int eram_a10_mfp_funcs[] = { S900_MUX_USB30,
588 static unsigned int eram_a11_mfp_pads[] = { ERAM_A11 };
589 static unsigned int eram_a11_mfp_funcs[] = { S900_MUX_RESERVED,
598 static unsigned int lvds_oep_odn_mfp_pads[] = { LVDS_OEP,
602 static unsigned int lvds_oep_odn_mfp_funcs[] = { S900_MUX_LVDS,
604 static unsigned int lvds_ocp_obn_mfp_pads[] = { LVDS_OCP,
608 static unsigned int lvds_ocp_obn_mfp_funcs[] = { S900_MUX_LVDS,
610 static unsigned int lvds_oap_oan_mfp_pads[] = { LVDS_OAP,
612 static unsigned int lvds_oap_oan_mfp_funcs[] = { S900_MUX_LVDS,
615 static unsigned int lvds_e_mfp_pads[] = { LVDS_EEP,
625 static unsigned int lvds_e_mfp_funcs[] = { S900_MUX_LVDS,
628 static unsigned int spi0_sclk_mosi_mfp_pads[] = { SPI0_SCLK,
630 static unsigned int spi0_sclk_mosi_mfp_funcs[] = { S900_MUX_SPI0,
635 static unsigned int spi0_ss_mfp_pads[] = { SPI0_SS };
636 static unsigned int spi0_ss_mfp_funcs[] = { S900_MUX_SPI0,
642 static unsigned int spi0_miso_mfp_pads[] = { SPI0_MISO };
643 static unsigned int spi0_miso_mfp_funcs[] = { S900_MUX_SPI0,
650 static unsigned int uart2_rtsb_mfp_pads[] = { UART2_RTSB };
651 static unsigned int uart2_rtsb_mfp_funcs[] = { S900_MUX_UART2,
654 static unsigned int uart2_ctsb_mfp_pads[] = { UART2_CTSB };
655 static unsigned int uart2_ctsb_mfp_funcs[] = { S900_MUX_UART2,
658 static unsigned int uart3_rtsb_mfp_pads[] = { UART3_RTSB };
659 static unsigned int uart3_rtsb_mfp_funcs[] = { S900_MUX_UART3,
662 static unsigned int uart3_ctsb_mfp_pads[] = { UART3_CTSB };
663 static unsigned int uart3_ctsb_mfp_funcs[] = { S900_MUX_UART3,
666 static unsigned int sd0_d0_mfp_pads[] = { SD0_D0 };
667 static unsigned int sd0_d0_mfp_funcs[] = { S900_MUX_SD0,
675 static unsigned int sd0_d1_mfp_pads[] = { SD0_D1 };
676 static unsigned int sd0_d1_mfp_funcs[] = { S900_MUX_SD0,
683 static unsigned int sd0_d2_d3_mfp_pads[] = { SD0_D2,
685 static unsigned int sd0_d2_d3_mfp_funcs[] = { S900_MUX_SD0,
693 static unsigned int sd1_d0_d3_mfp_pads[] = { SD1_D0, SD1_D1,
695 static unsigned int sd1_d0_d3_mfp_funcs[] = { S900_MUX_SD1,
698 static unsigned int sd0_cmd_mfp_pads[] = { SD0_CMD };
699 static unsigned int sd0_cmd_mfp_funcs[] = { S900_MUX_SD0,
704 static unsigned int sd0_clk_mfp_pads[] = { SD0_CLK };
705 static unsigned int sd0_clk_mfp_funcs[] = { S900_MUX_SD0,
710 static unsigned int sd1_cmd_clk_mfp_pads[] = { SD1_CMD, SD1_CLK };
711 static unsigned int sd1_cmd_clk_mfp_funcs[] = { S900_MUX_SD1,
714 static unsigned int uart0_rx_mfp_pads[] = { UART0_RX };
715 static unsigned int uart0_rx_mfp_funcs[] = { S900_MUX_UART0,
722 static unsigned int nand0_d0_ceb3_mfp_pads[] = { NAND0_D0, NAND0_D1,
726 NAND0_DQSN, NAND0_CEB3 };
727 static unsigned int nand0_d0_ceb3_mfp_funcs[] = { S900_MUX_NAND0,
730 static unsigned int uart0_tx_mfp_pads[] = { UART0_TX };
731 static unsigned int uart0_tx_mfp_funcs[] = { S900_MUX_UART0,
739 static unsigned int i2c0_mfp_pads[] = { I2C0_SCLK, I2C0_SDATA };
740 static unsigned int i2c0_mfp_funcs[] = { S900_MUX_I2C0,
746 static unsigned int csi0_cn_cp_mfp_pads[] = { CSI0_CN, CSI0_CP };
747 static unsigned int csi0_cn_cp_mfp_funcs[] = { S900_MUX_SENS0,
750 static unsigned int csi0_dn0_dp3_mfp_pads[] = { CSI0_DN0, CSI0_DP0,
754 CSI0_DN3, CSI0_DP3 };
755 static unsigned int csi0_dn0_dp3_mfp_funcs[] = { S900_MUX_MIPI_CSI0,
758 static unsigned int csi1_dn0_cp_mfp_pads[] = { CSI1_DN0, CSI1_DP0,
761 static unsigned int csi1_dn0_cp_mfp_funcs[] = { S900_MUX_MIPI_CSI1,
764 static unsigned int dsi_dp3_dn1_mfp_pads[] = { DSI_DP3, DSI_DN2,
766 static unsigned int dsi_dp3_dn1_mfp_funcs[] = { S900_MUX_MIPI_DSI,
768 static unsigned int dsi_cp_dn0_mfp_pads[] = { DSI_CP, DSI_CN,
770 static unsigned int dsi_cp_dn0_mfp_funcs[] = { S900_MUX_MIPI_DSI,
772 static unsigned int dsi_dp2_dn2_mfp_pads[] = { DSI_DP2, DSI_DN2 };
773 static unsigned int dsi_dp2_dn2_mfp_funcs[] = { S900_MUX_MIPI_DSI,
776 static unsigned int nand1_d0_ceb1_mfp_pads[] = { NAND1_D0, NAND1_D1,
780 NAND1_DQSN, NAND1_CEB1 };
781 static unsigned int nand1_d0_ceb1_mfp_funcs[] = { S900_MUX_NAND1,
784 static unsigned int nand1_ceb3_mfp_pads[] = { NAND1_CEB3 };
785 static unsigned int nand1_ceb3_mfp_funcs[] = { S900_MUX_NAND1,
787 static unsigned int nand1_ceb0_mfp_pads[] = { NAND1_CEB0 };
788 static unsigned int nand1_ceb0_mfp_funcs[] = { S900_MUX_NAND1,
791 static unsigned int csi1_dn0_dp0_mfp_pads[] = { CSI1_DN0, CSI1_DP0 };
792 static unsigned int csi1_dn0_dp0_mfp_funcs[] = { S900_MUX_SENS0,
795 static unsigned int uart4_rx_tx_mfp_pads[] = { UART4_RX, UART4_TX };
796 static unsigned int uart4_rx_tx_mfp_funcs[] = { S900_MUX_UART4,
798 /* PADDRV group data */
800 static unsigned int sgpio3_drv_pads[] = { SGPIO3 };
801 static unsigned int sgpio2_drv_pads[] = { SGPIO2 };
802 static unsigned int sgpio1_drv_pads[] = { SGPIO1 };
803 static unsigned int sgpio0_drv_pads[] = { SGPIO0 };
804 static unsigned int rmii_tx_d0_d1_drv_pads[] = { ETH_TXD0, ETH_TXD1 };
805 static unsigned int rmii_txen_rxer_drv_pads[] = { ETH_TXEN, ETH_RXER };
806 static unsigned int rmii_crs_dv_drv_pads[] = { ETH_CRS_DV };
807 static unsigned int rmii_rx_d1_d0_drv_pads[] = { ETH_RXD1, ETH_RXD0 };
808 static unsigned int rmii_ref_clk_drv_pads[] = { ETH_REF_CLK };
809 static unsigned int rmii_mdc_mdio_drv_pads[] = { ETH_MDC, ETH_MDIO };
810 static unsigned int sirq_0_1_drv_pads[] = { SIRQ0, SIRQ1 };
811 static unsigned int sirq2_drv_pads[] = { SIRQ2 };
812 static unsigned int i2s_d0_d1_drv_pads[] = { I2S_D0, I2S_D1 };
813 static unsigned int i2s_lr_m_clk0_drv_pads[] = { I2S_LRCLK0, I2S_MCLK0 };
814 static unsigned int i2s_blk1_mclk1_drv_pads[] = { I2S_BCLK0, I2S_BCLK1,
815 I2S_LRCLK1, I2S_MCLK1 };
816 static unsigned int pcm1_in_out_drv_pads[] = { PCM1_IN, PCM1_CLK,
817 PCM1_SYNC, PCM1_OUT };
819 static unsigned int lvds_oap_oan_drv_pads[] = { LVDS_OAP, LVDS_OAN };
820 static unsigned int lvds_oep_odn_drv_pads[] = { LVDS_OEP, LVDS_OEN,
821 LVDS_ODP, LVDS_ODN };
822 static unsigned int lvds_ocp_obn_drv_pads[] = { LVDS_OCP, LVDS_OCN,
823 LVDS_OBP, LVDS_OBN };
824 static unsigned int lvds_e_drv_pads[] = { LVDS_EEP, LVDS_EEN,
827 LVDS_EBP, LVDS_EBN };
828 static unsigned int sd0_d3_d0_drv_pads[] = { SD0_D3, SD0_D2,
830 static unsigned int sd1_d3_d0_drv_pads[] = { SD1_D3, SD1_D2,
832 static unsigned int sd0_sd1_cmd_clk_drv_pads[] = { SD0_CLK, SD0_CMD,
834 static unsigned int spi0_sclk_mosi_drv_pads[] = { SPI0_SCLK, SPI0_MOSI };
835 static unsigned int spi0_ss_miso_drv_pads[] = { SPI0_SS, SPI0_MISO };
836 static unsigned int uart0_rx_tx_drv_pads[] = { UART0_RX, UART0_TX };
837 static unsigned int uart4_rx_tx_drv_pads[] = { UART4_RX, UART4_TX };
838 static unsigned int uart2_drv_pads[] = { UART2_RX, UART2_TX,
839 UART2_RTSB, UART2_CTSB };
840 static unsigned int uart3_drv_pads[] = { UART3_RX, UART3_TX,
841 UART3_RTSB, UART3_CTSB };
843 static unsigned int i2c0_drv_pads[] = { I2C0_SCLK, I2C0_SDATA };
844 static unsigned int i2c1_drv_pads[] = { I2C1_SCLK, I2C1_SDATA };
845 static unsigned int i2c2_drv_pads[] = { I2C2_SCLK, I2C2_SDATA };
846 static unsigned int sensor0_drv_pads[] = { SENSOR0_PCLK,
850 static unsigned int sgpio3_sr_pads[] = { SGPIO3 };
851 static unsigned int sgpio2_sr_pads[] = { SGPIO2 };
852 static unsigned int sgpio1_sr_pads[] = { SGPIO1 };
853 static unsigned int sgpio0_sr_pads[] = { SGPIO0 };
854 static unsigned int rmii_tx_d0_d1_sr_pads[] = { ETH_TXD0, ETH_TXD1 };
855 static unsigned int rmii_txen_rxer_sr_pads[] = { ETH_TXEN, ETH_RXER };
856 static unsigned int rmii_crs_dv_sr_pads[] = { ETH_CRS_DV };
857 static unsigned int rmii_rx_d1_d0_sr_pads[] = { ETH_RXD1, ETH_RXD0 };
858 static unsigned int rmii_ref_clk_sr_pads[] = { ETH_REF_CLK };
859 static unsigned int rmii_mdc_mdio_sr_pads[] = { ETH_MDC, ETH_MDIO };
860 static unsigned int sirq_0_1_sr_pads[] = { SIRQ0, SIRQ1 };
861 static unsigned int sirq2_sr_pads[] = { SIRQ2 };
862 static unsigned int i2s_do_d1_sr_pads[] = { I2S_D0, I2S_D1 };
863 static unsigned int i2s_lr_m_clk0_sr_pads[] = { I2S_LRCLK0, I2S_MCLK0 };
864 static unsigned int i2s_bclk0_mclk1_sr_pads[] = { I2S_BCLK0, I2S_BCLK1,
865 I2S_LRCLK1, I2S_MCLK1 };
866 static unsigned int pcm1_in_out_sr_pads[] = { PCM1_IN, PCM1_CLK,
867 PCM1_SYNC, PCM1_OUT };
869 static unsigned int sd1_d3_d0_sr_pads[] = { SD1_D3, SD1_D2,
871 static unsigned int sd0_sd1_clk_cmd_sr_pads[] = { SD0_CLK, SD0_CMD,
873 static unsigned int spi0_sclk_mosi_sr_pads[] = { SPI0_SCLK, SPI0_MOSI };
874 static unsigned int spi0_ss_miso_sr_pads[] = { SPI0_SS, SPI0_MISO };
875 static unsigned int uart0_rx_tx_sr_pads[] = { UART0_RX, UART0_TX };
876 static unsigned int uart4_rx_tx_sr_pads[] = { UART4_RX, UART4_TX };
877 static unsigned int uart2_sr_pads[] = { UART2_RX, UART2_TX,
878 UART2_RTSB, UART2_CTSB };
879 static unsigned int uart3_sr_pads[] = { UART3_RX, UART3_TX,
880 UART3_RTSB, UART3_CTSB };
882 static unsigned int i2c0_sr_pads[] = { I2C0_SCLK, I2C0_SDATA };
883 static unsigned int i2c1_sr_pads[] = { I2C1_SCLK, I2C1_SDATA };
884 static unsigned int i2c2_sr_pads[] = { I2C2_SCLK, I2C2_SDATA };
885 static unsigned int sensor0_sr_pads[] = { SENSOR0_PCLK,
888 #define MUX_PG(group_name, reg, shift, width) \
890 .name = #group_name, \
891 .pads = group_name##_pads, \
892 .npads = ARRAY_SIZE(group_name##_pads), \
893 .funcs = group_name##_funcs, \
894 .nfuncs = ARRAY_SIZE(group_name##_funcs), \
895 .mfpctl_reg = MFCTL##reg, \
896 .mfpctl_shift = shift, \
897 .mfpctl_width = width, \
906 #define DRV_PG(group_name, reg, shift, width) \
908 .name = #group_name, \
909 .pads = group_name##_pads, \
910 .npads = ARRAY_SIZE(group_name##_pads), \
912 .mfpctl_shift = -1, \
913 .mfpctl_width = -1, \
914 .drv_reg = PAD_DRV##reg, \
915 .drv_shift = shift, \
916 .drv_width = width, \
922 #define SR_PG(group_name, reg, shift, width) \
924 .name = #group_name, \
925 .pads = group_name##_pads, \
926 .npads = ARRAY_SIZE(group_name##_pads), \
928 .mfpctl_shift = -1, \
929 .mfpctl_width = -1, \
933 .sr_reg = PAD_SR##reg, \
939 static const struct owl_pingroup s900_groups[] = {
940 MUX_PG(lvds_oxx_uart4_mfp, 0, 22, 1),
941 MUX_PG(rmii_mdc_mfp, 0, 20, 2),
942 MUX_PG(rmii_mdio_mfp, 0, 20, 2),
943 MUX_PG(sirq0_mfp, 0, 19, 1),
944 MUX_PG(sirq1_mfp, 0, 19, 1),
945 MUX_PG(rmii_txd0_mfp, 0, 16, 3),
946 MUX_PG(rmii_txd1_mfp, 0, 16, 3),
947 MUX_PG(rmii_txen_mfp, 0, 13, 3),
948 MUX_PG(rmii_rxer_mfp, 0, 13, 3),
949 MUX_PG(rmii_crs_dv_mfp, 0, 11, 2),
950 MUX_PG(rmii_rxd1_mfp, 0, 8, 3),
951 MUX_PG(rmii_rxd0_mfp, 0, 8, 3),
952 MUX_PG(rmii_ref_clk_mfp, 0, 6, 2),
953 MUX_PG(i2s_d0_mfp, 0, 5, 1),
954 MUX_PG(i2s_d1_mfp, 0, 5, 1),
955 MUX_PG(i2s_lr_m_clk0_mfp, 0, 3, 2),
956 MUX_PG(i2s_bclk0_mfp, 0, 2, 1),
957 MUX_PG(i2s_bclk1_mclk1_mfp, 0, 2, 1),
958 MUX_PG(pcm1_in_out_mfp, 0, 0, 2),
959 MUX_PG(pcm1_clk_mfp, 0, 0, 2),
960 MUX_PG(pcm1_sync_mfp, 0, 0, 2),
961 MUX_PG(eram_a5_mfp, 1, 29, 3),
962 MUX_PG(eram_a6_mfp, 1, 29, 3),
963 MUX_PG(eram_a7_mfp, 1, 29, 3),
964 MUX_PG(eram_a8_mfp, 1, 26, 3),
965 MUX_PG(eram_a9_mfp, 1, 26, 3),
966 MUX_PG(eram_a10_mfp, 1, 26, 3),
967 MUX_PG(eram_a11_mfp, 1, 23, 3),
968 MUX_PG(lvds_oep_odn_mfp, 1, 22, 1),
969 MUX_PG(lvds_ocp_obn_mfp, 1, 22, 1),
970 MUX_PG(lvds_oap_oan_mfp, 1, 22, 1),
971 MUX_PG(lvds_e_mfp, 1, 21, 1),
972 MUX_PG(spi0_sclk_mosi_mfp, 1, 4, 2),
973 MUX_PG(spi0_ss_mfp, 1, 1, 3),
974 MUX_PG(spi0_miso_mfp, 1, 1, 3),
975 MUX_PG(uart2_rtsb_mfp, 2, 23, 1),
976 MUX_PG(uart2_ctsb_mfp, 2, 22, 1),
977 MUX_PG(uart3_rtsb_mfp, 2, 21, 1),
978 MUX_PG(uart3_ctsb_mfp, 2, 20, 1),
979 MUX_PG(sd0_d0_mfp, 2, 17, 3),
980 MUX_PG(sd0_d1_mfp, 2, 14, 3),
981 MUX_PG(sd0_d2_d3_mfp, 2, 11, 3),
982 MUX_PG(sd1_d0_d3_mfp, 2, 9, 2),
983 MUX_PG(sd0_cmd_mfp, 2, 7, 2),
984 MUX_PG(sd0_clk_mfp, 2, 5, 2),
985 MUX_PG(sd1_cmd_clk_mfp, 2, 3, 2),
986 MUX_PG(uart0_rx_mfp, 2, 0, 3),
987 MUX_PG(nand0_d0_ceb3_mfp, 3, 27, 1),
988 MUX_PG(uart0_tx_mfp, 3, 19, 3),
989 MUX_PG(i2c0_mfp, 3, 16, 3),
990 MUX_PG(csi0_cn_cp_mfp, 3, 15, 1),
991 MUX_PG(csi0_dn0_dp3_mfp, 3, 14, 1),
992 MUX_PG(csi1_dn0_cp_mfp, 3, 13, 1),
993 MUX_PG(dsi_dp3_dn1_mfp, 3, 12, 1),
994 MUX_PG(dsi_cp_dn0_mfp, 3, 12, 1),
995 MUX_PG(dsi_dp2_dn2_mfp, 3, 12, 1),
996 MUX_PG(nand1_d0_ceb1_mfp, 3, 11, 1),
997 MUX_PG(nand1_ceb3_mfp, 3, 10, 1),
998 MUX_PG(nand1_ceb0_mfp, 3, 10, 1),
999 MUX_PG(csi1_dn0_dp0_mfp, 3, 9, 1),
1000 MUX_PG(uart4_rx_tx_mfp, 3, 8, 1),
1002 DRV_PG(sgpio3_drv, 0, 30, 2),
1003 DRV_PG(sgpio2_drv, 0, 28, 2),
1004 DRV_PG(sgpio1_drv, 0, 26, 2),
1005 DRV_PG(sgpio0_drv, 0, 24, 2),
1006 DRV_PG(rmii_tx_d0_d1_drv, 0, 22, 2),
1007 DRV_PG(rmii_txen_rxer_drv, 0, 20, 2),
1008 DRV_PG(rmii_crs_dv_drv, 0, 18, 2),
1009 DRV_PG(rmii_rx_d1_d0_drv, 0, 16, 2),
1010 DRV_PG(rmii_ref_clk_drv, 0, 14, 2),
1011 DRV_PG(rmii_mdc_mdio_drv, 0, 12, 2),
1012 DRV_PG(sirq_0_1_drv, 0, 10, 2),
1013 DRV_PG(sirq2_drv, 0, 8, 2),
1014 DRV_PG(i2s_d0_d1_drv, 0, 6, 2),
1015 DRV_PG(i2s_lr_m_clk0_drv, 0, 4, 2),
1016 DRV_PG(i2s_blk1_mclk1_drv, 0, 2, 2),
1017 DRV_PG(pcm1_in_out_drv, 0, 0, 2),
1018 DRV_PG(lvds_oap_oan_drv, 1, 28, 2),
1019 DRV_PG(lvds_oep_odn_drv, 1, 26, 2),
1020 DRV_PG(lvds_ocp_obn_drv, 1, 24, 2),
1021 DRV_PG(lvds_e_drv, 1, 22, 2),
1022 DRV_PG(sd0_d3_d0_drv, 1, 20, 2),
1023 DRV_PG(sd1_d3_d0_drv, 1, 18, 2),
1024 DRV_PG(sd0_sd1_cmd_clk_drv, 1, 16, 2),
1025 DRV_PG(spi0_sclk_mosi_drv, 1, 14, 2),
1026 DRV_PG(spi0_ss_miso_drv, 1, 12, 2),
1027 DRV_PG(uart0_rx_tx_drv, 1, 10, 2),
1028 DRV_PG(uart4_rx_tx_drv, 1, 8, 2),
1029 DRV_PG(uart2_drv, 1, 6, 2),
1030 DRV_PG(uart3_drv, 1, 4, 2),
1031 DRV_PG(i2c0_drv, 2, 30, 2),
1032 DRV_PG(i2c1_drv, 2, 28, 2),
1033 DRV_PG(i2c2_drv, 2, 26, 2),
1034 DRV_PG(sensor0_drv, 2, 20, 2),
1036 SR_PG(sgpio3_sr, 0, 15, 1),
1037 SR_PG(sgpio2_sr, 0, 14, 1),
1038 SR_PG(sgpio1_sr, 0, 13, 1),
1039 SR_PG(sgpio0_sr, 0, 12, 1),
1040 SR_PG(rmii_tx_d0_d1_sr, 0, 11, 1),
1041 SR_PG(rmii_txen_rxer_sr, 0, 10, 1),
1042 SR_PG(rmii_crs_dv_sr, 0, 9, 1),
1043 SR_PG(rmii_rx_d1_d0_sr, 0, 8, 1),
1044 SR_PG(rmii_ref_clk_sr, 0, 7, 1),
1045 SR_PG(rmii_mdc_mdio_sr, 0, 6, 1),
1046 SR_PG(sirq_0_1_sr, 0, 5, 1),
1047 SR_PG(sirq2_sr, 0, 4, 1),
1048 SR_PG(i2s_do_d1_sr, 0, 3, 1),
1049 SR_PG(i2s_lr_m_clk0_sr, 0, 2, 1),
1050 SR_PG(i2s_bclk0_mclk1_sr, 0, 1, 1),
1051 SR_PG(pcm1_in_out_sr, 0, 0, 1),
1052 SR_PG(sd1_d3_d0_sr, 1, 25, 1),
1053 SR_PG(sd0_sd1_clk_cmd_sr, 1, 24, 1),
1054 SR_PG(spi0_sclk_mosi_sr, 1, 23, 1),
1055 SR_PG(spi0_ss_miso_sr, 1, 22, 1),
1056 SR_PG(uart0_rx_tx_sr, 1, 21, 1),
1057 SR_PG(uart4_rx_tx_sr, 1, 20, 1),
1058 SR_PG(uart2_sr, 1, 19, 1),
1059 SR_PG(uart3_sr, 1, 18, 1),
1060 SR_PG(i2c0_sr, 2, 31, 1),
1061 SR_PG(i2c1_sr, 2, 30, 1),
1062 SR_PG(i2c2_sr, 2, 29, 1),
1063 SR_PG(sensor0_sr, 2, 25, 1)
1066 static const char * const eram_groups[] = {
1067 "lvds_oxx_uart4_mfp",
1077 "spi0_sclk_mosi_mfp",
1089 static const char * const eth_rmii_groups[] = {
1103 static const char * const eth_smii_groups[] = {
1110 static const char * const spi0_groups[] = {
1111 "spi0_sclk_mosi_mfp",
1114 "spi0_sclk_mosi_mfp",
1119 static const char * const spi1_groups[] = {
1128 static const char * const spi2_groups[] = {
1135 static const char * const spi3_groups[] = {
1140 static const char * const sens0_groups[] = {
1158 static const char * const uart0_groups[] = {
1165 static const char * const uart1_groups[] = {
1170 static const char * const uart2_groups[] = {
1184 "uart0_tx_mfp_pads",
1190 static const char * const uart3_groups[] = {
1196 static const char * const uart4_groups[] = {
1197 "lvds_oxx_uart4_mfp",
1206 "uart4_rx_tx_mfp_pads",
1210 static const char * const uart5_groups[] = {
1221 static const char * const uart6_groups[] = {
1226 static const char * const i2s0_groups[] = {
1228 "i2s_lr_m_clk0_mfp",
1233 static const char * const i2s1_groups[] = {
1235 "i2s_bclk1_mclk1_mfp",
1243 static const char * const pcm0_groups[] = {
1246 "i2s_lr_m_clk0_mfp",
1248 "i2s_bclk1_mclk1_mfp",
1249 "spi0_sclk_mosi_mfp",
1254 static const char * const pcm1_groups[] = {
1255 "i2s_lr_m_clk0_mfp",
1268 static const char * const jtag_groups[] = {
1280 static const char * const pwm0_groups[] = {
1288 static const char * const pwm1_groups[] = {
1297 static const char * const pwm2_groups[] = {
1304 static const char * const pwm3_groups[] = {
1310 static const char * const pwm4_groups[] = {
1315 static const char * const pwm5_groups[] = {
1320 static const char * const sd0_groups[] = {
1328 static const char * const sd1_groups[] = {
1334 static const char * const sd2_groups[] = {
1335 "nand0_d0_ceb3_mfp",
1338 static const char * const sd3_groups[] = {
1339 "nand1_d0_ceb1_mfp",
1342 static const char * const i2c0_groups[] = {
1346 static const char * const i2c1_groups[] = {
1351 static const char * const i2c2_groups[] = {
1355 static const char * const i2c3_groups[] = {
1357 "spi0_sclk_mosi_mfp",
1360 static const char * const i2c4_groups[] = {
1364 static const char * const i2c5_groups[] = {
1370 static const char * const lvds_groups[] = {
1377 static const char * const usb20_groups[] = {
1381 static const char * const usb30_groups[] = {
1385 static const char * const gpu_groups[] = {
1393 static const char * const mipi_csi0_groups[] = {
1397 static const char * const mipi_csi1_groups[] = {
1401 static const char * const mipi_dsi_groups[] = {
1408 static const char * const nand0_groups[] = {
1409 "nand0_d0_ceb3_mfp",
1413 static const char * const nand1_groups[] = {
1414 "nand1_d0_ceb1_mfp",
1420 static const char * const spdif_groups[] = {
1424 static const char * const sirq0_groups[] = {
1429 static const char * const sirq1_groups[] = {
1434 static const char * const sirq2_groups[] = {
1438 #define FUNCTION(fname) \
1441 .groups = fname##_groups, \
1442 .ngroups = ARRAY_SIZE(fname##_groups), \
1445 static const struct owl_pinmux_func s900_functions[] = {
1446 [S900_MUX_ERAM] = FUNCTION(eram),
1447 [S900_MUX_ETH_RMII] = FUNCTION(eth_rmii),
1448 [S900_MUX_ETH_SMII] = FUNCTION(eth_smii),
1449 [S900_MUX_SPI0] = FUNCTION(spi0),
1450 [S900_MUX_SPI1] = FUNCTION(spi1),
1451 [S900_MUX_SPI2] = FUNCTION(spi2),
1452 [S900_MUX_SPI3] = FUNCTION(spi3),
1453 [S900_MUX_SENS0] = FUNCTION(sens0),
1454 [S900_MUX_UART0] = FUNCTION(uart0),
1455 [S900_MUX_UART1] = FUNCTION(uart1),
1456 [S900_MUX_UART2] = FUNCTION(uart2),
1457 [S900_MUX_UART3] = FUNCTION(uart3),
1458 [S900_MUX_UART4] = FUNCTION(uart4),
1459 [S900_MUX_UART5] = FUNCTION(uart5),
1460 [S900_MUX_UART6] = FUNCTION(uart6),
1461 [S900_MUX_I2S0] = FUNCTION(i2s0),
1462 [S900_MUX_I2S1] = FUNCTION(i2s1),
1463 [S900_MUX_PCM0] = FUNCTION(pcm0),
1464 [S900_MUX_PCM1] = FUNCTION(pcm1),
1465 [S900_MUX_JTAG] = FUNCTION(jtag),
1466 [S900_MUX_PWM0] = FUNCTION(pwm0),
1467 [S900_MUX_PWM1] = FUNCTION(pwm1),
1468 [S900_MUX_PWM2] = FUNCTION(pwm2),
1469 [S900_MUX_PWM3] = FUNCTION(pwm3),
1470 [S900_MUX_PWM4] = FUNCTION(pwm4),
1471 [S900_MUX_PWM5] = FUNCTION(pwm5),
1472 [S900_MUX_SD0] = FUNCTION(sd0),
1473 [S900_MUX_SD1] = FUNCTION(sd1),
1474 [S900_MUX_SD2] = FUNCTION(sd2),
1475 [S900_MUX_SD3] = FUNCTION(sd3),
1476 [S900_MUX_I2C0] = FUNCTION(i2c0),
1477 [S900_MUX_I2C1] = FUNCTION(i2c1),
1478 [S900_MUX_I2C2] = FUNCTION(i2c2),
1479 [S900_MUX_I2C3] = FUNCTION(i2c3),
1480 [S900_MUX_I2C4] = FUNCTION(i2c4),
1481 [S900_MUX_I2C5] = FUNCTION(i2c5),
1482 [S900_MUX_LVDS] = FUNCTION(lvds),
1483 [S900_MUX_USB30] = FUNCTION(usb30),
1484 [S900_MUX_USB20] = FUNCTION(usb20),
1485 [S900_MUX_GPU] = FUNCTION(gpu),
1486 [S900_MUX_MIPI_CSI0] = FUNCTION(mipi_csi0),
1487 [S900_MUX_MIPI_CSI1] = FUNCTION(mipi_csi1),
1488 [S900_MUX_MIPI_DSI] = FUNCTION(mipi_dsi),
1489 [S900_MUX_NAND0] = FUNCTION(nand0),
1490 [S900_MUX_NAND1] = FUNCTION(nand1),
1491 [S900_MUX_SPDIF] = FUNCTION(spdif),
1492 [S900_MUX_SIRQ0] = FUNCTION(sirq0),
1493 [S900_MUX_SIRQ1] = FUNCTION(sirq1),
1494 [S900_MUX_SIRQ2] = FUNCTION(sirq2)
1496 /* PAD PULL UP/DOWN CONFIGURES */
1497 #define PULLCTL_CONF(pull_reg, pull_sft, pull_wdt) \
1499 .reg = PAD_PULLCTL##pull_reg, \
1500 .shift = pull_sft, \
1501 .width = pull_wdt, \
1504 #define PAD_PULLCTL_CONF(pad_name, pull_reg, pull_sft, pull_wdt) \
1505 struct owl_pullctl pad_name##_pullctl_conf \
1506 = PULLCTL_CONF(pull_reg, pull_sft, pull_wdt)
1508 #define ST_CONF(st_reg, st_sft, st_wdt) \
1510 .reg = PAD_ST##st_reg, \
1515 #define PAD_ST_CONF(pad_name, st_reg, st_sft, st_wdt) \
1516 struct owl_st pad_name##_st_conf \
1517 = ST_CONF(st_reg, st_sft, st_wdt)
1520 static PAD_PULLCTL_CONF(ETH_RXER, 0, 18, 2);
1521 static PAD_PULLCTL_CONF(SIRQ0, 0, 16, 2);
1522 static PAD_PULLCTL_CONF(SIRQ1, 0, 14, 2);
1523 static PAD_PULLCTL_CONF(SIRQ2, 0, 12, 2);
1524 static PAD_PULLCTL_CONF(I2C0_SDATA, 0, 10, 2);
1525 static PAD_PULLCTL_CONF(I2C0_SCLK, 0, 8, 2);
1526 static PAD_PULLCTL_CONF(ERAM_A5, 0, 6, 2);
1527 static PAD_PULLCTL_CONF(ERAM_A6, 0, 4, 2);
1528 static PAD_PULLCTL_CONF(ERAM_A7, 0, 2, 2);
1529 static PAD_PULLCTL_CONF(ERAM_A10, 0, 0, 2);
1532 static PAD_PULLCTL_CONF(PCM1_IN, 1, 30, 2);
1533 static PAD_PULLCTL_CONF(PCM1_OUT, 1, 28, 2);
1534 static PAD_PULLCTL_CONF(SD0_D0, 1, 26, 2);
1535 static PAD_PULLCTL_CONF(SD0_D1, 1, 24, 2);
1536 static PAD_PULLCTL_CONF(SD0_D2, 1, 22, 2);
1537 static PAD_PULLCTL_CONF(SD0_D3, 1, 20, 2);
1538 static PAD_PULLCTL_CONF(SD0_CMD, 1, 18, 2);
1539 static PAD_PULLCTL_CONF(SD0_CLK, 1, 16, 2);
1540 static PAD_PULLCTL_CONF(SD1_CMD, 1, 14, 2);
1541 static PAD_PULLCTL_CONF(SD1_D0, 1, 12, 2);
1542 static PAD_PULLCTL_CONF(SD1_D1, 1, 10, 2);
1543 static PAD_PULLCTL_CONF(SD1_D2, 1, 8, 2);
1544 static PAD_PULLCTL_CONF(SD1_D3, 1, 6, 2);
1545 static PAD_PULLCTL_CONF(UART0_RX, 1, 4, 2);
1546 static PAD_PULLCTL_CONF(UART0_TX, 1, 2, 2);
1549 static PAD_PULLCTL_CONF(I2C2_SDATA, 2, 26, 2);
1550 static PAD_PULLCTL_CONF(I2C2_SCLK, 2, 24, 2);
1551 static PAD_PULLCTL_CONF(SPI0_SCLK, 2, 22, 2);
1552 static PAD_PULLCTL_CONF(SPI0_MOSI, 2, 20, 2);
1553 static PAD_PULLCTL_CONF(I2C1_SDATA, 2, 18, 2);
1554 static PAD_PULLCTL_CONF(I2C1_SCLK, 2, 16, 2);
1555 static PAD_PULLCTL_CONF(NAND0_D0, 2, 15, 1);
1556 static PAD_PULLCTL_CONF(NAND0_D1, 2, 15, 1);
1557 static PAD_PULLCTL_CONF(NAND0_D2, 2, 15, 1);
1558 static PAD_PULLCTL_CONF(NAND0_D3, 2, 15, 1);
1559 static PAD_PULLCTL_CONF(NAND0_D4, 2, 15, 1);
1560 static PAD_PULLCTL_CONF(NAND0_D5, 2, 15, 1);
1561 static PAD_PULLCTL_CONF(NAND0_D6, 2, 15, 1);
1562 static PAD_PULLCTL_CONF(NAND0_D7, 2, 15, 1);
1563 static PAD_PULLCTL_CONF(NAND0_DQSN, 2, 14, 1);
1564 static PAD_PULLCTL_CONF(NAND0_DQS, 2, 13, 1);
1565 static PAD_PULLCTL_CONF(NAND1_D0, 2, 12, 1);
1566 static PAD_PULLCTL_CONF(NAND1_D1, 2, 12, 1);
1567 static PAD_PULLCTL_CONF(NAND1_D2, 2, 12, 1);
1568 static PAD_PULLCTL_CONF(NAND1_D3, 2, 12, 1);
1569 static PAD_PULLCTL_CONF(NAND1_D4, 2, 12, 1);
1570 static PAD_PULLCTL_CONF(NAND1_D5, 2, 12, 1);
1571 static PAD_PULLCTL_CONF(NAND1_D6, 2, 12, 1);
1572 static PAD_PULLCTL_CONF(NAND1_D7, 2, 12, 1);
1573 static PAD_PULLCTL_CONF(NAND1_DQSN, 2, 11, 1);
1574 static PAD_PULLCTL_CONF(NAND1_DQS, 2, 10, 1);
1575 static PAD_PULLCTL_CONF(SGPIO2, 2, 8, 2);
1576 static PAD_PULLCTL_CONF(SGPIO3, 2, 6, 2);
1577 static PAD_PULLCTL_CONF(UART4_RX, 2, 4, 2);
1578 static PAD_PULLCTL_CONF(UART4_TX, 2, 2, 2);
1581 static PAD_ST_CONF(I2C0_SDATA, 0, 30, 1);
1582 static PAD_ST_CONF(UART0_RX, 0, 29, 1);
1583 static PAD_ST_CONF(ETH_MDC, 0, 28, 1);
1584 static PAD_ST_CONF(I2S_MCLK1, 0, 23, 1);
1585 static PAD_ST_CONF(ETH_REF_CLK, 0, 22, 1);
1586 static PAD_ST_CONF(ETH_TXEN, 0, 21, 1);
1587 static PAD_ST_CONF(ETH_TXD0, 0, 20, 1);
1588 static PAD_ST_CONF(I2S_LRCLK1, 0, 19, 1);
1589 static PAD_ST_CONF(SGPIO2, 0, 18, 1);
1590 static PAD_ST_CONF(SGPIO3, 0, 17, 1);
1591 static PAD_ST_CONF(UART4_TX, 0, 16, 1);
1592 static PAD_ST_CONF(I2S_D1, 0, 15, 1);
1593 static PAD_ST_CONF(UART0_TX, 0, 14, 1);
1594 static PAD_ST_CONF(SPI0_SCLK, 0, 13, 1);
1595 static PAD_ST_CONF(SD0_CLK, 0, 12, 1);
1596 static PAD_ST_CONF(ERAM_A5, 0, 11, 1);
1597 static PAD_ST_CONF(I2C0_SCLK, 0, 7, 1);
1598 static PAD_ST_CONF(ERAM_A9, 0, 6, 1);
1599 static PAD_ST_CONF(LVDS_OEP, 0, 5, 1);
1600 static PAD_ST_CONF(LVDS_ODN, 0, 4, 1);
1601 static PAD_ST_CONF(LVDS_OAP, 0, 3, 1);
1602 static PAD_ST_CONF(I2S_BCLK1, 0, 2, 1);
1605 static PAD_ST_CONF(I2S_LRCLK0, 1, 29, 1);
1606 static PAD_ST_CONF(UART4_RX, 1, 28, 1);
1607 static PAD_ST_CONF(UART3_CTSB, 1, 27, 1);
1608 static PAD_ST_CONF(UART3_RTSB, 1, 26, 1);
1609 static PAD_ST_CONF(UART3_RX, 1, 25, 1);
1610 static PAD_ST_CONF(UART2_RTSB, 1, 24, 1);
1611 static PAD_ST_CONF(UART2_CTSB, 1, 23, 1);
1612 static PAD_ST_CONF(UART2_RX, 1, 22, 1);
1613 static PAD_ST_CONF(ETH_RXD0, 1, 21, 1);
1614 static PAD_ST_CONF(ETH_RXD1, 1, 20, 1);
1615 static PAD_ST_CONF(ETH_CRS_DV, 1, 19, 1);
1616 static PAD_ST_CONF(ETH_RXER, 1, 18, 1);
1617 static PAD_ST_CONF(ETH_TXD1, 1, 17, 1);
1618 static PAD_ST_CONF(LVDS_OCP, 1, 16, 1);
1619 static PAD_ST_CONF(LVDS_OBP, 1, 15, 1);
1620 static PAD_ST_CONF(LVDS_OBN, 1, 14, 1);
1621 static PAD_ST_CONF(PCM1_OUT, 1, 12, 1);
1622 static PAD_ST_CONF(PCM1_CLK, 1, 11, 1);
1623 static PAD_ST_CONF(PCM1_IN, 1, 10, 1);
1624 static PAD_ST_CONF(PCM1_SYNC, 1, 9, 1);
1625 static PAD_ST_CONF(I2C1_SCLK, 1, 8, 1);
1626 static PAD_ST_CONF(I2C1_SDATA, 1, 7, 1);
1627 static PAD_ST_CONF(I2C2_SCLK, 1, 6, 1);
1628 static PAD_ST_CONF(I2C2_SDATA, 1, 5, 1);
1629 static PAD_ST_CONF(SPI0_MOSI, 1, 4, 1);
1630 static PAD_ST_CONF(SPI0_MISO, 1, 3, 1);
1631 static PAD_ST_CONF(SPI0_SS, 1, 2, 1);
1632 static PAD_ST_CONF(I2S_BCLK0, 1, 1, 1);
1633 static PAD_ST_CONF(I2S_MCLK0, 1, 0, 1);
1635 #define PAD_INFO(name) \
1642 #define PAD_INFO_ST(name) \
1646 .st = &name##_st_conf, \
1649 #define PAD_INFO_PULLCTL(name) \
1652 .pullctl = &name##_pullctl_conf, \
1656 #define PAD_INFO_PULLCTL_ST(name) \
1659 .pullctl = &name##_pullctl_conf, \
1660 .st = &name##_st_conf, \
1663 /* Pad info table */
1664 static struct owl_padinfo s900_padinfo[NUM_PADS] = {
1665 [ETH_TXD0] = PAD_INFO_ST(ETH_TXD0),
1666 [ETH_TXD1] = PAD_INFO_ST(ETH_TXD1),
1667 [ETH_TXEN] = PAD_INFO_ST(ETH_TXEN),
1668 [ETH_RXER] = PAD_INFO_PULLCTL_ST(ETH_RXER),
1669 [ETH_CRS_DV] = PAD_INFO_ST(ETH_CRS_DV),
1670 [ETH_RXD1] = PAD_INFO_ST(ETH_RXD1),
1671 [ETH_RXD0] = PAD_INFO_ST(ETH_RXD0),
1672 [ETH_REF_CLK] = PAD_INFO_ST(ETH_REF_CLK),
1673 [ETH_MDC] = PAD_INFO_ST(ETH_MDC),
1674 [ETH_MDIO] = PAD_INFO(ETH_MDIO),
1675 [SIRQ0] = PAD_INFO_PULLCTL(SIRQ0),
1676 [SIRQ1] = PAD_INFO_PULLCTL(SIRQ1),
1677 [SIRQ2] = PAD_INFO_PULLCTL(SIRQ2),
1678 [I2S_D0] = PAD_INFO(I2S_D0),
1679 [I2S_BCLK0] = PAD_INFO_ST(I2S_BCLK0),
1680 [I2S_LRCLK0] = PAD_INFO_ST(I2S_LRCLK0),
1681 [I2S_MCLK0] = PAD_INFO_ST(I2S_MCLK0),
1682 [I2S_D1] = PAD_INFO_ST(I2S_D1),
1683 [I2S_BCLK1] = PAD_INFO_ST(I2S_BCLK1),
1684 [I2S_LRCLK1] = PAD_INFO_ST(I2S_LRCLK1),
1685 [I2S_MCLK1] = PAD_INFO_ST(I2S_MCLK1),
1686 [PCM1_IN] = PAD_INFO_PULLCTL_ST(PCM1_IN),
1687 [PCM1_CLK] = PAD_INFO_ST(PCM1_CLK),
1688 [PCM1_SYNC] = PAD_INFO_ST(PCM1_SYNC),
1689 [PCM1_OUT] = PAD_INFO_PULLCTL_ST(PCM1_OUT),
1690 [ERAM_A5] = PAD_INFO_PULLCTL_ST(ERAM_A5),
1691 [ERAM_A6] = PAD_INFO_PULLCTL(ERAM_A6),
1692 [ERAM_A7] = PAD_INFO_PULLCTL(ERAM_A7),
1693 [ERAM_A8] = PAD_INFO(ERAM_A8),
1694 [ERAM_A9] = PAD_INFO_ST(ERAM_A9),
1695 [ERAM_A10] = PAD_INFO_PULLCTL(ERAM_A10),
1696 [ERAM_A11] = PAD_INFO(ERAM_A11),
1697 [LVDS_OEP] = PAD_INFO_ST(LVDS_OEP),
1698 [LVDS_OEN] = PAD_INFO(LVDS_OEN),
1699 [LVDS_ODP] = PAD_INFO(LVDS_ODP),
1700 [LVDS_ODN] = PAD_INFO_ST(LVDS_ODN),
1701 [LVDS_OCP] = PAD_INFO_ST(LVDS_OCP),
1702 [LVDS_OCN] = PAD_INFO(LVDS_OCN),
1703 [LVDS_OBP] = PAD_INFO_ST(LVDS_OBP),
1704 [LVDS_OBN] = PAD_INFO_ST(LVDS_OBN),
1705 [LVDS_OAP] = PAD_INFO_ST(LVDS_OAP),
1706 [LVDS_OAN] = PAD_INFO(LVDS_OAN),
1707 [LVDS_EEP] = PAD_INFO(LVDS_EEP),
1708 [LVDS_EEN] = PAD_INFO(LVDS_EEN),
1709 [LVDS_EDP] = PAD_INFO(LVDS_EDP),
1710 [LVDS_EDN] = PAD_INFO(LVDS_EDN),
1711 [LVDS_ECP] = PAD_INFO(LVDS_ECP),
1712 [LVDS_ECN] = PAD_INFO(LVDS_ECN),
1713 [LVDS_EBP] = PAD_INFO(LVDS_EBP),
1714 [LVDS_EBN] = PAD_INFO(LVDS_EBN),
1715 [LVDS_EAP] = PAD_INFO(LVDS_EAP),
1716 [LVDS_EAN] = PAD_INFO(LVDS_EAN),
1717 [SD0_D0] = PAD_INFO_PULLCTL(SD0_D0),
1718 [SD0_D1] = PAD_INFO_PULLCTL(SD0_D1),
1719 [SD0_D2] = PAD_INFO_PULLCTL(SD0_D2),
1720 [SD0_D3] = PAD_INFO_PULLCTL(SD0_D3),
1721 [SD1_D0] = PAD_INFO_PULLCTL(SD1_D0),
1722 [SD1_D1] = PAD_INFO_PULLCTL(SD1_D1),
1723 [SD1_D2] = PAD_INFO_PULLCTL(SD1_D2),
1724 [SD1_D3] = PAD_INFO_PULLCTL(SD1_D3),
1725 [SD0_CMD] = PAD_INFO_PULLCTL(SD0_CMD),
1726 [SD0_CLK] = PAD_INFO_PULLCTL_ST(SD0_CLK),
1727 [SD1_CMD] = PAD_INFO_PULLCTL(SD1_CMD),
1728 [SD1_CLK] = PAD_INFO(SD1_CLK),
1729 [SPI0_SCLK] = PAD_INFO_PULLCTL_ST(SPI0_SCLK),
1730 [SPI0_SS] = PAD_INFO_ST(SPI0_SS),
1731 [SPI0_MISO] = PAD_INFO_ST(SPI0_MISO),
1732 [SPI0_MOSI] = PAD_INFO_PULLCTL_ST(SPI0_MOSI),
1733 [UART0_RX] = PAD_INFO_PULLCTL_ST(UART0_RX),
1734 [UART0_TX] = PAD_INFO_PULLCTL_ST(UART0_TX),
1735 [UART2_RX] = PAD_INFO_ST(UART2_RX),
1736 [UART2_TX] = PAD_INFO(UART2_TX),
1737 [UART2_RTSB] = PAD_INFO_ST(UART2_RTSB),
1738 [UART2_CTSB] = PAD_INFO_ST(UART2_CTSB),
1739 [UART3_RX] = PAD_INFO_ST(UART3_RX),
1740 [UART3_TX] = PAD_INFO(UART3_TX),
1741 [UART3_RTSB] = PAD_INFO_ST(UART3_RTSB),
1742 [UART3_CTSB] = PAD_INFO_ST(UART3_CTSB),
1743 [UART4_RX] = PAD_INFO_PULLCTL_ST(UART4_RX),
1744 [UART4_TX] = PAD_INFO_PULLCTL_ST(UART4_TX),
1745 [I2C0_SCLK] = PAD_INFO_PULLCTL_ST(I2C0_SCLK),
1746 [I2C0_SDATA] = PAD_INFO_PULLCTL_ST(I2C0_SDATA),
1747 [I2C1_SCLK] = PAD_INFO_PULLCTL_ST(I2C1_SCLK),
1748 [I2C1_SDATA] = PAD_INFO_PULLCTL_ST(I2C1_SDATA),
1749 [I2C2_SCLK] = PAD_INFO_PULLCTL_ST(I2C2_SCLK),
1750 [I2C2_SDATA] = PAD_INFO_PULLCTL_ST(I2C2_SDATA),
1751 [CSI0_DN0] = PAD_INFO(CSI0_DN0),
1752 [CSI0_DP0] = PAD_INFO(CSI0_DP0),
1753 [CSI0_DN1] = PAD_INFO(CSI0_DN1),
1754 [CSI0_DP1] = PAD_INFO(CSI0_DP1),
1755 [CSI0_CN] = PAD_INFO(CSI0_CN),
1756 [CSI0_CP] = PAD_INFO(CSI0_CP),
1757 [CSI0_DN2] = PAD_INFO(CSI0_DN2),
1758 [CSI0_DP2] = PAD_INFO(CSI0_DP2),
1759 [CSI0_DN3] = PAD_INFO(CSI0_DN3),
1760 [CSI0_DP3] = PAD_INFO(CSI0_DP3),
1761 [DSI_DP3] = PAD_INFO(DSI_DP3),
1762 [DSI_DN3] = PAD_INFO(DSI_DN3),
1763 [DSI_DP1] = PAD_INFO(DSI_DP1),
1764 [DSI_DN1] = PAD_INFO(DSI_DN1),
1765 [DSI_CP] = PAD_INFO(DSI_CP),
1766 [DSI_CN] = PAD_INFO(DSI_CN),
1767 [DSI_DP0] = PAD_INFO(DSI_DP0),
1768 [DSI_DN0] = PAD_INFO(DSI_DN0),
1769 [DSI_DP2] = PAD_INFO(DSI_DP2),
1770 [DSI_DN2] = PAD_INFO(DSI_DN2),
1771 [SENSOR0_PCLK] = PAD_INFO(SENSOR0_PCLK),
1772 [CSI1_DN0] = PAD_INFO(CSI1_DN0),
1773 [CSI1_DP0] = PAD_INFO(CSI1_DP0),
1774 [CSI1_DN1] = PAD_INFO(CSI1_DN1),
1775 [CSI1_DP1] = PAD_INFO(CSI1_DP1),
1776 [CSI1_CN] = PAD_INFO(CSI1_CN),
1777 [CSI1_CP] = PAD_INFO(CSI1_CP),
1778 [SENSOR0_CKOUT] = PAD_INFO(SENSOR0_CKOUT),
1779 [NAND0_D0] = PAD_INFO_PULLCTL(NAND0_D0),
1780 [NAND0_D1] = PAD_INFO_PULLCTL(NAND0_D1),
1781 [NAND0_D2] = PAD_INFO_PULLCTL(NAND0_D2),
1782 [NAND0_D3] = PAD_INFO_PULLCTL(NAND0_D3),
1783 [NAND0_D4] = PAD_INFO_PULLCTL(NAND0_D4),
1784 [NAND0_D5] = PAD_INFO_PULLCTL(NAND0_D5),
1785 [NAND0_D6] = PAD_INFO_PULLCTL(NAND0_D6),
1786 [NAND0_D7] = PAD_INFO_PULLCTL(NAND0_D7),
1787 [NAND0_DQS] = PAD_INFO_PULLCTL(NAND0_DQS),
1788 [NAND0_DQSN] = PAD_INFO_PULLCTL(NAND0_DQSN),
1789 [NAND0_ALE] = PAD_INFO(NAND0_ALE),
1790 [NAND0_CLE] = PAD_INFO(NAND0_CLE),
1791 [NAND0_CEB0] = PAD_INFO(NAND0_CEB0),
1792 [NAND0_CEB1] = PAD_INFO(NAND0_CEB1),
1793 [NAND0_CEB2] = PAD_INFO(NAND0_CEB2),
1794 [NAND0_CEB3] = PAD_INFO(NAND0_CEB3),
1795 [NAND1_D0] = PAD_INFO_PULLCTL(NAND1_D0),
1796 [NAND1_D1] = PAD_INFO_PULLCTL(NAND1_D1),
1797 [NAND1_D2] = PAD_INFO_PULLCTL(NAND1_D2),
1798 [NAND1_D3] = PAD_INFO_PULLCTL(NAND1_D3),
1799 [NAND1_D4] = PAD_INFO_PULLCTL(NAND1_D4),
1800 [NAND1_D5] = PAD_INFO_PULLCTL(NAND1_D5),
1801 [NAND1_D6] = PAD_INFO_PULLCTL(NAND1_D6),
1802 [NAND1_D7] = PAD_INFO_PULLCTL(NAND1_D7),
1803 [NAND1_DQS] = PAD_INFO_PULLCTL(NAND1_DQS),
1804 [NAND1_DQSN] = PAD_INFO_PULLCTL(NAND1_DQSN),
1805 [NAND1_ALE] = PAD_INFO(NAND1_ALE),
1806 [NAND1_CLE] = PAD_INFO(NAND1_CLE),
1807 [NAND1_CEB0] = PAD_INFO(NAND1_CEB0),
1808 [NAND1_CEB1] = PAD_INFO(NAND1_CEB1),
1809 [NAND1_CEB2] = PAD_INFO(NAND1_CEB2),
1810 [NAND1_CEB3] = PAD_INFO(NAND1_CEB3),
1811 [SGPIO0] = PAD_INFO(SGPIO0),
1812 [SGPIO1] = PAD_INFO(SGPIO1),
1813 [SGPIO2] = PAD_INFO_PULLCTL_ST(SGPIO2),
1814 [SGPIO3] = PAD_INFO_PULLCTL_ST(SGPIO3)
1817 static struct owl_pinctrl_soc_data s900_pinctrl_data = {
1818 .padinfo = s900_padinfo,
1819 .pins = (const struct pinctrl_pin_desc *)s900_pads,
1820 .npins = ARRAY_SIZE(s900_pads),
1821 .functions = s900_functions,
1822 .nfunctions = ARRAY_SIZE(s900_functions),
1823 .groups = s900_groups,
1824 .ngroups = ARRAY_SIZE(s900_groups),
1828 static int s900_pinctrl_probe(struct platform_device *pdev)
1830 return owl_pinctrl_probe(pdev, &s900_pinctrl_data);
1833 static const struct of_device_id s900_pinctrl_of_match[] = {
1834 { .compatible = "actions,s900-pinctrl", },
1838 static struct platform_driver s900_pinctrl_driver = {
1840 .name = "pinctrl-s900",
1841 .of_match_table = of_match_ptr(s900_pinctrl_of_match),
1843 .probe = s900_pinctrl_probe,
1846 static int __init s900_pinctrl_init(void)
1848 return platform_driver_register(&s900_pinctrl_driver);
1850 arch_initcall(s900_pinctrl_init);
1852 static void __exit s900_pinctrl_exit(void)
1854 platform_driver_unregister(&s900_pinctrl_driver);
1856 module_exit(s900_pinctrl_exit);
1858 MODULE_AUTHOR("Actions Semi Inc.");
1859 MODULE_AUTHOR("Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>");
1860 MODULE_DESCRIPTION("Actions Semi S900 SoC Pinctrl Driver");
1861 MODULE_LICENSE("GPL");