diff options
-rw-r--r-- | Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt | 279 | ||||
-rw-r--r-- | drivers/pinctrl/Kconfig | 4 | ||||
-rw-r--r-- | drivers/pinctrl/Makefile | 1 | ||||
-rw-r--r-- | drivers/pinctrl/pinctrl-kirkwood.c | 472 |
4 files changed, 756 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt new file mode 100644 index 000000000000..361bccb7ec89 --- /dev/null +++ b/Documentation/devicetree/bindings/pinctrl/marvell,kirkwood-pinctrl.txt | |||
@@ -0,0 +1,279 @@ | |||
1 | * Marvell Kirkwood SoC pinctrl driver for mpp | ||
2 | |||
3 | Please refer to marvell,mvebu-pinctrl.txt in this directory for common binding | ||
4 | part and usage. | ||
5 | |||
6 | Required properties: | ||
7 | - compatible: "marvell,88f6180-pinctrl", | ||
8 | "marvell,88f6190-pinctrl", "marvell,88f6192-pinctrl", | ||
9 | "marvell,88f6281-pinctrl", "marvell,88f6282-pinctrl" | ||
10 | |||
11 | This driver supports all kirkwood variants, i.e. 88f6180, 88f619x, and 88f628x. | ||
12 | |||
13 | Available mpp pins/groups and functions: | ||
14 | Note: brackets (x) are not part of the mpp name for marvell,function and given | ||
15 | only for more detailed description in this document. | ||
16 | |||
17 | * Marvell Kirkwood 88f6180 | ||
18 | |||
19 | name pins functions | ||
20 | ================================================================================ | ||
21 | mpp0 0 gpio, nand(io2), spi(cs) | ||
22 | mpp1 1 gpo, nand(io3), spi(mosi) | ||
23 | mpp2 2 gpo, nand(io4), spi(sck) | ||
24 | mpp3 3 gpo, nand(io5), spi(miso) | ||
25 | mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk) | ||
26 | mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig) | ||
27 | mpp6 6 sysrst(out), spi(mosi), ptp(trig) | ||
28 | mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig) | ||
29 | mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk), | ||
30 | mii(col) | ||
31 | mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq), | ||
32 | mii(crs) | ||
33 | mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig) | ||
34 | mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq), | ||
35 | ptp-2(trig) | ||
36 | mpp12 12 gpo, sdio(clk) | ||
37 | mpp13 13 gpio, sdio(cmd), uart1(txd) | ||
38 | mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col) | ||
39 | mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd) | ||
40 | mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs) | ||
41 | mpp17 17 gpio, sdio(d3) | ||
42 | mpp18 18 gpo, nand(io0) | ||
43 | mpp19 19 gpo, nand(io1) | ||
44 | mpp20 20 gpio, mii(rxerr) | ||
45 | mpp21 21 gpio, audio(spdifi) | ||
46 | mpp22 22 gpio, audio(spdifo) | ||
47 | mpp23 23 gpio, audio(rmclk) | ||
48 | mpp24 24 gpio, audio(bclk) | ||
49 | mpp25 25 gpio, audio(sdo) | ||
50 | mpp26 26 gpio, audio(lrclk) | ||
51 | mpp27 27 gpio, audio(mclk) | ||
52 | mpp28 28 gpio, audio(sdi) | ||
53 | mpp29 29 gpio, audio(extclk) | ||
54 | |||
55 | * Marvell Kirkwood 88f6190 | ||
56 | |||
57 | name pins functions | ||
58 | ================================================================================ | ||
59 | mpp0 0 gpio, nand(io2), spi(cs) | ||
60 | mpp1 1 gpo, nand(io3), spi(mosi) | ||
61 | mpp2 2 gpo, nand(io4), spi(sck) | ||
62 | mpp3 3 gpo, nand(io5), spi(miso) | ||
63 | mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk) | ||
64 | mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig), sata0(act) | ||
65 | mpp6 6 sysrst(out), spi(mosi), ptp(trig) | ||
66 | mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig) | ||
67 | mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk), | ||
68 | mii(col), mii-1(rxerr) | ||
69 | mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq), | ||
70 | mii(crs), sata0(prsnt) | ||
71 | mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig) | ||
72 | mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq), | ||
73 | ptp-2(trig), sata0(act) | ||
74 | mpp12 12 gpo, sdio(clk) | ||
75 | mpp13 13 gpio, sdio(cmd), uart1(txd) | ||
76 | mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col) | ||
77 | mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd), sata0(act) | ||
78 | mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs) | ||
79 | mpp17 17 gpio, sdio(d3), sata0(prsnt) | ||
80 | mpp18 18 gpo, nand(io0) | ||
81 | mpp19 19 gpo, nand(io1) | ||
82 | mpp20 20 gpio, ge1(txd0) | ||
83 | mpp21 21 gpio, ge1(txd1), sata0(act) | ||
84 | mpp22 22 gpio, ge1(txd2) | ||
85 | mpp23 23 gpio, ge1(txd3), sata0(prsnt) | ||
86 | mpp24 24 gpio, ge1(rxd0) | ||
87 | mpp25 25 gpio, ge1(rxd1) | ||
88 | mpp26 26 gpio, ge1(rxd2) | ||
89 | mpp27 27 gpio, ge1(rxd3) | ||
90 | mpp28 28 gpio, ge1(col) | ||
91 | mpp29 29 gpio, ge1(txclk) | ||
92 | mpp30 30 gpio, ge1(rxclk) | ||
93 | mpp31 31 gpio, ge1(rxclk) | ||
94 | mpp32 32 gpio, ge1(txclko) | ||
95 | mpp33 33 gpo, ge1(txclk) | ||
96 | mpp34 34 gpio, ge1(txen) | ||
97 | mpp35 35 gpio, ge1(rxerr), sata0(act), mii(rxerr) | ||
98 | |||
99 | * Marvell Kirkwood 88f6192 | ||
100 | |||
101 | name pins functions | ||
102 | ================================================================================ | ||
103 | mpp0 0 gpio, nand(io2), spi(cs) | ||
104 | mpp1 1 gpo, nand(io3), spi(mosi) | ||
105 | mpp2 2 gpo, nand(io4), spi(sck) | ||
106 | mpp3 3 gpo, nand(io5), spi(miso) | ||
107 | mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk), sata1(act) | ||
108 | mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig), sata0(act) | ||
109 | mpp6 6 sysrst(out), spi(mosi), ptp(trig) | ||
110 | mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig) | ||
111 | mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk), | ||
112 | mii(col), mii-1(rxerr), sata1(prsnt) | ||
113 | mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq), | ||
114 | mii(crs), sata0(prsnt) | ||
115 | mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig), sata1(act) | ||
116 | mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq), | ||
117 | ptp-2(trig), sata0(act) | ||
118 | mpp12 12 gpo, sdio(clk) | ||
119 | mpp13 13 gpio, sdio(cmd), uart1(txd) | ||
120 | mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col), sata1(prsnt) | ||
121 | mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd), sata0(act) | ||
122 | mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs), | ||
123 | sata1(act) | ||
124 | mpp17 17 gpio, sdio(d3), sata0(prsnt) | ||
125 | mpp18 18 gpo, nand(io0) | ||
126 | mpp19 19 gpo, nand(io1) | ||
127 | mpp20 20 gpio, ge1(txd0), ts(mp0), tdm(tx0ql), audio(spdifi), | ||
128 | sata1(act) | ||
129 | mpp21 21 gpio, ge1(txd1), sata0(act), ts(mp1), tdm(rx0ql), | ||
130 | audio(spdifo) | ||
131 | mpp22 22 gpio, ge1(txd2), ts(mp2), tdm(tx2ql), audio(rmclk), | ||
132 | sata1(prsnt) | ||
133 | mpp23 23 gpio, ge1(txd3), sata0(prsnt), ts(mp3), tdm(rx2ql), | ||
134 | audio(bclk) | ||
135 | mpp24 24 gpio, ge1(rxd0), ts(mp4), tdm(spi-cs0), audio(sdo) | ||
136 | mpp25 25 gpio, ge1(rxd1), ts(mp5), tdm(spi-sck), audio(lrclk) | ||
137 | mpp26 26 gpio, ge1(rxd2), ts(mp6), tdm(spi-miso), audio(mclk) | ||
138 | mpp27 27 gpio, ge1(rxd3), ts(mp7), tdm(spi-mosi), audio(sdi) | ||
139 | mpp28 28 gpio, ge1(col), ts(mp8), tdm(int), audio(extclk) | ||
140 | mpp29 29 gpio, ge1(txclk), ts(mp9), tdm(rst) | ||
141 | mpp30 30 gpio, ge1(rxclk), ts(mp10), tdm(pclk) | ||
142 | mpp31 31 gpio, ge1(rxclk), ts(mp11), tdm(fs) | ||
143 | mpp32 32 gpio, ge1(txclko), ts(mp12), tdm(drx) | ||
144 | mpp33 33 gpo, ge1(txclk), tdm(drx) | ||
145 | mpp34 34 gpio, ge1(txen), tdm(spi-cs1) | ||
146 | mpp35 35 gpio, ge1(rxerr), sata0(act), mii(rxerr), tdm(tx0ql) | ||
147 | |||
148 | * Marvell Kirkwood 88f6281 | ||
149 | |||
150 | name pins functions | ||
151 | ================================================================================ | ||
152 | mpp0 0 gpio, nand(io2), spi(cs) | ||
153 | mpp1 1 gpo, nand(io3), spi(mosi) | ||
154 | mpp2 2 gpo, nand(io4), spi(sck) | ||
155 | mpp3 3 gpo, nand(io5), spi(miso) | ||
156 | mpp4 4 gpio, nand(io6), uart0(rxd), ptp(clk), sata1(act) | ||
157 | mpp5 5 gpo, nand(io7), uart0(txd), ptp(trig), sata0(act) | ||
158 | mpp6 6 sysrst(out), spi(mosi), ptp(trig) | ||
159 | mpp7 7 gpo, pex(rsto), spi(cs), ptp(trig) | ||
160 | mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), ptp(clk), | ||
161 | mii(col), mii-1(rxerr), sata1(prsnt) | ||
162 | mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), ptp(evreq), | ||
163 | mii(crs), sata0(prsnt) | ||
164 | mpp10 10 gpo, spi(sck), uart0(txd), ptp(trig), sata1(act) | ||
165 | mpp11 11 gpio, spi(miso), uart0(rxd), ptp(clk), ptp-1(evreq), | ||
166 | ptp-2(trig), sata0(act) | ||
167 | mpp12 12 gpio, sdio(clk) | ||
168 | mpp13 13 gpio, sdio(cmd), uart1(txd) | ||
169 | mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col), sata1(prsnt) | ||
170 | mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd), sata0(act) | ||
171 | mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs), | ||
172 | sata1(act) | ||
173 | mpp17 17 gpio, sdio(d3), sata0(prsnt) | ||
174 | mpp18 18 gpo, nand(io0) | ||
175 | mpp19 19 gpo, nand(io1) | ||
176 | mpp20 20 gpio, ge1(txd0), ts(mp0), tdm(tx0ql), audio(spdifi), | ||
177 | sata1(act) | ||
178 | mpp21 21 gpio, ge1(txd1), sata0(act), ts(mp1), tdm(rx0ql), | ||
179 | audio(spdifo) | ||
180 | mpp22 22 gpio, ge1(txd2), ts(mp2), tdm(tx2ql), audio(rmclk), | ||
181 | sata1(prsnt) | ||
182 | mpp23 23 gpio, ge1(txd3), sata0(prsnt), ts(mp3), tdm(rx2ql), | ||
183 | audio(bclk) | ||
184 | mpp24 24 gpio, ge1(rxd0), ts(mp4), tdm(spi-cs0), audio(sdo) | ||
185 | mpp25 25 gpio, ge1(rxd1), ts(mp5), tdm(spi-sck), audio(lrclk) | ||
186 | mpp26 26 gpio, ge1(rxd2), ts(mp6), tdm(spi-miso), audio(mclk) | ||
187 | mpp27 27 gpio, ge1(rxd3), ts(mp7), tdm(spi-mosi), audio(sdi) | ||
188 | mpp28 28 gpio, ge1(col), ts(mp8), tdm(int), audio(extclk) | ||
189 | mpp29 29 gpio, ge1(txclk), ts(mp9), tdm(rst) | ||
190 | mpp30 30 gpio, ge1(rxclk), ts(mp10), tdm(pclk) | ||
191 | mpp31 31 gpio, ge1(rxclk), ts(mp11), tdm(fs) | ||
192 | mpp32 32 gpio, ge1(txclko), ts(mp12), tdm(drx) | ||
193 | mpp33 33 gpo, ge1(txclk), tdm(drx) | ||
194 | mpp34 34 gpio, ge1(txen), tdm(spi-cs1), sata1(act) | ||
195 | mpp35 35 gpio, ge1(rxerr), sata0(act), mii(rxerr), tdm(tx0ql) | ||
196 | mpp36 36 gpio, ts(mp0), tdm(spi-cs1), audio(spdifi) | ||
197 | mpp37 37 gpio, ts(mp1), tdm(tx2ql), audio(spdifo) | ||
198 | mpp38 38 gpio, ts(mp2), tdm(rx2ql), audio(rmclk) | ||
199 | mpp39 39 gpio, ts(mp3), tdm(spi-cs0), audio(bclk) | ||
200 | mpp40 40 gpio, ts(mp4), tdm(spi-sck), audio(sdo) | ||
201 | mpp41 41 gpio, ts(mp5), tdm(spi-miso), audio(lrclk) | ||
202 | mpp42 42 gpio, ts(mp6), tdm(spi-mosi), audio(mclk) | ||
203 | mpp43 43 gpio, ts(mp7), tdm(int), audio(sdi) | ||
204 | mpp44 44 gpio, ts(mp8), tdm(rst), audio(extclk) | ||
205 | mpp45 45 gpio, ts(mp9), tdm(pclk) | ||
206 | mpp46 46 gpio, ts(mp10), tdm(fs) | ||
207 | mpp47 47 gpio, ts(mp11), tdm(drx) | ||
208 | mpp48 48 gpio, ts(mp12), tdm(dtx) | ||
209 | mpp49 49 gpio, ts(mp9), tdm(rx0ql), ptp(clk) | ||
210 | |||
211 | * Marvell Kirkwood 88f6282 | ||
212 | |||
213 | name pins functions | ||
214 | ================================================================================ | ||
215 | mpp0 0 gpio, nand(io2), spi(cs) | ||
216 | mpp1 1 gpo, nand(io3), spi(mosi) | ||
217 | mpp2 2 gpo, nand(io4), spi(sck) | ||
218 | mpp3 3 gpo, nand(io5), spi(miso) | ||
219 | mpp4 4 gpio, nand(io6), uart0(rxd), sata1(act), lcd(hsync) | ||
220 | mpp5 5 gpo, nand(io7), uart0(txd), sata0(act), lcd(vsync) | ||
221 | mpp6 6 sysrst(out), spi(mosi) | ||
222 | mpp7 7 gpo, spi(cs), lcd(pwm) | ||
223 | mpp8 8 gpio, twsi0(sda), uart0(rts), uart1(rts), mii(col), | ||
224 | mii-1(rxerr), sata1(prsnt) | ||
225 | mpp9 9 gpio, twsi(sck), uart0(cts), uart1(cts), mii(crs), | ||
226 | sata0(prsnt) | ||
227 | mpp10 10 gpo, spi(sck), uart0(txd), sata1(act) | ||
228 | mpp11 11 gpio, spi(miso), uart0(rxd), sata0(act) | ||
229 | mpp12 12 gpo, sdio(clk), audio(spdifo), spi(mosi), twsi(sda) | ||
230 | mpp13 13 gpio, sdio(cmd), uart1(txd), audio(rmclk), lcd(pwm) | ||
231 | mpp14 14 gpio, sdio(d0), uart1(rxd), mii(col), sata1(prsnt), | ||
232 | audio(spdifi), audio-1(sdi) | ||
233 | mpp15 15 gpio, sdio(d1), uart0(rts), uart1(txd), sata0(act), | ||
234 | spi(cs) | ||
235 | mpp16 16 gpio, sdio(d2), uart0(cts), uart1(rxd), mii(crs), | ||
236 | sata1(act), lcd(extclk) | ||
237 | mpp17 17 gpio, sdio(d3), sata0(prsnt), sata1(act), twsi1(sck) | ||
238 | mpp18 18 gpo, nand(io0), pex(clkreq) | ||
239 | mpp19 19 gpo, nand(io1) | ||
240 | mpp20 20 gpio, ge1(txd0), ts(mp0), tdm(tx0ql), audio(spdifi), | ||
241 | sata1(act), lcd(d0) | ||
242 | mpp21 21 gpio, ge1(txd1), sata0(act), ts(mp1), tdm(rx0ql), | ||
243 | audio(spdifo), lcd(d1) | ||
244 | mpp22 22 gpio, ge1(txd2), ts(mp2), tdm(tx2ql), audio(rmclk), | ||
245 | sata1(prsnt), lcd(d2) | ||
246 | mpp23 23 gpio, ge1(txd3), sata0(prsnt), ts(mp3), tdm(rx2ql), | ||
247 | audio(bclk), lcd(d3) | ||
248 | mpp24 24 gpio, ge1(rxd0), ts(mp4), tdm(spi-cs0), audio(sdo), | ||
249 | lcd(d4) | ||
250 | mpp25 25 gpio, ge1(rxd1), ts(mp5), tdm(spi-sck), audio(lrclk), | ||
251 | lcd(d5) | ||
252 | mpp26 26 gpio, ge1(rxd2), ts(mp6), tdm(spi-miso), audio(mclk), | ||
253 | lcd(d6) | ||
254 | mpp27 27 gpio, ge1(rxd3), ts(mp7), tdm(spi-mosi), audio(sdi), | ||
255 | lcd(d7) | ||
256 | mpp28 28 gpio, ge1(col), ts(mp8), tdm(int), audio(extclk), | ||
257 | lcd(d8) | ||
258 | mpp29 29 gpio, ge1(txclk), ts(mp9), tdm(rst), lcd(d9) | ||
259 | mpp30 30 gpio, ge1(rxclk), ts(mp10), tdm(pclk), lcd(d10) | ||
260 | mpp31 31 gpio, ge1(rxclk), ts(mp11), tdm(fs), lcd(d11) | ||
261 | mpp32 32 gpio, ge1(txclko), ts(mp12), tdm(drx), lcd(d12) | ||
262 | mpp33 33 gpo, ge1(txclk), tdm(drx), lcd(d13) | ||
263 | mpp34 34 gpio, ge1(txen), tdm(spi-cs1), sata1(act), lcd(d14) | ||
264 | mpp35 35 gpio, ge1(rxerr), sata0(act), mii(rxerr), tdm(tx0ql), | ||
265 | lcd(d15) | ||
266 | mpp36 36 gpio, ts(mp0), tdm(spi-cs1), audio(spdifi), twsi1(sda) | ||
267 | mpp37 37 gpio, ts(mp1), tdm(tx2ql), audio(spdifo), twsi1(sck) | ||
268 | mpp38 38 gpio, ts(mp2), tdm(rx2ql), audio(rmclk), lcd(d18) | ||
269 | mpp39 39 gpio, ts(mp3), tdm(spi-cs0), audio(bclk), lcd(d19) | ||
270 | mpp40 40 gpio, ts(mp4), tdm(spi-sck), audio(sdo), lcd(d20) | ||
271 | mpp41 41 gpio, ts(mp5), tdm(spi-miso), audio(lrclk), lcd(d21) | ||
272 | mpp42 42 gpio, ts(mp6), tdm(spi-mosi), audio(mclk), lcd(d22) | ||
273 | mpp43 43 gpio, ts(mp7), tdm(int), audio(sdi), lcd(d23) | ||
274 | mpp44 44 gpio, ts(mp8), tdm(rst), audio(extclk), lcd(clk) | ||
275 | mpp45 45 gpio, ts(mp9), tdm(pclk), lcd(e) | ||
276 | mpp46 46 gpio, ts(mp10), tdm(fs), lcd(hsync) | ||
277 | mpp47 47 gpio, ts(mp11), tdm(drx), lcd(vsync) | ||
278 | mpp48 48 gpio, ts(mp12), tdm(dtx), lcd(d16) | ||
279 | mpp49 49 gpo, tdm(rx0ql), pex(clkreq), lcd(d17) | ||
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig index f15eba4a5599..31c0bbaaf373 100644 --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig | |||
@@ -155,6 +155,10 @@ config PINCTRL_DOVE | |||
155 | bool | 155 | bool |
156 | select PINCTRL_MVEBU | 156 | select PINCTRL_MVEBU |
157 | 157 | ||
158 | config PINCTRL_KIRKWOOD | ||
159 | bool | ||
160 | select PINCTRL_MVEBU | ||
161 | |||
158 | source "drivers/pinctrl/spear/Kconfig" | 162 | source "drivers/pinctrl/spear/Kconfig" |
159 | 163 | ||
160 | endmenu | 164 | endmenu |
diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile index d1327dfaeecd..300629465203 100644 --- a/drivers/pinctrl/Makefile +++ b/drivers/pinctrl/Makefile | |||
@@ -31,5 +31,6 @@ obj-$(CONFIG_PINCTRL_U300) += pinctrl-u300.o | |||
31 | obj-$(CONFIG_PINCTRL_COH901) += pinctrl-coh901.o | 31 | obj-$(CONFIG_PINCTRL_COH901) += pinctrl-coh901.o |
32 | obj-$(CONFIG_PINCTRL_MVEBU) += pinctrl-mvebu.o | 32 | obj-$(CONFIG_PINCTRL_MVEBU) += pinctrl-mvebu.o |
33 | obj-$(CONFIG_PINCTRL_DOVE) += pinctrl-dove.o | 33 | obj-$(CONFIG_PINCTRL_DOVE) += pinctrl-dove.o |
34 | obj-$(CONFIG_PINCTRL_KIRKWOOD) += pinctrl-kirkwood.o | ||
34 | 35 | ||
35 | obj-$(CONFIG_PLAT_SPEAR) += spear/ | 36 | obj-$(CONFIG_PLAT_SPEAR) += spear/ |
diff --git a/drivers/pinctrl/pinctrl-kirkwood.c b/drivers/pinctrl/pinctrl-kirkwood.c new file mode 100644 index 000000000000..9a74ef674a0e --- /dev/null +++ b/drivers/pinctrl/pinctrl-kirkwood.c | |||
@@ -0,0 +1,472 @@ | |||
1 | /* | ||
2 | * Marvell Kirkwood pinctrl driver based on mvebu pinctrl core | ||
3 | * | ||
4 | * Author: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #include <linux/err.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/io.h> | ||
15 | #include <linux/module.h> | ||
16 | #include <linux/platform_device.h> | ||
17 | #include <linux/clk.h> | ||
18 | #include <linux/of.h> | ||
19 | #include <linux/of_device.h> | ||
20 | #include <linux/pinctrl/pinctrl.h> | ||
21 | |||
22 | #include "pinctrl-mvebu.h" | ||
23 | |||
24 | #define V(f6180, f6190, f6192, f6281, f6282) \ | ||
25 | ((f6180 << 0) | (f6190 << 1) | (f6192 << 2) | \ | ||
26 | (f6281 << 3) | (f6282 << 4)) | ||
27 | |||
28 | enum kirkwood_variant { | ||
29 | VARIANT_MV88F6180 = V(1, 0, 0, 0, 0), | ||
30 | VARIANT_MV88F6190 = V(0, 1, 0, 0, 0), | ||
31 | VARIANT_MV88F6192 = V(0, 0, 1, 0, 0), | ||
32 | VARIANT_MV88F6281 = V(0, 0, 0, 1, 0), | ||
33 | VARIANT_MV88F6282 = V(0, 0, 0, 0, 1), | ||
34 | }; | ||
35 | |||
36 | static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = { | ||
37 | MPP_MODE(0, | ||
38 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
39 | MPP_VAR_FUNCTION(0x1, "nand", "io2", V(1, 1, 1, 1, 1)), | ||
40 | MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1))), | ||
41 | MPP_MODE(1, | ||
42 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)), | ||
43 | MPP_VAR_FUNCTION(0x1, "nand", "io3", V(1, 1, 1, 1, 1)), | ||
44 | MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1))), | ||
45 | MPP_MODE(2, | ||
46 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)), | ||
47 | MPP_VAR_FUNCTION(0x1, "nand", "io4", V(1, 1, 1, 1, 1)), | ||
48 | MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1))), | ||
49 | MPP_MODE(3, | ||
50 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)), | ||
51 | MPP_VAR_FUNCTION(0x1, "nand", "io5", V(1, 1, 1, 1, 1)), | ||
52 | MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1))), | ||
53 | MPP_MODE(4, | ||
54 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
55 | MPP_VAR_FUNCTION(0x1, "nand", "io6", V(1, 1, 1, 1, 1)), | ||
56 | MPP_VAR_FUNCTION(0x2, "uart0", "rxd", V(1, 1, 1, 1, 1)), | ||
57 | MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1)), | ||
58 | MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1)), | ||
59 | MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0))), | ||
60 | MPP_MODE(5, | ||
61 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)), | ||
62 | MPP_VAR_FUNCTION(0x1, "nand", "io7", V(1, 1, 1, 1, 1)), | ||
63 | MPP_VAR_FUNCTION(0x2, "uart0", "txd", V(1, 1, 1, 1, 1)), | ||
64 | MPP_VAR_FUNCTION(0x4, "ptp", "trig", V(1, 1, 1, 1, 0)), | ||
65 | MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1)), | ||
66 | MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1))), | ||
67 | MPP_MODE(6, | ||
68 | MPP_VAR_FUNCTION(0x0, "sysrst", "out", V(1, 1, 1, 1, 1)), | ||
69 | MPP_VAR_FUNCTION(0x1, "spi", "mosi", V(1, 1, 1, 1, 1)), | ||
70 | MPP_VAR_FUNCTION(0x2, "ptp", "trig", V(1, 1, 1, 1, 0))), | ||
71 | MPP_MODE(7, | ||
72 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)), | ||
73 | MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0)), | ||
74 | MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1)), | ||
75 | MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0)), | ||
76 | MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1))), | ||
77 | MPP_MODE(8, | ||
78 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
79 | MPP_VAR_FUNCTION(0x1, "twsi0", "sda", V(1, 1, 1, 1, 1)), | ||
80 | MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1)), | ||
81 | MPP_VAR_FUNCTION(0x3, "uart1", "rts", V(1, 1, 1, 1, 1)), | ||
82 | MPP_VAR_FUNCTION(0x4, "mii-1", "rxerr", V(0, 1, 1, 1, 1)), | ||
83 | MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1)), | ||
84 | MPP_VAR_FUNCTION(0xc, "ptp", "clk", V(1, 1, 1, 1, 0)), | ||
85 | MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1))), | ||
86 | MPP_MODE(9, | ||
87 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
88 | MPP_VAR_FUNCTION(0x1, "twsi0", "sck", V(1, 1, 1, 1, 1)), | ||
89 | MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1)), | ||
90 | MPP_VAR_FUNCTION(0x3, "uart1", "cts", V(1, 1, 1, 1, 1)), | ||
91 | MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1)), | ||
92 | MPP_VAR_FUNCTION(0xc, "ptp", "evreq", V(1, 1, 1, 1, 0)), | ||
93 | MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1))), | ||
94 | MPP_MODE(10, | ||
95 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)), | ||
96 | MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1)), | ||
97 | MPP_VAR_FUNCTION(0X3, "uart0", "txd", V(1, 1, 1, 1, 1)), | ||
98 | MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1)), | ||
99 | MPP_VAR_FUNCTION(0xc, "ptp", "trig", V(1, 1, 1, 1, 0))), | ||
100 | MPP_MODE(11, | ||
101 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
102 | MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1)), | ||
103 | MPP_VAR_FUNCTION(0x3, "uart0", "rxd", V(1, 1, 1, 1, 1)), | ||
104 | MPP_VAR_FUNCTION(0x4, "ptp-1", "evreq", V(1, 1, 1, 1, 0)), | ||
105 | MPP_VAR_FUNCTION(0xc, "ptp-2", "trig", V(1, 1, 1, 1, 0)), | ||
106 | MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0)), | ||
107 | MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1))), | ||
108 | MPP_MODE(12, | ||
109 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 0, 1)), | ||
110 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0)), | ||
111 | MPP_VAR_FUNCTION(0x1, "sdio", "clk", V(1, 1, 1, 1, 1)), | ||
112 | MPP_VAR_FUNCTION(0xa, "audio", "spdifo", V(0, 0, 0, 0, 1)), | ||
113 | MPP_VAR_FUNCTION(0xb, "spi", "mosi", V(0, 0, 0, 0, 1)), | ||
114 | MPP_VAR_FUNCTION(0xd, "twsi1", "sda", V(0, 0, 0, 0, 1))), | ||
115 | MPP_MODE(13, | ||
116 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
117 | MPP_VAR_FUNCTION(0x1, "sdio", "cmd", V(1, 1, 1, 1, 1)), | ||
118 | MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1)), | ||
119 | MPP_VAR_FUNCTION(0xa, "audio", "rmclk", V(0, 0, 0, 0, 1)), | ||
120 | MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1))), | ||
121 | MPP_MODE(14, | ||
122 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
123 | MPP_VAR_FUNCTION(0x1, "sdio", "d0", V(1, 1, 1, 1, 1)), | ||
124 | MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1)), | ||
125 | MPP_VAR_FUNCTION(0x4, "sata1", "prsnt", V(0, 0, 1, 1, 1)), | ||
126 | MPP_VAR_FUNCTION(0xa, "audio", "spdifi", V(0, 0, 0, 0, 1)), | ||
127 | MPP_VAR_FUNCTION(0xb, "audio-1", "sdi", V(0, 0, 0, 0, 1)), | ||
128 | MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1))), | ||
129 | MPP_MODE(15, | ||
130 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
131 | MPP_VAR_FUNCTION(0x1, "sdio", "d1", V(1, 1, 1, 1, 1)), | ||
132 | MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1)), | ||
133 | MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1)), | ||
134 | MPP_VAR_FUNCTION(0x4, "sata0", "act", V(0, 1, 1, 1, 1)), | ||
135 | MPP_VAR_FUNCTION(0xb, "spi", "cs", V(0, 0, 0, 0, 1))), | ||
136 | MPP_MODE(16, | ||
137 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
138 | MPP_VAR_FUNCTION(0x1, "sdio", "d2", V(1, 1, 1, 1, 1)), | ||
139 | MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1)), | ||
140 | MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1)), | ||
141 | MPP_VAR_FUNCTION(0x4, "sata1", "act", V(0, 0, 1, 1, 1)), | ||
142 | MPP_VAR_FUNCTION(0xb, "lcd", "extclk", V(0, 0, 0, 0, 1)), | ||
143 | MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1))), | ||
144 | MPP_MODE(17, | ||
145 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
146 | MPP_VAR_FUNCTION(0x1, "sdio", "d3", V(1, 1, 1, 1, 1)), | ||
147 | MPP_VAR_FUNCTION(0x4, "sata0", "prsnt", V(0, 1, 1, 1, 1)), | ||
148 | MPP_VAR_FUNCTION(0xa, "sata1", "act", V(0, 0, 0, 0, 1)), | ||
149 | MPP_VAR_FUNCTION(0xd, "twsi1", "sck", V(0, 0, 0, 0, 1))), | ||
150 | MPP_MODE(18, | ||
151 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)), | ||
152 | MPP_VAR_FUNCTION(0x1, "nand", "io0", V(1, 1, 1, 1, 1)), | ||
153 | MPP_VAR_FUNCTION(0x2, "pex", "clkreq", V(0, 0, 0, 0, 1))), | ||
154 | MPP_MODE(19, | ||
155 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1)), | ||
156 | MPP_VAR_FUNCTION(0x1, "nand", "io1", V(1, 1, 1, 1, 1))), | ||
157 | MPP_MODE(20, | ||
158 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
159 | MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 1, 1, 1)), | ||
160 | MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1)), | ||
161 | MPP_VAR_FUNCTION(0x3, "ge1", "txd0", V(0, 1, 1, 1, 1)), | ||
162 | MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 1, 1, 1)), | ||
163 | MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1)), | ||
164 | MPP_VAR_FUNCTION(0xb, "lcd", "d0", V(0, 0, 0, 0, 1)), | ||
165 | MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(1, 0, 0, 0, 0))), | ||
166 | MPP_MODE(21, | ||
167 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
168 | MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 1, 1, 1)), | ||
169 | MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 1, 1, 1)), | ||
170 | MPP_VAR_FUNCTION(0x3, "ge1", "txd1", V(0, 1, 1, 1, 1)), | ||
171 | MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(1, 0, 0, 0, 0)), | ||
172 | MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 1, 1, 1)), | ||
173 | MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1)), | ||
174 | MPP_VAR_FUNCTION(0xb, "lcd", "d1", V(0, 0, 0, 0, 1))), | ||
175 | MPP_MODE(22, | ||
176 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
177 | MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 1, 1, 1)), | ||
178 | MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 1, 1, 1)), | ||
179 | MPP_VAR_FUNCTION(0x3, "ge1", "txd2", V(0, 1, 1, 1, 1)), | ||
180 | MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(1, 0, 0, 0, 0)), | ||
181 | MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 1, 1, 1)), | ||
182 | MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1)), | ||
183 | MPP_VAR_FUNCTION(0xb, "lcd", "d2", V(0, 0, 0, 0, 1))), | ||
184 | MPP_MODE(23, | ||
185 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
186 | MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 1, 1, 1)), | ||
187 | MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 1, 1, 1)), | ||
188 | MPP_VAR_FUNCTION(0x3, "ge1", "txd3", V(0, 1, 1, 1, 1)), | ||
189 | MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(1, 0, 0, 0, 0)), | ||
190 | MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 1, 1, 1)), | ||
191 | MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1)), | ||
192 | MPP_VAR_FUNCTION(0xb, "lcd", "d3", V(0, 0, 0, 0, 1))), | ||
193 | MPP_MODE(24, | ||
194 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
195 | MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 1, 1, 1)), | ||
196 | MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 1, 1, 1)), | ||
197 | MPP_VAR_FUNCTION(0x3, "ge1", "rxd0", V(0, 1, 1, 1, 1)), | ||
198 | MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(1, 0, 0, 0, 0)), | ||
199 | MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 1, 1, 1)), | ||
200 | MPP_VAR_FUNCTION(0xb, "lcd", "d4", V(0, 0, 0, 0, 1))), | ||
201 | MPP_MODE(25, | ||
202 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
203 | MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 1, 1, 1)), | ||
204 | MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 1, 1, 1)), | ||
205 | MPP_VAR_FUNCTION(0x3, "ge1", "rxd1", V(0, 1, 1, 1, 1)), | ||
206 | MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(1, 0, 0, 0, 0)), | ||
207 | MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 1, 1, 1)), | ||
208 | MPP_VAR_FUNCTION(0xb, "lcd", "d5", V(0, 0, 0, 0, 1))), | ||
209 | MPP_MODE(26, | ||
210 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
211 | MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 1, 1, 1)), | ||
212 | MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 1, 1, 1)), | ||
213 | MPP_VAR_FUNCTION(0x3, "ge1", "rxd2", V(0, 1, 1, 1, 1)), | ||
214 | MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(1, 0, 0, 0, 0)), | ||
215 | MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 1, 1, 1)), | ||
216 | MPP_VAR_FUNCTION(0xb, "lcd", "d6", V(0, 0, 0, 0, 1))), | ||
217 | MPP_MODE(27, | ||
218 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
219 | MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 1, 1, 1)), | ||
220 | MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 1, 1, 1)), | ||
221 | MPP_VAR_FUNCTION(0x3, "ge1", "rxd3", V(0, 1, 1, 1, 1)), | ||
222 | MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(1, 0, 0, 0, 0)), | ||
223 | MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 1, 1, 1)), | ||
224 | MPP_VAR_FUNCTION(0xb, "lcd", "d7", V(0, 0, 0, 0, 1))), | ||
225 | MPP_MODE(28, | ||
226 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
227 | MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 1, 1, 1)), | ||
228 | MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 1, 1, 1)), | ||
229 | MPP_VAR_FUNCTION(0x3, "ge1", "col", V(0, 1, 1, 1, 1)), | ||
230 | MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(1, 0, 0, 0, 0)), | ||
231 | MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 1, 1, 1)), | ||
232 | MPP_VAR_FUNCTION(0xb, "lcd", "d8", V(0, 0, 0, 0, 1))), | ||
233 | MPP_MODE(29, | ||
234 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1)), | ||
235 | MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 1, 1, 1)), | ||
236 | MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 1, 1, 1)), | ||
237 | MPP_VAR_FUNCTION(0x3, "ge1", "txclk", V(0, 1, 1, 1, 1)), | ||
238 | MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(1, 0, 0, 0, 0)), | ||
239 | MPP_VAR_FUNCTION(0xb, "lcd", "d9", V(0, 0, 0, 0, 1))), | ||
240 | MPP_MODE(30, | ||
241 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1)), | ||
242 | MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 1, 1, 1)), | ||
243 | MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 1, 1, 1)), | ||
244 | MPP_VAR_FUNCTION(0x3, "ge1", "rxctl", V(0, 1, 1, 1, 1)), | ||
245 | MPP_VAR_FUNCTION(0xb, "lcd", "d10", V(0, 0, 0, 0, 1))), | ||
246 | MPP_MODE(31, | ||
247 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1)), | ||
248 | MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 1, 1, 1)), | ||
249 | MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 1, 1, 1)), | ||
250 | MPP_VAR_FUNCTION(0x3, "ge1", "rxclk", V(0, 1, 1, 1, 1)), | ||
251 | MPP_VAR_FUNCTION(0xb, "lcd", "d11", V(0, 0, 0, 0, 1))), | ||
252 | MPP_MODE(32, | ||
253 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1)), | ||
254 | MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 1, 1, 1)), | ||
255 | MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 1, 1, 1)), | ||
256 | MPP_VAR_FUNCTION(0x3, "ge1", "txclko", V(0, 1, 1, 1, 1)), | ||
257 | MPP_VAR_FUNCTION(0xb, "lcd", "d12", V(0, 0, 0, 0, 1))), | ||
258 | MPP_MODE(33, | ||
259 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 1, 1, 1, 1)), | ||
260 | MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 1, 1, 1)), | ||
261 | MPP_VAR_FUNCTION(0x3, "ge1", "txctl", V(0, 1, 1, 1, 1)), | ||
262 | MPP_VAR_FUNCTION(0xb, "lcd", "d13", V(0, 0, 0, 0, 1))), | ||
263 | MPP_MODE(34, | ||
264 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1)), | ||
265 | MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 1, 1, 1)), | ||
266 | MPP_VAR_FUNCTION(0x3, "ge1", "txen", V(0, 1, 1, 1, 1)), | ||
267 | MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 0, 1, 1)), | ||
268 | MPP_VAR_FUNCTION(0xb, "lcd", "d14", V(0, 0, 0, 0, 1))), | ||
269 | MPP_MODE(35, | ||
270 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1)), | ||
271 | MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1)), | ||
272 | MPP_VAR_FUNCTION(0x3, "ge1", "rxerr", V(0, 1, 1, 1, 1)), | ||
273 | MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1)), | ||
274 | MPP_VAR_FUNCTION(0xb, "lcd", "d15", V(0, 0, 0, 0, 1)), | ||
275 | MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(0, 1, 1, 1, 1))), | ||
276 | MPP_MODE(36, | ||
277 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
278 | MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 0, 1, 1)), | ||
279 | MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 0, 1, 1)), | ||
280 | MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 0, 1, 1)), | ||
281 | MPP_VAR_FUNCTION(0xb, "twsi1", "sda", V(0, 0, 0, 0, 1))), | ||
282 | MPP_MODE(37, | ||
283 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
284 | MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 0, 1, 1)), | ||
285 | MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 0, 1, 1)), | ||
286 | MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 0, 1, 1)), | ||
287 | MPP_VAR_FUNCTION(0xb, "twsi1", "sck", V(0, 0, 0, 0, 1))), | ||
288 | MPP_MODE(38, | ||
289 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
290 | MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 0, 1, 1)), | ||
291 | MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 0, 1, 1)), | ||
292 | MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 0, 1, 1)), | ||
293 | MPP_VAR_FUNCTION(0xb, "lcd", "d18", V(0, 0, 0, 0, 1))), | ||
294 | MPP_MODE(39, | ||
295 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
296 | MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 0, 1, 1)), | ||
297 | MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 0, 1, 1)), | ||
298 | MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 0, 1, 1)), | ||
299 | MPP_VAR_FUNCTION(0xb, "lcd", "d19", V(0, 0, 0, 0, 1))), | ||
300 | MPP_MODE(40, | ||
301 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
302 | MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 0, 1, 1)), | ||
303 | MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 0, 1, 1)), | ||
304 | MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 0, 1, 1)), | ||
305 | MPP_VAR_FUNCTION(0xb, "lcd", "d20", V(0, 0, 0, 0, 1))), | ||
306 | MPP_MODE(41, | ||
307 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
308 | MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 0, 1, 1)), | ||
309 | MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 0, 1, 1)), | ||
310 | MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 0, 1, 1)), | ||
311 | MPP_VAR_FUNCTION(0xb, "lcd", "d21", V(0, 0, 0, 0, 1))), | ||
312 | MPP_MODE(42, | ||
313 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
314 | MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 0, 1, 1)), | ||
315 | MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 0, 1, 1)), | ||
316 | MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 0, 1, 1)), | ||
317 | MPP_VAR_FUNCTION(0xb, "lcd", "d22", V(0, 0, 0, 0, 1))), | ||
318 | MPP_MODE(43, | ||
319 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
320 | MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 0, 1, 1)), | ||
321 | MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 0, 1, 1)), | ||
322 | MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 0, 1, 1)), | ||
323 | MPP_VAR_FUNCTION(0xb, "lcd", "d23", V(0, 0, 0, 0, 1))), | ||
324 | MPP_MODE(44, | ||
325 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
326 | MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 0, 1, 1)), | ||
327 | MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 0, 1, 1)), | ||
328 | MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 0, 1, 1)), | ||
329 | MPP_VAR_FUNCTION(0xb, "lcd", "clk", V(0, 0, 0, 0, 1))), | ||
330 | MPP_MODE(45, | ||
331 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
332 | MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 1)), | ||
333 | MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 0, 1, 1)), | ||
334 | MPP_VAR_FUNCTION(0xb, "lcd", "e", V(0, 0, 0, 0, 1))), | ||
335 | MPP_MODE(46, | ||
336 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
337 | MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 0, 1, 1)), | ||
338 | MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 0, 1, 1)), | ||
339 | MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1))), | ||
340 | MPP_MODE(47, | ||
341 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
342 | MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 0, 1, 1)), | ||
343 | MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 0, 1, 1)), | ||
344 | MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1))), | ||
345 | MPP_MODE(48, | ||
346 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1)), | ||
347 | MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 0, 1, 1)), | ||
348 | MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 0, 1, 1)), | ||
349 | MPP_VAR_FUNCTION(0xb, "lcd", "d16", V(0, 0, 0, 0, 1))), | ||
350 | MPP_MODE(49, | ||
351 | MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0)), | ||
352 | MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 0, 0, 0, 1)), | ||
353 | MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 0)), | ||
354 | MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 0, 1, 1)), | ||
355 | MPP_VAR_FUNCTION(0x5, "ptp", "clk", V(0, 0, 0, 1, 0)), | ||
356 | MPP_VAR_FUNCTION(0xa, "pex", "clkreq", V(0, 0, 0, 0, 1)), | ||
357 | MPP_VAR_FUNCTION(0xb, "lcd", "d17", V(0, 0, 0, 0, 1))), | ||
358 | }; | ||
359 | |||
360 | static struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = { | ||
361 | MPP_REG_CTRL(0, 29), | ||
362 | }; | ||
363 | |||
364 | static struct pinctrl_gpio_range mv88f6180_gpio_ranges[] = { | ||
365 | MPP_GPIO_RANGE(0, 0, 0, 30), | ||
366 | }; | ||
367 | |||
368 | static struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = { | ||
369 | MPP_REG_CTRL(0, 35), | ||
370 | }; | ||
371 | |||
372 | static struct pinctrl_gpio_range mv88f619x_gpio_ranges[] = { | ||
373 | MPP_GPIO_RANGE(0, 0, 0, 32), | ||
374 | MPP_GPIO_RANGE(1, 32, 32, 4), | ||
375 | }; | ||
376 | |||
377 | static struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = { | ||
378 | MPP_REG_CTRL(0, 49), | ||
379 | }; | ||
380 | |||
381 | static struct pinctrl_gpio_range mv88f628x_gpio_ranges[] = { | ||
382 | MPP_GPIO_RANGE(0, 0, 0, 32), | ||
383 | MPP_GPIO_RANGE(1, 32, 32, 18), | ||
384 | }; | ||
385 | |||
386 | static struct mvebu_pinctrl_soc_info mv88f6180_info = { | ||
387 | .variant = VARIANT_MV88F6180, | ||
388 | .controls = mv88f6180_mpp_controls, | ||
389 | .ncontrols = ARRAY_SIZE(mv88f6180_mpp_controls), | ||
390 | .modes = mv88f6xxx_mpp_modes, | ||
391 | .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes), | ||
392 | .gpioranges = mv88f6180_gpio_ranges, | ||
393 | .ngpioranges = ARRAY_SIZE(mv88f6180_gpio_ranges), | ||
394 | }; | ||
395 | |||
396 | static struct mvebu_pinctrl_soc_info mv88f6190_info = { | ||
397 | .variant = VARIANT_MV88F6190, | ||
398 | .controls = mv88f619x_mpp_controls, | ||
399 | .ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls), | ||
400 | .modes = mv88f6xxx_mpp_modes, | ||
401 | .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes), | ||
402 | .gpioranges = mv88f619x_gpio_ranges, | ||
403 | .ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges), | ||
404 | }; | ||
405 | |||
406 | static struct mvebu_pinctrl_soc_info mv88f6192_info = { | ||
407 | .variant = VARIANT_MV88F6192, | ||
408 | .controls = mv88f619x_mpp_controls, | ||
409 | .ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls), | ||
410 | .modes = mv88f6xxx_mpp_modes, | ||
411 | .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes), | ||
412 | .gpioranges = mv88f619x_gpio_ranges, | ||
413 | .ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges), | ||
414 | }; | ||
415 | |||
416 | static struct mvebu_pinctrl_soc_info mv88f6281_info = { | ||
417 | .variant = VARIANT_MV88F6281, | ||
418 | .controls = mv88f628x_mpp_controls, | ||
419 | .ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls), | ||
420 | .modes = mv88f6xxx_mpp_modes, | ||
421 | .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes), | ||
422 | .gpioranges = mv88f628x_gpio_ranges, | ||
423 | .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges), | ||
424 | }; | ||
425 | |||
426 | static struct mvebu_pinctrl_soc_info mv88f6282_info = { | ||
427 | .variant = VARIANT_MV88F6282, | ||
428 | .controls = mv88f628x_mpp_controls, | ||
429 | .ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls), | ||
430 | .modes = mv88f6xxx_mpp_modes, | ||
431 | .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes), | ||
432 | .gpioranges = mv88f628x_gpio_ranges, | ||
433 | .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges), | ||
434 | }; | ||
435 | |||
436 | static struct of_device_id kirkwood_pinctrl_of_match[] __devinitdata = { | ||
437 | { .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info }, | ||
438 | { .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info }, | ||
439 | { .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info }, | ||
440 | { .compatible = "marvell,88f6281-pinctrl", .data = &mv88f6281_info }, | ||
441 | { .compatible = "marvell,88f6282-pinctrl", .data = &mv88f6282_info }, | ||
442 | { } | ||
443 | }; | ||
444 | |||
445 | static int __devinit kirkwood_pinctrl_probe(struct platform_device *pdev) | ||
446 | { | ||
447 | const struct of_device_id *match = | ||
448 | of_match_device(kirkwood_pinctrl_of_match, &pdev->dev); | ||
449 | pdev->dev.platform_data = match->data; | ||
450 | return mvebu_pinctrl_probe(pdev); | ||
451 | } | ||
452 | |||
453 | static int __devexit kirkwood_pinctrl_remove(struct platform_device *pdev) | ||
454 | { | ||
455 | return mvebu_pinctrl_remove(pdev); | ||
456 | } | ||
457 | |||
458 | static struct platform_driver kirkwood_pinctrl_driver = { | ||
459 | .driver = { | ||
460 | .name = "kirkwood-pinctrl", | ||
461 | .owner = THIS_MODULE, | ||
462 | .of_match_table = of_match_ptr(kirkwood_pinctrl_of_match), | ||
463 | }, | ||
464 | .probe = kirkwood_pinctrl_probe, | ||
465 | .remove = __devexit_p(kirkwood_pinctrl_remove), | ||
466 | }; | ||
467 | |||
468 | module_platform_driver(kirkwood_pinctrl_driver); | ||
469 | |||
470 | MODULE_AUTHOR("Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>"); | ||
471 | MODULE_DESCRIPTION("Marvell Kirkwood pinctrl driver"); | ||
472 | MODULE_LICENSE("GPL v2"); | ||