14 #include <linux/module.h>
19 #define DRIVER_NAME "spear1310-pinmux"
22 static const struct pinctrl_pin_desc spear1310_pins[] = {
28 #define PERIP_CFG 0x3B0
29 #define MCIF_SEL_SHIFT 5
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)
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)
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)
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)
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)
167 #define PAD_DIRECTION_SEL_0 0x65C
168 #define PAD_DIRECTION_SEL_1 0x660
169 #define PAD_DIRECTION_SEL_2 0x664
172 #define PMX_GMII_MASK (PMX_GMIICLK_MASK | \
173 PMX_GMIICOL_CRS_XFERER_MIITXCLK_MASK | \
174 PMX_RXCLK_RDV_TXEN_D03_MASK | \
175 PMX_GMIID47_MASK | PMX_MDC_MDIO_MASK)
177 #define PMX_EGPIO_0_GRP_MASK (PMX_EGPIO00_MASK | PMX_EGPIO01_MASK | \
179 PMX_EGPIO03_MASK | PMX_EGPIO04_MASK | \
180 PMX_EGPIO05_MASK | PMX_EGPIO06_MASK | \
181 PMX_EGPIO07_MASK | PMX_EGPIO08_MASK | \
183 #define PMX_EGPIO_1_GRP_MASK (PMX_EGPIO10_MASK | PMX_EGPIO11_MASK | \
184 PMX_EGPIO12_MASK | PMX_EGPIO13_MASK | \
185 PMX_EGPIO14_MASK | PMX_EGPIO15_MASK)
187 #define PMX_KEYBOARD_6X6_MASK (PMX_KBD_ROW0_MASK | PMX_KBD_ROW1_MASK | \
188 PMX_KBD_ROWCOL25_MASK | PMX_KBD_COL0_MASK | \
191 #define PMX_NAND8BIT_0_MASK (PMX_NAND8_MASK | PMX_NFAD23_MASK | \
192 PMX_NFAD24_MASK | PMX_NFAD25_MASK | \
193 PMX_NFWPRT3_MASK | PMX_NFRSTPWDWN0_MASK | \
194 PMX_NFRSTPWDWN1_MASK | PMX_NFRSTPWDWN2_MASK | \
196 #define PMX_NAND8BIT_1_MASK PMX_NFRSTPWDWN3_MASK
198 #define PMX_NAND16BIT_1_MASK (PMX_KBD_ROWCOL25_MASK | PMX_NFIO8_15_MASK)
199 #define PMX_NAND_4CHIPS_MASK (PMX_NFCE1_MASK | PMX_NFCE2_MASK | \
200 PMX_NFWPRT1_MASK | PMX_NFWPRT2_MASK | \
201 PMX_KBD_ROW0_MASK | PMX_KBD_ROW1_MASK | \
202 PMX_KBD_COL0_MASK | PMX_KBD_COL1_MASK)
204 #define PMX_MCIFALL_1_MASK 0xF8000000
205 #define PMX_MCIFALL_2_MASK 0x0FFFFFFF
207 #define PMX_PCI_REG1_MASK (PMX_SMINCS2_MASK | PMX_SMINCS3_MASK | \
208 PMX_CLCD2_MASK | PMX_KBD_ROWCOL68_MASK | \
209 PMX_EGPIO_1_GRP_MASK | PMX_GPT0_TMR0_MASK | \
210 PMX_GPT0_TMR1_MASK | PMX_GPT1_TMR0_MASK | \
211 PMX_GPT1_TMR1_MASK | PMX_I2S1_MASK | \
213 #define PMX_PCI_REG2_MASK (PMX_TOUCH_XY_MASK | PMX_SSP0_CS0_MASK | \
216 #define PMX_SMII_0_1_2_MASK (PMX_CLCD2_MASK | PMX_KBD_ROWCOL68_MASK)
217 #define PMX_RGMII_REG0_MASK (PMX_MCI_DATA8_15_MASK | \
218 PMX_GMIICOL_CRS_XFERER_MIITXCLK_MASK | \
220 #define PMX_RGMII_REG1_MASK (PMX_KBD_ROWCOL68_MASK | PMX_EGPIO_1_GRP_MASK |\
221 PMX_KBD_ROW1_MASK | PMX_NFWPRT1_MASK | \
222 PMX_KBD_ROW0_MASK | PMX_NFWPRT2_MASK)
223 #define PMX_RGMII_REG2_MASK (PMX_TOUCH_XY_MASK | PMX_SSP0_CS0_MASK | \
226 #define PCIE_CFG_VAL(x) (PCIE_SATA##x##_SEL_PCIE | \
227 PCIE##x##_CFG_AUX_CLK_EN | \
228 PCIE##x##_CFG_CORE_CLK_EN | \
229 PCIE##x##_CFG_POWERUP_RESET | \
230 PCIE##x##_CFG_DEVICE_PRESENT)
231 #define SATA_CFG_VAL(x) (PCIE_SATA##x##_SEL_SATA | \
232 SATA##x##_CFG_PM_CLK_EN | \
233 SATA##x##_CFG_POWERUP_RESET | \
234 SATA##x##_CFG_RX_CLK_EN | \
235 SATA##x##_CFG_TX_CLK_EN)
238 static const unsigned i2c0_pins[] = { 102, 103 };
253 .muxregs = i2c0_muxreg,
262 .modemuxs = i2c0_modemux,
266 static const char *
const i2c0_grps[] = {
"i2c0_grp" };
274 static const unsigned ssp0_pins[] = { 109, 110, 111, 112 };
289 .muxregs = ssp0_muxreg,
298 .modemuxs = ssp0_modemux,
303 static const unsigned ssp0_cs0_pins[] = { 96 };
318 .muxregs = ssp0_cs0_muxreg,
324 .name =
"ssp0_cs0_grp",
325 .pins = ssp0_cs0_pins,
327 .modemuxs = ssp0_cs0_modemux,
332 static const unsigned ssp0_cs1_2_pins[] = { 94, 95 };
347 .muxregs = ssp0_cs1_2_muxreg,
353 .name =
"ssp0_cs1_2_grp",
354 .pins = ssp0_cs1_2_pins,
356 .modemuxs = ssp0_cs1_2_modemux,
360 static const char *
const ssp0_grps[] = {
"ssp0_grp",
"ssp0_cs0_grp",
369 static const unsigned i2s0_pins[] = { 104, 105, 106, 107, 108 };
384 .muxregs = i2s0_muxreg,
393 .modemuxs = i2s0_modemux,
397 static const char *
const i2s0_grps[] = {
"i2s0_grp" };
405 static const unsigned i2s1_pins[] = { 0, 1, 2, 3 };
420 .muxregs = i2s1_muxreg,
429 .modemuxs = i2s1_modemux,
433 static const char *
const i2s1_grps[] = {
"i2s1_grp" };
441 static const unsigned clcd_pins[] = { 113, 114, 115, 116, 117, 118, 119, 120,
442 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
443 135, 136, 137, 138, 139, 140, 141, 142 };
458 .muxregs = clcd_muxreg,
467 .modemuxs = clcd_modemux,
471 static const unsigned clcd_high_res_pins[] = { 30, 31, 32, 33, 34, 35, 36, 37,
472 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 };
487 .muxregs = clcd_high_res_muxreg,
493 .name =
"clcd_high_res_grp",
494 .pins = clcd_high_res_pins,
496 .modemuxs = clcd_high_res_modemux,
497 .nmodemuxs =
ARRAY_SIZE(clcd_high_res_modemux),
500 static const char *
const clcd_grps[] = {
"clcd_grp",
"clcd_high_res_grp" };
507 static const unsigned arm_gpio_pins[] = { 18, 19, 20, 21, 22, 23, 143, 144, 145,
508 146, 147, 148, 149, 150, 151, 152 };
531 .muxregs = arm_gpio_muxreg,
537 .name =
"arm_gpio_grp",
538 .pins = arm_gpio_pins,
540 .modemuxs = arm_gpio_modemux,
544 static const char *
const arm_gpio_grps[] = {
"arm_gpio_grp" };
547 .groups = arm_gpio_grps,
552 static const unsigned smi_2_chips_pins[] = { 153, 154, 155, 156, 157 };
567 .muxregs = smi_2_chips_muxreg,
573 .name =
"smi_2_chips_grp",
574 .pins = smi_2_chips_pins,
576 .modemuxs = smi_2_chips_modemux,
580 static const unsigned smi_4_chips_pins[] = { 54, 55 };
603 .muxregs = smi_4_chips_muxreg,
609 .name =
"smi_4_chips_grp",
610 .pins = smi_4_chips_pins,
612 .modemuxs = smi_4_chips_modemux,
616 static const char *
const smi_grps[] = {
"smi_2_chips_grp",
"smi_4_chips_grp" };
624 static const unsigned gmii_pins[] = { 173, 174, 175, 176, 177, 178, 179, 180,
625 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
626 195, 196, 197, 198, 199, 200 };
641 .muxregs = gmii_muxreg,
650 .modemuxs = gmii_modemux,
654 static const char *
const gmii_grps[] = {
"gmii_grp" };
662 static const unsigned rgmii_pins[] = { 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
663 28, 29, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 175,
664 180, 181, 182, 183, 185, 188, 193, 194, 195, 196, 197, 198, 211, 212 };
695 .muxregs = rgmii_muxreg,
704 .modemuxs = rgmii_modemux,
708 static const char *
const rgmii_grps[] = {
"rgmii_grp" };
711 .groups = rgmii_grps,
716 static const unsigned smii_0_1_2_pins[] = { 24, 25, 26, 27, 28, 29, 30, 31, 32,
717 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
718 51, 52, 53, 54, 55 };
733 .muxregs = smii_0_1_2_muxreg,
739 .name =
"smii_0_1_2_grp",
740 .pins = smii_0_1_2_pins,
742 .modemuxs = smii_0_1_2_modemux,
746 static const char *
const smii_0_1_2_grps[] = {
"smii_0_1_2_grp" };
748 .name =
"smii_0_1_2",
749 .groups = smii_0_1_2_grps,
754 static const unsigned ras_mii_txclk_pins[] = { 98, 99 };
769 .muxregs = ras_mii_txclk_muxreg,
775 .name =
"ras_mii_txclk_grp",
776 .pins = ras_mii_txclk_pins,
778 .modemuxs = ras_mii_txclk_modemux,
779 .nmodemuxs =
ARRAY_SIZE(ras_mii_txclk_modemux),
782 static const char *
const ras_mii_txclk_grps[] = {
"ras_mii_txclk_grp" };
784 .name =
"ras_mii_txclk",
785 .groups = ras_mii_txclk_grps,
790 static const unsigned nand_8bit_pins[] = { 56, 57, 58, 59, 60, 61, 62, 63, 64,
791 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
792 83, 84, 85, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
793 170, 171, 172, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
817 .muxregs = nand_8bit_muxreg,
823 .name =
"nand_8bit_grp",
824 .pins = nand_8bit_pins,
826 .modemuxs = nand_8bit_modemux,
831 static const unsigned nand_16bit_pins[] = { 201, 202, 203, 204, 207, 208, 209,
847 .muxregs = nand_16bit_muxreg,
853 .name =
"nand_16bit_grp",
854 .pins = nand_16bit_pins,
856 .modemuxs = nand_16bit_modemux,
861 static const unsigned nand_4_chips_pins[] = { 205, 206, 211, 212 };
876 .muxregs = nand_4_chips_muxreg,
882 .name =
"nand_4_chips_grp",
883 .pins = nand_4_chips_pins,
885 .modemuxs = nand_4_chips_modemux,
886 .nmodemuxs =
ARRAY_SIZE(nand_4_chips_modemux),
889 static const char *
const nand_grps[] = {
"nand_8bit_grp",
"nand_16bit_grp",
890 "nand_4_chips_grp" };
898 static const unsigned keyboard_6x6_pins[] = { 201, 202, 203, 204, 205, 206, 207,
899 208, 209, 210, 211, 212 };
912 .muxregs = keyboard_6x6_muxreg,
918 .name =
"keyboard_6x6_grp",
919 .pins = keyboard_6x6_pins,
921 .modemuxs = keyboard_6x6_modemux,
922 .nmodemuxs =
ARRAY_SIZE(keyboard_6x6_modemux),
926 static const unsigned keyboard_rowcol6_8_pins[] = { 24, 25, 26, 27, 28, 29 };
927 static struct spear_muxreg keyboard_rowcol6_8_muxreg[] = {
941 .muxregs = keyboard_rowcol6_8_muxreg,
942 .nmuxregs =
ARRAY_SIZE(keyboard_rowcol6_8_muxreg),
947 .name =
"keyboard_rowcol6_8_grp",
948 .pins = keyboard_rowcol6_8_pins,
950 .modemuxs = keyboard_rowcol6_8_modemux,
951 .nmodemuxs =
ARRAY_SIZE(keyboard_rowcol6_8_modemux),
954 static const char *
const keyboard_grps[] = {
"keyboard_6x6_grp",
955 "keyboard_rowcol6_8_grp" };
958 .groups = keyboard_grps,
963 static const unsigned uart0_pins[] = { 100, 101 };
978 .muxregs = uart0_muxreg,
987 .modemuxs = uart0_modemux,
992 static const unsigned uart0_modem_pins[] = { 12, 13, 14, 15, 16, 17 };
1007 .muxregs = uart0_modem_muxreg,
1013 .name =
"uart0_modem_grp",
1014 .pins = uart0_modem_pins,
1016 .modemuxs = uart0_modem_modemux,
1017 .nmodemuxs =
ARRAY_SIZE(uart0_modem_modemux),
1020 static const char *
const uart0_grps[] = {
"uart0_grp",
"uart0_modem_grp" };
1023 .groups = uart0_grps,
1028 static const unsigned gpt0_tmr0_pins[] = { 10, 11 };
1043 .muxregs = gpt0_tmr0_muxreg,
1049 .name =
"gpt0_tmr0_grp",
1050 .pins = gpt0_tmr0_pins,
1052 .modemuxs = gpt0_tmr0_modemux,
1057 static const unsigned gpt0_tmr1_pins[] = { 8, 9 };
1072 .muxregs = gpt0_tmr1_muxreg,
1078 .name =
"gpt0_tmr1_grp",
1079 .pins = gpt0_tmr1_pins,
1081 .modemuxs = gpt0_tmr1_modemux,
1085 static const char *
const gpt0_grps[] = {
"gpt0_tmr0_grp",
"gpt0_tmr1_grp" };
1088 .groups = gpt0_grps,
1093 static const unsigned gpt1_tmr0_pins[] = { 6, 7 };
1108 .muxregs = gpt1_tmr0_muxreg,
1114 .name =
"gpt1_tmr0_grp",
1115 .pins = gpt1_tmr0_pins,
1117 .modemuxs = gpt1_tmr0_modemux,
1122 static const unsigned gpt1_tmr1_pins[] = { 4, 5 };
1137 .muxregs = gpt1_tmr1_muxreg,
1143 .name =
"gpt1_tmr1_grp",
1144 .pins = gpt1_tmr1_pins,
1146 .modemuxs = gpt1_tmr1_modemux,
1150 static const char *
const gpt1_grps[] = {
"gpt1_tmr1_grp",
"gpt1_tmr0_grp" };
1153 .groups = gpt1_grps,
1158 static const unsigned mcif_pins[] = { 86, 87, 88, 89, 90, 91, 92, 93, 213, 214,
1159 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,
1160 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242,
1162 #define MCIF_MUXREG \
1164 .reg = PAD_FUNCTION_EN_0, \
1165 .mask = PMX_MCI_DATA8_15_MASK, \
1166 .val = PMX_MCI_DATA8_15_MASK, \
1168 .reg = PAD_FUNCTION_EN_1, \
1169 .mask = PMX_MCIFALL_1_MASK | PMX_NFWPRT1_MASK | \
1171 .val = PMX_MCIFALL_1_MASK, \
1173 .reg = PAD_FUNCTION_EN_2, \
1174 .mask = PMX_MCIFALL_2_MASK, \
1175 .val = PMX_MCIFALL_2_MASK, \
1177 .reg = PAD_DIRECTION_SEL_0, \
1178 .mask = PMX_MCI_DATA8_15_MASK, \
1179 .val = PMX_MCI_DATA8_15_MASK, \
1181 .reg = PAD_DIRECTION_SEL_1, \
1182 .mask = PMX_MCIFALL_1_MASK | PMX_NFWPRT1_MASK | \
1184 .val = PMX_MCIFALL_1_MASK | PMX_NFWPRT1_MASK | \
1187 .reg = PAD_DIRECTION_SEL_2, \
1188 .mask = PMX_MCIFALL_2_MASK, \
1189 .val = PMX_MCIFALL_2_MASK, \
1204 .muxregs = sdhci_muxreg,
1210 .name =
"sdhci_grp",
1213 .modemuxs = sdhci_modemux,
1217 static const char *
const sdhci_grps[] = {
"sdhci_grp" };
1220 .groups = sdhci_grps,
1236 .muxregs = cf_muxreg,
1245 .modemuxs = cf_modemux,
1249 static const char *
const cf_grps[] = {
"cf_grp" };
1268 .muxregs = xd_muxreg,
1277 .modemuxs = xd_modemux,
1281 static const char *
const xd_grps[] = {
"xd_grp" };
1289 static const unsigned touch_xy_pins[] = { 97 };
1304 .muxregs = touch_xy_muxreg,
1310 .name =
"touch_xy_grp",
1311 .pins = touch_xy_pins,
1313 .modemuxs = touch_xy_modemux,
1317 static const char *
const touch_xy_grps[] = {
"touch_xy_grp" };
1319 .name =
"touchscreen",
1320 .groups = touch_xy_grps,
1326 static const unsigned uart1_dis_i2c_pins[] = { 102, 103 };
1341 .muxregs = uart1_dis_i2c_muxreg,
1342 .nmuxregs =
ARRAY_SIZE(uart1_dis_i2c_muxreg),
1347 .name =
"uart1_disable_i2c_grp",
1348 .pins = uart1_dis_i2c_pins,
1350 .modemuxs = uart1_dis_i2c_modemux,
1351 .nmodemuxs =
ARRAY_SIZE(uart1_dis_i2c_modemux),
1355 static const unsigned uart1_dis_sd_pins[] = { 214, 215 };
1373 .muxregs = uart1_dis_sd_muxreg,
1379 .name =
"uart1_disable_sd_grp",
1380 .pins = uart1_dis_sd_pins,
1382 .modemuxs = uart1_dis_sd_modemux,
1383 .nmodemuxs =
ARRAY_SIZE(uart1_dis_sd_modemux),
1386 static const char *
const uart1_grps[] = {
"uart1_disable_i2c_grp",
1387 "uart1_disable_sd_grp" };
1390 .groups = uart1_grps,
1395 static const unsigned uart2_3_pins[] = { 104, 105, 106, 107 };
1410 .muxregs = uart2_3_muxreg,
1416 .name =
"uart2_3_grp",
1417 .pins = uart2_3_pins,
1419 .modemuxs = uart2_3_modemux,
1423 static const char *
const uart2_3_grps[] = {
"uart2_3_grp" };
1426 .groups = uart2_3_grps,
1431 static const unsigned uart4_pins[] = { 108, 113 };
1446 .muxregs = uart4_muxreg,
1452 .name =
"uart4_grp",
1455 .modemuxs = uart4_modemux,
1459 static const char *
const uart4_grps[] = {
"uart4_grp" };
1462 .groups = uart4_grps,
1467 static const unsigned uart5_pins[] = { 114, 115 };
1482 .muxregs = uart5_muxreg,
1488 .name =
"uart5_grp",
1491 .modemuxs = uart5_modemux,
1495 static const char *
const uart5_grps[] = {
"uart5_grp" };
1498 .groups = uart5_grps,
1503 static const unsigned rs485_0_1_tdm_0_1_pins[] = { 116, 117, 118, 119, 120, 121,
1504 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135,
1506 static struct spear_muxreg rs485_0_1_tdm_0_1_muxreg[] = {
1520 .muxregs = rs485_0_1_tdm_0_1_muxreg,
1521 .nmuxregs =
ARRAY_SIZE(rs485_0_1_tdm_0_1_muxreg),
1526 .name =
"rs485_0_1_tdm_0_1_grp",
1527 .pins = rs485_0_1_tdm_0_1_pins,
1529 .modemuxs = rs485_0_1_tdm_0_1_modemux,
1530 .nmodemuxs =
ARRAY_SIZE(rs485_0_1_tdm_0_1_modemux),
1533 static const char *
const rs485_0_1_tdm_0_1_grps[] = {
"rs485_0_1_tdm_0_1_grp" };
1535 .name =
"rs485_0_1_tdm_0_1",
1536 .groups = rs485_0_1_tdm_0_1_grps,
1537 .ngroups =
ARRAY_SIZE(rs485_0_1_tdm_0_1_grps),
1541 static const unsigned i2c_1_2_pins[] = { 138, 139, 140, 141 };
1556 .muxregs = i2c_1_2_muxreg,
1562 .name =
"i2c_1_2_grp",
1563 .pins = i2c_1_2_pins,
1565 .modemuxs = i2c_1_2_modemux,
1569 static const char *
const i2c_1_2_grps[] = {
"i2c_1_2_grp" };
1572 .groups = i2c_1_2_grps,
1578 static const unsigned i2c3_dis_smi_clcd_pins[] = { 142, 153 };
1579 static struct spear_muxreg i2c3_dis_smi_clcd_muxreg[] = {
1593 .muxregs = i2c3_dis_smi_clcd_muxreg,
1594 .nmuxregs =
ARRAY_SIZE(i2c3_dis_smi_clcd_muxreg),
1599 .name =
"i2c3_dis_smi_clcd_grp",
1600 .pins = i2c3_dis_smi_clcd_pins,
1602 .modemuxs = i2c3_dis_smi_clcd_modemux,
1603 .nmodemuxs =
ARRAY_SIZE(i2c3_dis_smi_clcd_modemux),
1608 static const unsigned i2c3_dis_sd_i2s0_pins[] = { 0, 216 };
1609 static struct spear_muxreg i2c3_dis_sd_i2s0_muxreg[] = {
1623 .muxregs = i2c3_dis_sd_i2s0_muxreg,
1624 .nmuxregs =
ARRAY_SIZE(i2c3_dis_sd_i2s0_muxreg),
1629 .name =
"i2c3_dis_sd_i2s0_grp",
1630 .pins = i2c3_dis_sd_i2s0_pins,
1632 .modemuxs = i2c3_dis_sd_i2s0_modemux,
1633 .nmodemuxs =
ARRAY_SIZE(i2c3_dis_sd_i2s0_modemux),
1636 static const char *
const i2c3_grps[] = {
"i2c3_dis_smi_clcd_grp",
1637 "i2c3_dis_sd_i2s0_grp" };
1639 .name =
"i2c3_i2s1",
1640 .groups = i2c3_grps,
1646 static const unsigned i2c_4_5_dis_smi_pins[] = { 154, 155, 156, 157 };
1647 static struct spear_muxreg i2c_4_5_dis_smi_muxreg[] = {
1661 .muxregs = i2c_4_5_dis_smi_muxreg,
1662 .nmuxregs =
ARRAY_SIZE(i2c_4_5_dis_smi_muxreg),
1667 .name =
"i2c_4_5_dis_smi_grp",
1668 .pins = i2c_4_5_dis_smi_pins,
1670 .modemuxs = i2c_4_5_dis_smi_modemux,
1671 .nmodemuxs =
ARRAY_SIZE(i2c_4_5_dis_smi_modemux),
1676 static const unsigned i2c4_dis_sd_pins[] = { 217, 218 };
1699 .muxregs = i2c4_dis_sd_muxreg,
1705 .name =
"i2c4_dis_sd_grp",
1706 .pins = i2c4_dis_sd_pins,
1708 .modemuxs = i2c4_dis_sd_modemux,
1709 .nmodemuxs =
ARRAY_SIZE(i2c4_dis_sd_modemux),
1714 static const unsigned i2c5_dis_sd_pins[] = { 219, 220 };
1732 .muxregs = i2c5_dis_sd_muxreg,
1738 .name =
"i2c5_dis_sd_grp",
1739 .pins = i2c5_dis_sd_pins,
1741 .modemuxs = i2c5_dis_sd_modemux,
1742 .nmodemuxs =
ARRAY_SIZE(i2c5_dis_sd_modemux),
1745 static const char *
const i2c_4_5_grps[] = {
"i2c5_dis_sd_grp",
1746 "i2c4_dis_sd_grp",
"i2c_4_5_dis_smi_grp" };
1749 .groups = i2c_4_5_grps,
1755 static const unsigned i2c_6_7_dis_kbd_pins[] = { 207, 208, 209, 210 };
1756 static struct spear_muxreg i2c_6_7_dis_kbd_muxreg[] = {
1770 .muxregs = i2c_6_7_dis_kbd_muxreg,
1771 .nmuxregs =
ARRAY_SIZE(i2c_6_7_dis_kbd_muxreg),
1776 .name =
"i2c_6_7_dis_kbd_grp",
1777 .pins = i2c_6_7_dis_kbd_pins,
1779 .modemuxs = i2c_6_7_dis_kbd_modemux,
1780 .nmodemuxs =
ARRAY_SIZE(i2c_6_7_dis_kbd_modemux),
1785 static const unsigned i2c6_dis_sd_pins[] = { 236, 237 };
1803 .muxregs = i2c6_dis_sd_muxreg,
1809 .name =
"i2c6_dis_sd_grp",
1810 .pins = i2c6_dis_sd_pins,
1812 .modemuxs = i2c6_dis_sd_modemux,
1813 .nmodemuxs =
ARRAY_SIZE(i2c6_dis_sd_modemux),
1817 static const unsigned i2c7_dis_sd_pins[] = { 238, 239 };
1835 .muxregs = i2c7_dis_sd_muxreg,
1841 .name =
"i2c7_dis_sd_grp",
1842 .pins = i2c7_dis_sd_pins,
1844 .modemuxs = i2c7_dis_sd_modemux,
1845 .nmodemuxs =
ARRAY_SIZE(i2c7_dis_sd_modemux),
1848 static const char *
const i2c_6_7_grps[] = {
"i2c6_dis_sd_grp",
1849 "i2c7_dis_sd_grp",
"i2c_6_7_dis_kbd_grp" };
1852 .groups = i2c_6_7_grps,
1858 static const unsigned can0_dis_nor_pins[] = { 56, 57 };
1881 .muxregs = can0_dis_nor_muxreg,
1887 .name =
"can0_dis_nor_grp",
1888 .pins = can0_dis_nor_pins,
1890 .modemuxs = can0_dis_nor_modemux,
1891 .nmodemuxs =
ARRAY_SIZE(can0_dis_nor_modemux),
1896 static const unsigned can0_dis_sd_pins[] = { 240, 241 };
1911 .muxregs = can0_dis_sd_muxreg,
1917 .name =
"can0_dis_sd_grp",
1918 .pins = can0_dis_sd_pins,
1920 .modemuxs = can0_dis_sd_modemux,
1921 .nmodemuxs =
ARRAY_SIZE(can0_dis_sd_modemux),
1924 static const char *
const can0_grps[] = {
"can0_dis_nor_grp",
"can0_dis_sd_grp"
1928 .groups = can0_grps,
1934 static const unsigned can1_dis_sd_pins[] = { 242, 243 };
1949 .muxregs = can1_dis_sd_muxreg,
1955 .name =
"can1_dis_sd_grp",
1956 .pins = can1_dis_sd_pins,
1958 .modemuxs = can1_dis_sd_modemux,
1959 .nmodemuxs =
ARRAY_SIZE(can1_dis_sd_modemux),
1964 static const unsigned can1_dis_kbd_pins[] = { 201, 202 };
1979 .muxregs = can1_dis_kbd_muxreg,
1985 .name =
"can1_dis_kbd_grp",
1986 .pins = can1_dis_kbd_pins,
1988 .modemuxs = can1_dis_kbd_modemux,
1989 .nmodemuxs =
ARRAY_SIZE(can1_dis_kbd_modemux),
1992 static const char *
const can1_grps[] = {
"can1_dis_sd_grp",
"can1_dis_kbd_grp"
1996 .groups = can1_grps,
2001 static const unsigned pci_pins[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 18,
2002 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
2003 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
2004 55, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 };
2036 .muxregs = pci_muxreg,
2045 .modemuxs = pci_modemux,
2049 static const char *
const pci_grps[] = {
"pci_grp" };
2067 .muxregs = pcie0_muxreg,
2073 .name =
"pcie0_grp",
2074 .modemuxs = pcie0_modemux,
2089 .muxregs = pcie1_muxreg,
2095 .name =
"pcie1_grp",
2096 .modemuxs = pcie1_modemux,
2111 .muxregs = pcie2_muxreg,
2117 .name =
"pcie2_grp",
2118 .modemuxs = pcie2_modemux,
2122 static const char *
const pcie_grps[] = {
"pcie0_grp",
"pcie1_grp",
"pcie2_grp"
2125 .name =
"pci_express",
2126 .groups = pcie_grps,
2141 .muxregs = sata0_muxreg,
2147 .name =
"sata0_grp",
2148 .modemuxs = sata0_modemux,
2163 .muxregs = sata1_muxreg,
2169 .name =
"sata1_grp",
2170 .modemuxs = sata1_modemux,
2185 .muxregs = sata2_muxreg,
2191 .name =
"sata2_grp",
2192 .modemuxs = sata2_modemux,
2196 static const char *
const sata_grps[] = {
"sata0_grp",
"sata1_grp",
"sata2_grp"
2200 .groups = sata_grps,
2205 static const unsigned ssp1_dis_kbd_pins[] = { 203, 204, 205, 206 };
2226 .muxregs = ssp1_dis_kbd_muxreg,
2232 .name =
"ssp1_dis_kbd_grp",
2233 .pins = ssp1_dis_kbd_pins,
2235 .modemuxs = ssp1_dis_kbd_modemux,
2236 .nmodemuxs =
ARRAY_SIZE(ssp1_dis_kbd_modemux),
2240 static const unsigned ssp1_dis_sd_pins[] = { 224, 226, 227, 228 };
2258 .muxregs = ssp1_dis_sd_muxreg,
2264 .name =
"ssp1_dis_sd_grp",
2265 .pins = ssp1_dis_sd_pins,
2267 .modemuxs = ssp1_dis_sd_modemux,
2268 .nmodemuxs =
ARRAY_SIZE(ssp1_dis_sd_modemux),
2271 static const char *
const ssp1_grps[] = {
"ssp1_dis_kbd_grp",
2272 "ssp1_dis_sd_grp" };
2275 .groups = ssp1_grps,
2280 static const unsigned gpt64_pins[] = { 230, 231, 232, 245 };
2298 .muxregs = gpt64_muxreg,
2304 .name =
"gpt64_grp",
2307 .modemuxs = gpt64_modemux,
2311 static const char *
const gpt64_grps[] = {
"gpt64_grp" };
2314 .groups = gpt64_grps,
2325 &clcd_high_res_pingroup,
2327 &smi_2_chips_pingroup,
2328 &smi_4_chips_pingroup,
2331 &smii_0_1_2_pingroup,
2332 &ras_mii_txclk_pingroup,
2333 &nand_8bit_pingroup,
2334 &nand_16bit_pingroup,
2335 &nand_4_chips_pingroup,
2336 &keyboard_6x6_pingroup,
2337 &keyboard_rowcol6_8_pingroup,
2339 &uart0_modem_pingroup,
2340 &gpt0_tmr0_pingroup,
2341 &gpt0_tmr1_pingroup,
2342 &gpt1_tmr0_pingroup,
2343 &gpt1_tmr1_pingroup,
2349 &ssp0_cs1_2_pingroup,
2350 &uart_1_dis_i2c_pingroup,
2351 &uart_1_dis_sd_pingroup,
2355 &rs485_0_1_tdm_0_1_pingroup,
2357 &i2c3_dis_smi_clcd_pingroup,
2358 &i2c3_dis_sd_i2s0_pingroup,
2359 &i2c_4_5_dis_smi_pingroup,
2360 &i2c4_dis_sd_pingroup,
2361 &i2c5_dis_sd_pingroup,
2362 &i2c_6_7_dis_kbd_pingroup,
2363 &i2c6_dis_sd_pingroup,
2364 &i2c7_dis_sd_pingroup,
2365 &can0_dis_nor_pingroup,
2366 &can0_dis_sd_pingroup,
2367 &can1_dis_sd_pingroup,
2368 &can1_dis_kbd_pingroup,
2376 &ssp1_dis_kbd_pingroup,
2377 &ssp1_dis_sd_pingroup,
2392 &smii_0_1_2_function,
2393 &ras_mii_txclk_function,
2407 &rs485_0_1_tdm_0_1_function,
2422 .pins = spear1310_pins,
2424 .groups = spear1310_pingroups,
2426 .functions = spear1310_functions,
2427 .nfunctions =
ARRAY_SIZE(spear1310_functions),
2428 .modes_supported =
false,
2433 .compatible =
"st,spear1310-pinmux",
2452 .of_match_table = spear1310_pinctrl_of_match,
2454 .probe = spear1310_pinctrl_probe,
2458 static int __init spear1310_pinctrl_init(
void)
2464 static void __exit spear1310_pinctrl_exit(
void)