aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@st.com>2012-03-28 12:57:07 -0400
committerArnd Bergmann <arnd@arndb.de>2012-05-14 11:34:07 -0400
commit85ed41a76f7a3939b55872f39df841039321f033 (patch)
treefcf883322b3d1c16f92afb10116f5132cb20e032 /drivers/pinctrl
parentd1e77afe9d647174428de7d29be85a13f94f645b (diff)
pinctrl: Add SPEAr13xx pinctrl drivers
This adds pinctrl driver for SPEAr13xx family. SPEAr13xx family supports two machines: SPEAr1310 and SPEAr1340. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Acked-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r--drivers/pinctrl/spear/Kconfig10
-rw-r--r--drivers/pinctrl/spear/Makefile2
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear.h146
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear1310.c2198
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear1340.c1989
5 files changed, 4345 insertions, 0 deletions
diff --git a/drivers/pinctrl/spear/Kconfig b/drivers/pinctrl/spear/Kconfig
index 6a2596b4f359..91558791e766 100644
--- a/drivers/pinctrl/spear/Kconfig
+++ b/drivers/pinctrl/spear/Kconfig
@@ -31,4 +31,14 @@ config PINCTRL_SPEAR320
31 depends on MACH_SPEAR320 31 depends on MACH_SPEAR320
32 select PINCTRL_SPEAR3XX 32 select PINCTRL_SPEAR3XX
33 33
34config PINCTRL_SPEAR1310
35 bool "ST Microelectronics SPEAr1310 SoC pin controller driver"
36 depends on MACH_SPEAR1310
37 select PINCTRL_SPEAR
38
39config PINCTRL_SPEAR1340
40 bool "ST Microelectronics SPEAr1340 SoC pin controller driver"
41 depends on MACH_SPEAR1340
42 select PINCTRL_SPEAR
43
34endif 44endif
diff --git a/drivers/pinctrl/spear/Makefile b/drivers/pinctrl/spear/Makefile
index 15dcb85da22d..b28a7ba22443 100644
--- a/drivers/pinctrl/spear/Makefile
+++ b/drivers/pinctrl/spear/Makefile
@@ -5,3 +5,5 @@ obj-$(CONFIG_PINCTRL_SPEAR3XX) += pinctrl-spear3xx.o
5obj-$(CONFIG_PINCTRL_SPEAR300) += pinctrl-spear300.o 5obj-$(CONFIG_PINCTRL_SPEAR300) += pinctrl-spear300.o
6obj-$(CONFIG_PINCTRL_SPEAR310) += pinctrl-spear310.o 6obj-$(CONFIG_PINCTRL_SPEAR310) += pinctrl-spear310.o
7obj-$(CONFIG_PINCTRL_SPEAR320) += pinctrl-spear320.o 7obj-$(CONFIG_PINCTRL_SPEAR320) += pinctrl-spear320.o
8obj-$(CONFIG_PINCTRL_SPEAR1310) += pinctrl-spear1310.o
9obj-$(CONFIG_PINCTRL_SPEAR1340) += pinctrl-spear1340.o
diff --git a/drivers/pinctrl/spear/pinctrl-spear.h b/drivers/pinctrl/spear/pinctrl-spear.h
index 1f51dc9fbb62..9155783bb47f 100644
--- a/drivers/pinctrl/spear/pinctrl-spear.h
+++ b/drivers/pinctrl/spear/pinctrl-spear.h
@@ -244,4 +244,150 @@ int __devexit spear_pinctrl_remove(struct platform_device *pdev);
244 PINCTRL_PIN(100, "PLGPIO100"), \ 244 PINCTRL_PIN(100, "PLGPIO100"), \
245 PINCTRL_PIN(101, "PLGPIO101") 245 PINCTRL_PIN(101, "PLGPIO101")
246 246
247#define SPEAR_PIN_102_TO_245 \
248 PINCTRL_PIN(102, "PLGPIO102"), \
249 PINCTRL_PIN(103, "PLGPIO103"), \
250 PINCTRL_PIN(104, "PLGPIO104"), \
251 PINCTRL_PIN(105, "PLGPIO105"), \
252 PINCTRL_PIN(106, "PLGPIO106"), \
253 PINCTRL_PIN(107, "PLGPIO107"), \
254 PINCTRL_PIN(108, "PLGPIO108"), \
255 PINCTRL_PIN(109, "PLGPIO109"), \
256 PINCTRL_PIN(110, "PLGPIO110"), \
257 PINCTRL_PIN(111, "PLGPIO111"), \
258 PINCTRL_PIN(112, "PLGPIO112"), \
259 PINCTRL_PIN(113, "PLGPIO113"), \
260 PINCTRL_PIN(114, "PLGPIO114"), \
261 PINCTRL_PIN(115, "PLGPIO115"), \
262 PINCTRL_PIN(116, "PLGPIO116"), \
263 PINCTRL_PIN(117, "PLGPIO117"), \
264 PINCTRL_PIN(118, "PLGPIO118"), \
265 PINCTRL_PIN(119, "PLGPIO119"), \
266 PINCTRL_PIN(120, "PLGPIO120"), \
267 PINCTRL_PIN(121, "PLGPIO121"), \
268 PINCTRL_PIN(122, "PLGPIO122"), \
269 PINCTRL_PIN(123, "PLGPIO123"), \
270 PINCTRL_PIN(124, "PLGPIO124"), \
271 PINCTRL_PIN(125, "PLGPIO125"), \
272 PINCTRL_PIN(126, "PLGPIO126"), \
273 PINCTRL_PIN(127, "PLGPIO127"), \
274 PINCTRL_PIN(128, "PLGPIO128"), \
275 PINCTRL_PIN(129, "PLGPIO129"), \
276 PINCTRL_PIN(130, "PLGPIO130"), \
277 PINCTRL_PIN(131, "PLGPIO131"), \
278 PINCTRL_PIN(132, "PLGPIO132"), \
279 PINCTRL_PIN(133, "PLGPIO133"), \
280 PINCTRL_PIN(134, "PLGPIO134"), \
281 PINCTRL_PIN(135, "PLGPIO135"), \
282 PINCTRL_PIN(136, "PLGPIO136"), \
283 PINCTRL_PIN(137, "PLGPIO137"), \
284 PINCTRL_PIN(138, "PLGPIO138"), \
285 PINCTRL_PIN(139, "PLGPIO139"), \
286 PINCTRL_PIN(140, "PLGPIO140"), \
287 PINCTRL_PIN(141, "PLGPIO141"), \
288 PINCTRL_PIN(142, "PLGPIO142"), \
289 PINCTRL_PIN(143, "PLGPIO143"), \
290 PINCTRL_PIN(144, "PLGPIO144"), \
291 PINCTRL_PIN(145, "PLGPIO145"), \
292 PINCTRL_PIN(146, "PLGPIO146"), \
293 PINCTRL_PIN(147, "PLGPIO147"), \
294 PINCTRL_PIN(148, "PLGPIO148"), \
295 PINCTRL_PIN(149, "PLGPIO149"), \
296 PINCTRL_PIN(150, "PLGPIO150"), \
297 PINCTRL_PIN(151, "PLGPIO151"), \
298 PINCTRL_PIN(152, "PLGPIO152"), \
299 PINCTRL_PIN(153, "PLGPIO153"), \
300 PINCTRL_PIN(154, "PLGPIO154"), \
301 PINCTRL_PIN(155, "PLGPIO155"), \
302 PINCTRL_PIN(156, "PLGPIO156"), \
303 PINCTRL_PIN(157, "PLGPIO157"), \
304 PINCTRL_PIN(158, "PLGPIO158"), \
305 PINCTRL_PIN(159, "PLGPIO159"), \
306 PINCTRL_PIN(160, "PLGPIO160"), \
307 PINCTRL_PIN(161, "PLGPIO161"), \
308 PINCTRL_PIN(162, "PLGPIO162"), \
309 PINCTRL_PIN(163, "PLGPIO163"), \
310 PINCTRL_PIN(164, "PLGPIO164"), \
311 PINCTRL_PIN(165, "PLGPIO165"), \
312 PINCTRL_PIN(166, "PLGPIO166"), \
313 PINCTRL_PIN(167, "PLGPIO167"), \
314 PINCTRL_PIN(168, "PLGPIO168"), \
315 PINCTRL_PIN(169, "PLGPIO169"), \
316 PINCTRL_PIN(170, "PLGPIO170"), \
317 PINCTRL_PIN(171, "PLGPIO171"), \
318 PINCTRL_PIN(172, "PLGPIO172"), \
319 PINCTRL_PIN(173, "PLGPIO173"), \
320 PINCTRL_PIN(174, "PLGPIO174"), \
321 PINCTRL_PIN(175, "PLGPIO175"), \
322 PINCTRL_PIN(176, "PLGPIO176"), \
323 PINCTRL_PIN(177, "PLGPIO177"), \
324 PINCTRL_PIN(178, "PLGPIO178"), \
325 PINCTRL_PIN(179, "PLGPIO179"), \
326 PINCTRL_PIN(180, "PLGPIO180"), \
327 PINCTRL_PIN(181, "PLGPIO181"), \
328 PINCTRL_PIN(182, "PLGPIO182"), \
329 PINCTRL_PIN(183, "PLGPIO183"), \
330 PINCTRL_PIN(184, "PLGPIO184"), \
331 PINCTRL_PIN(185, "PLGPIO185"), \
332 PINCTRL_PIN(186, "PLGPIO186"), \
333 PINCTRL_PIN(187, "PLGPIO187"), \
334 PINCTRL_PIN(188, "PLGPIO188"), \
335 PINCTRL_PIN(189, "PLGPIO189"), \
336 PINCTRL_PIN(190, "PLGPIO190"), \
337 PINCTRL_PIN(191, "PLGPIO191"), \
338 PINCTRL_PIN(192, "PLGPIO192"), \
339 PINCTRL_PIN(193, "PLGPIO193"), \
340 PINCTRL_PIN(194, "PLGPIO194"), \
341 PINCTRL_PIN(195, "PLGPIO195"), \
342 PINCTRL_PIN(196, "PLGPIO196"), \
343 PINCTRL_PIN(197, "PLGPIO197"), \
344 PINCTRL_PIN(198, "PLGPIO198"), \
345 PINCTRL_PIN(199, "PLGPIO199"), \
346 PINCTRL_PIN(200, "PLGPIO200"), \
347 PINCTRL_PIN(201, "PLGPIO201"), \
348 PINCTRL_PIN(202, "PLGPIO202"), \
349 PINCTRL_PIN(203, "PLGPIO203"), \
350 PINCTRL_PIN(204, "PLGPIO204"), \
351 PINCTRL_PIN(205, "PLGPIO205"), \
352 PINCTRL_PIN(206, "PLGPIO206"), \
353 PINCTRL_PIN(207, "PLGPIO207"), \
354 PINCTRL_PIN(208, "PLGPIO208"), \
355 PINCTRL_PIN(209, "PLGPIO209"), \
356 PINCTRL_PIN(210, "PLGPIO210"), \
357 PINCTRL_PIN(211, "PLGPIO211"), \
358 PINCTRL_PIN(212, "PLGPIO212"), \
359 PINCTRL_PIN(213, "PLGPIO213"), \
360 PINCTRL_PIN(214, "PLGPIO214"), \
361 PINCTRL_PIN(215, "PLGPIO215"), \
362 PINCTRL_PIN(216, "PLGPIO216"), \
363 PINCTRL_PIN(217, "PLGPIO217"), \
364 PINCTRL_PIN(218, "PLGPIO218"), \
365 PINCTRL_PIN(219, "PLGPIO219"), \
366 PINCTRL_PIN(220, "PLGPIO220"), \
367 PINCTRL_PIN(221, "PLGPIO221"), \
368 PINCTRL_PIN(222, "PLGPIO222"), \
369 PINCTRL_PIN(223, "PLGPIO223"), \
370 PINCTRL_PIN(224, "PLGPIO224"), \
371 PINCTRL_PIN(225, "PLGPIO225"), \
372 PINCTRL_PIN(226, "PLGPIO226"), \
373 PINCTRL_PIN(227, "PLGPIO227"), \
374 PINCTRL_PIN(228, "PLGPIO228"), \
375 PINCTRL_PIN(229, "PLGPIO229"), \
376 PINCTRL_PIN(230, "PLGPIO230"), \
377 PINCTRL_PIN(231, "PLGPIO231"), \
378 PINCTRL_PIN(232, "PLGPIO232"), \
379 PINCTRL_PIN(233, "PLGPIO233"), \
380 PINCTRL_PIN(234, "PLGPIO234"), \
381 PINCTRL_PIN(235, "PLGPIO235"), \
382 PINCTRL_PIN(236, "PLGPIO236"), \
383 PINCTRL_PIN(237, "PLGPIO237"), \
384 PINCTRL_PIN(238, "PLGPIO238"), \
385 PINCTRL_PIN(239, "PLGPIO239"), \
386 PINCTRL_PIN(240, "PLGPIO240"), \
387 PINCTRL_PIN(241, "PLGPIO241"), \
388 PINCTRL_PIN(242, "PLGPIO242"), \
389 PINCTRL_PIN(243, "PLGPIO243"), \
390 PINCTRL_PIN(244, "PLGPIO244"), \
391 PINCTRL_PIN(245, "PLGPIO245")
392
247#endif /* __PINMUX_SPEAR_H__ */ 393#endif /* __PINMUX_SPEAR_H__ */
diff --git a/drivers/pinctrl/spear/pinctrl-spear1310.c b/drivers/pinctrl/spear/pinctrl-spear1310.c
new file mode 100644
index 000000000000..12b094dc806f
--- /dev/null
+++ b/drivers/pinctrl/spear/pinctrl-spear1310.c
@@ -0,0 +1,2198 @@
1/*
2 * Driver for the ST Microelectronics SPEAr1310 pinmux
3 *
4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <linux/err.h>
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/of_device.h>
16#include <linux/platform_device.h>
17#include "pinctrl-spear.h"
18
19#define DRIVER_NAME "spear1310-pinmux"
20
21/* pins */
22static const struct pinctrl_pin_desc spear1310_pins[] = {
23 SPEAR_PIN_0_TO_101,
24 SPEAR_PIN_102_TO_245,
25};
26
27/* registers */
28#define PERIP_CFG 0x32C
29 #define MCIF_SEL_SHIFT 3
30 #define MCIF_SEL_SD (0x1 << MCIF_SEL_SHIFT)
31 #define MCIF_SEL_CF (0x2 << MCIF_SEL_SHIFT)
32 #define MCIF_SEL_XD (0x3 << MCIF_SEL_SHIFT)
33 #define MCIF_SEL_MASK (0x3 << MCIF_SEL_SHIFT)
34
35#define PCIE_SATA_CFG 0x3A4
36 #define PCIE_SATA2_SEL_PCIE (0 << 31)
37 #define PCIE_SATA1_SEL_PCIE (0 << 30)
38 #define PCIE_SATA0_SEL_PCIE (0 << 29)
39 #define PCIE_SATA2_SEL_SATA (1 << 31)
40 #define PCIE_SATA1_SEL_SATA (1 << 30)
41 #define PCIE_SATA0_SEL_SATA (1 << 29)
42 #define SATA2_CFG_TX_CLK_EN (1 << 27)
43 #define SATA2_CFG_RX_CLK_EN (1 << 26)
44 #define SATA2_CFG_POWERUP_RESET (1 << 25)
45 #define SATA2_CFG_PM_CLK_EN (1 << 24)
46 #define SATA1_CFG_TX_CLK_EN (1 << 23)
47 #define SATA1_CFG_RX_CLK_EN (1 << 22)
48 #define SATA1_CFG_POWERUP_RESET (1 << 21)
49 #define SATA1_CFG_PM_CLK_EN (1 << 20)
50 #define SATA0_CFG_TX_CLK_EN (1 << 19)
51 #define SATA0_CFG_RX_CLK_EN (1 << 18)
52 #define SATA0_CFG_POWERUP_RESET (1 << 17)
53 #define SATA0_CFG_PM_CLK_EN (1 << 16)
54 #define PCIE2_CFG_DEVICE_PRESENT (1 << 11)
55 #define PCIE2_CFG_POWERUP_RESET (1 << 10)
56 #define PCIE2_CFG_CORE_CLK_EN (1 << 9)
57 #define PCIE2_CFG_AUX_CLK_EN (1 << 8)
58 #define PCIE1_CFG_DEVICE_PRESENT (1 << 7)
59 #define PCIE1_CFG_POWERUP_RESET (1 << 6)
60 #define PCIE1_CFG_CORE_CLK_EN (1 << 5)
61 #define PCIE1_CFG_AUX_CLK_EN (1 << 4)
62 #define PCIE0_CFG_DEVICE_PRESENT (1 << 3)
63 #define PCIE0_CFG_POWERUP_RESET (1 << 2)
64 #define PCIE0_CFG_CORE_CLK_EN (1 << 1)
65 #define PCIE0_CFG_AUX_CLK_EN (1 << 0)
66
67#define PAD_FUNCTION_EN_0 0x650
68 #define PMX_UART0_MASK (1 << 1)
69 #define PMX_I2C0_MASK (1 << 2)
70 #define PMX_I2S0_MASK (1 << 3)
71 #define PMX_SSP0_MASK (1 << 4)
72 #define PMX_CLCD1_MASK (1 << 5)
73 #define PMX_EGPIO00_MASK (1 << 6)
74 #define PMX_EGPIO01_MASK (1 << 7)
75 #define PMX_EGPIO02_MASK (1 << 8)
76 #define PMX_EGPIO03_MASK (1 << 9)
77 #define PMX_EGPIO04_MASK (1 << 10)
78 #define PMX_EGPIO05_MASK (1 << 11)
79 #define PMX_EGPIO06_MASK (1 << 12)
80 #define PMX_EGPIO07_MASK (1 << 13)
81 #define PMX_EGPIO08_MASK (1 << 14)
82 #define PMX_EGPIO09_MASK (1 << 15)
83 #define PMX_SMI_MASK (1 << 16)
84 #define PMX_NAND8_MASK (1 << 17)
85 #define PMX_GMIICLK_MASK (1 << 18)
86 #define PMX_GMIICOL_CRS_XFERER_MIITXCLK_MASK (1 << 19)
87 #define PMX_RXCLK_RDV_TXEN_D03_MASK (1 << 20)
88 #define PMX_GMIID47_MASK (1 << 21)
89 #define PMX_MDC_MDIO_MASK (1 << 22)
90 #define PMX_MCI_DATA8_15_MASK (1 << 23)
91 #define PMX_NFAD23_MASK (1 << 24)
92 #define PMX_NFAD24_MASK (1 << 25)
93 #define PMX_NFAD25_MASK (1 << 26)
94 #define PMX_NFCE3_MASK (1 << 27)
95 #define PMX_NFWPRT3_MASK (1 << 28)
96 #define PMX_NFRSTPWDWN0_MASK (1 << 29)
97 #define PMX_NFRSTPWDWN1_MASK (1 << 30)
98 #define PMX_NFRSTPWDWN2_MASK (1 << 31)
99
100#define PAD_FUNCTION_EN_1 0x654
101 #define PMX_NFRSTPWDWN3_MASK (1 << 0)
102 #define PMX_SMINCS2_MASK (1 << 1)
103 #define PMX_SMINCS3_MASK (1 << 2)
104 #define PMX_CLCD2_MASK (1 << 3)
105 #define PMX_KBD_ROWCOL68_MASK (1 << 4)
106 #define PMX_EGPIO10_MASK (1 << 5)
107 #define PMX_EGPIO11_MASK (1 << 6)
108 #define PMX_EGPIO12_MASK (1 << 7)
109 #define PMX_EGPIO13_MASK (1 << 8)
110 #define PMX_EGPIO14_MASK (1 << 9)
111 #define PMX_EGPIO15_MASK (1 << 10)
112 #define PMX_UART0_MODEM_MASK (1 << 11)
113 #define PMX_GPT0_TMR0_MASK (1 << 12)
114 #define PMX_GPT0_TMR1_MASK (1 << 13)
115 #define PMX_GPT1_TMR0_MASK (1 << 14)
116 #define PMX_GPT1_TMR1_MASK (1 << 15)
117 #define PMX_I2S1_MASK (1 << 16)
118 #define PMX_KBD_ROWCOL25_MASK (1 << 17)
119 #define PMX_NFIO8_15_MASK (1 << 18)
120 #define PMX_KBD_COL1_MASK (1 << 19)
121 #define PMX_NFCE1_MASK (1 << 20)
122 #define PMX_KBD_COL0_MASK (1 << 21)
123 #define PMX_NFCE2_MASK (1 << 22)
124 #define PMX_KBD_ROW1_MASK (1 << 23)
125 #define PMX_NFWPRT1_MASK (1 << 24)
126 #define PMX_KBD_ROW0_MASK (1 << 25)
127 #define PMX_NFWPRT2_MASK (1 << 26)
128 #define PMX_MCIDATA0_MASK (1 << 27)
129 #define PMX_MCIDATA1_MASK (1 << 28)
130 #define PMX_MCIDATA2_MASK (1 << 29)
131 #define PMX_MCIDATA3_MASK (1 << 30)
132 #define PMX_MCIDATA4_MASK (1 << 31)
133
134#define PAD_FUNCTION_EN_2 0x658
135 #define PMX_MCIDATA5_MASK (1 << 0)
136 #define PMX_MCIDATA6_MASK (1 << 1)
137 #define PMX_MCIDATA7_MASK (1 << 2)
138 #define PMX_MCIDATA1SD_MASK (1 << 3)
139 #define PMX_MCIDATA2SD_MASK (1 << 4)
140 #define PMX_MCIDATA3SD_MASK (1 << 5)
141 #define PMX_MCIADDR0ALE_MASK (1 << 6)
142 #define PMX_MCIADDR1CLECLK_MASK (1 << 7)
143 #define PMX_MCIADDR2_MASK (1 << 8)
144 #define PMX_MCICECF_MASK (1 << 9)
145 #define PMX_MCICEXD_MASK (1 << 10)
146 #define PMX_MCICESDMMC_MASK (1 << 11)
147 #define PMX_MCICDCF1_MASK (1 << 12)
148 #define PMX_MCICDCF2_MASK (1 << 13)
149 #define PMX_MCICDXD_MASK (1 << 14)
150 #define PMX_MCICDSDMMC_MASK (1 << 15)
151 #define PMX_MCIDATADIR_MASK (1 << 16)
152 #define PMX_MCIDMARQWP_MASK (1 << 17)
153 #define PMX_MCIIORDRE_MASK (1 << 18)
154 #define PMX_MCIIOWRWE_MASK (1 << 19)
155 #define PMX_MCIRESETCF_MASK (1 << 20)
156 #define PMX_MCICS0CE_MASK (1 << 21)
157 #define PMX_MCICFINTR_MASK (1 << 22)
158 #define PMX_MCIIORDY_MASK (1 << 23)
159 #define PMX_MCICS1_MASK (1 << 24)
160 #define PMX_MCIDMAACK_MASK (1 << 25)
161 #define PMX_MCISDCMD_MASK (1 << 26)
162 #define PMX_MCILEDS_MASK (1 << 27)
163 #define PMX_TOUCH_XY_MASK (1 << 28)
164 #define PMX_SSP0_CS0_MASK (1 << 29)
165 #define PMX_SSP0_CS1_2_MASK (1 << 30)
166
167/* combined macros */
168#define PMX_GMII_MASK (PMX_GMIICLK_MASK | \
169 PMX_GMIICOL_CRS_XFERER_MIITXCLK_MASK | \
170 PMX_RXCLK_RDV_TXEN_D03_MASK | \
171 PMX_GMIID47_MASK | PMX_MDC_MDIO_MASK)
172
173#define PMX_EGPIO_0_GRP_MASK (PMX_EGPIO00_MASK | PMX_EGPIO01_MASK | \
174 PMX_EGPIO02_MASK | \
175 PMX_EGPIO03_MASK | PMX_EGPIO04_MASK | \
176 PMX_EGPIO05_MASK | PMX_EGPIO06_MASK | \
177 PMX_EGPIO07_MASK | PMX_EGPIO08_MASK | \
178 PMX_EGPIO09_MASK)
179#define PMX_EGPIO_1_GRP_MASK (PMX_EGPIO10_MASK | PMX_EGPIO11_MASK | \
180 PMX_EGPIO12_MASK | PMX_EGPIO13_MASK | \
181 PMX_EGPIO14_MASK | PMX_EGPIO15_MASK)
182
183#define PMX_KEYBOARD_6X6_MASK (PMX_KBD_ROW0_MASK | PMX_KBD_ROW1_MASK | \
184 PMX_KBD_ROWCOL25_MASK | PMX_KBD_COL0_MASK | \
185 PMX_KBD_COL1_MASK)
186
187#define PMX_NAND8BIT_0_MASK (PMX_NAND8_MASK | PMX_NFAD23_MASK | \
188 PMX_NFAD24_MASK | PMX_NFAD25_MASK | \
189 PMX_NFWPRT3_MASK | PMX_NFRSTPWDWN0_MASK | \
190 PMX_NFRSTPWDWN1_MASK | PMX_NFRSTPWDWN2_MASK | \
191 PMX_NFCE3_MASK)
192#define PMX_NAND8BIT_1_MASK PMX_NFRSTPWDWN3_MASK
193
194#define PMX_NAND16BIT_1_MASK (PMX_KBD_ROWCOL25_MASK | PMX_NFIO8_15_MASK)
195#define PMX_NAND_4CHIPS_MASK (PMX_NFCE1_MASK | PMX_NFCE2_MASK | \
196 PMX_NFWPRT1_MASK | PMX_NFWPRT2_MASK | \
197 PMX_KBD_ROW0_MASK | PMX_KBD_ROW1_MASK | \
198 PMX_KBD_COL0_MASK | PMX_KBD_COL1_MASK)
199
200#define PMX_MCIFALL_1_MASK 0xF8000000
201#define PMX_MCIFALL_2_MASK 0x0FFFFFFF
202
203#define PMX_PCI_REG1_MASK (PMX_SMINCS2_MASK | PMX_SMINCS3_MASK | \
204 PMX_CLCD2_MASK | PMX_KBD_ROWCOL68_MASK | \
205 PMX_EGPIO_1_GRP_MASK | PMX_GPT0_TMR0_MASK | \
206 PMX_GPT0_TMR1_MASK | PMX_GPT1_TMR0_MASK | \
207 PMX_GPT1_TMR1_MASK | PMX_I2S1_MASK | \
208 PMX_NFCE2_MASK)
209#define PMX_PCI_REG2_MASK (PMX_TOUCH_XY_MASK | PMX_SSP0_CS0_MASK | \
210 PMX_SSP0_CS1_2_MASK)
211
212#define PMX_SMII_0_1_2_MASK (PMX_CLCD2_MASK | PMX_KBD_ROWCOL68_MASK)
213#define PMX_RGMII_REG0_MASK (PMX_MCI_DATA8_15_MASK | \
214 PMX_GMIICOL_CRS_XFERER_MIITXCLK_MASK | \
215 PMX_GMIID47_MASK)
216#define PMX_RGMII_REG1_MASK (PMX_KBD_ROWCOL68_MASK | PMX_EGPIO_1_GRP_MASK |\
217 PMX_KBD_ROW1_MASK | PMX_NFWPRT1_MASK | \
218 PMX_KBD_ROW0_MASK | PMX_NFWPRT2_MASK)
219#define PMX_RGMII_REG2_MASK (PMX_TOUCH_XY_MASK | PMX_SSP0_CS0_MASK | \
220 PMX_SSP0_CS1_2_MASK)
221
222#define PCIE_CFG_VAL(x) (PCIE_SATA##x##_SEL_PCIE | \
223 PCIE##x##_CFG_AUX_CLK_EN | \
224 PCIE##x##_CFG_CORE_CLK_EN | \
225 PCIE##x##_CFG_POWERUP_RESET | \
226 PCIE##x##_CFG_DEVICE_PRESENT)
227#define SATA_CFG_VAL(x) (PCIE_SATA##x##_SEL_SATA | \
228 SATA##x##_CFG_PM_CLK_EN | \
229 SATA##x##_CFG_POWERUP_RESET | \
230 SATA##x##_CFG_RX_CLK_EN | \
231 SATA##x##_CFG_TX_CLK_EN)
232
233/* Pad multiplexing for i2c0 device */
234static const unsigned i2c0_pins[] = { 102, 103 };
235static struct spear_muxreg i2c0_muxreg[] = {
236 {
237 .reg = PAD_FUNCTION_EN_0,
238 .mask = PMX_I2C0_MASK,
239 .val = PMX_I2C0_MASK,
240 },
241};
242
243static struct spear_modemux i2c0_modemux[] = {
244 {
245 .muxregs = i2c0_muxreg,
246 .nmuxregs = ARRAY_SIZE(i2c0_muxreg),
247 },
248};
249
250static struct spear_pingroup i2c0_pingroup = {
251 .name = "i2c0_grp",
252 .pins = i2c0_pins,
253 .npins = ARRAY_SIZE(i2c0_pins),
254 .modemuxs = i2c0_modemux,
255 .nmodemuxs = ARRAY_SIZE(i2c0_modemux),
256};
257
258static const char *const i2c0_grps[] = { "i2c0_grp" };
259static struct spear_function i2c0_function = {
260 .name = "i2c0",
261 .groups = i2c0_grps,
262 .ngroups = ARRAY_SIZE(i2c0_grps),
263};
264
265/* Pad multiplexing for ssp0 device */
266static const unsigned ssp0_pins[] = { 109, 110, 111, 112 };
267static struct spear_muxreg ssp0_muxreg[] = {
268 {
269 .reg = PAD_FUNCTION_EN_0,
270 .mask = PMX_SSP0_MASK,
271 .val = PMX_SSP0_MASK,
272 },
273};
274
275static struct spear_modemux ssp0_modemux[] = {
276 {
277 .muxregs = ssp0_muxreg,
278 .nmuxregs = ARRAY_SIZE(ssp0_muxreg),
279 },
280};
281
282static struct spear_pingroup ssp0_pingroup = {
283 .name = "ssp0_grp",
284 .pins = ssp0_pins,
285 .npins = ARRAY_SIZE(ssp0_pins),
286 .modemuxs = ssp0_modemux,
287 .nmodemuxs = ARRAY_SIZE(ssp0_modemux),
288};
289
290/* Pad multiplexing for ssp0_cs0 device */
291static const unsigned ssp0_cs0_pins[] = { 96 };
292static struct spear_muxreg ssp0_cs0_muxreg[] = {
293 {
294 .reg = PAD_FUNCTION_EN_2,
295 .mask = PMX_SSP0_CS0_MASK,
296 .val = PMX_SSP0_CS0_MASK,
297 },
298};
299
300static struct spear_modemux ssp0_cs0_modemux[] = {
301 {
302 .muxregs = ssp0_cs0_muxreg,
303 .nmuxregs = ARRAY_SIZE(ssp0_cs0_muxreg),
304 },
305};
306
307static struct spear_pingroup ssp0_cs0_pingroup = {
308 .name = "ssp0_cs0_grp",
309 .pins = ssp0_cs0_pins,
310 .npins = ARRAY_SIZE(ssp0_cs0_pins),
311 .modemuxs = ssp0_cs0_modemux,
312 .nmodemuxs = ARRAY_SIZE(ssp0_cs0_modemux),
313};
314
315/* ssp0_cs1_2 device */
316static const unsigned ssp0_cs1_2_pins[] = { 94, 95 };
317static struct spear_muxreg ssp0_cs1_2_muxreg[] = {
318 {
319 .reg = PAD_FUNCTION_EN_2,
320 .mask = PMX_SSP0_CS1_2_MASK,
321 .val = PMX_SSP0_CS1_2_MASK,
322 },
323};
324
325static struct spear_modemux ssp0_cs1_2_modemux[] = {
326 {
327 .muxregs = ssp0_cs1_2_muxreg,
328 .nmuxregs = ARRAY_SIZE(ssp0_cs1_2_muxreg),
329 },
330};
331
332static struct spear_pingroup ssp0_cs1_2_pingroup = {
333 .name = "ssp0_cs1_2_grp",
334 .pins = ssp0_cs1_2_pins,
335 .npins = ARRAY_SIZE(ssp0_cs1_2_pins),
336 .modemuxs = ssp0_cs1_2_modemux,
337 .nmodemuxs = ARRAY_SIZE(ssp0_cs1_2_modemux),
338};
339
340static const char *const ssp0_grps[] = { "ssp0_grp", "ssp0_cs0_grp",
341 "ssp0_cs1_2_grp" };
342static struct spear_function ssp0_function = {
343 .name = "ssp0",
344 .groups = ssp0_grps,
345 .ngroups = ARRAY_SIZE(ssp0_grps),
346};
347
348/* Pad multiplexing for i2s0 device */
349static const unsigned i2s0_pins[] = { 104, 105, 106, 107, 108 };
350static struct spear_muxreg i2s0_muxreg[] = {
351 {
352 .reg = PAD_FUNCTION_EN_0,
353 .mask = PMX_I2S0_MASK,
354 .val = PMX_I2S0_MASK,
355 },
356};
357
358static struct spear_modemux i2s0_modemux[] = {
359 {
360 .muxregs = i2s0_muxreg,
361 .nmuxregs = ARRAY_SIZE(i2s0_muxreg),
362 },
363};
364
365static struct spear_pingroup i2s0_pingroup = {
366 .name = "i2s0_grp",
367 .pins = i2s0_pins,
368 .npins = ARRAY_SIZE(i2s0_pins),
369 .modemuxs = i2s0_modemux,
370 .nmodemuxs = ARRAY_SIZE(i2s0_modemux),
371};
372
373static const char *const i2s0_grps[] = { "i2s0_grp" };
374static struct spear_function i2s0_function = {
375 .name = "i2s0",
376 .groups = i2s0_grps,
377 .ngroups = ARRAY_SIZE(i2s0_grps),
378};
379
380/* Pad multiplexing for i2s1 device */
381static const unsigned i2s1_pins[] = { 0, 1, 2, 3 };
382static struct spear_muxreg i2s1_muxreg[] = {
383 {
384 .reg = PAD_FUNCTION_EN_1,
385 .mask = PMX_I2S1_MASK,
386 .val = PMX_I2S1_MASK,
387 },
388};
389
390static struct spear_modemux i2s1_modemux[] = {
391 {
392 .muxregs = i2s1_muxreg,
393 .nmuxregs = ARRAY_SIZE(i2s1_muxreg),
394 },
395};
396
397static struct spear_pingroup i2s1_pingroup = {
398 .name = "i2s1_grp",
399 .pins = i2s1_pins,
400 .npins = ARRAY_SIZE(i2s1_pins),
401 .modemuxs = i2s1_modemux,
402 .nmodemuxs = ARRAY_SIZE(i2s1_modemux),
403};
404
405static const char *const i2s1_grps[] = { "i2s1_grp" };
406static struct spear_function i2s1_function = {
407 .name = "i2s1",
408 .groups = i2s1_grps,
409 .ngroups = ARRAY_SIZE(i2s1_grps),
410};
411
412/* Pad multiplexing for clcd device */
413static const unsigned clcd_pins[] = { 113, 114, 115, 116, 117, 118, 119, 120,
414 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
415 135, 136, 137, 138, 139, 140, 141, 142 };
416static struct spear_muxreg clcd_muxreg[] = {
417 {
418 .reg = PAD_FUNCTION_EN_0,
419 .mask = PMX_CLCD1_MASK,
420 .val = PMX_CLCD1_MASK,
421 },
422};
423
424static struct spear_modemux clcd_modemux[] = {
425 {
426 .muxregs = clcd_muxreg,
427 .nmuxregs = ARRAY_SIZE(clcd_muxreg),
428 },
429};
430
431static struct spear_pingroup clcd_pingroup = {
432 .name = "clcd_grp",
433 .pins = clcd_pins,
434 .npins = ARRAY_SIZE(clcd_pins),
435 .modemuxs = clcd_modemux,
436 .nmodemuxs = ARRAY_SIZE(clcd_modemux),
437};
438
439static const unsigned clcd_high_res_pins[] = { 30, 31, 32, 33, 34, 35, 36, 37,
440 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52 };
441static struct spear_muxreg clcd_high_res_muxreg[] = {
442 {
443 .reg = PAD_FUNCTION_EN_1,
444 .mask = PMX_CLCD2_MASK,
445 .val = PMX_CLCD2_MASK,
446 },
447};
448
449static struct spear_modemux clcd_high_res_modemux[] = {
450 {
451 .muxregs = clcd_high_res_muxreg,
452 .nmuxregs = ARRAY_SIZE(clcd_high_res_muxreg),
453 },
454};
455
456static struct spear_pingroup clcd_high_res_pingroup = {
457 .name = "clcd_high_res_grp",
458 .pins = clcd_high_res_pins,
459 .npins = ARRAY_SIZE(clcd_high_res_pins),
460 .modemuxs = clcd_high_res_modemux,
461 .nmodemuxs = ARRAY_SIZE(clcd_high_res_modemux),
462};
463
464static const char *const clcd_grps[] = { "clcd_grp", "clcd_high_res" };
465static struct spear_function clcd_function = {
466 .name = "clcd",
467 .groups = clcd_grps,
468 .ngroups = ARRAY_SIZE(clcd_grps),
469};
470
471static const unsigned arm_gpio_pins[] = { 18, 19, 20, 21, 22, 23, 143, 144, 145,
472 146, 147, 148, 149, 150, 151, 152 };
473static struct spear_muxreg arm_gpio_muxreg[] = {
474 {
475 .reg = PAD_FUNCTION_EN_0,
476 .mask = PMX_EGPIO_0_GRP_MASK,
477 .val = PMX_EGPIO_0_GRP_MASK,
478 }, {
479 .reg = PAD_FUNCTION_EN_1,
480 .mask = PMX_EGPIO_1_GRP_MASK,
481 .val = PMX_EGPIO_1_GRP_MASK,
482 },
483};
484
485static struct spear_modemux arm_gpio_modemux[] = {
486 {
487 .muxregs = arm_gpio_muxreg,
488 .nmuxregs = ARRAY_SIZE(arm_gpio_muxreg),
489 },
490};
491
492static struct spear_pingroup arm_gpio_pingroup = {
493 .name = "arm_gpio_grp",
494 .pins = arm_gpio_pins,
495 .npins = ARRAY_SIZE(arm_gpio_pins),
496 .modemuxs = arm_gpio_modemux,
497 .nmodemuxs = ARRAY_SIZE(arm_gpio_modemux),
498};
499
500static const char *const arm_gpio_grps[] = { "arm_gpio_grp" };
501static struct spear_function arm_gpio_function = {
502 .name = "arm_gpio",
503 .groups = arm_gpio_grps,
504 .ngroups = ARRAY_SIZE(arm_gpio_grps),
505};
506
507/* Pad multiplexing for smi 2 chips device */
508static const unsigned smi_2_chips_pins[] = { 153, 154, 155, 156, 157 };
509static struct spear_muxreg smi_2_chips_muxreg[] = {
510 {
511 .reg = PAD_FUNCTION_EN_0,
512 .mask = PMX_SMI_MASK,
513 .val = PMX_SMI_MASK,
514 },
515};
516
517static struct spear_modemux smi_2_chips_modemux[] = {
518 {
519 .muxregs = smi_2_chips_muxreg,
520 .nmuxregs = ARRAY_SIZE(smi_2_chips_muxreg),
521 },
522};
523
524static struct spear_pingroup smi_2_chips_pingroup = {
525 .name = "smi_2_chips_grp",
526 .pins = smi_2_chips_pins,
527 .npins = ARRAY_SIZE(smi_2_chips_pins),
528 .modemuxs = smi_2_chips_modemux,
529 .nmodemuxs = ARRAY_SIZE(smi_2_chips_modemux),
530};
531
532static const unsigned smi_4_chips_pins[] = { 54, 55 };
533static struct spear_muxreg smi_4_chips_muxreg[] = {
534 {
535 .reg = PAD_FUNCTION_EN_0,
536 .mask = PMX_SMI_MASK,
537 .val = PMX_SMI_MASK,
538 }, {
539 .reg = PAD_FUNCTION_EN_1,
540 .mask = PMX_SMINCS2_MASK | PMX_SMINCS3_MASK,
541 .val = PMX_SMINCS2_MASK | PMX_SMINCS3_MASK,
542 },
543};
544
545static struct spear_modemux smi_4_chips_modemux[] = {
546 {
547 .muxregs = smi_4_chips_muxreg,
548 .nmuxregs = ARRAY_SIZE(smi_4_chips_muxreg),
549 },
550};
551
552static struct spear_pingroup smi_4_chips_pingroup = {
553 .name = "smi_4_chips_grp",
554 .pins = smi_4_chips_pins,
555 .npins = ARRAY_SIZE(smi_4_chips_pins),
556 .modemuxs = smi_4_chips_modemux,
557 .nmodemuxs = ARRAY_SIZE(smi_4_chips_modemux),
558};
559
560static const char *const smi_grps[] = { "smi_2_chips_grp", "smi_4_chips_grp" };
561static struct spear_function smi_function = {
562 .name = "smi",
563 .groups = smi_grps,
564 .ngroups = ARRAY_SIZE(smi_grps),
565};
566
567/* Pad multiplexing for gmii device */
568static const unsigned gmii_pins[] = { 173, 174, 175, 176, 177, 178, 179, 180,
569 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
570 195, 196, 197, 198, 199, 200 };
571static struct spear_muxreg gmii_muxreg[] = {
572 {
573 .reg = PAD_FUNCTION_EN_0,
574 .mask = PMX_GMII_MASK,
575 .val = PMX_GMII_MASK,
576 },
577};
578
579static struct spear_modemux gmii_modemux[] = {
580 {
581 .muxregs = gmii_muxreg,
582 .nmuxregs = ARRAY_SIZE(gmii_muxreg),
583 },
584};
585
586static struct spear_pingroup gmii_pingroup = {
587 .name = "gmii_grp",
588 .pins = gmii_pins,
589 .npins = ARRAY_SIZE(gmii_pins),
590 .modemuxs = gmii_modemux,
591 .nmodemuxs = ARRAY_SIZE(gmii_modemux),
592};
593
594static const char *const gmii_grps[] = { "gmii_grp" };
595static struct spear_function gmii_function = {
596 .name = "gmii",
597 .groups = gmii_grps,
598 .ngroups = ARRAY_SIZE(gmii_grps),
599};
600
601/* Pad multiplexing for rgmii device */
602static const unsigned rgmii_pins[] = { 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
603 28, 29, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 175,
604 180, 181, 182, 183, 185, 188, 193, 194, 195, 196, 197, 198, 211, 212 };
605static struct spear_muxreg rgmii_muxreg[] = {
606 {
607 .reg = PAD_FUNCTION_EN_0,
608 .mask = PMX_RGMII_REG0_MASK,
609 .val = 0,
610 }, {
611 .reg = PAD_FUNCTION_EN_1,
612 .mask = PMX_RGMII_REG1_MASK,
613 .val = 0,
614 }, {
615 .reg = PAD_FUNCTION_EN_2,
616 .mask = PMX_RGMII_REG2_MASK,
617 .val = 0,
618 },
619};
620
621static struct spear_modemux rgmii_modemux[] = {
622 {
623 .muxregs = rgmii_muxreg,
624 .nmuxregs = ARRAY_SIZE(rgmii_muxreg),
625 },
626};
627
628static struct spear_pingroup rgmii_pingroup = {
629 .name = "rgmii_grp",
630 .pins = rgmii_pins,
631 .npins = ARRAY_SIZE(rgmii_pins),
632 .modemuxs = rgmii_modemux,
633 .nmodemuxs = ARRAY_SIZE(rgmii_modemux),
634};
635
636static const char *const rgmii_grps[] = { "rgmii_grp" };
637static struct spear_function rgmii_function = {
638 .name = "rgmii",
639 .groups = rgmii_grps,
640 .ngroups = ARRAY_SIZE(rgmii_grps),
641};
642
643/* Pad multiplexing for smii_0_1_2 device */
644static const unsigned smii_0_1_2_pins[] = { 24, 25, 26, 27, 28, 29, 30, 31, 32,
645 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
646 51, 52, 53, 54, 55 };
647static struct spear_muxreg smii_0_1_2_muxreg[] = {
648 {
649 .reg = PAD_FUNCTION_EN_1,
650 .mask = PMX_SMII_0_1_2_MASK,
651 .val = 0,
652 },
653};
654
655static struct spear_modemux smii_0_1_2_modemux[] = {
656 {
657 .muxregs = smii_0_1_2_muxreg,
658 .nmuxregs = ARRAY_SIZE(smii_0_1_2_muxreg),
659 },
660};
661
662static struct spear_pingroup smii_0_1_2_pingroup = {
663 .name = "smii_0_1_2_grp",
664 .pins = smii_0_1_2_pins,
665 .npins = ARRAY_SIZE(smii_0_1_2_pins),
666 .modemuxs = smii_0_1_2_modemux,
667 .nmodemuxs = ARRAY_SIZE(smii_0_1_2_modemux),
668};
669
670static const char *const smii_0_1_2_grps[] = { "smii_0_1_2_grp" };
671static struct spear_function smii_0_1_2_function = {
672 .name = "smii_0_1_2",
673 .groups = smii_0_1_2_grps,
674 .ngroups = ARRAY_SIZE(smii_0_1_2_grps),
675};
676
677/* Pad multiplexing for ras_mii_txclk device */
678static const unsigned ras_mii_txclk_pins[] = { 98, 99 };
679static struct spear_muxreg ras_mii_txclk_muxreg[] = {
680 {
681 .reg = PAD_FUNCTION_EN_1,
682 .mask = PMX_NFCE2_MASK,
683 .val = 0,
684 },
685};
686
687static struct spear_modemux ras_mii_txclk_modemux[] = {
688 {
689 .muxregs = ras_mii_txclk_muxreg,
690 .nmuxregs = ARRAY_SIZE(ras_mii_txclk_muxreg),
691 },
692};
693
694static struct spear_pingroup ras_mii_txclk_pingroup = {
695 .name = "ras_mii_txclk_grp",
696 .pins = ras_mii_txclk_pins,
697 .npins = ARRAY_SIZE(ras_mii_txclk_pins),
698 .modemuxs = ras_mii_txclk_modemux,
699 .nmodemuxs = ARRAY_SIZE(ras_mii_txclk_modemux),
700};
701
702static const char *const ras_mii_txclk_grps[] = { "ras_mii_txclk_grp" };
703static struct spear_function ras_mii_txclk_function = {
704 .name = "ras_mii_txclk",
705 .groups = ras_mii_txclk_grps,
706 .ngroups = ARRAY_SIZE(ras_mii_txclk_grps),
707};
708
709/* Pad multiplexing for nand 8bit device (cs0 only) */
710static const unsigned nand_8bit_pins[] = { 56, 57, 58, 59, 60, 61, 62, 63, 64,
711 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
712 83, 84, 85, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
713 170, 171, 172, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
714 212 };
715static struct spear_muxreg nand_8bit_muxreg[] = {
716 {
717 .reg = PAD_FUNCTION_EN_0,
718 .mask = PMX_NAND8BIT_0_MASK,
719 .val = PMX_NAND8BIT_0_MASK,
720 }, {
721 .reg = PAD_FUNCTION_EN_1,
722 .mask = PMX_NAND8BIT_1_MASK,
723 .val = PMX_NAND8BIT_1_MASK,
724 },
725};
726
727static struct spear_modemux nand_8bit_modemux[] = {
728 {
729 .muxregs = nand_8bit_muxreg,
730 .nmuxregs = ARRAY_SIZE(nand_8bit_muxreg),
731 },
732};
733
734static struct spear_pingroup nand_8bit_pingroup = {
735 .name = "nand_8bit_grp",
736 .pins = nand_8bit_pins,
737 .npins = ARRAY_SIZE(nand_8bit_pins),
738 .modemuxs = nand_8bit_modemux,
739 .nmodemuxs = ARRAY_SIZE(nand_8bit_modemux),
740};
741
742/* Pad multiplexing for nand 16bit device */
743static const unsigned nand_16bit_pins[] = { 201, 202, 203, 204, 207, 208, 209,
744 210 };
745static struct spear_muxreg nand_16bit_muxreg[] = {
746 {
747 .reg = PAD_FUNCTION_EN_1,
748 .mask = PMX_NAND16BIT_1_MASK,
749 .val = PMX_NAND16BIT_1_MASK,
750 },
751};
752
753static struct spear_modemux nand_16bit_modemux[] = {
754 {
755 .muxregs = nand_16bit_muxreg,
756 .nmuxregs = ARRAY_SIZE(nand_16bit_muxreg),
757 },
758};
759
760static struct spear_pingroup nand_16bit_pingroup = {
761 .name = "nand_16bit_grp",
762 .pins = nand_16bit_pins,
763 .npins = ARRAY_SIZE(nand_16bit_pins),
764 .modemuxs = nand_16bit_modemux,
765 .nmodemuxs = ARRAY_SIZE(nand_16bit_modemux),
766};
767
768/* Pad multiplexing for nand 4 chips */
769static const unsigned nand_4_chips_pins[] = { 205, 206, 211, 212 };
770static struct spear_muxreg nand_4_chips_muxreg[] = {
771 {
772 .reg = PAD_FUNCTION_EN_1,
773 .mask = PMX_NAND_4CHIPS_MASK,
774 .val = PMX_NAND_4CHIPS_MASK,
775 },
776};
777
778static struct spear_modemux nand_4_chips_modemux[] = {
779 {
780 .muxregs = nand_4_chips_muxreg,
781 .nmuxregs = ARRAY_SIZE(nand_4_chips_muxreg),
782 },
783};
784
785static struct spear_pingroup nand_4_chips_pingroup = {
786 .name = "nand_4_chips_grp",
787 .pins = nand_4_chips_pins,
788 .npins = ARRAY_SIZE(nand_4_chips_pins),
789 .modemuxs = nand_4_chips_modemux,
790 .nmodemuxs = ARRAY_SIZE(nand_4_chips_modemux),
791};
792
793static const char *const nand_grps[] = { "nand_8bit_grp", "nand_16bit_grp",
794 "nand_4_chips_grp" };
795static struct spear_function nand_function = {
796 .name = "nand",
797 .groups = nand_grps,
798 .ngroups = ARRAY_SIZE(nand_grps),
799};
800
801/* Pad multiplexing for keyboard_6x6 device */
802static const unsigned keyboard_6x6_pins[] = { 201, 202, 203, 204, 205, 206, 207,
803 208, 209, 210, 211, 212 };
804static struct spear_muxreg keyboard_6x6_muxreg[] = {
805 {
806 .reg = PAD_FUNCTION_EN_1,
807 .mask = PMX_KEYBOARD_6X6_MASK | PMX_NFIO8_15_MASK |
808 PMX_NFCE1_MASK | PMX_NFCE2_MASK | PMX_NFWPRT1_MASK |
809 PMX_NFWPRT2_MASK,
810 .val = PMX_KEYBOARD_6X6_MASK,
811 },
812};
813
814static struct spear_modemux keyboard_6x6_modemux[] = {
815 {
816 .muxregs = keyboard_6x6_muxreg,
817 .nmuxregs = ARRAY_SIZE(keyboard_6x6_muxreg),
818 },
819};
820
821static struct spear_pingroup keyboard_6x6_pingroup = {
822 .name = "keyboard_6x6_grp",
823 .pins = keyboard_6x6_pins,
824 .npins = ARRAY_SIZE(keyboard_6x6_pins),
825 .modemuxs = keyboard_6x6_modemux,
826 .nmodemuxs = ARRAY_SIZE(keyboard_6x6_modemux),
827};
828
829/* Pad multiplexing for keyboard_rowcol6_8 device */
830static const unsigned keyboard_rowcol6_8_pins[] = { 24, 25, 26, 27, 28, 29 };
831static struct spear_muxreg keyboard_rowcol6_8_muxreg[] = {
832 {
833 .reg = PAD_FUNCTION_EN_1,
834 .mask = PMX_KBD_ROWCOL68_MASK,
835 .val = PMX_KBD_ROWCOL68_MASK,
836 },
837};
838
839static struct spear_modemux keyboard_rowcol6_8_modemux[] = {
840 {
841 .muxregs = keyboard_rowcol6_8_muxreg,
842 .nmuxregs = ARRAY_SIZE(keyboard_rowcol6_8_muxreg),
843 },
844};
845
846static struct spear_pingroup keyboard_rowcol6_8_pingroup = {
847 .name = "keyboard_rowcol6_8_grp",
848 .pins = keyboard_rowcol6_8_pins,
849 .npins = ARRAY_SIZE(keyboard_rowcol6_8_pins),
850 .modemuxs = keyboard_rowcol6_8_modemux,
851 .nmodemuxs = ARRAY_SIZE(keyboard_rowcol6_8_modemux),
852};
853
854static const char *const keyboard_grps[] = { "keyboard_6x6_grp",
855 "keyboard_rowcol6_8_grp" };
856static struct spear_function keyboard_function = {
857 .name = "keyboard",
858 .groups = keyboard_grps,
859 .ngroups = ARRAY_SIZE(keyboard_grps),
860};
861
862/* Pad multiplexing for uart0 device */
863static const unsigned uart0_pins[] = { 100, 101 };
864static struct spear_muxreg uart0_muxreg[] = {
865 {
866 .reg = PAD_FUNCTION_EN_0,
867 .mask = PMX_UART0_MASK,
868 .val = PMX_UART0_MASK,
869 },
870};
871
872static struct spear_modemux uart0_modemux[] = {
873 {
874 .muxregs = uart0_muxreg,
875 .nmuxregs = ARRAY_SIZE(uart0_muxreg),
876 },
877};
878
879static struct spear_pingroup uart0_pingroup = {
880 .name = "uart0_grp",
881 .pins = uart0_pins,
882 .npins = ARRAY_SIZE(uart0_pins),
883 .modemuxs = uart0_modemux,
884 .nmodemuxs = ARRAY_SIZE(uart0_modemux),
885};
886
887/* Pad multiplexing for uart0_modem device */
888static const unsigned uart0_modem_pins[] = { 12, 13, 14, 15, 16, 17 };
889static struct spear_muxreg uart0_modem_muxreg[] = {
890 {
891 .reg = PAD_FUNCTION_EN_1,
892 .mask = PMX_UART0_MODEM_MASK,
893 .val = PMX_UART0_MODEM_MASK,
894 },
895};
896
897static struct spear_modemux uart0_modem_modemux[] = {
898 {
899 .muxregs = uart0_modem_muxreg,
900 .nmuxregs = ARRAY_SIZE(uart0_modem_muxreg),
901 },
902};
903
904static struct spear_pingroup uart0_modem_pingroup = {
905 .name = "uart0_modem_grp",
906 .pins = uart0_modem_pins,
907 .npins = ARRAY_SIZE(uart0_modem_pins),
908 .modemuxs = uart0_modem_modemux,
909 .nmodemuxs = ARRAY_SIZE(uart0_modem_modemux),
910};
911
912static const char *const uart0_grps[] = { "uart0_grp", "uart0_modem_grp" };
913static struct spear_function uart0_function = {
914 .name = "uart0",
915 .groups = uart0_grps,
916 .ngroups = ARRAY_SIZE(uart0_grps),
917};
918
919/* Pad multiplexing for gpt0_tmr0 device */
920static const unsigned gpt0_tmr0_pins[] = { 10, 11 };
921static struct spear_muxreg gpt0_tmr0_muxreg[] = {
922 {
923 .reg = PAD_FUNCTION_EN_1,
924 .mask = PMX_GPT0_TMR0_MASK,
925 .val = PMX_GPT0_TMR0_MASK,
926 },
927};
928
929static struct spear_modemux gpt0_tmr0_modemux[] = {
930 {
931 .muxregs = gpt0_tmr0_muxreg,
932 .nmuxregs = ARRAY_SIZE(gpt0_tmr0_muxreg),
933 },
934};
935
936static struct spear_pingroup gpt0_tmr0_pingroup = {
937 .name = "gpt0_tmr0_grp",
938 .pins = gpt0_tmr0_pins,
939 .npins = ARRAY_SIZE(gpt0_tmr0_pins),
940 .modemuxs = gpt0_tmr0_modemux,
941 .nmodemuxs = ARRAY_SIZE(gpt0_tmr0_modemux),
942};
943
944/* Pad multiplexing for gpt0_tmr1 device */
945static const unsigned gpt0_tmr1_pins[] = { 8, 9 };
946static struct spear_muxreg gpt0_tmr1_muxreg[] = {
947 {
948 .reg = PAD_FUNCTION_EN_1,
949 .mask = PMX_GPT0_TMR1_MASK,
950 .val = PMX_GPT0_TMR1_MASK,
951 },
952};
953
954static struct spear_modemux gpt0_tmr1_modemux[] = {
955 {
956 .muxregs = gpt0_tmr1_muxreg,
957 .nmuxregs = ARRAY_SIZE(gpt0_tmr1_muxreg),
958 },
959};
960
961static struct spear_pingroup gpt0_tmr1_pingroup = {
962 .name = "gpt0_tmr1_grp",
963 .pins = gpt0_tmr1_pins,
964 .npins = ARRAY_SIZE(gpt0_tmr1_pins),
965 .modemuxs = gpt0_tmr1_modemux,
966 .nmodemuxs = ARRAY_SIZE(gpt0_tmr1_modemux),
967};
968
969static const char *const gpt0_grps[] = { "gpt0_tmr0_grp", "gpt0_tmr1_grp" };
970static struct spear_function gpt0_function = {
971 .name = "gpt0",
972 .groups = gpt0_grps,
973 .ngroups = ARRAY_SIZE(gpt0_grps),
974};
975
976/* Pad multiplexing for gpt1_tmr0 device */
977static const unsigned gpt1_tmr0_pins[] = { 6, 7 };
978static struct spear_muxreg gpt1_tmr0_muxreg[] = {
979 {
980 .reg = PAD_FUNCTION_EN_1,
981 .mask = PMX_GPT1_TMR0_MASK,
982 .val = PMX_GPT1_TMR0_MASK,
983 },
984};
985
986static struct spear_modemux gpt1_tmr0_modemux[] = {
987 {
988 .muxregs = gpt1_tmr0_muxreg,
989 .nmuxregs = ARRAY_SIZE(gpt1_tmr0_muxreg),
990 },
991};
992
993static struct spear_pingroup gpt1_tmr0_pingroup = {
994 .name = "gpt1_tmr0_grp",
995 .pins = gpt1_tmr0_pins,
996 .npins = ARRAY_SIZE(gpt1_tmr0_pins),
997 .modemuxs = gpt1_tmr0_modemux,
998 .nmodemuxs = ARRAY_SIZE(gpt1_tmr0_modemux),
999};
1000
1001/* Pad multiplexing for gpt1_tmr1 device */
1002static const unsigned gpt1_tmr1_pins[] = { 4, 5 };
1003static struct spear_muxreg gpt1_tmr1_muxreg[] = {
1004 {
1005 .reg = PAD_FUNCTION_EN_1,
1006 .mask = PMX_GPT1_TMR1_MASK,
1007 .val = PMX_GPT1_TMR1_MASK,
1008 },
1009};
1010
1011static struct spear_modemux gpt1_tmr1_modemux[] = {
1012 {
1013 .muxregs = gpt1_tmr1_muxreg,
1014 .nmuxregs = ARRAY_SIZE(gpt1_tmr1_muxreg),
1015 },
1016};
1017
1018static struct spear_pingroup gpt1_tmr1_pingroup = {
1019 .name = "gpt1_tmr1_grp",
1020 .pins = gpt1_tmr1_pins,
1021 .npins = ARRAY_SIZE(gpt1_tmr1_pins),
1022 .modemuxs = gpt1_tmr1_modemux,
1023 .nmodemuxs = ARRAY_SIZE(gpt1_tmr1_modemux),
1024};
1025
1026static const char *const gpt1_grps[] = { "gpt1_tmr1_grp", "gpt1_tmr0_grp" };
1027static struct spear_function gpt1_function = {
1028 .name = "gpt1",
1029 .groups = gpt1_grps,
1030 .ngroups = ARRAY_SIZE(gpt1_grps),
1031};
1032
1033/* Pad multiplexing for mcif device */
1034static const unsigned mcif_pins[] = { 86, 87, 88, 89, 90, 91, 92, 93, 213, 214,
1035 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
1036 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242,
1037 243, 244, 245 };
1038#define MCIF_MUXREG \
1039 { \
1040 .reg = PAD_FUNCTION_EN_0, \
1041 .mask = PMX_MCI_DATA8_15_MASK, \
1042 .val = PMX_MCI_DATA8_15_MASK, \
1043 }, { \
1044 .reg = PAD_FUNCTION_EN_1, \
1045 .mask = PMX_MCIFALL_1_MASK | PMX_NFWPRT1_MASK | \
1046 PMX_NFWPRT2_MASK, \
1047 .val = PMX_MCIFALL_1_MASK, \
1048 }, { \
1049 .reg = PAD_FUNCTION_EN_2, \
1050 .mask = PMX_MCIFALL_2_MASK, \
1051 .val = PMX_MCIFALL_2_MASK, \
1052 }
1053
1054/* sdhci device */
1055static struct spear_muxreg sdhci_muxreg[] = {
1056 MCIF_MUXREG,
1057 {
1058 .reg = PERIP_CFG,
1059 .mask = MCIF_SEL_MASK,
1060 .val = MCIF_SEL_SD,
1061 },
1062};
1063
1064static struct spear_modemux sdhci_modemux[] = {
1065 {
1066 .muxregs = sdhci_muxreg,
1067 .nmuxregs = ARRAY_SIZE(sdhci_muxreg),
1068 },
1069};
1070
1071static struct spear_pingroup sdhci_pingroup = {
1072 .name = "sdhci_grp",
1073 .pins = mcif_pins,
1074 .npins = ARRAY_SIZE(mcif_pins),
1075 .modemuxs = sdhci_modemux,
1076 .nmodemuxs = ARRAY_SIZE(sdhci_modemux),
1077};
1078
1079static const char *const sdhci_grps[] = { "sdhci_grp" };
1080static struct spear_function sdhci_function = {
1081 .name = "sdhci",
1082 .groups = sdhci_grps,
1083 .ngroups = ARRAY_SIZE(sdhci_grps),
1084};
1085
1086/* cf device */
1087static struct spear_muxreg cf_muxreg[] = {
1088 MCIF_MUXREG,
1089 {
1090 .reg = PERIP_CFG,
1091 .mask = MCIF_SEL_MASK,
1092 .val = MCIF_SEL_CF,
1093 },
1094};
1095
1096static struct spear_modemux cf_modemux[] = {
1097 {
1098 .muxregs = cf_muxreg,
1099 .nmuxregs = ARRAY_SIZE(cf_muxreg),
1100 },
1101};
1102
1103static struct spear_pingroup cf_pingroup = {
1104 .name = "cf_grp",
1105 .pins = mcif_pins,
1106 .npins = ARRAY_SIZE(mcif_pins),
1107 .modemuxs = cf_modemux,
1108 .nmodemuxs = ARRAY_SIZE(cf_modemux),
1109};
1110
1111static const char *const cf_grps[] = { "cf_grp" };
1112static struct spear_function cf_function = {
1113 .name = "cf",
1114 .groups = cf_grps,
1115 .ngroups = ARRAY_SIZE(cf_grps),
1116};
1117
1118/* xd device */
1119static struct spear_muxreg xd_muxreg[] = {
1120 MCIF_MUXREG,
1121 {
1122 .reg = PERIP_CFG,
1123 .mask = MCIF_SEL_MASK,
1124 .val = MCIF_SEL_XD,
1125 },
1126};
1127
1128static struct spear_modemux xd_modemux[] = {
1129 {
1130 .muxregs = xd_muxreg,
1131 .nmuxregs = ARRAY_SIZE(xd_muxreg),
1132 },
1133};
1134
1135static struct spear_pingroup xd_pingroup = {
1136 .name = "xd_grp",
1137 .pins = mcif_pins,
1138 .npins = ARRAY_SIZE(mcif_pins),
1139 .modemuxs = xd_modemux,
1140 .nmodemuxs = ARRAY_SIZE(xd_modemux),
1141};
1142
1143static const char *const xd_grps[] = { "xd_grp" };
1144static struct spear_function xd_function = {
1145 .name = "xd",
1146 .groups = xd_grps,
1147 .ngroups = ARRAY_SIZE(xd_grps),
1148};
1149
1150/* Pad multiplexing for touch_xy device */
1151static const unsigned touch_xy_pins[] = { 97 };
1152static struct spear_muxreg touch_xy_muxreg[] = {
1153 {
1154 .reg = PAD_FUNCTION_EN_2,
1155 .mask = PMX_TOUCH_XY_MASK,
1156 .val = PMX_TOUCH_XY_MASK,
1157 },
1158};
1159
1160static struct spear_modemux touch_xy_modemux[] = {
1161 {
1162 .muxregs = touch_xy_muxreg,
1163 .nmuxregs = ARRAY_SIZE(touch_xy_muxreg),
1164 },
1165};
1166
1167static struct spear_pingroup touch_xy_pingroup = {
1168 .name = "touch_xy_grp",
1169 .pins = touch_xy_pins,
1170 .npins = ARRAY_SIZE(touch_xy_pins),
1171 .modemuxs = touch_xy_modemux,
1172 .nmodemuxs = ARRAY_SIZE(touch_xy_modemux),
1173};
1174
1175static const char *const touch_xy_grps[] = { "touch_xy_grp" };
1176static struct spear_function touch_xy_function = {
1177 .name = "touchscreen",
1178 .groups = touch_xy_grps,
1179 .ngroups = ARRAY_SIZE(touch_xy_grps),
1180};
1181
1182/* Pad multiplexing for uart1 device */
1183/* Muxed with I2C */
1184static const unsigned uart1_dis_i2c_pins[] = { 102, 103 };
1185static struct spear_muxreg uart1_dis_i2c_muxreg[] = {
1186 {
1187 .reg = PAD_FUNCTION_EN_0,
1188 .mask = PMX_I2C0_MASK,
1189 .val = 0,
1190 },
1191};
1192
1193static struct spear_modemux uart1_dis_i2c_modemux[] = {
1194 {
1195 .muxregs = uart1_dis_i2c_muxreg,
1196 .nmuxregs = ARRAY_SIZE(uart1_dis_i2c_muxreg),
1197 },
1198};
1199
1200static struct spear_pingroup uart_1_dis_i2c_pingroup = {
1201 .name = "uart1_disable_i2c_grp",
1202 .pins = uart1_dis_i2c_pins,
1203 .npins = ARRAY_SIZE(uart1_dis_i2c_pins),
1204 .modemuxs = uart1_dis_i2c_modemux,
1205 .nmodemuxs = ARRAY_SIZE(uart1_dis_i2c_modemux),
1206};
1207
1208/* Muxed with SD/MMC */
1209static const unsigned uart1_dis_sd_pins[] = { 214, 215 };
1210static struct spear_muxreg uart1_dis_sd_muxreg[] = {
1211 {
1212 .reg = PAD_FUNCTION_EN_1,
1213 .mask = PMX_MCIDATA1_MASK |
1214 PMX_MCIDATA2_MASK,
1215 .val = 0,
1216 },
1217};
1218
1219static struct spear_modemux uart1_dis_sd_modemux[] = {
1220 {
1221 .muxregs = uart1_dis_sd_muxreg,
1222 .nmuxregs = ARRAY_SIZE(uart1_dis_sd_muxreg),
1223 },
1224};
1225
1226static struct spear_pingroup uart_1_dis_sd_pingroup = {
1227 .name = "uart1_disable_sd_grp",
1228 .pins = uart1_dis_sd_pins,
1229 .npins = ARRAY_SIZE(uart1_dis_sd_pins),
1230 .modemuxs = uart1_dis_sd_modemux,
1231 .nmodemuxs = ARRAY_SIZE(uart1_dis_sd_modemux),
1232};
1233
1234static const char *const uart1_grps[] = { "uart1_disable_i2c_grp",
1235 "uart1_disable_sd_grp" };
1236static struct spear_function uart1_function = {
1237 .name = "uart1",
1238 .groups = uart1_grps,
1239 .ngroups = ARRAY_SIZE(uart1_grps),
1240};
1241
1242/* Pad multiplexing for uart2_3 device */
1243static const unsigned uart2_3_pins[] = { 104, 105, 106, 107 };
1244static struct spear_muxreg uart2_3_muxreg[] = {
1245 {
1246 .reg = PAD_FUNCTION_EN_0,
1247 .mask = PMX_I2S0_MASK,
1248 .val = 0,
1249 },
1250};
1251
1252static struct spear_modemux uart2_3_modemux[] = {
1253 {
1254 .muxregs = uart2_3_muxreg,
1255 .nmuxregs = ARRAY_SIZE(uart2_3_muxreg),
1256 },
1257};
1258
1259static struct spear_pingroup uart_2_3_pingroup = {
1260 .name = "uart2_3_grp",
1261 .pins = uart2_3_pins,
1262 .npins = ARRAY_SIZE(uart2_3_pins),
1263 .modemuxs = uart2_3_modemux,
1264 .nmodemuxs = ARRAY_SIZE(uart2_3_modemux),
1265};
1266
1267static const char *const uart2_3_grps[] = { "uart2_3_grp" };
1268static struct spear_function uart2_3_function = {
1269 .name = "uart2_3",
1270 .groups = uart2_3_grps,
1271 .ngroups = ARRAY_SIZE(uart2_3_grps),
1272};
1273
1274/* Pad multiplexing for uart4 device */
1275static const unsigned uart4_pins[] = { 108, 113 };
1276static struct spear_muxreg uart4_muxreg[] = {
1277 {
1278 .reg = PAD_FUNCTION_EN_0,
1279 .mask = PMX_I2S0_MASK | PMX_CLCD1_MASK,
1280 .val = 0,
1281 },
1282};
1283
1284static struct spear_modemux uart4_modemux[] = {
1285 {
1286 .muxregs = uart4_muxreg,
1287 .nmuxregs = ARRAY_SIZE(uart4_muxreg),
1288 },
1289};
1290
1291static struct spear_pingroup uart_4_pingroup = {
1292 .name = "uart4_grp",
1293 .pins = uart4_pins,
1294 .npins = ARRAY_SIZE(uart4_pins),
1295 .modemuxs = uart4_modemux,
1296 .nmodemuxs = ARRAY_SIZE(uart4_modemux),
1297};
1298
1299static const char *const uart4_grps[] = { "uart4_grp" };
1300static struct spear_function uart4_function = {
1301 .name = "uart4",
1302 .groups = uart4_grps,
1303 .ngroups = ARRAY_SIZE(uart4_grps),
1304};
1305
1306/* Pad multiplexing for uart5 device */
1307static const unsigned uart5_pins[] = { 114, 115 };
1308static struct spear_muxreg uart5_muxreg[] = {
1309 {
1310 .reg = PAD_FUNCTION_EN_0,
1311 .mask = PMX_CLCD1_MASK,
1312 .val = 0,
1313 },
1314};
1315
1316static struct spear_modemux uart5_modemux[] = {
1317 {
1318 .muxregs = uart5_muxreg,
1319 .nmuxregs = ARRAY_SIZE(uart5_muxreg),
1320 },
1321};
1322
1323static struct spear_pingroup uart_5_pingroup = {
1324 .name = "uart5_grp",
1325 .pins = uart5_pins,
1326 .npins = ARRAY_SIZE(uart5_pins),
1327 .modemuxs = uart5_modemux,
1328 .nmodemuxs = ARRAY_SIZE(uart5_modemux),
1329};
1330
1331static const char *const uart5_grps[] = { "uart5_grp" };
1332static struct spear_function uart5_function = {
1333 .name = "uart5",
1334 .groups = uart5_grps,
1335 .ngroups = ARRAY_SIZE(uart5_grps),
1336};
1337
1338/* Pad multiplexing for rs485_0_1_tdm_0_1 device */
1339static const unsigned rs485_0_1_tdm_0_1_pins[] = { 116, 117, 118, 119, 120, 121,
1340 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
1341 136, 137 };
1342static struct spear_muxreg rs485_0_1_tdm_0_1_muxreg[] = {
1343 {
1344 .reg = PAD_FUNCTION_EN_0,
1345 .mask = PMX_CLCD1_MASK,
1346 .val = 0,
1347 },
1348};
1349
1350static struct spear_modemux rs485_0_1_tdm_0_1_modemux[] = {
1351 {
1352 .muxregs = rs485_0_1_tdm_0_1_muxreg,
1353 .nmuxregs = ARRAY_SIZE(rs485_0_1_tdm_0_1_muxreg),
1354 },
1355};
1356
1357static struct spear_pingroup rs485_0_1_tdm_0_1_pingroup = {
1358 .name = "rs485_0_1_tdm_0_1_grp",
1359 .pins = rs485_0_1_tdm_0_1_pins,
1360 .npins = ARRAY_SIZE(rs485_0_1_tdm_0_1_pins),
1361 .modemuxs = rs485_0_1_tdm_0_1_modemux,
1362 .nmodemuxs = ARRAY_SIZE(rs485_0_1_tdm_0_1_modemux),
1363};
1364
1365static const char *const rs485_0_1_tdm_0_1_grps[] = { "rs485_0_1_tdm_0_1_grp" };
1366static struct spear_function rs485_0_1_tdm_0_1_function = {
1367 .name = "rs485_0_1_tdm_0_1",
1368 .groups = rs485_0_1_tdm_0_1_grps,
1369 .ngroups = ARRAY_SIZE(rs485_0_1_tdm_0_1_grps),
1370};
1371
1372/* Pad multiplexing for i2c_1_2 device */
1373static const unsigned i2c_1_2_pins[] = { 138, 139, 140, 141 };
1374static struct spear_muxreg i2c_1_2_muxreg[] = {
1375 {
1376 .reg = PAD_FUNCTION_EN_0,
1377 .mask = PMX_CLCD1_MASK,
1378 .val = 0,
1379 },
1380};
1381
1382static struct spear_modemux i2c_1_2_modemux[] = {
1383 {
1384 .muxregs = i2c_1_2_muxreg,
1385 .nmuxregs = ARRAY_SIZE(i2c_1_2_muxreg),
1386 },
1387};
1388
1389static struct spear_pingroup i2c_1_2_pingroup = {
1390 .name = "i2c_1_2_grp",
1391 .pins = i2c_1_2_pins,
1392 .npins = ARRAY_SIZE(i2c_1_2_pins),
1393 .modemuxs = i2c_1_2_modemux,
1394 .nmodemuxs = ARRAY_SIZE(i2c_1_2_modemux),
1395};
1396
1397static const char *const i2c_1_2_grps[] = { "i2c_1_2_grp" };
1398static struct spear_function i2c_1_2_function = {
1399 .name = "i2c_1_2",
1400 .groups = i2c_1_2_grps,
1401 .ngroups = ARRAY_SIZE(i2c_1_2_grps),
1402};
1403
1404/* Pad multiplexing for i2c3_dis_smi_clcd device */
1405/* Muxed with SMI & CLCD */
1406static const unsigned i2c3_dis_smi_clcd_pins[] = { 142, 153 };
1407static struct spear_muxreg i2c3_dis_smi_clcd_muxreg[] = {
1408 {
1409 .reg = PAD_FUNCTION_EN_0,
1410 .mask = PMX_CLCD1_MASK | PMX_SMI_MASK,
1411 .val = 0,
1412 },
1413};
1414
1415static struct spear_modemux i2c3_dis_smi_clcd_modemux[] = {
1416 {
1417 .muxregs = i2c3_dis_smi_clcd_muxreg,
1418 .nmuxregs = ARRAY_SIZE(i2c3_dis_smi_clcd_muxreg),
1419 },
1420};
1421
1422static struct spear_pingroup i2c3_dis_smi_clcd_pingroup = {
1423 .name = "i2c3_dis_smi_clcd_grp",
1424 .pins = i2c3_dis_smi_clcd_pins,
1425 .npins = ARRAY_SIZE(i2c3_dis_smi_clcd_pins),
1426 .modemuxs = i2c3_dis_smi_clcd_modemux,
1427 .nmodemuxs = ARRAY_SIZE(i2c3_dis_smi_clcd_modemux),
1428};
1429
1430/* Pad multiplexing for i2c3_dis_sd_i2s0 device */
1431/* Muxed with SD/MMC & I2S1 */
1432static const unsigned i2c3_dis_sd_i2s0_pins[] = { 0, 216 };
1433static struct spear_muxreg i2c3_dis_sd_i2s0_muxreg[] = {
1434 {
1435 .reg = PAD_FUNCTION_EN_1,
1436 .mask = PMX_I2S1_MASK | PMX_MCIDATA3_MASK,
1437 .val = 0,
1438 },
1439};
1440
1441static struct spear_modemux i2c3_dis_sd_i2s0_modemux[] = {
1442 {
1443 .muxregs = i2c3_dis_sd_i2s0_muxreg,
1444 .nmuxregs = ARRAY_SIZE(i2c3_dis_sd_i2s0_muxreg),
1445 },
1446};
1447
1448static struct spear_pingroup i2c3_dis_sd_i2s0_pingroup = {
1449 .name = "i2c3_dis_sd_i2s0_grp",
1450 .pins = i2c3_dis_sd_i2s0_pins,
1451 .npins = ARRAY_SIZE(i2c3_dis_sd_i2s0_pins),
1452 .modemuxs = i2c3_dis_sd_i2s0_modemux,
1453 .nmodemuxs = ARRAY_SIZE(i2c3_dis_sd_i2s0_modemux),
1454};
1455
1456static const char *const i2c3_grps[] = { "i2c3_dis_smi_clcd_grp",
1457 "i2c3_dis_sd_i2s0_grp" };
1458static struct spear_function i2c3_unction = {
1459 .name = "i2c3_i2s1",
1460 .groups = i2c3_grps,
1461 .ngroups = ARRAY_SIZE(i2c3_grps),
1462};
1463
1464/* Pad multiplexing for i2c_4_5_dis_smi device */
1465/* Muxed with SMI */
1466static const unsigned i2c_4_5_dis_smi_pins[] = { 154, 155, 156, 157 };
1467static struct spear_muxreg i2c_4_5_dis_smi_muxreg[] = {
1468 {
1469 .reg = PAD_FUNCTION_EN_0,
1470 .mask = PMX_SMI_MASK,
1471 .val = 0,
1472 },
1473};
1474
1475static struct spear_modemux i2c_4_5_dis_smi_modemux[] = {
1476 {
1477 .muxregs = i2c_4_5_dis_smi_muxreg,
1478 .nmuxregs = ARRAY_SIZE(i2c_4_5_dis_smi_muxreg),
1479 },
1480};
1481
1482static struct spear_pingroup i2c_4_5_dis_smi_pingroup = {
1483 .name = "i2c_4_5_dis_smi_grp",
1484 .pins = i2c_4_5_dis_smi_pins,
1485 .npins = ARRAY_SIZE(i2c_4_5_dis_smi_pins),
1486 .modemuxs = i2c_4_5_dis_smi_modemux,
1487 .nmodemuxs = ARRAY_SIZE(i2c_4_5_dis_smi_modemux),
1488};
1489
1490/* Pad multiplexing for i2c4_dis_sd device */
1491/* Muxed with SD/MMC */
1492static const unsigned i2c4_dis_sd_pins[] = { 217, 218 };
1493static struct spear_muxreg i2c4_dis_sd_muxreg[] = {
1494 {
1495 .reg = PAD_FUNCTION_EN_1,
1496 .mask = PMX_MCIDATA4_MASK,
1497 .val = 0,
1498 }, {
1499 .reg = PAD_FUNCTION_EN_2,
1500 .mask = PMX_MCIDATA5_MASK,
1501 .val = 0,
1502 },
1503};
1504
1505static struct spear_modemux i2c4_dis_sd_modemux[] = {
1506 {
1507 .muxregs = i2c4_dis_sd_muxreg,
1508 .nmuxregs = ARRAY_SIZE(i2c4_dis_sd_muxreg),
1509 },
1510};
1511
1512static struct spear_pingroup i2c4_dis_sd_pingroup = {
1513 .name = "i2c4_dis_sd_grp",
1514 .pins = i2c4_dis_sd_pins,
1515 .npins = ARRAY_SIZE(i2c4_dis_sd_pins),
1516 .modemuxs = i2c4_dis_sd_modemux,
1517 .nmodemuxs = ARRAY_SIZE(i2c4_dis_sd_modemux),
1518};
1519
1520/* Pad multiplexing for i2c5_dis_sd device */
1521/* Muxed with SD/MMC */
1522static const unsigned i2c5_dis_sd_pins[] = { 219, 220 };
1523static struct spear_muxreg i2c5_dis_sd_muxreg[] = {
1524 {
1525 .reg = PAD_FUNCTION_EN_2,
1526 .mask = PMX_MCIDATA6_MASK |
1527 PMX_MCIDATA7_MASK,
1528 .val = 0,
1529 },
1530};
1531
1532static struct spear_modemux i2c5_dis_sd_modemux[] = {
1533 {
1534 .muxregs = i2c5_dis_sd_muxreg,
1535 .nmuxregs = ARRAY_SIZE(i2c5_dis_sd_muxreg),
1536 },
1537};
1538
1539static struct spear_pingroup i2c5_dis_sd_pingroup = {
1540 .name = "i2c5_dis_sd_grp",
1541 .pins = i2c5_dis_sd_pins,
1542 .npins = ARRAY_SIZE(i2c5_dis_sd_pins),
1543 .modemuxs = i2c5_dis_sd_modemux,
1544 .nmodemuxs = ARRAY_SIZE(i2c5_dis_sd_modemux),
1545};
1546
1547static const char *const i2c_4_5_grps[] = { "i2c5_dis_sd_grp",
1548 "i2c4_dis_sd_grp", "i2c_4_5_dis_smi_grp" };
1549static struct spear_function i2c_4_5_function = {
1550 .name = "i2c_4_5",
1551 .groups = i2c_4_5_grps,
1552 .ngroups = ARRAY_SIZE(i2c_4_5_grps),
1553};
1554
1555/* Pad multiplexing for i2c_6_7_dis_kbd device */
1556/* Muxed with KBD */
1557static const unsigned i2c_6_7_dis_kbd_pins[] = { 207, 208, 209, 210 };
1558static struct spear_muxreg i2c_6_7_dis_kbd_muxreg[] = {
1559 {
1560 .reg = PAD_FUNCTION_EN_1,
1561 .mask = PMX_KBD_ROWCOL25_MASK,
1562 .val = 0,
1563 },
1564};
1565
1566static struct spear_modemux i2c_6_7_dis_kbd_modemux[] = {
1567 {
1568 .muxregs = i2c_6_7_dis_kbd_muxreg,
1569 .nmuxregs = ARRAY_SIZE(i2c_6_7_dis_kbd_muxreg),
1570 },
1571};
1572
1573static struct spear_pingroup i2c_6_7_dis_kbd_pingroup = {
1574 .name = "i2c_6_7_dis_kbd_grp",
1575 .pins = i2c_6_7_dis_kbd_pins,
1576 .npins = ARRAY_SIZE(i2c_6_7_dis_kbd_pins),
1577 .modemuxs = i2c_6_7_dis_kbd_modemux,
1578 .nmodemuxs = ARRAY_SIZE(i2c_6_7_dis_kbd_modemux),
1579};
1580
1581/* Pad multiplexing for i2c6_dis_sd device */
1582/* Muxed with SD/MMC */
1583static const unsigned i2c6_dis_sd_pins[] = { 236, 237 };
1584static struct spear_muxreg i2c6_dis_sd_muxreg[] = {
1585 {
1586 .reg = PAD_FUNCTION_EN_2,
1587 .mask = PMX_MCIIORDRE_MASK |
1588 PMX_MCIIOWRWE_MASK,
1589 .val = 0,
1590 },
1591};
1592
1593static struct spear_modemux i2c6_dis_sd_modemux[] = {
1594 {
1595 .muxregs = i2c6_dis_sd_muxreg,
1596 .nmuxregs = ARRAY_SIZE(i2c6_dis_sd_muxreg),
1597 },
1598};
1599
1600static struct spear_pingroup i2c6_dis_sd_pingroup = {
1601 .name = "i2c6_dis_sd_grp",
1602 .pins = i2c6_dis_sd_pins,
1603 .npins = ARRAY_SIZE(i2c6_dis_sd_pins),
1604 .modemuxs = i2c6_dis_sd_modemux,
1605 .nmodemuxs = ARRAY_SIZE(i2c6_dis_sd_modemux),
1606};
1607
1608/* Pad multiplexing for i2c7_dis_sd device */
1609static const unsigned i2c7_dis_sd_pins[] = { 238, 239 };
1610static struct spear_muxreg i2c7_dis_sd_muxreg[] = {
1611 {
1612 .reg = PAD_FUNCTION_EN_2,
1613 .mask = PMX_MCIRESETCF_MASK |
1614 PMX_MCICS0CE_MASK,
1615 .val = 0,
1616 },
1617};
1618
1619static struct spear_modemux i2c7_dis_sd_modemux[] = {
1620 {
1621 .muxregs = i2c7_dis_sd_muxreg,
1622 .nmuxregs = ARRAY_SIZE(i2c7_dis_sd_muxreg),
1623 },
1624};
1625
1626static struct spear_pingroup i2c7_dis_sd_pingroup = {
1627 .name = "i2c7_dis_sd_grp",
1628 .pins = i2c7_dis_sd_pins,
1629 .npins = ARRAY_SIZE(i2c7_dis_sd_pins),
1630 .modemuxs = i2c7_dis_sd_modemux,
1631 .nmodemuxs = ARRAY_SIZE(i2c7_dis_sd_modemux),
1632};
1633
1634static const char *const i2c_6_7_grps[] = { "i2c6_dis_sd_grp",
1635 "i2c7_dis_sd_grp", "i2c_6_7_dis_kbd_grp" };
1636static struct spear_function i2c_6_7_function = {
1637 .name = "i2c_6_7",
1638 .groups = i2c_6_7_grps,
1639 .ngroups = ARRAY_SIZE(i2c_6_7_grps),
1640};
1641
1642/* Pad multiplexing for can0_dis_nor device */
1643/* Muxed with NOR */
1644static const unsigned can0_dis_nor_pins[] = { 56, 57 };
1645static struct spear_muxreg can0_dis_nor_muxreg[] = {
1646 {
1647 .reg = PAD_FUNCTION_EN_0,
1648 .mask = PMX_NFRSTPWDWN2_MASK,
1649 .val = 0,
1650 }, {
1651 .reg = PAD_FUNCTION_EN_1,
1652 .mask = PMX_NFRSTPWDWN3_MASK,
1653 .val = 0,
1654 },
1655};
1656
1657static struct spear_modemux can0_dis_nor_modemux[] = {
1658 {
1659 .muxregs = can0_dis_nor_muxreg,
1660 .nmuxregs = ARRAY_SIZE(can0_dis_nor_muxreg),
1661 },
1662};
1663
1664static struct spear_pingroup can0_dis_nor_pingroup = {
1665 .name = "can0_dis_nor_grp",
1666 .pins = can0_dis_nor_pins,
1667 .npins = ARRAY_SIZE(can0_dis_nor_pins),
1668 .modemuxs = can0_dis_nor_modemux,
1669 .nmodemuxs = ARRAY_SIZE(can0_dis_nor_modemux),
1670};
1671
1672/* Pad multiplexing for can0_dis_sd device */
1673/* Muxed with SD/MMC */
1674static const unsigned can0_dis_sd_pins[] = { 240, 241 };
1675static struct spear_muxreg can0_dis_sd_muxreg[] = {
1676 {
1677 .reg = PAD_FUNCTION_EN_2,
1678 .mask = PMX_MCICFINTR_MASK | PMX_MCIIORDY_MASK,
1679 .val = 0,
1680 },
1681};
1682
1683static struct spear_modemux can0_dis_sd_modemux[] = {
1684 {
1685 .muxregs = can0_dis_sd_muxreg,
1686 .nmuxregs = ARRAY_SIZE(can0_dis_sd_muxreg),
1687 },
1688};
1689
1690static struct spear_pingroup can0_dis_sd_pingroup = {
1691 .name = "can0_dis_sd_grp",
1692 .pins = can0_dis_sd_pins,
1693 .npins = ARRAY_SIZE(can0_dis_sd_pins),
1694 .modemuxs = can0_dis_sd_modemux,
1695 .nmodemuxs = ARRAY_SIZE(can0_dis_sd_modemux),
1696};
1697
1698static const char *const can0_grps[] = { "can0_dis_nor_grp", "can0_dis_sd_grp"
1699};
1700static struct spear_function can0_function = {
1701 .name = "can0",
1702 .groups = can0_grps,
1703 .ngroups = ARRAY_SIZE(can0_grps),
1704};
1705
1706/* Pad multiplexing for can1_dis_sd device */
1707/* Muxed with SD/MMC */
1708static const unsigned can1_dis_sd_pins[] = { 242, 243 };
1709static struct spear_muxreg can1_dis_sd_muxreg[] = {
1710 {
1711 .reg = PAD_FUNCTION_EN_2,
1712 .mask = PMX_MCICS1_MASK | PMX_MCIDMAACK_MASK,
1713 .val = 0,
1714 },
1715};
1716
1717static struct spear_modemux can1_dis_sd_modemux[] = {
1718 {
1719 .muxregs = can1_dis_sd_muxreg,
1720 .nmuxregs = ARRAY_SIZE(can1_dis_sd_muxreg),
1721 },
1722};
1723
1724static struct spear_pingroup can1_dis_sd_pingroup = {
1725 .name = "can1_dis_sd_grp",
1726 .pins = can1_dis_sd_pins,
1727 .npins = ARRAY_SIZE(can1_dis_sd_pins),
1728 .modemuxs = can1_dis_sd_modemux,
1729 .nmodemuxs = ARRAY_SIZE(can1_dis_sd_modemux),
1730};
1731
1732/* Pad multiplexing for can1_dis_kbd device */
1733/* Muxed with KBD */
1734static const unsigned can1_dis_kbd_pins[] = { 201, 202 };
1735static struct spear_muxreg can1_dis_kbd_muxreg[] = {
1736 {
1737 .reg = PAD_FUNCTION_EN_1,
1738 .mask = PMX_KBD_ROWCOL25_MASK,
1739 .val = 0,
1740 },
1741};
1742
1743static struct spear_modemux can1_dis_kbd_modemux[] = {
1744 {
1745 .muxregs = can1_dis_kbd_muxreg,
1746 .nmuxregs = ARRAY_SIZE(can1_dis_kbd_muxreg),
1747 },
1748};
1749
1750static struct spear_pingroup can1_dis_kbd_pingroup = {
1751 .name = "can1_dis_kbd_grp",
1752 .pins = can1_dis_kbd_pins,
1753 .npins = ARRAY_SIZE(can1_dis_kbd_pins),
1754 .modemuxs = can1_dis_kbd_modemux,
1755 .nmodemuxs = ARRAY_SIZE(can1_dis_kbd_modemux),
1756};
1757
1758static const char *const can1_grps[] = { "can1_dis_sd_grp", "can1_dis_kbd_grp"
1759};
1760static struct spear_function can1_function = {
1761 .name = "can1",
1762 .groups = can1_grps,
1763 .ngroups = ARRAY_SIZE(can1_grps),
1764};
1765
1766/* Pad multiplexing for pci device */
1767static const unsigned pci_sata_pins[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 18,
1768 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1769 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1770 55, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 };
1771#define PCI_SATA_MUXREG \
1772 { \
1773 .reg = PAD_FUNCTION_EN_0, \
1774 .mask = PMX_MCI_DATA8_15_MASK, \
1775 .val = 0, \
1776 }, { \
1777 .reg = PAD_FUNCTION_EN_1, \
1778 .mask = PMX_PCI_REG1_MASK, \
1779 .val = 0, \
1780 }, { \
1781 .reg = PAD_FUNCTION_EN_2, \
1782 .mask = PMX_PCI_REG2_MASK, \
1783 .val = 0, \
1784 }
1785
1786/* pad multiplexing for pcie0 device */
1787static struct spear_muxreg pcie0_muxreg[] = {
1788 PCI_SATA_MUXREG,
1789 {
1790 .reg = PCIE_SATA_CFG,
1791 .mask = PCIE_CFG_VAL(0),
1792 .val = PCIE_CFG_VAL(0),
1793 },
1794};
1795
1796static struct spear_modemux pcie0_modemux[] = {
1797 {
1798 .muxregs = pcie0_muxreg,
1799 .nmuxregs = ARRAY_SIZE(pcie0_muxreg),
1800 },
1801};
1802
1803static struct spear_pingroup pcie0_pingroup = {
1804 .name = "pcie0_grp",
1805 .pins = pci_sata_pins,
1806 .npins = ARRAY_SIZE(pci_sata_pins),
1807 .modemuxs = pcie0_modemux,
1808 .nmodemuxs = ARRAY_SIZE(pcie0_modemux),
1809};
1810
1811/* pad multiplexing for pcie1 device */
1812static struct spear_muxreg pcie1_muxreg[] = {
1813 PCI_SATA_MUXREG,
1814 {
1815 .reg = PCIE_SATA_CFG,
1816 .mask = PCIE_CFG_VAL(1),
1817 .val = PCIE_CFG_VAL(1),
1818 },
1819};
1820
1821static struct spear_modemux pcie1_modemux[] = {
1822 {
1823 .muxregs = pcie1_muxreg,
1824 .nmuxregs = ARRAY_SIZE(pcie1_muxreg),
1825 },
1826};
1827
1828static struct spear_pingroup pcie1_pingroup = {
1829 .name = "pcie1_grp",
1830 .pins = pci_sata_pins,
1831 .npins = ARRAY_SIZE(pci_sata_pins),
1832 .modemuxs = pcie1_modemux,
1833 .nmodemuxs = ARRAY_SIZE(pcie1_modemux),
1834};
1835
1836/* pad multiplexing for pcie2 device */
1837static struct spear_muxreg pcie2_muxreg[] = {
1838 PCI_SATA_MUXREG,
1839 {
1840 .reg = PCIE_SATA_CFG,
1841 .mask = PCIE_CFG_VAL(2),
1842 .val = PCIE_CFG_VAL(2),
1843 },
1844};
1845
1846static struct spear_modemux pcie2_modemux[] = {
1847 {
1848 .muxregs = pcie2_muxreg,
1849 .nmuxregs = ARRAY_SIZE(pcie2_muxreg),
1850 },
1851};
1852
1853static struct spear_pingroup pcie2_pingroup = {
1854 .name = "pcie2_grp",
1855 .pins = pci_sata_pins,
1856 .npins = ARRAY_SIZE(pci_sata_pins),
1857 .modemuxs = pcie2_modemux,
1858 .nmodemuxs = ARRAY_SIZE(pcie2_modemux),
1859};
1860
1861static const char *const pci_grps[] = { "pcie0_grp", "pcie1_grp", "pcie2_grp" };
1862static struct spear_function pci_function = {
1863 .name = "pci",
1864 .groups = pci_grps,
1865 .ngroups = ARRAY_SIZE(pci_grps),
1866};
1867
1868/* pad multiplexing for sata0 device */
1869static struct spear_muxreg sata0_muxreg[] = {
1870 PCI_SATA_MUXREG,
1871 {
1872 .reg = PCIE_SATA_CFG,
1873 .mask = SATA_CFG_VAL(0),
1874 .val = SATA_CFG_VAL(0),
1875 },
1876};
1877
1878static struct spear_modemux sata0_modemux[] = {
1879 {
1880 .muxregs = sata0_muxreg,
1881 .nmuxregs = ARRAY_SIZE(sata0_muxreg),
1882 },
1883};
1884
1885static struct spear_pingroup sata0_pingroup = {
1886 .name = "sata0_grp",
1887 .pins = pci_sata_pins,
1888 .npins = ARRAY_SIZE(pci_sata_pins),
1889 .modemuxs = sata0_modemux,
1890 .nmodemuxs = ARRAY_SIZE(sata0_modemux),
1891};
1892
1893/* pad multiplexing for sata1 device */
1894static struct spear_muxreg sata1_muxreg[] = {
1895 PCI_SATA_MUXREG,
1896 {
1897 .reg = PCIE_SATA_CFG,
1898 .mask = SATA_CFG_VAL(1),
1899 .val = SATA_CFG_VAL(1),
1900 },
1901};
1902
1903static struct spear_modemux sata1_modemux[] = {
1904 {
1905 .muxregs = sata1_muxreg,
1906 .nmuxregs = ARRAY_SIZE(sata1_muxreg),
1907 },
1908};
1909
1910static struct spear_pingroup sata1_pingroup = {
1911 .name = "sata1_grp",
1912 .pins = pci_sata_pins,
1913 .npins = ARRAY_SIZE(pci_sata_pins),
1914 .modemuxs = sata1_modemux,
1915 .nmodemuxs = ARRAY_SIZE(sata1_modemux),
1916};
1917
1918/* pad multiplexing for sata2 device */
1919static struct spear_muxreg sata2_muxreg[] = {
1920 PCI_SATA_MUXREG,
1921 {
1922 .reg = PCIE_SATA_CFG,
1923 .mask = SATA_CFG_VAL(2),
1924 .val = SATA_CFG_VAL(2),
1925 },
1926};
1927
1928static struct spear_modemux sata2_modemux[] = {
1929 {
1930 .muxregs = sata2_muxreg,
1931 .nmuxregs = ARRAY_SIZE(sata2_muxreg),
1932 },
1933};
1934
1935static struct spear_pingroup sata2_pingroup = {
1936 .name = "sata2_grp",
1937 .pins = pci_sata_pins,
1938 .npins = ARRAY_SIZE(pci_sata_pins),
1939 .modemuxs = sata2_modemux,
1940 .nmodemuxs = ARRAY_SIZE(sata2_modemux),
1941};
1942
1943static const char *const sata_grps[] = { "sata0_grp", "sata1_grp", "sata2_grp"
1944};
1945static struct spear_function sata_function = {
1946 .name = "sata",
1947 .groups = sata_grps,
1948 .ngroups = ARRAY_SIZE(sata_grps),
1949};
1950
1951/* Pad multiplexing for ssp1_dis_kbd device */
1952static const unsigned ssp1_dis_kbd_pins[] = { 203, 204, 205, 206 };
1953static struct spear_muxreg ssp1_dis_kbd_muxreg[] = {
1954 {
1955 .reg = PAD_FUNCTION_EN_1,
1956 .mask = PMX_KBD_ROWCOL25_MASK | PMX_KBD_COL1_MASK |
1957 PMX_KBD_COL0_MASK | PMX_NFIO8_15_MASK | PMX_NFCE1_MASK |
1958 PMX_NFCE2_MASK,
1959 .val = 0,
1960 },
1961};
1962
1963static struct spear_modemux ssp1_dis_kbd_modemux[] = {
1964 {
1965 .muxregs = ssp1_dis_kbd_muxreg,
1966 .nmuxregs = ARRAY_SIZE(ssp1_dis_kbd_muxreg),
1967 },
1968};
1969
1970static struct spear_pingroup ssp1_dis_kbd_pingroup = {
1971 .name = "ssp1_dis_kbd_grp",
1972 .pins = ssp1_dis_kbd_pins,
1973 .npins = ARRAY_SIZE(ssp1_dis_kbd_pins),
1974 .modemuxs = ssp1_dis_kbd_modemux,
1975 .nmodemuxs = ARRAY_SIZE(ssp1_dis_kbd_modemux),
1976};
1977
1978/* Pad multiplexing for ssp1_dis_sd device */
1979static const unsigned ssp1_dis_sd_pins[] = { 224, 226, 227, 228 };
1980static struct spear_muxreg ssp1_dis_sd_muxreg[] = {
1981 {
1982 .reg = PAD_FUNCTION_EN_2,
1983 .mask = PMX_MCIADDR0ALE_MASK | PMX_MCIADDR2_MASK |
1984 PMX_MCICECF_MASK | PMX_MCICEXD_MASK,
1985 .val = 0,
1986 },
1987};
1988
1989static struct spear_modemux ssp1_dis_sd_modemux[] = {
1990 {
1991 .muxregs = ssp1_dis_sd_muxreg,
1992 .nmuxregs = ARRAY_SIZE(ssp1_dis_sd_muxreg),
1993 },
1994};
1995
1996static struct spear_pingroup ssp1_dis_sd_pingroup = {
1997 .name = "ssp1_dis_sd_grp",
1998 .pins = ssp1_dis_sd_pins,
1999 .npins = ARRAY_SIZE(ssp1_dis_sd_pins),
2000 .modemuxs = ssp1_dis_sd_modemux,
2001 .nmodemuxs = ARRAY_SIZE(ssp1_dis_sd_modemux),
2002};
2003
2004static const char *const ssp1_grps[] = { "ssp1_dis_kbd_grp",
2005 "ssp1_dis_sd_grp" };
2006static struct spear_function ssp1_function = {
2007 .name = "ssp1",
2008 .groups = ssp1_grps,
2009 .ngroups = ARRAY_SIZE(ssp1_grps),
2010};
2011
2012/* Pad multiplexing for gpt64 device */
2013static const unsigned gpt64_pins[] = { 230, 231, 232, 245 };
2014static struct spear_muxreg gpt64_muxreg[] = {
2015 {
2016 .reg = PAD_FUNCTION_EN_2,
2017 .mask = PMX_MCICDCF1_MASK | PMX_MCICDCF2_MASK | PMX_MCICDXD_MASK
2018 | PMX_MCILEDS_MASK,
2019 .val = 0,
2020 },
2021};
2022
2023static struct spear_modemux gpt64_modemux[] = {
2024 {
2025 .muxregs = gpt64_muxreg,
2026 .nmuxregs = ARRAY_SIZE(gpt64_muxreg),
2027 },
2028};
2029
2030static struct spear_pingroup gpt64_pingroup = {
2031 .name = "gpt64_grp",
2032 .pins = gpt64_pins,
2033 .npins = ARRAY_SIZE(gpt64_pins),
2034 .modemuxs = gpt64_modemux,
2035 .nmodemuxs = ARRAY_SIZE(gpt64_modemux),
2036};
2037
2038static const char *const gpt64_grps[] = { "gpt64_grp" };
2039static struct spear_function gpt64_function = {
2040 .name = "gpt64",
2041 .groups = gpt64_grps,
2042 .ngroups = ARRAY_SIZE(gpt64_grps),
2043};
2044
2045/* pingroups */
2046static struct spear_pingroup *spear1310_pingroups[] = {
2047 &i2c0_pingroup,
2048 &ssp0_pingroup,
2049 &i2s0_pingroup,
2050 &i2s1_pingroup,
2051 &clcd_pingroup,
2052 &clcd_high_res_pingroup,
2053 &arm_gpio_pingroup,
2054 &smi_2_chips_pingroup,
2055 &smi_4_chips_pingroup,
2056 &gmii_pingroup,
2057 &rgmii_pingroup,
2058 &smii_0_1_2_pingroup,
2059 &ras_mii_txclk_pingroup,
2060 &nand_8bit_pingroup,
2061 &nand_16bit_pingroup,
2062 &nand_4_chips_pingroup,
2063 &keyboard_6x6_pingroup,
2064 &keyboard_rowcol6_8_pingroup,
2065 &uart0_pingroup,
2066 &uart0_modem_pingroup,
2067 &gpt0_tmr0_pingroup,
2068 &gpt0_tmr1_pingroup,
2069 &gpt1_tmr0_pingroup,
2070 &gpt1_tmr1_pingroup,
2071 &sdhci_pingroup,
2072 &cf_pingroup,
2073 &xd_pingroup,
2074 &touch_xy_pingroup,
2075 &ssp0_cs0_pingroup,
2076 &ssp0_cs1_2_pingroup,
2077 &uart_1_dis_i2c_pingroup,
2078 &uart_1_dis_sd_pingroup,
2079 &uart_2_3_pingroup,
2080 &uart_4_pingroup,
2081 &uart_5_pingroup,
2082 &rs485_0_1_tdm_0_1_pingroup,
2083 &i2c_1_2_pingroup,
2084 &i2c3_dis_smi_clcd_pingroup,
2085 &i2c3_dis_sd_i2s0_pingroup,
2086 &i2c_4_5_dis_smi_pingroup,
2087 &i2c4_dis_sd_pingroup,
2088 &i2c5_dis_sd_pingroup,
2089 &i2c_6_7_dis_kbd_pingroup,
2090 &i2c6_dis_sd_pingroup,
2091 &i2c7_dis_sd_pingroup,
2092 &can0_dis_nor_pingroup,
2093 &can0_dis_sd_pingroup,
2094 &can1_dis_sd_pingroup,
2095 &can1_dis_kbd_pingroup,
2096 &pcie0_pingroup,
2097 &pcie1_pingroup,
2098 &pcie2_pingroup,
2099 &sata0_pingroup,
2100 &sata1_pingroup,
2101 &sata2_pingroup,
2102 &ssp1_dis_kbd_pingroup,
2103 &ssp1_dis_sd_pingroup,
2104 &gpt64_pingroup,
2105};
2106
2107/* functions */
2108static struct spear_function *spear1310_functions[] = {
2109 &i2c0_function,
2110 &ssp0_function,
2111 &i2s0_function,
2112 &i2s1_function,
2113 &clcd_function,
2114 &arm_gpio_function,
2115 &smi_function,
2116 &gmii_function,
2117 &rgmii_function,
2118 &smii_0_1_2_function,
2119 &ras_mii_txclk_function,
2120 &nand_function,
2121 &keyboard_function,
2122 &uart0_function,
2123 &gpt0_function,
2124 &gpt1_function,
2125 &sdhci_function,
2126 &cf_function,
2127 &xd_function,
2128 &touch_xy_function,
2129 &uart1_function,
2130 &uart2_3_function,
2131 &uart4_function,
2132 &uart5_function,
2133 &rs485_0_1_tdm_0_1_function,
2134 &i2c_1_2_function,
2135 &i2c3_unction,
2136 &i2c_4_5_function,
2137 &i2c_6_7_function,
2138 &can0_function,
2139 &can1_function,
2140 &pci_function,
2141 &sata_function,
2142 &ssp1_function,
2143 &gpt64_function,
2144};
2145
2146static struct spear_pinctrl_machdata spear1310_machdata = {
2147 .pins = spear1310_pins,
2148 .npins = ARRAY_SIZE(spear1310_pins),
2149 .groups = spear1310_pingroups,
2150 .ngroups = ARRAY_SIZE(spear1310_pingroups),
2151 .functions = spear1310_functions,
2152 .nfunctions = ARRAY_SIZE(spear1310_functions),
2153 .modes_supported = false,
2154};
2155
2156static struct of_device_id spear1310_pinctrl_of_match[] __devinitdata = {
2157 {
2158 .compatible = "st,spear1310-pinmux",
2159 },
2160 {},
2161};
2162
2163static int __devinit spear1310_pinctrl_probe(struct platform_device *pdev)
2164{
2165 return spear_pinctrl_probe(pdev, &spear1310_machdata);
2166}
2167
2168static int __devexit spear1310_pinctrl_remove(struct platform_device *pdev)
2169{
2170 return spear_pinctrl_remove(pdev);
2171}
2172
2173static struct platform_driver spear1310_pinctrl_driver = {
2174 .driver = {
2175 .name = DRIVER_NAME,
2176 .owner = THIS_MODULE,
2177 .of_match_table = spear1310_pinctrl_of_match,
2178 },
2179 .probe = spear1310_pinctrl_probe,
2180 .remove = __devexit_p(spear1310_pinctrl_remove),
2181};
2182
2183static int __init spear1310_pinctrl_init(void)
2184{
2185 return platform_driver_register(&spear1310_pinctrl_driver);
2186}
2187arch_initcall(spear1310_pinctrl_init);
2188
2189static void __exit spear1310_pinctrl_exit(void)
2190{
2191 platform_driver_unregister(&spear1310_pinctrl_driver);
2192}
2193module_exit(spear1310_pinctrl_exit);
2194
2195MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>");
2196MODULE_DESCRIPTION("ST Microelectronics SPEAr1310 pinctrl driver");
2197MODULE_LICENSE("GPL v2");
2198MODULE_DEVICE_TABLE(of, spear1310_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear1340.c b/drivers/pinctrl/spear/pinctrl-spear1340.c
new file mode 100644
index 000000000000..a8ab2a6f51bf
--- /dev/null
+++ b/drivers/pinctrl/spear/pinctrl-spear1340.c
@@ -0,0 +1,1989 @@
1/*
2 * Driver for the ST Microelectronics SPEAr1340 pinmux
3 *
4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#include <linux/err.h>
13#include <linux/init.h>
14#include <linux/module.h>
15#include <linux/of_device.h>
16#include <linux/platform_device.h>
17#include "pinctrl-spear.h"
18
19#define DRIVER_NAME "spear1340-pinmux"
20
21/* pins */
22static const struct pinctrl_pin_desc spear1340_pins[] = {
23 SPEAR_PIN_0_TO_101,
24 SPEAR_PIN_102_TO_245,
25 PINCTRL_PIN(246, "PLGPIO246"),
26 PINCTRL_PIN(247, "PLGPIO247"),
27 PINCTRL_PIN(248, "PLGPIO248"),
28 PINCTRL_PIN(249, "PLGPIO249"),
29 PINCTRL_PIN(250, "PLGPIO250"),
30 PINCTRL_PIN(251, "PLGPIO251"),
31};
32
33/* In SPEAr1340 there are two levels of pad muxing */
34/* - pads as gpio OR peripherals */
35#define PAD_FUNCTION_EN_1 0x668
36#define PAD_FUNCTION_EN_2 0x66C
37#define PAD_FUNCTION_EN_3 0x670
38#define PAD_FUNCTION_EN_4 0x674
39#define PAD_FUNCTION_EN_5 0x690
40#define PAD_FUNCTION_EN_6 0x694
41#define PAD_FUNCTION_EN_7 0x698
42#define PAD_FUNCTION_EN_8 0x69C
43
44/* - If peripherals, then primary OR alternate peripheral */
45#define PAD_SHARED_IP_EN_1 0x6A0
46#define PAD_SHARED_IP_EN_2 0x6A4
47
48/*
49 * Macro's for first level of pmx - pads as gpio OR peripherals. There are 8
50 * registers with 32 bits each for handling gpio pads, register 8 has only 26
51 * relevant bits.
52 */
53/* macro's for making pads as gpio's */
54#define PADS_AS_GPIO_REG0_MASK 0xFFFFFFFE
55#define PADS_AS_GPIO_REGS_MASK 0xFFFFFFFF
56#define PADS_AS_GPIO_REG7_MASK 0x07FFFFFF
57
58/* macro's for making pads as peripherals */
59#define FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK 0x00000FFE
60#define UART0_ENH_AND_GPT_REG0_MASK 0x0003F000
61#define PWM1_AND_KBD_COL5_REG0_MASK 0x00040000
62#define I2C1_REG0_MASK 0x01080000
63#define SPDIF_IN_REG0_MASK 0x00100000
64#define PWM2_AND_GPT0_TMR0_CPT_REG0_MASK 0x00400000
65#define PWM3_AND_GPT0_TMR1_CLK_REG0_MASK 0x00800000
66#define PWM0_AND_SSP0_CS1_REG0_MASK 0x02000000
67#define VIP_AND_CAM3_REG0_MASK 0xFC200000
68#define VIP_AND_CAM3_REG1_MASK 0x0000000F
69#define VIP_REG1_MASK 0x00001EF0
70#define VIP_AND_CAM2_REG1_MASK 0x007FE100
71#define VIP_AND_CAM1_REG1_MASK 0xFF800000
72#define VIP_AND_CAM1_REG2_MASK 0x00000003
73#define VIP_AND_CAM0_REG2_MASK 0x00001FFC
74#define SMI_REG2_MASK 0x0021E000
75#define SSP0_REG2_MASK 0x001E0000
76#define TS_AND_SSP0_CS2_REG2_MASK 0x00400000
77#define UART0_REG2_MASK 0x01800000
78#define UART1_REG2_MASK 0x06000000
79#define I2S_IN_REG2_MASK 0xF8000000
80#define DEVS_GRP_AND_MIPHY_DBG_REG3_MASK 0x000001FE
81#define I2S_OUT_REG3_MASK 0x000001EF
82#define I2S_IN_REG3_MASK 0x00000010
83#define GMAC_REG3_MASK 0xFFFFFE00
84#define GMAC_REG4_MASK 0x0000001F
85#define DEVS_GRP_AND_MIPHY_DBG_REG4_MASK 0x7FFFFF20
86#define SSP0_CS3_REG4_MASK 0x00000020
87#define I2C0_REG4_MASK 0x000000C0
88#define CEC0_REG4_MASK 0x00000100
89#define CEC1_REG4_MASK 0x00000200
90#define SPDIF_OUT_REG4_MASK 0x00000400
91#define CLCD_REG4_MASK 0x7FFFF800
92#define CLCD_AND_ARM_TRACE_REG4_MASK 0x80000000
93#define CLCD_AND_ARM_TRACE_REG5_MASK 0xFFFFFFFF
94#define CLCD_AND_ARM_TRACE_REG6_MASK 0x00000001
95#define FSMC_PNOR_AND_MCIF_REG6_MASK 0x073FFFFE
96#define MCIF_REG6_MASK 0xF8C00000
97#define MCIF_REG7_MASK 0x000043FF
98#define FSMC_8BIT_REG7_MASK 0x07FFBC00
99
100/* other registers */
101#define PERIP_CFG 0x42C
102 /* PERIP_CFG register masks */
103 #define SSP_CS_CTL_HW 0
104 #define SSP_CS_CTL_SW 1
105 #define SSP_CS_CTL_MASK 1
106 #define SSP_CS_CTL_SHIFT 21
107 #define SSP_CS_VAL_MASK 1
108 #define SSP_CS_VAL_SHIFT 20
109 #define SSP_CS_SEL_CS0 0
110 #define SSP_CS_SEL_CS1 1
111 #define SSP_CS_SEL_CS2 2
112 #define SSP_CS_SEL_MASK 3
113 #define SSP_CS_SEL_SHIFT 18
114
115 #define I2S_CHNL_2_0 (0)
116 #define I2S_CHNL_3_1 (1)
117 #define I2S_CHNL_5_1 (2)
118 #define I2S_CHNL_7_1 (3)
119 #define I2S_CHNL_PLAY_SHIFT (4)
120 #define I2S_CHNL_PLAY_MASK (3 << 4)
121 #define I2S_CHNL_REC_SHIFT (6)
122 #define I2S_CHNL_REC_MASK (3 << 6)
123
124 #define SPDIF_OUT_ENB_MASK (1 << 2)
125 #define SPDIF_OUT_ENB_SHIFT 2
126
127 #define MCIF_SEL_SD 1
128 #define MCIF_SEL_CF 2
129 #define MCIF_SEL_XD 3
130 #define MCIF_SEL_MASK 3
131 #define MCIF_SEL_SHIFT 0
132
133#define GMAC_CLK_CFG 0x248
134 #define GMAC_PHY_IF_GMII_VAL (0 << 3)
135 #define GMAC_PHY_IF_RGMII_VAL (1 << 3)
136 #define GMAC_PHY_IF_SGMII_VAL (2 << 3)
137 #define GMAC_PHY_IF_RMII_VAL (4 << 3)
138 #define GMAC_PHY_IF_SEL_MASK (7 << 3)
139 #define GMAC_PHY_INPUT_ENB_VAL 0
140 #define GMAC_PHY_SYNT_ENB_VAL 1
141 #define GMAC_PHY_CLK_MASK 1
142 #define GMAC_PHY_CLK_SHIFT 2
143 #define GMAC_PHY_125M_PAD_VAL 0
144 #define GMAC_PHY_PLL2_VAL 1
145 #define GMAC_PHY_OSC3_VAL 2
146 #define GMAC_PHY_INPUT_CLK_MASK 3
147 #define GMAC_PHY_INPUT_CLK_SHIFT 0
148
149#define PCIE_SATA_CFG 0x424
150 /* PCIE CFG MASks */
151 #define PCIE_CFG_DEVICE_PRESENT (1 << 11)
152 #define PCIE_CFG_POWERUP_RESET (1 << 10)
153 #define PCIE_CFG_CORE_CLK_EN (1 << 9)
154 #define PCIE_CFG_AUX_CLK_EN (1 << 8)
155 #define SATA_CFG_TX_CLK_EN (1 << 4)
156 #define SATA_CFG_RX_CLK_EN (1 << 3)
157 #define SATA_CFG_POWERUP_RESET (1 << 2)
158 #define SATA_CFG_PM_CLK_EN (1 << 1)
159 #define PCIE_SATA_SEL_PCIE (0)
160 #define PCIE_SATA_SEL_SATA (1)
161 #define SATA_PCIE_CFG_MASK 0xF1F
162 #define PCIE_CFG_VAL (PCIE_SATA_SEL_PCIE | PCIE_CFG_AUX_CLK_EN | \
163 PCIE_CFG_CORE_CLK_EN | PCIE_CFG_POWERUP_RESET |\
164 PCIE_CFG_DEVICE_PRESENT)
165 #define SATA_CFG_VAL (PCIE_SATA_SEL_SATA | SATA_CFG_PM_CLK_EN | \
166 SATA_CFG_POWERUP_RESET | SATA_CFG_RX_CLK_EN | \
167 SATA_CFG_TX_CLK_EN)
168
169/* Macro's for second level of pmx - pads as primary OR alternate peripheral */
170/* Write 0 to enable FSMC_16_BIT */
171#define KBD_ROW_COL_MASK (1 << 0)
172
173/* Write 0 to enable UART0_ENH */
174#define GPT_MASK (1 << 1) /* Only clk & cpt */
175
176/* Write 0 to enable PWM1 */
177#define KBD_COL5_MASK (1 << 2)
178
179/* Write 0 to enable PWM2 */
180#define GPT0_TMR0_CPT_MASK (1 << 3) /* Only clk & cpt */
181
182/* Write 0 to enable PWM3 */
183#define GPT0_TMR1_CLK_MASK (1 << 4) /* Only clk & cpt */
184
185/* Write 0 to enable PWM0 */
186#define SSP0_CS1_MASK (1 << 5)
187
188/* Write 0 to enable VIP */
189#define CAM3_MASK (1 << 6)
190
191/* Write 0 to enable VIP */
192#define CAM2_MASK (1 << 7)
193
194/* Write 0 to enable VIP */
195#define CAM1_MASK (1 << 8)
196
197/* Write 0 to enable VIP */
198#define CAM0_MASK (1 << 9)
199
200/* Write 0 to enable TS */
201#define SSP0_CS2_MASK (1 << 10)
202
203/* Write 0 to enable FSMC PNOR */
204#define MCIF_MASK (1 << 11)
205
206/* Write 0 to enable CLCD */
207#define ARM_TRACE_MASK (1 << 12)
208
209/* Write 0 to enable I2S, SSP0_CS2, CEC0, 1, SPDIF out, CLCD */
210#define MIPHY_DBG_MASK (1 << 13)
211
212/*
213 * Pad multiplexing for making all pads as gpio's. This is done to override the
214 * values passed from bootloader and start from scratch.
215 */
216static const unsigned pads_as_gpio_pins[] = { 251 };
217static struct spear_muxreg pads_as_gpio_muxreg[] = {
218 {
219 .reg = PAD_FUNCTION_EN_1,
220 .mask = PADS_AS_GPIO_REG0_MASK,
221 .val = 0x0,
222 }, {
223 .reg = PAD_FUNCTION_EN_2,
224 .mask = PADS_AS_GPIO_REGS_MASK,
225 .val = 0x0,
226 }, {
227 .reg = PAD_FUNCTION_EN_3,
228 .mask = PADS_AS_GPIO_REGS_MASK,
229 .val = 0x0,
230 }, {
231 .reg = PAD_FUNCTION_EN_4,
232 .mask = PADS_AS_GPIO_REGS_MASK,
233 .val = 0x0,
234 }, {
235 .reg = PAD_FUNCTION_EN_5,
236 .mask = PADS_AS_GPIO_REGS_MASK,
237 .val = 0x0,
238 }, {
239 .reg = PAD_FUNCTION_EN_6,
240 .mask = PADS_AS_GPIO_REGS_MASK,
241 .val = 0x0,
242 }, {
243 .reg = PAD_FUNCTION_EN_7,
244 .mask = PADS_AS_GPIO_REGS_MASK,
245 .val = 0x0,
246 }, {
247 .reg = PAD_FUNCTION_EN_8,
248 .mask = PADS_AS_GPIO_REG7_MASK,
249 .val = 0x0,
250 },
251};
252
253static struct spear_modemux pads_as_gpio_modemux[] = {
254 {
255 .muxregs = pads_as_gpio_muxreg,
256 .nmuxregs = ARRAY_SIZE(pads_as_gpio_muxreg),
257 },
258};
259
260static struct spear_pingroup pads_as_gpio_pingroup = {
261 .name = "pads_as_gpio_grp",
262 .pins = pads_as_gpio_pins,
263 .npins = ARRAY_SIZE(pads_as_gpio_pins),
264 .modemuxs = pads_as_gpio_modemux,
265 .nmodemuxs = ARRAY_SIZE(pads_as_gpio_modemux),
266};
267
268static const char *const pads_as_gpio_grps[] = { "pads_as_gpio_grp" };
269static struct spear_function pads_as_gpio_function = {
270 .name = "pads_as_gpio",
271 .groups = pads_as_gpio_grps,
272 .ngroups = ARRAY_SIZE(pads_as_gpio_grps),
273};
274
275/* Pad multiplexing for fsmc_8bit device */
276static const unsigned fsmc_8bit_pins[] = { 233, 234, 235, 236, 238, 239, 240,
277 241, 242, 243, 244, 245, 246, 247, 248, 249 };
278static struct spear_muxreg fsmc_8bit_muxreg[] = {
279 {
280 .reg = PAD_FUNCTION_EN_8,
281 .mask = FSMC_8BIT_REG7_MASK,
282 .val = FSMC_8BIT_REG7_MASK,
283 }
284};
285
286static struct spear_modemux fsmc_8bit_modemux[] = {
287 {
288 .muxregs = fsmc_8bit_muxreg,
289 .nmuxregs = ARRAY_SIZE(fsmc_8bit_muxreg),
290 },
291};
292
293static struct spear_pingroup fsmc_8bit_pingroup = {
294 .name = "fsmc_8bit_grp",
295 .pins = fsmc_8bit_pins,
296 .npins = ARRAY_SIZE(fsmc_8bit_pins),
297 .modemuxs = fsmc_8bit_modemux,
298 .nmodemuxs = ARRAY_SIZE(fsmc_8bit_modemux),
299};
300
301/* Pad multiplexing for fsmc_16bit device */
302static const unsigned fsmc_16bit_pins[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
303static struct spear_muxreg fsmc_16bit_muxreg[] = {
304 {
305 .reg = PAD_SHARED_IP_EN_1,
306 .mask = KBD_ROW_COL_MASK,
307 .val = 0,
308 }, {
309 .reg = PAD_FUNCTION_EN_1,
310 .mask = FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK,
311 .val = FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK,
312 },
313};
314
315static struct spear_modemux fsmc_16bit_modemux[] = {
316 {
317 .muxregs = fsmc_16bit_muxreg,
318 .nmuxregs = ARRAY_SIZE(fsmc_16bit_muxreg),
319 },
320};
321
322static struct spear_pingroup fsmc_16bit_pingroup = {
323 .name = "fsmc_16bit_grp",
324 .pins = fsmc_16bit_pins,
325 .npins = ARRAY_SIZE(fsmc_16bit_pins),
326 .modemuxs = fsmc_16bit_modemux,
327 .nmodemuxs = ARRAY_SIZE(fsmc_16bit_modemux),
328};
329
330/* pad multiplexing for fsmc_pnor device */
331static const unsigned fsmc_pnor_pins[] = { 192, 193, 194, 195, 196, 197, 198,
332 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
333 215, 216, 217 };
334static struct spear_muxreg fsmc_pnor_muxreg[] = {
335 {
336 .reg = PAD_SHARED_IP_EN_1,
337 .mask = MCIF_MASK,
338 .val = 0,
339 }, {
340 .reg = PAD_FUNCTION_EN_7,
341 .mask = FSMC_PNOR_AND_MCIF_REG6_MASK,
342 .val = FSMC_PNOR_AND_MCIF_REG6_MASK,
343 },
344};
345
346static struct spear_modemux fsmc_pnor_modemux[] = {
347 {
348 .muxregs = fsmc_pnor_muxreg,
349 .nmuxregs = ARRAY_SIZE(fsmc_pnor_muxreg),
350 },
351};
352
353static struct spear_pingroup fsmc_pnor_pingroup = {
354 .name = "fsmc_pnor_grp",
355 .pins = fsmc_pnor_pins,
356 .npins = ARRAY_SIZE(fsmc_pnor_pins),
357 .modemuxs = fsmc_pnor_modemux,
358 .nmodemuxs = ARRAY_SIZE(fsmc_pnor_modemux),
359};
360
361static const char *const fsmc_grps[] = { "fsmc_8bit_grp", "fsmc_16bit_grp",
362 "fsmc_pnor_grp" };
363static struct spear_function fsmc_function = {
364 .name = "fsmc",
365 .groups = fsmc_grps,
366 .ngroups = ARRAY_SIZE(fsmc_grps),
367};
368
369/* pad multiplexing for keyboard rows-cols device */
370static const unsigned keyboard_row_col_pins[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
371 10 };
372static struct spear_muxreg keyboard_row_col_muxreg[] = {
373 {
374 .reg = PAD_SHARED_IP_EN_1,
375 .mask = KBD_ROW_COL_MASK,
376 .val = KBD_ROW_COL_MASK,
377 }, {
378 .reg = PAD_FUNCTION_EN_1,
379 .mask = FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK,
380 .val = FSMC_16_BIT_AND_KBD_ROW_COL_REG0_MASK,
381 },
382};
383
384static struct spear_modemux keyboard_row_col_modemux[] = {
385 {
386 .muxregs = keyboard_row_col_muxreg,
387 .nmuxregs = ARRAY_SIZE(keyboard_row_col_muxreg),
388 },
389};
390
391static struct spear_pingroup keyboard_row_col_pingroup = {
392 .name = "keyboard_row_col_grp",
393 .pins = keyboard_row_col_pins,
394 .npins = ARRAY_SIZE(keyboard_row_col_pins),
395 .modemuxs = keyboard_row_col_modemux,
396 .nmodemuxs = ARRAY_SIZE(keyboard_row_col_modemux),
397};
398
399/* pad multiplexing for keyboard col5 device */
400static const unsigned keyboard_col5_pins[] = { 17 };
401static struct spear_muxreg keyboard_col5_muxreg[] = {
402 {
403 .reg = PAD_SHARED_IP_EN_1,
404 .mask = KBD_COL5_MASK,
405 .val = KBD_COL5_MASK,
406 }, {
407 .reg = PAD_FUNCTION_EN_1,
408 .mask = PWM1_AND_KBD_COL5_REG0_MASK,
409 .val = PWM1_AND_KBD_COL5_REG0_MASK,
410 },
411};
412
413static struct spear_modemux keyboard_col5_modemux[] = {
414 {
415 .muxregs = keyboard_col5_muxreg,
416 .nmuxregs = ARRAY_SIZE(keyboard_col5_muxreg),
417 },
418};
419
420static struct spear_pingroup keyboard_col5_pingroup = {
421 .name = "keyboard_col5_grp",
422 .pins = keyboard_col5_pins,
423 .npins = ARRAY_SIZE(keyboard_col5_pins),
424 .modemuxs = keyboard_col5_modemux,
425 .nmodemuxs = ARRAY_SIZE(keyboard_col5_modemux),
426};
427
428static const char *const keyboard_grps[] = { "keyboard_row_col_grp",
429 "keyboard_col5_grp" };
430static struct spear_function keyboard_function = {
431 .name = "keyboard",
432 .groups = keyboard_grps,
433 .ngroups = ARRAY_SIZE(keyboard_grps),
434};
435
436/* pad multiplexing for spdif_in device */
437static const unsigned spdif_in_pins[] = { 19 };
438static struct spear_muxreg spdif_in_muxreg[] = {
439 {
440 .reg = PAD_FUNCTION_EN_1,
441 .mask = SPDIF_IN_REG0_MASK,
442 .val = SPDIF_IN_REG0_MASK,
443 },
444};
445
446static struct spear_modemux spdif_in_modemux[] = {
447 {
448 .muxregs = spdif_in_muxreg,
449 .nmuxregs = ARRAY_SIZE(spdif_in_muxreg),
450 },
451};
452
453static struct spear_pingroup spdif_in_pingroup = {
454 .name = "spdif_in_grp",
455 .pins = spdif_in_pins,
456 .npins = ARRAY_SIZE(spdif_in_pins),
457 .modemuxs = spdif_in_modemux,
458 .nmodemuxs = ARRAY_SIZE(spdif_in_modemux),
459};
460
461static const char *const spdif_in_grps[] = { "spdif_in_grp" };
462static struct spear_function spdif_in_function = {
463 .name = "spdif_in",
464 .groups = spdif_in_grps,
465 .ngroups = ARRAY_SIZE(spdif_in_grps),
466};
467
468/* pad multiplexing for spdif_out device */
469static const unsigned spdif_out_pins[] = { 137 };
470static struct spear_muxreg spdif_out_muxreg[] = {
471 {
472 .reg = PAD_FUNCTION_EN_5,
473 .mask = SPDIF_OUT_REG4_MASK,
474 .val = SPDIF_OUT_REG4_MASK,
475 }, {
476 .reg = PERIP_CFG,
477 .mask = SPDIF_OUT_ENB_MASK,
478 .val = SPDIF_OUT_ENB_MASK,
479 }
480};
481
482static struct spear_modemux spdif_out_modemux[] = {
483 {
484 .muxregs = spdif_out_muxreg,
485 .nmuxregs = ARRAY_SIZE(spdif_out_muxreg),
486 },
487};
488
489static struct spear_pingroup spdif_out_pingroup = {
490 .name = "spdif_out_grp",
491 .pins = spdif_out_pins,
492 .npins = ARRAY_SIZE(spdif_out_pins),
493 .modemuxs = spdif_out_modemux,
494 .nmodemuxs = ARRAY_SIZE(spdif_out_modemux),
495};
496
497static const char *const spdif_out_grps[] = { "spdif_out_grp" };
498static struct spear_function spdif_out_function = {
499 .name = "spdif_out",
500 .groups = spdif_out_grps,
501 .ngroups = ARRAY_SIZE(spdif_out_grps),
502};
503
504/* pad multiplexing for gpt_0_1 device */
505static const unsigned gpt_0_1_pins[] = { 11, 12, 13, 14, 15, 16, 21, 22 };
506static struct spear_muxreg gpt_0_1_muxreg[] = {
507 {
508 .reg = PAD_SHARED_IP_EN_1,
509 .mask = GPT_MASK | GPT0_TMR0_CPT_MASK | GPT0_TMR1_CLK_MASK,
510 .val = GPT_MASK | GPT0_TMR0_CPT_MASK | GPT0_TMR1_CLK_MASK,
511 }, {
512 .reg = PAD_FUNCTION_EN_1,
513 .mask = UART0_ENH_AND_GPT_REG0_MASK |
514 PWM2_AND_GPT0_TMR0_CPT_REG0_MASK |
515 PWM3_AND_GPT0_TMR1_CLK_REG0_MASK,
516 .val = UART0_ENH_AND_GPT_REG0_MASK |
517 PWM2_AND_GPT0_TMR0_CPT_REG0_MASK |
518 PWM3_AND_GPT0_TMR1_CLK_REG0_MASK,
519 },
520};
521
522static struct spear_modemux gpt_0_1_modemux[] = {
523 {
524 .muxregs = gpt_0_1_muxreg,
525 .nmuxregs = ARRAY_SIZE(gpt_0_1_muxreg),
526 },
527};
528
529static struct spear_pingroup gpt_0_1_pingroup = {
530 .name = "gpt_0_1_grp",
531 .pins = gpt_0_1_pins,
532 .npins = ARRAY_SIZE(gpt_0_1_pins),
533 .modemuxs = gpt_0_1_modemux,
534 .nmodemuxs = ARRAY_SIZE(gpt_0_1_modemux),
535};
536
537static const char *const gpt_0_1_grps[] = { "gpt_0_1_grp" };
538static struct spear_function gpt_0_1_function = {
539 .name = "gpt_0_1",
540 .groups = gpt_0_1_grps,
541 .ngroups = ARRAY_SIZE(gpt_0_1_grps),
542};
543
544/* pad multiplexing for pwm0 device */
545static const unsigned pwm0_pins[] = { 24 };
546static struct spear_muxreg pwm0_muxreg[] = {
547 {
548 .reg = PAD_SHARED_IP_EN_1,
549 .mask = SSP0_CS1_MASK,
550 .val = 0,
551 }, {
552 .reg = PAD_FUNCTION_EN_1,
553 .mask = PWM0_AND_SSP0_CS1_REG0_MASK,
554 .val = PWM0_AND_SSP0_CS1_REG0_MASK,
555 },
556};
557
558static struct spear_modemux pwm0_modemux[] = {
559 {
560 .muxregs = pwm0_muxreg,
561 .nmuxregs = ARRAY_SIZE(pwm0_muxreg),
562 },
563};
564
565static struct spear_pingroup pwm0_pingroup = {
566 .name = "pwm0_grp",
567 .pins = pwm0_pins,
568 .npins = ARRAY_SIZE(pwm0_pins),
569 .modemuxs = pwm0_modemux,
570 .nmodemuxs = ARRAY_SIZE(pwm0_modemux),
571};
572
573/* pad multiplexing for pwm1 device */
574static const unsigned pwm1_pins[] = { 17 };
575static struct spear_muxreg pwm1_muxreg[] = {
576 {
577 .reg = PAD_SHARED_IP_EN_1,
578 .mask = KBD_COL5_MASK,
579 .val = 0,
580 }, {
581 .reg = PAD_FUNCTION_EN_1,
582 .mask = PWM1_AND_KBD_COL5_REG0_MASK,
583 .val = PWM1_AND_KBD_COL5_REG0_MASK,
584 },
585};
586
587static struct spear_modemux pwm1_modemux[] = {
588 {
589 .muxregs = pwm1_muxreg,
590 .nmuxregs = ARRAY_SIZE(pwm1_muxreg),
591 },
592};
593
594static struct spear_pingroup pwm1_pingroup = {
595 .name = "pwm1_grp",
596 .pins = pwm1_pins,
597 .npins = ARRAY_SIZE(pwm1_pins),
598 .modemuxs = pwm1_modemux,
599 .nmodemuxs = ARRAY_SIZE(pwm1_modemux),
600};
601
602/* pad multiplexing for pwm2 device */
603static const unsigned pwm2_pins[] = { 21 };
604static struct spear_muxreg pwm2_muxreg[] = {
605 {
606 .reg = PAD_SHARED_IP_EN_1,
607 .mask = GPT0_TMR0_CPT_MASK,
608 .val = 0,
609 }, {
610 .reg = PAD_FUNCTION_EN_1,
611 .mask = PWM2_AND_GPT0_TMR0_CPT_REG0_MASK,
612 .val = PWM2_AND_GPT0_TMR0_CPT_REG0_MASK,
613 },
614};
615
616static struct spear_modemux pwm2_modemux[] = {
617 {
618 .muxregs = pwm2_muxreg,
619 .nmuxregs = ARRAY_SIZE(pwm2_muxreg),
620 },
621};
622
623static struct spear_pingroup pwm2_pingroup = {
624 .name = "pwm2_grp",
625 .pins = pwm2_pins,
626 .npins = ARRAY_SIZE(pwm2_pins),
627 .modemuxs = pwm2_modemux,
628 .nmodemuxs = ARRAY_SIZE(pwm2_modemux),
629};
630
631/* pad multiplexing for pwm3 device */
632static const unsigned pwm3_pins[] = { 22 };
633static struct spear_muxreg pwm3_muxreg[] = {
634 {
635 .reg = PAD_SHARED_IP_EN_1,
636 .mask = GPT0_TMR1_CLK_MASK,
637 .val = 0,
638 }, {
639 .reg = PAD_FUNCTION_EN_1,
640 .mask = PWM3_AND_GPT0_TMR1_CLK_REG0_MASK,
641 .val = PWM3_AND_GPT0_TMR1_CLK_REG0_MASK,
642 },
643};
644
645static struct spear_modemux pwm3_modemux[] = {
646 {
647 .muxregs = pwm3_muxreg,
648 .nmuxregs = ARRAY_SIZE(pwm3_muxreg),
649 },
650};
651
652static struct spear_pingroup pwm3_pingroup = {
653 .name = "pwm3_grp",
654 .pins = pwm3_pins,
655 .npins = ARRAY_SIZE(pwm3_pins),
656 .modemuxs = pwm3_modemux,
657 .nmodemuxs = ARRAY_SIZE(pwm3_modemux),
658};
659
660static const char *const pwm_grps[] = { "pwm0_grp", "pwm1_grp", "pwm2_grp",
661 "pwm3_grp" };
662static struct spear_function pwm_function = {
663 .name = "pwm",
664 .groups = pwm_grps,
665 .ngroups = ARRAY_SIZE(pwm_grps),
666};
667
668/* pad multiplexing for vip_mux device */
669static const unsigned vip_mux_pins[] = { 35, 36, 37, 38, 40, 41, 42, 43 };
670static struct spear_muxreg vip_mux_muxreg[] = {
671 {
672 .reg = PAD_FUNCTION_EN_2,
673 .mask = VIP_REG1_MASK,
674 .val = VIP_REG1_MASK,
675 },
676};
677
678static struct spear_modemux vip_mux_modemux[] = {
679 {
680 .muxregs = vip_mux_muxreg,
681 .nmuxregs = ARRAY_SIZE(vip_mux_muxreg),
682 },
683};
684
685static struct spear_pingroup vip_mux_pingroup = {
686 .name = "vip_mux_grp",
687 .pins = vip_mux_pins,
688 .npins = ARRAY_SIZE(vip_mux_pins),
689 .modemuxs = vip_mux_modemux,
690 .nmodemuxs = ARRAY_SIZE(vip_mux_modemux),
691};
692
693/* pad multiplexing for vip_mux_cam0 (disables cam0) device */
694static const unsigned vip_mux_cam0_pins[] = { 65, 66, 67, 68, 69, 70, 71, 72,
695 73, 74, 75 };
696static struct spear_muxreg vip_mux_cam0_muxreg[] = {
697 {
698 .reg = PAD_SHARED_IP_EN_1,
699 .mask = CAM0_MASK,
700 .val = 0,
701 }, {
702 .reg = PAD_FUNCTION_EN_3,
703 .mask = VIP_AND_CAM0_REG2_MASK,
704 .val = VIP_AND_CAM0_REG2_MASK,
705 },
706};
707
708static struct spear_modemux vip_mux_cam0_modemux[] = {
709 {
710 .muxregs = vip_mux_cam0_muxreg,
711 .nmuxregs = ARRAY_SIZE(vip_mux_cam0_muxreg),
712 },
713};
714
715static struct spear_pingroup vip_mux_cam0_pingroup = {
716 .name = "vip_mux_cam0_grp",
717 .pins = vip_mux_cam0_pins,
718 .npins = ARRAY_SIZE(vip_mux_cam0_pins),
719 .modemuxs = vip_mux_cam0_modemux,
720 .nmodemuxs = ARRAY_SIZE(vip_mux_cam0_modemux),
721};
722
723/* pad multiplexing for vip_mux_cam1 (disables cam1) device */
724static const unsigned vip_mux_cam1_pins[] = { 54, 55, 56, 57, 58, 59, 60, 61,
725 62, 63, 64 };
726static struct spear_muxreg vip_mux_cam1_muxreg[] = {
727 {
728 .reg = PAD_SHARED_IP_EN_1,
729 .mask = CAM1_MASK,
730 .val = 0,
731 }, {
732 .reg = PAD_FUNCTION_EN_2,
733 .mask = VIP_AND_CAM1_REG1_MASK,
734 .val = VIP_AND_CAM1_REG1_MASK,
735 }, {
736 .reg = PAD_FUNCTION_EN_3,
737 .mask = VIP_AND_CAM1_REG2_MASK,
738 .val = VIP_AND_CAM1_REG2_MASK,
739 },
740};
741
742static struct spear_modemux vip_mux_cam1_modemux[] = {
743 {
744 .muxregs = vip_mux_cam1_muxreg,
745 .nmuxregs = ARRAY_SIZE(vip_mux_cam1_muxreg),
746 },
747};
748
749static struct spear_pingroup vip_mux_cam1_pingroup = {
750 .name = "vip_mux_cam1_grp",
751 .pins = vip_mux_cam1_pins,
752 .npins = ARRAY_SIZE(vip_mux_cam1_pins),
753 .modemuxs = vip_mux_cam1_modemux,
754 .nmodemuxs = ARRAY_SIZE(vip_mux_cam1_modemux),
755};
756
757/* pad multiplexing for vip_mux_cam2 (disables cam2) device */
758static const unsigned vip_mux_cam2_pins[] = { 39, 44, 45, 46, 47, 48, 49, 50,
759 51, 52, 53 };
760static struct spear_muxreg vip_mux_cam2_muxreg[] = {
761 {
762 .reg = PAD_SHARED_IP_EN_1,
763 .mask = CAM2_MASK,
764 .val = 0,
765 }, {
766 .reg = PAD_FUNCTION_EN_2,
767 .mask = VIP_AND_CAM2_REG1_MASK,
768 .val = VIP_AND_CAM2_REG1_MASK,
769 },
770};
771
772static struct spear_modemux vip_mux_cam2_modemux[] = {
773 {
774 .muxregs = vip_mux_cam2_muxreg,
775 .nmuxregs = ARRAY_SIZE(vip_mux_cam2_muxreg),
776 },
777};
778
779static struct spear_pingroup vip_mux_cam2_pingroup = {
780 .name = "vip_mux_cam2_grp",
781 .pins = vip_mux_cam2_pins,
782 .npins = ARRAY_SIZE(vip_mux_cam2_pins),
783 .modemuxs = vip_mux_cam2_modemux,
784 .nmodemuxs = ARRAY_SIZE(vip_mux_cam2_modemux),
785};
786
787/* pad multiplexing for vip_mux_cam3 (disables cam3) device */
788static const unsigned vip_mux_cam3_pins[] = { 20, 25, 26, 27, 28, 29, 30, 31,
789 32, 33, 34 };
790static struct spear_muxreg vip_mux_cam3_muxreg[] = {
791 {
792 .reg = PAD_SHARED_IP_EN_1,
793 .mask = CAM3_MASK,
794 .val = 0,
795 }, {
796 .reg = PAD_FUNCTION_EN_1,
797 .mask = VIP_AND_CAM3_REG0_MASK,
798 .val = VIP_AND_CAM3_REG0_MASK,
799 }, {
800 .reg = PAD_FUNCTION_EN_2,
801 .mask = VIP_AND_CAM3_REG1_MASK,
802 .val = VIP_AND_CAM3_REG1_MASK,
803 },
804};
805
806static struct spear_modemux vip_mux_cam3_modemux[] = {
807 {
808 .muxregs = vip_mux_cam3_muxreg,
809 .nmuxregs = ARRAY_SIZE(vip_mux_cam3_muxreg),
810 },
811};
812
813static struct spear_pingroup vip_mux_cam3_pingroup = {
814 .name = "vip_mux_cam3_grp",
815 .pins = vip_mux_cam3_pins,
816 .npins = ARRAY_SIZE(vip_mux_cam3_pins),
817 .modemuxs = vip_mux_cam3_modemux,
818 .nmodemuxs = ARRAY_SIZE(vip_mux_cam3_modemux),
819};
820
821static const char *const vip_grps[] = { "vip_mux_grp", "vip_mux_cam0_grp" ,
822 "vip_mux_cam1_grp" , "vip_mux_cam2_grp", "vip_mux_cam3_grp" };
823static struct spear_function vip_function = {
824 .name = "vip",
825 .groups = vip_grps,
826 .ngroups = ARRAY_SIZE(vip_grps),
827};
828
829/* pad multiplexing for cam0 device */
830static const unsigned cam0_pins[] = { 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75
831};
832static struct spear_muxreg cam0_muxreg[] = {
833 {
834 .reg = PAD_SHARED_IP_EN_1,
835 .mask = CAM0_MASK,
836 .val = CAM0_MASK,
837 }, {
838 .reg = PAD_FUNCTION_EN_3,
839 .mask = VIP_AND_CAM0_REG2_MASK,
840 .val = VIP_AND_CAM0_REG2_MASK,
841 },
842};
843
844static struct spear_modemux cam0_modemux[] = {
845 {
846 .muxregs = cam0_muxreg,
847 .nmuxregs = ARRAY_SIZE(cam0_muxreg),
848 },
849};
850
851static struct spear_pingroup cam0_pingroup = {
852 .name = "cam0_grp",
853 .pins = cam0_pins,
854 .npins = ARRAY_SIZE(cam0_pins),
855 .modemuxs = cam0_modemux,
856 .nmodemuxs = ARRAY_SIZE(cam0_modemux),
857};
858
859static const char *const cam0_grps[] = { "cam0_grp" };
860static struct spear_function cam0_function = {
861 .name = "cam0",
862 .groups = cam0_grps,
863 .ngroups = ARRAY_SIZE(cam0_grps),
864};
865
866/* pad multiplexing for cam1 device */
867static const unsigned cam1_pins[] = { 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64
868};
869static struct spear_muxreg cam1_muxreg[] = {
870 {
871 .reg = PAD_SHARED_IP_EN_1,
872 .mask = CAM1_MASK,
873 .val = CAM1_MASK,
874 }, {
875 .reg = PAD_FUNCTION_EN_2,
876 .mask = VIP_AND_CAM1_REG1_MASK,
877 .val = VIP_AND_CAM1_REG1_MASK,
878 }, {
879 .reg = PAD_FUNCTION_EN_3,
880 .mask = VIP_AND_CAM1_REG2_MASK,
881 .val = VIP_AND_CAM1_REG2_MASK,
882 },
883};
884
885static struct spear_modemux cam1_modemux[] = {
886 {
887 .muxregs = cam1_muxreg,
888 .nmuxregs = ARRAY_SIZE(cam1_muxreg),
889 },
890};
891
892static struct spear_pingroup cam1_pingroup = {
893 .name = "cam1_grp",
894 .pins = cam1_pins,
895 .npins = ARRAY_SIZE(cam1_pins),
896 .modemuxs = cam1_modemux,
897 .nmodemuxs = ARRAY_SIZE(cam1_modemux),
898};
899
900static const char *const cam1_grps[] = { "cam1_grp" };
901static struct spear_function cam1_function = {
902 .name = "cam1",
903 .groups = cam1_grps,
904 .ngroups = ARRAY_SIZE(cam1_grps),
905};
906
907/* pad multiplexing for cam2 device */
908static const unsigned cam2_pins[] = { 39, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53
909};
910static struct spear_muxreg cam2_muxreg[] = {
911 {
912 .reg = PAD_SHARED_IP_EN_1,
913 .mask = CAM2_MASK,
914 .val = CAM2_MASK,
915 }, {
916 .reg = PAD_FUNCTION_EN_2,
917 .mask = VIP_AND_CAM2_REG1_MASK,
918 .val = VIP_AND_CAM2_REG1_MASK,
919 },
920};
921
922static struct spear_modemux cam2_modemux[] = {
923 {
924 .muxregs = cam2_muxreg,
925 .nmuxregs = ARRAY_SIZE(cam2_muxreg),
926 },
927};
928
929static struct spear_pingroup cam2_pingroup = {
930 .name = "cam2_grp",
931 .pins = cam2_pins,
932 .npins = ARRAY_SIZE(cam2_pins),
933 .modemuxs = cam2_modemux,
934 .nmodemuxs = ARRAY_SIZE(cam2_modemux),
935};
936
937static const char *const cam2_grps[] = { "cam2_grp" };
938static struct spear_function cam2_function = {
939 .name = "cam2",
940 .groups = cam2_grps,
941 .ngroups = ARRAY_SIZE(cam2_grps),
942};
943
944/* pad multiplexing for cam3 device */
945static const unsigned cam3_pins[] = { 20, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
946};
947static struct spear_muxreg cam3_muxreg[] = {
948 {
949 .reg = PAD_SHARED_IP_EN_1,
950 .mask = CAM3_MASK,
951 .val = CAM3_MASK,
952 }, {
953 .reg = PAD_FUNCTION_EN_1,
954 .mask = VIP_AND_CAM3_REG0_MASK,
955 .val = VIP_AND_CAM3_REG0_MASK,
956 }, {
957 .reg = PAD_FUNCTION_EN_2,
958 .mask = VIP_AND_CAM3_REG1_MASK,
959 .val = VIP_AND_CAM3_REG1_MASK,
960 },
961};
962
963static struct spear_modemux cam3_modemux[] = {
964 {
965 .muxregs = cam3_muxreg,
966 .nmuxregs = ARRAY_SIZE(cam3_muxreg),
967 },
968};
969
970static struct spear_pingroup cam3_pingroup = {
971 .name = "cam3_grp",
972 .pins = cam3_pins,
973 .npins = ARRAY_SIZE(cam3_pins),
974 .modemuxs = cam3_modemux,
975 .nmodemuxs = ARRAY_SIZE(cam3_modemux),
976};
977
978static const char *const cam3_grps[] = { "cam3_grp" };
979static struct spear_function cam3_function = {
980 .name = "cam3",
981 .groups = cam3_grps,
982 .ngroups = ARRAY_SIZE(cam3_grps),
983};
984
985/* pad multiplexing for smi device */
986static const unsigned smi_pins[] = { 76, 77, 78, 79, 84 };
987static struct spear_muxreg smi_muxreg[] = {
988 {
989 .reg = PAD_FUNCTION_EN_3,
990 .mask = SMI_REG2_MASK,
991 .val = SMI_REG2_MASK,
992 },
993};
994
995static struct spear_modemux smi_modemux[] = {
996 {
997 .muxregs = smi_muxreg,
998 .nmuxregs = ARRAY_SIZE(smi_muxreg),
999 },
1000};
1001
1002static struct spear_pingroup smi_pingroup = {
1003 .name = "smi_grp",
1004 .pins = smi_pins,
1005 .npins = ARRAY_SIZE(smi_pins),
1006 .modemuxs = smi_modemux,
1007 .nmodemuxs = ARRAY_SIZE(smi_modemux),
1008};
1009
1010static const char *const smi_grps[] = { "smi_grp" };
1011static struct spear_function smi_function = {
1012 .name = "smi",
1013 .groups = smi_grps,
1014 .ngroups = ARRAY_SIZE(smi_grps),
1015};
1016
1017/* pad multiplexing for ssp0 device */
1018static const unsigned ssp0_pins[] = { 80, 81, 82, 83 };
1019static struct spear_muxreg ssp0_muxreg[] = {
1020 {
1021 .reg = PAD_FUNCTION_EN_3,
1022 .mask = SSP0_REG2_MASK,
1023 .val = SSP0_REG2_MASK,
1024 },
1025};
1026
1027static struct spear_modemux ssp0_modemux[] = {
1028 {
1029 .muxregs = ssp0_muxreg,
1030 .nmuxregs = ARRAY_SIZE(ssp0_muxreg),
1031 },
1032};
1033
1034static struct spear_pingroup ssp0_pingroup = {
1035 .name = "ssp0_grp",
1036 .pins = ssp0_pins,
1037 .npins = ARRAY_SIZE(ssp0_pins),
1038 .modemuxs = ssp0_modemux,
1039 .nmodemuxs = ARRAY_SIZE(ssp0_modemux),
1040};
1041
1042/* pad multiplexing for ssp0_cs1 device */
1043static const unsigned ssp0_cs1_pins[] = { 24 };
1044static struct spear_muxreg ssp0_cs1_muxreg[] = {
1045 {
1046 .reg = PAD_SHARED_IP_EN_1,
1047 .mask = SSP0_CS1_MASK,
1048 .val = SSP0_CS1_MASK,
1049 }, {
1050 .reg = PAD_FUNCTION_EN_1,
1051 .mask = PWM0_AND_SSP0_CS1_REG0_MASK,
1052 .val = PWM0_AND_SSP0_CS1_REG0_MASK,
1053 },
1054};
1055
1056static struct spear_modemux ssp0_cs1_modemux[] = {
1057 {
1058 .muxregs = ssp0_cs1_muxreg,
1059 .nmuxregs = ARRAY_SIZE(ssp0_cs1_muxreg),
1060 },
1061};
1062
1063static struct spear_pingroup ssp0_cs1_pingroup = {
1064 .name = "ssp0_cs1_grp",
1065 .pins = ssp0_cs1_pins,
1066 .npins = ARRAY_SIZE(ssp0_cs1_pins),
1067 .modemuxs = ssp0_cs1_modemux,
1068 .nmodemuxs = ARRAY_SIZE(ssp0_cs1_modemux),
1069};
1070
1071/* pad multiplexing for ssp0_cs2 device */
1072static const unsigned ssp0_cs2_pins[] = { 85 };
1073static struct spear_muxreg ssp0_cs2_muxreg[] = {
1074 {
1075 .reg = PAD_SHARED_IP_EN_1,
1076 .mask = SSP0_CS2_MASK,
1077 .val = SSP0_CS2_MASK,
1078 }, {
1079 .reg = PAD_FUNCTION_EN_3,
1080 .mask = TS_AND_SSP0_CS2_REG2_MASK,
1081 .val = TS_AND_SSP0_CS2_REG2_MASK,
1082 },
1083};
1084
1085static struct spear_modemux ssp0_cs2_modemux[] = {
1086 {
1087 .muxregs = ssp0_cs2_muxreg,
1088 .nmuxregs = ARRAY_SIZE(ssp0_cs2_muxreg),
1089 },
1090};
1091
1092static struct spear_pingroup ssp0_cs2_pingroup = {
1093 .name = "ssp0_cs2_grp",
1094 .pins = ssp0_cs2_pins,
1095 .npins = ARRAY_SIZE(ssp0_cs2_pins),
1096 .modemuxs = ssp0_cs2_modemux,
1097 .nmodemuxs = ARRAY_SIZE(ssp0_cs2_modemux),
1098};
1099
1100/* pad multiplexing for ssp0_cs3 device */
1101static const unsigned ssp0_cs3_pins[] = { 132 };
1102static struct spear_muxreg ssp0_cs3_muxreg[] = {
1103 {
1104 .reg = PAD_FUNCTION_EN_5,
1105 .mask = SSP0_CS3_REG4_MASK,
1106 .val = SSP0_CS3_REG4_MASK,
1107 },
1108};
1109
1110static struct spear_modemux ssp0_cs3_modemux[] = {
1111 {
1112 .muxregs = ssp0_cs3_muxreg,
1113 .nmuxregs = ARRAY_SIZE(ssp0_cs3_muxreg),
1114 },
1115};
1116
1117static struct spear_pingroup ssp0_cs3_pingroup = {
1118 .name = "ssp0_cs3_grp",
1119 .pins = ssp0_cs3_pins,
1120 .npins = ARRAY_SIZE(ssp0_cs3_pins),
1121 .modemuxs = ssp0_cs3_modemux,
1122 .nmodemuxs = ARRAY_SIZE(ssp0_cs3_modemux),
1123};
1124
1125static const char *const ssp0_grps[] = { "ssp0_grp", "ssp0_cs1_grp",
1126 "ssp0_cs2_grp", "ssp0_cs3_grp" };
1127static struct spear_function ssp0_function = {
1128 .name = "ssp0",
1129 .groups = ssp0_grps,
1130 .ngroups = ARRAY_SIZE(ssp0_grps),
1131};
1132
1133/* pad multiplexing for uart0 device */
1134static const unsigned uart0_pins[] = { 86, 87 };
1135static struct spear_muxreg uart0_muxreg[] = {
1136 {
1137 .reg = PAD_FUNCTION_EN_3,
1138 .mask = UART0_REG2_MASK,
1139 .val = UART0_REG2_MASK,
1140 },
1141};
1142
1143static struct spear_modemux uart0_modemux[] = {
1144 {
1145 .muxregs = uart0_muxreg,
1146 .nmuxregs = ARRAY_SIZE(uart0_muxreg),
1147 },
1148};
1149
1150static struct spear_pingroup uart0_pingroup = {
1151 .name = "uart0_grp",
1152 .pins = uart0_pins,
1153 .npins = ARRAY_SIZE(uart0_pins),
1154 .modemuxs = uart0_modemux,
1155 .nmodemuxs = ARRAY_SIZE(uart0_modemux),
1156};
1157
1158/* pad multiplexing for uart0_enh device */
1159static const unsigned uart0_enh_pins[] = { 11, 12, 13, 14, 15, 16 };
1160static struct spear_muxreg uart0_enh_muxreg[] = {
1161 {
1162 .reg = PAD_SHARED_IP_EN_1,
1163 .mask = GPT_MASK,
1164 .val = 0,
1165 }, {
1166 .reg = PAD_FUNCTION_EN_1,
1167 .mask = UART0_ENH_AND_GPT_REG0_MASK,
1168 .val = UART0_ENH_AND_GPT_REG0_MASK,
1169 },
1170};
1171
1172static struct spear_modemux uart0_enh_modemux[] = {
1173 {
1174 .muxregs = uart0_enh_muxreg,
1175 .nmuxregs = ARRAY_SIZE(uart0_enh_muxreg),
1176 },
1177};
1178
1179static struct spear_pingroup uart0_enh_pingroup = {
1180 .name = "uart0_enh_grp",
1181 .pins = uart0_enh_pins,
1182 .npins = ARRAY_SIZE(uart0_enh_pins),
1183 .modemuxs = uart0_enh_modemux,
1184 .nmodemuxs = ARRAY_SIZE(uart0_enh_modemux),
1185};
1186
1187static const char *const uart0_grps[] = { "uart0_grp", "uart0_enh_grp" };
1188static struct spear_function uart0_function = {
1189 .name = "uart0",
1190 .groups = uart0_grps,
1191 .ngroups = ARRAY_SIZE(uart0_grps),
1192};
1193
1194/* pad multiplexing for uart1 device */
1195static const unsigned uart1_pins[] = { 88, 89 };
1196static struct spear_muxreg uart1_muxreg[] = {
1197 {
1198 .reg = PAD_FUNCTION_EN_3,
1199 .mask = UART1_REG2_MASK,
1200 .val = UART1_REG2_MASK,
1201 },
1202};
1203
1204static struct spear_modemux uart1_modemux[] = {
1205 {
1206 .muxregs = uart1_muxreg,
1207 .nmuxregs = ARRAY_SIZE(uart1_muxreg),
1208 },
1209};
1210
1211static struct spear_pingroup uart1_pingroup = {
1212 .name = "uart1_grp",
1213 .pins = uart1_pins,
1214 .npins = ARRAY_SIZE(uart1_pins),
1215 .modemuxs = uart1_modemux,
1216 .nmodemuxs = ARRAY_SIZE(uart1_modemux),
1217};
1218
1219static const char *const uart1_grps[] = { "uart1_grp" };
1220static struct spear_function uart1_function = {
1221 .name = "uart1",
1222 .groups = uart1_grps,
1223 .ngroups = ARRAY_SIZE(uart1_grps),
1224};
1225
1226/* pad multiplexing for i2s_in device */
1227static const unsigned i2s_in_pins[] = { 90, 91, 92, 93, 94, 99 };
1228static struct spear_muxreg i2s_in_muxreg[] = {
1229 {
1230 .reg = PAD_FUNCTION_EN_3,
1231 .mask = I2S_IN_REG2_MASK,
1232 .val = I2S_IN_REG2_MASK,
1233 }, {
1234 .reg = PAD_FUNCTION_EN_4,
1235 .mask = I2S_IN_REG3_MASK,
1236 .val = I2S_IN_REG3_MASK,
1237 },
1238};
1239
1240static struct spear_modemux i2s_in_modemux[] = {
1241 {
1242 .muxregs = i2s_in_muxreg,
1243 .nmuxregs = ARRAY_SIZE(i2s_in_muxreg),
1244 },
1245};
1246
1247static struct spear_pingroup i2s_in_pingroup = {
1248 .name = "i2s_in_grp",
1249 .pins = i2s_in_pins,
1250 .npins = ARRAY_SIZE(i2s_in_pins),
1251 .modemuxs = i2s_in_modemux,
1252 .nmodemuxs = ARRAY_SIZE(i2s_in_modemux),
1253};
1254
1255/* pad multiplexing for i2s_out device */
1256static const unsigned i2s_out_pins[] = { 95, 96, 97, 98, 100, 101, 102, 103 };
1257static struct spear_muxreg i2s_out_muxreg[] = {
1258 {
1259 .reg = PAD_FUNCTION_EN_4,
1260 .mask = I2S_OUT_REG3_MASK,
1261 .val = I2S_OUT_REG3_MASK,
1262 },
1263};
1264
1265static struct spear_modemux i2s_out_modemux[] = {
1266 {
1267 .muxregs = i2s_out_muxreg,
1268 .nmuxregs = ARRAY_SIZE(i2s_out_muxreg),
1269 },
1270};
1271
1272static struct spear_pingroup i2s_out_pingroup = {
1273 .name = "i2s_out_grp",
1274 .pins = i2s_out_pins,
1275 .npins = ARRAY_SIZE(i2s_out_pins),
1276 .modemuxs = i2s_out_modemux,
1277 .nmodemuxs = ARRAY_SIZE(i2s_out_modemux),
1278};
1279
1280static const char *const i2s_grps[] = { "i2s_in_grp", "i2s_out_grp" };
1281static struct spear_function i2s_function = {
1282 .name = "i2s",
1283 .groups = i2s_grps,
1284 .ngroups = ARRAY_SIZE(i2s_grps),
1285};
1286
1287/* pad multiplexing for gmac device */
1288static const unsigned gmac_pins[] = { 104, 105, 106, 107, 108, 109, 110, 111,
1289 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,
1290 126, 127, 128, 129, 130, 131 };
1291#define GMAC_MUXREG \
1292 { \
1293 .reg = PAD_FUNCTION_EN_4, \
1294 .mask = GMAC_REG3_MASK, \
1295 .val = GMAC_REG3_MASK, \
1296 }, { \
1297 .reg = PAD_FUNCTION_EN_5, \
1298 .mask = GMAC_REG4_MASK, \
1299 .val = GMAC_REG4_MASK, \
1300 }
1301
1302/* pad multiplexing for gmii device */
1303static struct spear_muxreg gmii_muxreg[] = {
1304 GMAC_MUXREG,
1305 {
1306 .reg = GMAC_CLK_CFG,
1307 .mask = GMAC_PHY_IF_SEL_MASK,
1308 .val = GMAC_PHY_IF_GMII_VAL,
1309 },
1310};
1311
1312static struct spear_modemux gmii_modemux[] = {
1313 {
1314 .muxregs = gmii_muxreg,
1315 .nmuxregs = ARRAY_SIZE(gmii_muxreg),
1316 },
1317};
1318
1319static struct spear_pingroup gmii_pingroup = {
1320 .name = "gmii_grp",
1321 .pins = gmac_pins,
1322 .npins = ARRAY_SIZE(gmac_pins),
1323 .modemuxs = gmii_modemux,
1324 .nmodemuxs = ARRAY_SIZE(gmii_modemux),
1325};
1326
1327/* pad multiplexing for rgmii device */
1328static struct spear_muxreg rgmii_muxreg[] = {
1329 GMAC_MUXREG,
1330 {
1331 .reg = GMAC_CLK_CFG,
1332 .mask = GMAC_PHY_IF_SEL_MASK,
1333 .val = GMAC_PHY_IF_RGMII_VAL,
1334 },
1335};
1336
1337static struct spear_modemux rgmii_modemux[] = {
1338 {
1339 .muxregs = rgmii_muxreg,
1340 .nmuxregs = ARRAY_SIZE(rgmii_muxreg),
1341 },
1342};
1343
1344static struct spear_pingroup rgmii_pingroup = {
1345 .name = "rgmii_grp",
1346 .pins = gmac_pins,
1347 .npins = ARRAY_SIZE(gmac_pins),
1348 .modemuxs = rgmii_modemux,
1349 .nmodemuxs = ARRAY_SIZE(rgmii_modemux),
1350};
1351
1352/* pad multiplexing for rmii device */
1353static struct spear_muxreg rmii_muxreg[] = {
1354 GMAC_MUXREG,
1355 {
1356 .reg = GMAC_CLK_CFG,
1357 .mask = GMAC_PHY_IF_SEL_MASK,
1358 .val = GMAC_PHY_IF_RMII_VAL,
1359 },
1360};
1361
1362static struct spear_modemux rmii_modemux[] = {
1363 {
1364 .muxregs = rmii_muxreg,
1365 .nmuxregs = ARRAY_SIZE(rmii_muxreg),
1366 },
1367};
1368
1369static struct spear_pingroup rmii_pingroup = {
1370 .name = "rmii_grp",
1371 .pins = gmac_pins,
1372 .npins = ARRAY_SIZE(gmac_pins),
1373 .modemuxs = rmii_modemux,
1374 .nmodemuxs = ARRAY_SIZE(rmii_modemux),
1375};
1376
1377/* pad multiplexing for sgmii device */
1378static struct spear_muxreg sgmii_muxreg[] = {
1379 GMAC_MUXREG,
1380 {
1381 .reg = GMAC_CLK_CFG,
1382 .mask = GMAC_PHY_IF_SEL_MASK,
1383 .val = GMAC_PHY_IF_SGMII_VAL,
1384 },
1385};
1386
1387static struct spear_modemux sgmii_modemux[] = {
1388 {
1389 .muxregs = sgmii_muxreg,
1390 .nmuxregs = ARRAY_SIZE(sgmii_muxreg),
1391 },
1392};
1393
1394static struct spear_pingroup sgmii_pingroup = {
1395 .name = "sgmii_grp",
1396 .pins = gmac_pins,
1397 .npins = ARRAY_SIZE(gmac_pins),
1398 .modemuxs = sgmii_modemux,
1399 .nmodemuxs = ARRAY_SIZE(sgmii_modemux),
1400};
1401
1402static const char *const gmac_grps[] = { "gmii_grp", "rgmii_grp", "rmii_grp",
1403 "sgmii_grp" };
1404static struct spear_function gmac_function = {
1405 .name = "gmac",
1406 .groups = gmac_grps,
1407 .ngroups = ARRAY_SIZE(gmac_grps),
1408};
1409
1410/* pad multiplexing for i2c0 device */
1411static const unsigned i2c0_pins[] = { 133, 134 };
1412static struct spear_muxreg i2c0_muxreg[] = {
1413 {
1414 .reg = PAD_FUNCTION_EN_5,
1415 .mask = I2C0_REG4_MASK,
1416 .val = I2C0_REG4_MASK,
1417 },
1418};
1419
1420static struct spear_modemux i2c0_modemux[] = {
1421 {
1422 .muxregs = i2c0_muxreg,
1423 .nmuxregs = ARRAY_SIZE(i2c0_muxreg),
1424 },
1425};
1426
1427static struct spear_pingroup i2c0_pingroup = {
1428 .name = "i2c0_grp",
1429 .pins = i2c0_pins,
1430 .npins = ARRAY_SIZE(i2c0_pins),
1431 .modemuxs = i2c0_modemux,
1432 .nmodemuxs = ARRAY_SIZE(i2c0_modemux),
1433};
1434
1435static const char *const i2c0_grps[] = { "i2c0_grp" };
1436static struct spear_function i2c0_function = {
1437 .name = "i2c0",
1438 .groups = i2c0_grps,
1439 .ngroups = ARRAY_SIZE(i2c0_grps),
1440};
1441
1442/* pad multiplexing for i2c1 device */
1443static const unsigned i2c1_pins[] = { 18, 23 };
1444static struct spear_muxreg i2c1_muxreg[] = {
1445 {
1446 .reg = PAD_FUNCTION_EN_1,
1447 .mask = I2C1_REG0_MASK,
1448 .val = I2C1_REG0_MASK,
1449 },
1450};
1451
1452static struct spear_modemux i2c1_modemux[] = {
1453 {
1454 .muxregs = i2c1_muxreg,
1455 .nmuxregs = ARRAY_SIZE(i2c1_muxreg),
1456 },
1457};
1458
1459static struct spear_pingroup i2c1_pingroup = {
1460 .name = "i2c1_grp",
1461 .pins = i2c1_pins,
1462 .npins = ARRAY_SIZE(i2c1_pins),
1463 .modemuxs = i2c1_modemux,
1464 .nmodemuxs = ARRAY_SIZE(i2c1_modemux),
1465};
1466
1467static const char *const i2c1_grps[] = { "i2c1_grp" };
1468static struct spear_function i2c1_function = {
1469 .name = "i2c1",
1470 .groups = i2c1_grps,
1471 .ngroups = ARRAY_SIZE(i2c1_grps),
1472};
1473
1474/* pad multiplexing for cec0 device */
1475static const unsigned cec0_pins[] = { 135 };
1476static struct spear_muxreg cec0_muxreg[] = {
1477 {
1478 .reg = PAD_FUNCTION_EN_5,
1479 .mask = CEC0_REG4_MASK,
1480 .val = CEC0_REG4_MASK,
1481 },
1482};
1483
1484static struct spear_modemux cec0_modemux[] = {
1485 {
1486 .muxregs = cec0_muxreg,
1487 .nmuxregs = ARRAY_SIZE(cec0_muxreg),
1488 },
1489};
1490
1491static struct spear_pingroup cec0_pingroup = {
1492 .name = "cec0_grp",
1493 .pins = cec0_pins,
1494 .npins = ARRAY_SIZE(cec0_pins),
1495 .modemuxs = cec0_modemux,
1496 .nmodemuxs = ARRAY_SIZE(cec0_modemux),
1497};
1498
1499static const char *const cec0_grps[] = { "cec0_grp" };
1500static struct spear_function cec0_function = {
1501 .name = "cec0",
1502 .groups = cec0_grps,
1503 .ngroups = ARRAY_SIZE(cec0_grps),
1504};
1505
1506/* pad multiplexing for cec1 device */
1507static const unsigned cec1_pins[] = { 136 };
1508static struct spear_muxreg cec1_muxreg[] = {
1509 {
1510 .reg = PAD_FUNCTION_EN_5,
1511 .mask = CEC1_REG4_MASK,
1512 .val = CEC1_REG4_MASK,
1513 },
1514};
1515
1516static struct spear_modemux cec1_modemux[] = {
1517 {
1518 .muxregs = cec1_muxreg,
1519 .nmuxregs = ARRAY_SIZE(cec1_muxreg),
1520 },
1521};
1522
1523static struct spear_pingroup cec1_pingroup = {
1524 .name = "cec1_grp",
1525 .pins = cec1_pins,
1526 .npins = ARRAY_SIZE(cec1_pins),
1527 .modemuxs = cec1_modemux,
1528 .nmodemuxs = ARRAY_SIZE(cec1_modemux),
1529};
1530
1531static const char *const cec1_grps[] = { "cec1_grp" };
1532static struct spear_function cec1_function = {
1533 .name = "cec1",
1534 .groups = cec1_grps,
1535 .ngroups = ARRAY_SIZE(cec1_grps),
1536};
1537
1538/* pad multiplexing for mcif devices */
1539static const unsigned mcif_pins[] = { 193, 194, 195, 196, 197, 198, 199, 200,
1540 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
1541 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
1542 229, 230, 231, 232, 237 };
1543#define MCIF_MUXREG \
1544 { \
1545 .reg = PAD_SHARED_IP_EN_1, \
1546 .mask = MCIF_MASK, \
1547 .val = MCIF_MASK, \
1548 }, { \
1549 .reg = PAD_FUNCTION_EN_7, \
1550 .mask = FSMC_PNOR_AND_MCIF_REG6_MASK | MCIF_REG6_MASK, \
1551 .val = FSMC_PNOR_AND_MCIF_REG6_MASK | MCIF_REG6_MASK, \
1552 }, { \
1553 .reg = PAD_FUNCTION_EN_8, \
1554 .mask = MCIF_REG7_MASK, \
1555 .val = MCIF_REG7_MASK, \
1556 }
1557
1558/* Pad multiplexing for sdhci device */
1559static struct spear_muxreg sdhci_muxreg[] = {
1560 MCIF_MUXREG,
1561 {
1562 .reg = PERIP_CFG,
1563 .mask = MCIF_SEL_MASK,
1564 .val = MCIF_SEL_SD,
1565 },
1566};
1567
1568static struct spear_modemux sdhci_modemux[] = {
1569 {
1570 .muxregs = sdhci_muxreg,
1571 .nmuxregs = ARRAY_SIZE(sdhci_muxreg),
1572 },
1573};
1574
1575static struct spear_pingroup sdhci_pingroup = {
1576 .name = "sdhci_grp",
1577 .pins = mcif_pins,
1578 .npins = ARRAY_SIZE(mcif_pins),
1579 .modemuxs = sdhci_modemux,
1580 .nmodemuxs = ARRAY_SIZE(sdhci_modemux),
1581};
1582
1583static const char *const sdhci_grps[] = { "sdhci_grp" };
1584static struct spear_function sdhci_function = {
1585 .name = "sdhci",
1586 .groups = sdhci_grps,
1587 .ngroups = ARRAY_SIZE(sdhci_grps),
1588};
1589
1590/* Pad multiplexing for cf device */
1591static struct spear_muxreg cf_muxreg[] = {
1592 MCIF_MUXREG,
1593 {
1594 .reg = PERIP_CFG,
1595 .mask = MCIF_SEL_MASK,
1596 .val = MCIF_SEL_CF,
1597 },
1598};
1599
1600static struct spear_modemux cf_modemux[] = {
1601 {
1602 .muxregs = cf_muxreg,
1603 .nmuxregs = ARRAY_SIZE(cf_muxreg),
1604 },
1605};
1606
1607static struct spear_pingroup cf_pingroup = {
1608 .name = "cf_grp",
1609 .pins = mcif_pins,
1610 .npins = ARRAY_SIZE(mcif_pins),
1611 .modemuxs = cf_modemux,
1612 .nmodemuxs = ARRAY_SIZE(cf_modemux),
1613};
1614
1615static const char *const cf_grps[] = { "cf_grp" };
1616static struct spear_function cf_function = {
1617 .name = "cf",
1618 .groups = cf_grps,
1619 .ngroups = ARRAY_SIZE(cf_grps),
1620};
1621
1622/* Pad multiplexing for xd device */
1623static struct spear_muxreg xd_muxreg[] = {
1624 MCIF_MUXREG,
1625 {
1626 .reg = PERIP_CFG,
1627 .mask = MCIF_SEL_MASK,
1628 .val = MCIF_SEL_XD,
1629 },
1630};
1631
1632static struct spear_modemux xd_modemux[] = {
1633 {
1634 .muxregs = xd_muxreg,
1635 .nmuxregs = ARRAY_SIZE(xd_muxreg),
1636 },
1637};
1638
1639static struct spear_pingroup xd_pingroup = {
1640 .name = "xd_grp",
1641 .pins = mcif_pins,
1642 .npins = ARRAY_SIZE(mcif_pins),
1643 .modemuxs = xd_modemux,
1644 .nmodemuxs = ARRAY_SIZE(xd_modemux),
1645};
1646
1647static const char *const xd_grps[] = { "xd_grp" };
1648static struct spear_function xd_function = {
1649 .name = "xd",
1650 .groups = xd_grps,
1651 .ngroups = ARRAY_SIZE(xd_grps),
1652};
1653
1654/* pad multiplexing for clcd device */
1655static const unsigned clcd_pins[] = { 138, 139, 140, 141, 142, 143, 144, 145,
1656 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
1657 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
1658 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187,
1659 188, 189, 190, 191 };
1660static struct spear_muxreg clcd_muxreg[] = {
1661 {
1662 .reg = PAD_SHARED_IP_EN_1,
1663 .mask = ARM_TRACE_MASK | MIPHY_DBG_MASK,
1664 .val = 0,
1665 }, {
1666 .reg = PAD_FUNCTION_EN_5,
1667 .mask = CLCD_REG4_MASK | CLCD_AND_ARM_TRACE_REG4_MASK,
1668 .val = CLCD_REG4_MASK | CLCD_AND_ARM_TRACE_REG4_MASK,
1669 }, {
1670 .reg = PAD_FUNCTION_EN_6,
1671 .mask = CLCD_AND_ARM_TRACE_REG5_MASK,
1672 .val = CLCD_AND_ARM_TRACE_REG5_MASK,
1673 }, {
1674 .reg = PAD_FUNCTION_EN_7,
1675 .mask = CLCD_AND_ARM_TRACE_REG6_MASK,
1676 .val = CLCD_AND_ARM_TRACE_REG6_MASK,
1677 },
1678};
1679
1680static struct spear_modemux clcd_modemux[] = {
1681 {
1682 .muxregs = clcd_muxreg,
1683 .nmuxregs = ARRAY_SIZE(clcd_muxreg),
1684 },
1685};
1686
1687static struct spear_pingroup clcd_pingroup = {
1688 .name = "clcd_grp",
1689 .pins = clcd_pins,
1690 .npins = ARRAY_SIZE(clcd_pins),
1691 .modemuxs = clcd_modemux,
1692 .nmodemuxs = ARRAY_SIZE(clcd_modemux),
1693};
1694
1695static const char *const clcd_grps[] = { "clcd_grp" };
1696static struct spear_function clcd_function = {
1697 .name = "clcd",
1698 .groups = clcd_grps,
1699 .ngroups = ARRAY_SIZE(clcd_grps),
1700};
1701
1702/* pad multiplexing for arm_trace device */
1703static const unsigned arm_trace_pins[] = { 158, 159, 160, 161, 162, 163, 164,
1704 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178,
1705 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
1706 193, 194, 195, 196, 197, 198, 199, 200 };
1707static struct spear_muxreg arm_trace_muxreg[] = {
1708 {
1709 .reg = PAD_SHARED_IP_EN_1,
1710 .mask = ARM_TRACE_MASK,
1711 .val = ARM_TRACE_MASK,
1712 }, {
1713 .reg = PAD_FUNCTION_EN_5,
1714 .mask = CLCD_AND_ARM_TRACE_REG4_MASK,
1715 .val = CLCD_AND_ARM_TRACE_REG4_MASK,
1716 }, {
1717 .reg = PAD_FUNCTION_EN_6,
1718 .mask = CLCD_AND_ARM_TRACE_REG5_MASK,
1719 .val = CLCD_AND_ARM_TRACE_REG5_MASK,
1720 }, {
1721 .reg = PAD_FUNCTION_EN_7,
1722 .mask = CLCD_AND_ARM_TRACE_REG6_MASK,
1723 .val = CLCD_AND_ARM_TRACE_REG6_MASK,
1724 },
1725};
1726
1727static struct spear_modemux arm_trace_modemux[] = {
1728 {
1729 .muxregs = arm_trace_muxreg,
1730 .nmuxregs = ARRAY_SIZE(arm_trace_muxreg),
1731 },
1732};
1733
1734static struct spear_pingroup arm_trace_pingroup = {
1735 .name = "arm_trace_grp",
1736 .pins = arm_trace_pins,
1737 .npins = ARRAY_SIZE(arm_trace_pins),
1738 .modemuxs = arm_trace_modemux,
1739 .nmodemuxs = ARRAY_SIZE(arm_trace_modemux),
1740};
1741
1742static const char *const arm_trace_grps[] = { "arm_trace_grp" };
1743static struct spear_function arm_trace_function = {
1744 .name = "arm_trace",
1745 .groups = arm_trace_grps,
1746 .ngroups = ARRAY_SIZE(arm_trace_grps),
1747};
1748
1749/* pad multiplexing for miphy_dbg device */
1750static const unsigned miphy_dbg_pins[] = { 96, 97, 98, 99, 100, 101, 102, 103,
1751 132, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
1752 148, 149, 150, 151, 152, 153, 154, 155, 156, 157 };
1753static struct spear_muxreg miphy_dbg_muxreg[] = {
1754 {
1755 .reg = PAD_SHARED_IP_EN_1,
1756 .mask = MIPHY_DBG_MASK,
1757 .val = MIPHY_DBG_MASK,
1758 }, {
1759 .reg = PAD_FUNCTION_EN_5,
1760 .mask = DEVS_GRP_AND_MIPHY_DBG_REG4_MASK,
1761 .val = DEVS_GRP_AND_MIPHY_DBG_REG4_MASK,
1762 },
1763};
1764
1765static struct spear_modemux miphy_dbg_modemux[] = {
1766 {
1767 .muxregs = miphy_dbg_muxreg,
1768 .nmuxregs = ARRAY_SIZE(miphy_dbg_muxreg),
1769 },
1770};
1771
1772static struct spear_pingroup miphy_dbg_pingroup = {
1773 .name = "miphy_dbg_grp",
1774 .pins = miphy_dbg_pins,
1775 .npins = ARRAY_SIZE(miphy_dbg_pins),
1776 .modemuxs = miphy_dbg_modemux,
1777 .nmodemuxs = ARRAY_SIZE(miphy_dbg_modemux),
1778};
1779
1780static const char *const miphy_dbg_grps[] = { "miphy_dbg_grp" };
1781static struct spear_function miphy_dbg_function = {
1782 .name = "miphy_dbg",
1783 .groups = miphy_dbg_grps,
1784 .ngroups = ARRAY_SIZE(miphy_dbg_grps),
1785};
1786
1787/* pad multiplexing for pcie device */
1788static const unsigned pcie_pins[] = { 250 };
1789static struct spear_muxreg pcie_muxreg[] = {
1790 {
1791 .reg = PCIE_SATA_CFG,
1792 .mask = SATA_PCIE_CFG_MASK,
1793 .val = PCIE_CFG_VAL,
1794 },
1795};
1796
1797static struct spear_modemux pcie_modemux[] = {
1798 {
1799 .muxregs = pcie_muxreg,
1800 .nmuxregs = ARRAY_SIZE(pcie_muxreg),
1801 },
1802};
1803
1804static struct spear_pingroup pcie_pingroup = {
1805 .name = "pcie_grp",
1806 .pins = pcie_pins,
1807 .npins = ARRAY_SIZE(pcie_pins),
1808 .modemuxs = pcie_modemux,
1809 .nmodemuxs = ARRAY_SIZE(pcie_modemux),
1810};
1811
1812static const char *const pcie_grps[] = { "pcie_grp" };
1813static struct spear_function pcie_function = {
1814 .name = "pcie",
1815 .groups = pcie_grps,
1816 .ngroups = ARRAY_SIZE(pcie_grps),
1817};
1818
1819/* pad multiplexing for sata device */
1820static const unsigned sata_pins[] = { 250 };
1821static struct spear_muxreg sata_muxreg[] = {
1822 {
1823 .reg = PCIE_SATA_CFG,
1824 .mask = SATA_PCIE_CFG_MASK,
1825 .val = SATA_CFG_VAL,
1826 },
1827};
1828
1829static struct spear_modemux sata_modemux[] = {
1830 {
1831 .muxregs = sata_muxreg,
1832 .nmuxregs = ARRAY_SIZE(sata_muxreg),
1833 },
1834};
1835
1836static struct spear_pingroup sata_pingroup = {
1837 .name = "sata_grp",
1838 .pins = sata_pins,
1839 .npins = ARRAY_SIZE(sata_pins),
1840 .modemuxs = sata_modemux,
1841 .nmodemuxs = ARRAY_SIZE(sata_modemux),
1842};
1843
1844static const char *const sata_grps[] = { "sata_grp" };
1845static struct spear_function sata_function = {
1846 .name = "sata",
1847 .groups = sata_grps,
1848 .ngroups = ARRAY_SIZE(sata_grps),
1849};
1850
1851/* pingroups */
1852static struct spear_pingroup *spear1340_pingroups[] = {
1853 &pads_as_gpio_pingroup,
1854 &fsmc_8bit_pingroup,
1855 &fsmc_16bit_pingroup,
1856 &fsmc_pnor_pingroup,
1857 &keyboard_row_col_pingroup,
1858 &keyboard_col5_pingroup,
1859 &spdif_in_pingroup,
1860 &spdif_out_pingroup,
1861 &gpt_0_1_pingroup,
1862 &pwm0_pingroup,
1863 &pwm1_pingroup,
1864 &pwm2_pingroup,
1865 &pwm3_pingroup,
1866 &vip_mux_pingroup,
1867 &vip_mux_cam0_pingroup,
1868 &vip_mux_cam1_pingroup,
1869 &vip_mux_cam2_pingroup,
1870 &vip_mux_cam3_pingroup,
1871 &cam0_pingroup,
1872 &cam1_pingroup,
1873 &cam2_pingroup,
1874 &cam3_pingroup,
1875 &smi_pingroup,
1876 &ssp0_pingroup,
1877 &ssp0_cs1_pingroup,
1878 &ssp0_cs2_pingroup,
1879 &ssp0_cs3_pingroup,
1880 &uart0_pingroup,
1881 &uart0_enh_pingroup,
1882 &uart1_pingroup,
1883 &i2s_in_pingroup,
1884 &i2s_out_pingroup,
1885 &gmii_pingroup,
1886 &rgmii_pingroup,
1887 &rmii_pingroup,
1888 &sgmii_pingroup,
1889 &i2c0_pingroup,
1890 &i2c1_pingroup,
1891 &cec0_pingroup,
1892 &cec1_pingroup,
1893 &sdhci_pingroup,
1894 &cf_pingroup,
1895 &xd_pingroup,
1896 &clcd_pingroup,
1897 &arm_trace_pingroup,
1898 &miphy_dbg_pingroup,
1899 &pcie_pingroup,
1900 &sata_pingroup,
1901};
1902
1903/* functions */
1904static struct spear_function *spear1340_functions[] = {
1905 &pads_as_gpio_function,
1906 &fsmc_function,
1907 &keyboard_function,
1908 &spdif_in_function,
1909 &spdif_out_function,
1910 &gpt_0_1_function,
1911 &pwm_function,
1912 &vip_function,
1913 &cam0_function,
1914 &cam1_function,
1915 &cam2_function,
1916 &cam3_function,
1917 &smi_function,
1918 &ssp0_function,
1919 &uart0_function,
1920 &uart1_function,
1921 &i2s_function,
1922 &gmac_function,
1923 &i2c0_function,
1924 &i2c1_function,
1925 &cec0_function,
1926 &cec1_function,
1927 &sdhci_function,
1928 &cf_function,
1929 &xd_function,
1930 &clcd_function,
1931 &arm_trace_function,
1932 &miphy_dbg_function,
1933 &pcie_function,
1934 &sata_function,
1935};
1936
1937static struct spear_pinctrl_machdata spear1340_machdata = {
1938 .pins = spear1340_pins,
1939 .npins = ARRAY_SIZE(spear1340_pins),
1940 .groups = spear1340_pingroups,
1941 .ngroups = ARRAY_SIZE(spear1340_pingroups),
1942 .functions = spear1340_functions,
1943 .nfunctions = ARRAY_SIZE(spear1340_functions),
1944 .modes_supported = false,
1945};
1946
1947static struct of_device_id spear1340_pinctrl_of_match[] __devinitdata = {
1948 {
1949 .compatible = "st,spear1340-pinmux",
1950 },
1951 {},
1952};
1953
1954static int __devinit spear1340_pinctrl_probe(struct platform_device *pdev)
1955{
1956 return spear_pinctrl_probe(pdev, &spear1340_machdata);
1957}
1958
1959static int __devexit spear1340_pinctrl_remove(struct platform_device *pdev)
1960{
1961 return spear_pinctrl_remove(pdev);
1962}
1963
1964static struct platform_driver spear1340_pinctrl_driver = {
1965 .driver = {
1966 .name = DRIVER_NAME,
1967 .owner = THIS_MODULE,
1968 .of_match_table = spear1340_pinctrl_of_match,
1969 },
1970 .probe = spear1340_pinctrl_probe,
1971 .remove = __devexit_p(spear1340_pinctrl_remove),
1972};
1973
1974static int __init spear1340_pinctrl_init(void)
1975{
1976 return platform_driver_register(&spear1340_pinctrl_driver);
1977}
1978arch_initcall(spear1340_pinctrl_init);
1979
1980static void __exit spear1340_pinctrl_exit(void)
1981{
1982 platform_driver_unregister(&spear1340_pinctrl_driver);
1983}
1984module_exit(spear1340_pinctrl_exit);
1985
1986MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>");
1987MODULE_DESCRIPTION("ST Microelectronics SPEAr1340 pinctrl driver");
1988MODULE_LICENSE("GPL v2");
1989MODULE_DEVICE_TABLE(of, spear1340_pinctrl_of_match);