xref: /OK3568_Linux_fs/kernel/drivers/pinctrl/mvebu/pinctrl-kirkwood.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-or-later
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Marvell Kirkwood pinctrl driver based on mvebu pinctrl core
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Author: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #include <linux/err.h>
9*4882a593Smuzhiyun #include <linux/init.h>
10*4882a593Smuzhiyun #include <linux/io.h>
11*4882a593Smuzhiyun #include <linux/platform_device.h>
12*4882a593Smuzhiyun #include <linux/clk.h>
13*4882a593Smuzhiyun #include <linux/of.h>
14*4882a593Smuzhiyun #include <linux/of_device.h>
15*4882a593Smuzhiyun #include <linux/pinctrl/pinctrl.h>
16*4882a593Smuzhiyun 
17*4882a593Smuzhiyun #include "pinctrl-mvebu.h"
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun #define V(f6180, f6190, f6192, f6281, f6282, dx4122, dx1135)	\
20*4882a593Smuzhiyun 	((f6180 << 0) | (f6190 << 1) | (f6192 << 2) |	\
21*4882a593Smuzhiyun 	 (f6281 << 3) | (f6282 << 4) | (dx4122 << 5) |	\
22*4882a593Smuzhiyun 	 (dx1135 << 6))
23*4882a593Smuzhiyun 
24*4882a593Smuzhiyun enum kirkwood_variant {
25*4882a593Smuzhiyun 	VARIANT_MV88F6180	= V(1, 0, 0, 0, 0, 0, 0),
26*4882a593Smuzhiyun 	VARIANT_MV88F6190	= V(0, 1, 0, 0, 0, 0, 0),
27*4882a593Smuzhiyun 	VARIANT_MV88F6192	= V(0, 0, 1, 0, 0, 0, 0),
28*4882a593Smuzhiyun 	VARIANT_MV88F6281	= V(0, 0, 0, 1, 0, 0, 0),
29*4882a593Smuzhiyun 	VARIANT_MV88F6282	= V(0, 0, 0, 0, 1, 0, 0),
30*4882a593Smuzhiyun 	VARIANT_MV98DX4122	= V(0, 0, 0, 0, 0, 1, 0),
31*4882a593Smuzhiyun 	VARIANT_MV98DX1135	= V(0, 0, 0, 0, 0, 0, 1),
32*4882a593Smuzhiyun };
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = {
35*4882a593Smuzhiyun 	MPP_MODE(0,
36*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
37*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "nand", "io2",     V(1, 1, 1, 1, 1, 1, 1)),
38*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "spi", "cs",       V(1, 1, 1, 1, 1, 1, 1))),
39*4882a593Smuzhiyun 	MPP_MODE(1,
40*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
41*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "nand", "io3",     V(1, 1, 1, 1, 1, 1, 1)),
42*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "spi", "mosi",     V(1, 1, 1, 1, 1, 1, 1))),
43*4882a593Smuzhiyun 	MPP_MODE(2,
44*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
45*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "nand", "io4",     V(1, 1, 1, 1, 1, 1, 1)),
46*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "spi", "sck",      V(1, 1, 1, 1, 1, 1, 1))),
47*4882a593Smuzhiyun 	MPP_MODE(3,
48*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
49*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "nand", "io5",     V(1, 1, 1, 1, 1, 1, 1)),
50*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "spi", "miso",     V(1, 1, 1, 1, 1, 1, 1))),
51*4882a593Smuzhiyun 	MPP_MODE(4,
52*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
53*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "nand", "io6",     V(1, 1, 1, 1, 1, 1, 1)),
54*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "uart0", "rxd",    V(1, 1, 1, 1, 1, 1, 1)),
55*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 1, 1, 1, 0, 0)),
56*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "hsync",    V(0, 0, 0, 0, 1, 0, 0)),
57*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xd, "ptp", "clk",      V(1, 1, 1, 1, 0, 0, 0))),
58*4882a593Smuzhiyun 	MPP_MODE(5,
59*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
60*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "nand", "io7",     V(1, 1, 1, 1, 1, 1, 1)),
61*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "uart0", "txd",    V(1, 1, 1, 1, 1, 1, 1)),
62*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "ptp", "trig",     V(1, 1, 1, 1, 0, 0, 0)),
63*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0, 0)),
64*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "vsync",    V(0, 0, 0, 0, 1, 0, 0))),
65*4882a593Smuzhiyun 	MPP_MODE(6,
66*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "sysrst", "out",   V(1, 1, 1, 1, 1, 1, 1)),
67*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "spi", "mosi",     V(1, 1, 1, 1, 1, 1, 1)),
68*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ptp", "trig",     V(1, 1, 1, 1, 0, 0, 0))),
69*4882a593Smuzhiyun 	MPP_MODE(7,
70*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
71*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "pex", "rsto",     V(1, 1, 1, 1, 0, 1, 1)),
72*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "spi", "cs",       V(1, 1, 1, 1, 1, 1, 1)),
73*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ptp", "trig",     V(1, 1, 1, 1, 0, 0, 0)),
74*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "pwm",      V(0, 0, 0, 0, 1, 0, 0))),
75*4882a593Smuzhiyun 	MPP_MODE(8,
76*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
77*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "twsi0", "sda",    V(1, 1, 1, 1, 1, 1, 1)),
78*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "uart0", "rts",    V(1, 1, 1, 1, 1, 1, 1)),
79*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "uart1", "rts",    V(1, 1, 1, 1, 1, 1, 1)),
80*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "mii-1", "rxerr",  V(0, 1, 1, 1, 1, 0, 0)),
81*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "sata1", "prsnt",  V(0, 0, 1, 1, 1, 0, 0)),
82*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xc, "ptp", "clk",      V(1, 1, 1, 1, 0, 0, 0)),
83*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xd, "mii", "col",      V(1, 1, 1, 1, 1, 0, 0))),
84*4882a593Smuzhiyun 	MPP_MODE(9,
85*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
86*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "twsi0", "sck",    V(1, 1, 1, 1, 1, 1, 1)),
87*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "uart0", "cts",    V(1, 1, 1, 1, 1, 1, 1)),
88*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "uart1", "cts",    V(1, 1, 1, 1, 1, 1, 1)),
89*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "sata0", "prsnt",  V(0, 1, 1, 1, 1, 0, 0)),
90*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xc, "ptp", "evreq",    V(1, 1, 1, 1, 0, 0, 0)),
91*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xd, "mii", "crs",      V(1, 1, 1, 1, 1, 0, 0))),
92*4882a593Smuzhiyun 	MPP_MODE(10,
93*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
94*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "spi", "sck",      V(1, 1, 1, 1, 1, 1, 1)),
95*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0X3, "uart0", "txd",    V(1, 1, 1, 1, 1, 1, 1)),
96*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 1, 1, 1, 0, 0)),
97*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xc, "ptp", "trig",     V(1, 1, 1, 1, 0, 0, 0))),
98*4882a593Smuzhiyun 	MPP_MODE(11,
99*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
100*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "spi", "miso",     V(1, 1, 1, 1, 1, 1, 1)),
101*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "uart0", "rxd",    V(1, 1, 1, 1, 1, 1, 1)),
102*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "ptp-1", "evreq",  V(1, 1, 1, 1, 0, 0, 0)),
103*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xc, "ptp-2", "trig",   V(1, 1, 1, 1, 0, 0, 0)),
104*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xd, "ptp", "clk",      V(1, 1, 1, 1, 0, 0, 0)),
105*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0, 0))),
106*4882a593Smuzhiyun 	MPP_MODE(12,
107*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 0, 1, 0, 0)),
108*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 0, 0, 0)),
109*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "sdio", "clk",     V(1, 1, 1, 1, 1, 0, 0)),
110*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xa, "audio", "spdifo", V(0, 0, 0, 0, 1, 0, 0)),
111*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "spi", "mosi",     V(0, 0, 0, 0, 1, 0, 0)),
112*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xd, "twsi1", "sda",    V(0, 0, 0, 0, 1, 0, 0))),
113*4882a593Smuzhiyun 	MPP_MODE(13,
114*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
115*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "sdio", "cmd",     V(1, 1, 1, 1, 1, 0, 0)),
116*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "uart1", "txd",    V(1, 1, 1, 1, 1, 1, 1)),
117*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xa, "audio", "rmclk",  V(0, 0, 0, 0, 1, 0, 0)),
118*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "pwm",      V(0, 0, 0, 0, 1, 0, 0))),
119*4882a593Smuzhiyun 	MPP_MODE(14,
120*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
121*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "sdio", "d0",      V(1, 1, 1, 1, 1, 0, 0)),
122*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "uart1", "rxd",    V(1, 1, 1, 1, 1, 1, 1)),
123*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "sata1", "prsnt",  V(0, 0, 1, 1, 1, 0, 0)),
124*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xa, "audio", "spdifi", V(0, 0, 0, 0, 1, 0, 0)),
125*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "audio-1", "sdi",  V(0, 0, 0, 0, 1, 0, 0)),
126*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xd, "mii", "col",      V(1, 1, 1, 1, 1, 0, 0))),
127*4882a593Smuzhiyun 	MPP_MODE(15,
128*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
129*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "sdio", "d1",      V(1, 1, 1, 1, 1, 0, 0)),
130*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "uart0", "rts",    V(1, 1, 1, 1, 1, 1, 1)),
131*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "uart1", "txd",    V(1, 1, 1, 1, 1, 0, 0)),
132*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "sata0", "act",    V(0, 1, 1, 1, 1, 0, 0)),
133*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "spi", "cs",       V(0, 0, 0, 0, 1, 0, 0))),
134*4882a593Smuzhiyun 	MPP_MODE(16,
135*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
136*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "sdio", "d2",      V(1, 1, 1, 1, 1, 0, 0)),
137*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "uart0", "cts",    V(1, 1, 1, 1, 1, 1, 1)),
138*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "uart1", "rxd",    V(1, 1, 1, 1, 1, 0, 0)),
139*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "sata1", "act",    V(0, 0, 1, 1, 1, 0, 0)),
140*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "extclk",   V(0, 0, 0, 0, 1, 0, 0)),
141*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xd, "mii", "crs",      V(1, 1, 1, 1, 1, 0, 0))),
142*4882a593Smuzhiyun 	MPP_MODE(17,
143*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 0, 0)),
144*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "sdio", "d3",      V(1, 1, 1, 1, 1, 0, 0)),
145*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "sata0", "prsnt",  V(0, 1, 1, 1, 1, 0, 0)),
146*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xa, "sata1", "act",    V(0, 0, 0, 0, 1, 0, 0)),
147*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xd, "twsi1", "sck",    V(0, 0, 0, 0, 1, 0, 0))),
148*4882a593Smuzhiyun 	MPP_MODE(18,
149*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
150*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "nand", "io0",     V(1, 1, 1, 1, 1, 1, 1)),
151*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "pex", "clkreq",   V(0, 0, 0, 0, 1, 0, 0))),
152*4882a593Smuzhiyun 	MPP_MODE(19,
153*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
154*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "nand", "io1",     V(1, 1, 1, 1, 1, 1, 1))),
155*4882a593Smuzhiyun 	MPP_MODE(20,
156*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
157*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp0",       V(0, 0, 1, 1, 1, 0, 0)),
158*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql",    V(0, 0, 1, 1, 1, 0, 0)),
159*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "txd0",     V(0, 1, 1, 1, 1, 0, 0)),
160*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 1, 1, 1, 0, 0)),
161*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 1, 1, 1, 0, 0)),
162*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d0",       V(0, 0, 0, 0, 1, 0, 0)),
163*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xc, "mii", "rxerr",    V(0, 0, 0, 0, 0, 0, 0))),
164*4882a593Smuzhiyun 	MPP_MODE(21,
165*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
166*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp1",       V(0, 0, 1, 1, 1, 0, 0)),
167*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql",    V(0, 0, 1, 1, 1, 0, 0)),
168*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "txd1",     V(0, 1, 1, 1, 1, 0, 0)),
169*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 0, 0, 0, 0, 0)),
170*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 1, 1, 1, 0, 0)),
171*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0, 0)),
172*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d1",       V(0, 0, 0, 0, 1, 0, 0))),
173*4882a593Smuzhiyun 	MPP_MODE(22,
174*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
175*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp2",       V(0, 0, 1, 1, 1, 0, 0)),
176*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql",    V(0, 0, 1, 1, 1, 0, 0)),
177*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "txd2",     V(0, 1, 1, 1, 1, 0, 0)),
178*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 0, 0, 0, 0, 0)),
179*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "rmclk",  V(0, 0, 1, 1, 1, 0, 0)),
180*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "sata1", "prsnt",  V(0, 0, 1, 1, 1, 0, 0)),
181*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d2",       V(0, 0, 0, 0, 1, 0, 0))),
182*4882a593Smuzhiyun 	MPP_MODE(23,
183*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
184*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp3",       V(0, 0, 1, 1, 1, 0, 0)),
185*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql",    V(0, 0, 1, 1, 1, 0, 0)),
186*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "txd3",     V(0, 1, 1, 1, 1, 0, 0)),
187*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "rmclk",  V(0, 0, 0, 0, 0, 0, 0)),
188*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "bclk",   V(0, 0, 1, 1, 1, 0, 0)),
189*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "sata0", "prsnt",  V(0, 1, 1, 1, 1, 0, 0)),
190*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d3",       V(0, 0, 0, 0, 1, 0, 0))),
191*4882a593Smuzhiyun 	MPP_MODE(24,
192*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
193*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp4",       V(0, 0, 1, 1, 1, 0, 0)),
194*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0",  V(0, 0, 1, 1, 1, 0, 0)),
195*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "rxd0",     V(0, 1, 1, 1, 1, 0, 0)),
196*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "bclk",   V(0, 0, 0, 0, 0, 0, 0)),
197*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "sdo",    V(0, 0, 1, 1, 1, 0, 0)),
198*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d4",       V(0, 0, 0, 0, 1, 0, 0))),
199*4882a593Smuzhiyun 	MPP_MODE(25,
200*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
201*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp5",       V(0, 0, 1, 1, 1, 0, 0)),
202*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck",  V(0, 0, 1, 1, 1, 0, 0)),
203*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "rxd1",     V(0, 1, 1, 1, 1, 0, 0)),
204*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "sdo",    V(0, 0, 0, 0, 0, 0, 0)),
205*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "lrclk",  V(0, 0, 1, 1, 1, 0, 0)),
206*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d5",       V(0, 0, 0, 0, 1, 0, 0))),
207*4882a593Smuzhiyun 	MPP_MODE(26,
208*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
209*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp6",       V(0, 0, 1, 1, 1, 0, 0)),
210*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 1, 1, 1, 0, 0)),
211*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "rxd2",     V(0, 1, 1, 1, 1, 0, 0)),
212*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "lrclk",  V(0, 0, 0, 0, 0, 0, 0)),
213*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "mclk",   V(0, 0, 1, 1, 1, 0, 0)),
214*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d6",       V(0, 0, 0, 0, 1, 0, 0))),
215*4882a593Smuzhiyun 	MPP_MODE(27,
216*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
217*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp7",       V(0, 0, 1, 1, 1, 0, 0)),
218*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 1, 1, 1, 0, 0)),
219*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "rxd3",     V(0, 1, 1, 1, 1, 0, 0)),
220*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "mclk",   V(0, 0, 0, 0, 0, 0, 0)),
221*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "sdi",    V(0, 0, 1, 1, 1, 0, 0)),
222*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d7",       V(0, 0, 0, 0, 1, 0, 0))),
223*4882a593Smuzhiyun 	MPP_MODE(28,
224*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 0)),
225*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp8",       V(0, 0, 1, 1, 1, 0, 0)),
226*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "int",      V(0, 0, 1, 1, 1, 0, 0)),
227*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "col",      V(0, 1, 1, 1, 1, 0, 0)),
228*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "sdi",    V(0, 0, 0, 0, 0, 0, 0)),
229*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 1, 1, 1, 0, 0)),
230*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d8",       V(0, 0, 0, 0, 1, 0, 0)),
231*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "nand", "ren",     V(0, 0, 0, 0, 0, 0, 1))),
232*4882a593Smuzhiyun 	MPP_MODE(29,
233*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 0)),
234*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp9",       V(0, 0, 1, 1, 1, 0, 0)),
235*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "rst",      V(0, 0, 1, 1, 1, 0, 0)),
236*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "txclk",    V(0, 1, 1, 1, 1, 0, 0)),
237*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 0, 0, 0, 0, 0)),
238*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d9",       V(0, 0, 0, 0, 1, 0, 0)),
239*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "nand", "wen",     V(0, 0, 0, 0, 0, 0, 1))),
240*4882a593Smuzhiyun 	MPP_MODE(30,
241*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
242*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp10",      V(0, 0, 1, 1, 1, 0, 0)),
243*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "pclk",     V(0, 0, 1, 1, 1, 0, 0)),
244*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "rxctl",    V(0, 1, 1, 1, 1, 0, 0)),
245*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d10",      V(0, 0, 0, 0, 1, 0, 0))),
246*4882a593Smuzhiyun 	MPP_MODE(31,
247*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
248*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp11",      V(0, 0, 1, 1, 1, 0, 0)),
249*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "fs",       V(0, 0, 1, 1, 1, 0, 0)),
250*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "rxclk",    V(0, 1, 1, 1, 1, 0, 0)),
251*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d11",      V(0, 0, 0, 0, 1, 0, 0))),
252*4882a593Smuzhiyun 	MPP_MODE(32,
253*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
254*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp12",      V(0, 0, 1, 1, 1, 0, 0)),
255*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "drx",      V(0, 0, 1, 1, 1, 0, 0)),
256*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "txclko",   V(0, 1, 1, 1, 1, 0, 0)),
257*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d12",      V(0, 0, 0, 0, 1, 0, 0))),
258*4882a593Smuzhiyun 	MPP_MODE(33,
259*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(0, 1, 1, 1, 1, 0, 1)),
260*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "dtx",      V(0, 0, 1, 1, 1, 0, 0)),
261*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "txctl",    V(0, 1, 1, 1, 1, 0, 0)),
262*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d13",      V(0, 0, 0, 0, 1, 0, 0))),
263*4882a593Smuzhiyun 	MPP_MODE(34,
264*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 1, 1)),
265*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1",  V(0, 0, 1, 1, 1, 0, 0)),
266*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "txen",     V(0, 1, 1, 1, 1, 0, 0)),
267*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 0, 1, 1, 0, 0)),
268*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d14",      V(0, 0, 0, 0, 1, 0, 0)),
269*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "nand", "ale",     V(0, 0, 0, 0, 0, 0, 1))),
270*4882a593Smuzhiyun 	MPP_MODE(35,
271*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
272*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql",    V(0, 0, 1, 1, 1, 0, 0)),
273*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x3, "ge1", "rxerr",    V(0, 1, 1, 1, 1, 0, 0)),
274*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0, 0)),
275*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d15",      V(0, 0, 0, 0, 1, 0, 0)),
276*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xc, "mii", "rxerr",    V(1, 1, 1, 1, 1, 0, 0)),
277*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "nand", "cen",     V(0, 0, 0, 0, 0, 0, 1))),
278*4882a593Smuzhiyun 	MPP_MODE(36,
279*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
280*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp0",       V(0, 0, 0, 1, 1, 0, 0)),
281*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1",  V(0, 0, 0, 1, 1, 0, 0)),
282*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(1, 0, 0, 1, 1, 0, 0)),
283*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "twsi1", "sda",    V(0, 0, 0, 0, 1, 0, 0))),
284*4882a593Smuzhiyun 	MPP_MODE(37,
285*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
286*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp1",       V(0, 0, 0, 1, 1, 0, 0)),
287*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql",    V(0, 0, 0, 1, 1, 0, 0)),
288*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(1, 0, 0, 1, 1, 0, 0)),
289*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "twsi1", "sck",    V(0, 0, 0, 0, 1, 0, 0))),
290*4882a593Smuzhiyun 	MPP_MODE(38,
291*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
292*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp2",       V(0, 0, 0, 1, 1, 0, 0)),
293*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql",    V(0, 0, 0, 1, 1, 0, 0)),
294*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "rmclk",  V(1, 0, 0, 1, 1, 0, 0)),
295*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d18",      V(0, 0, 0, 0, 1, 0, 0))),
296*4882a593Smuzhiyun 	MPP_MODE(39,
297*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
298*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp3",       V(0, 0, 0, 1, 1, 0, 0)),
299*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0",  V(0, 0, 0, 1, 1, 0, 0)),
300*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "bclk",   V(1, 0, 0, 1, 1, 0, 0)),
301*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d19",      V(0, 0, 0, 0, 1, 0, 0))),
302*4882a593Smuzhiyun 	MPP_MODE(40,
303*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
304*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp4",       V(0, 0, 0, 1, 1, 0, 0)),
305*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck",  V(0, 0, 0, 1, 1, 0, 0)),
306*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "sdo",    V(1, 0, 0, 1, 1, 0, 0)),
307*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d20",      V(0, 0, 0, 0, 1, 0, 0))),
308*4882a593Smuzhiyun 	MPP_MODE(41,
309*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
310*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp5",       V(0, 0, 0, 1, 1, 0, 0)),
311*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 0, 1, 1, 0, 0)),
312*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "lrclk",  V(1, 0, 0, 1, 1, 0, 0)),
313*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d21",      V(0, 0, 0, 0, 1, 0, 0))),
314*4882a593Smuzhiyun 	MPP_MODE(42,
315*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
316*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp6",       V(0, 0, 0, 1, 1, 0, 0)),
317*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 0, 1, 1, 0, 0)),
318*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "mclk",   V(1, 0, 0, 1, 1, 0, 0)),
319*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d22",      V(0, 0, 0, 0, 1, 0, 0))),
320*4882a593Smuzhiyun 	MPP_MODE(43,
321*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
322*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp7",       V(0, 0, 0, 1, 1, 0, 0)),
323*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "int",      V(0, 0, 0, 1, 1, 0, 0)),
324*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "sdi",    V(1, 0, 0, 1, 1, 0, 0)),
325*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d23",      V(0, 0, 0, 0, 1, 0, 0))),
326*4882a593Smuzhiyun 	MPP_MODE(44,
327*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
328*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp8",       V(0, 0, 0, 1, 1, 0, 0)),
329*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "rst",      V(0, 0, 0, 1, 1, 0, 0)),
330*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(1, 0, 0, 1, 1, 0, 0)),
331*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "clk",      V(0, 0, 0, 0, 1, 0, 0))),
332*4882a593Smuzhiyun 	MPP_MODE(45,
333*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1, 1, 1)),
334*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp9",       V(0, 0, 0, 1, 1, 0, 0)),
335*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "pclk",     V(0, 0, 0, 1, 1, 0, 0)),
336*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "e",        V(0, 0, 0, 0, 1, 0, 0))),
337*4882a593Smuzhiyun 	MPP_MODE(46,
338*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1, 0, 0)),
339*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp10",      V(0, 0, 0, 1, 1, 0, 0)),
340*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "fs",       V(0, 0, 0, 1, 1, 0, 0)),
341*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "hsync",    V(0, 0, 0, 0, 1, 0, 0))),
342*4882a593Smuzhiyun 	MPP_MODE(47,
343*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1, 0, 0)),
344*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp11",      V(0, 0, 0, 1, 1, 0, 0)),
345*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "drx",      V(0, 0, 0, 1, 1, 0, 0)),
346*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "vsync",    V(0, 0, 0, 0, 1, 0, 0))),
347*4882a593Smuzhiyun 	MPP_MODE(48,
348*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1, 0, 0)),
349*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp12",      V(0, 0, 0, 1, 1, 0, 0)),
350*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "dtx",      V(0, 0, 0, 1, 1, 0, 0)),
351*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d16",      V(0, 0, 0, 0, 1, 0, 0))),
352*4882a593Smuzhiyun 	MPP_MODE(49,
353*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 0, 1, 1)),
354*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(0, 0, 0, 0, 1, 0, 0)),
355*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x1, "ts", "mp9",       V(0, 0, 0, 1, 0, 0, 0)),
356*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql",    V(0, 0, 0, 1, 1, 0, 0)),
357*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0x5, "ptp", "clk",      V(0, 0, 0, 1, 0, 0, 0)),
358*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xa, "pex", "clkreq",   V(0, 0, 0, 0, 1, 0, 0)),
359*4882a593Smuzhiyun 		MPP_VAR_FUNCTION(0xb, "lcd", "d17",      V(0, 0, 0, 0, 1, 0, 0))),
360*4882a593Smuzhiyun };
361*4882a593Smuzhiyun 
362*4882a593Smuzhiyun static const struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = {
363*4882a593Smuzhiyun 	MPP_FUNC_CTRL(0, 44, NULL, mvebu_mmio_mpp_ctrl),
364*4882a593Smuzhiyun };
365*4882a593Smuzhiyun 
366*4882a593Smuzhiyun static struct pinctrl_gpio_range mv88f6180_gpio_ranges[] = {
367*4882a593Smuzhiyun 	MPP_GPIO_RANGE(0,  0,  0, 20),
368*4882a593Smuzhiyun 	MPP_GPIO_RANGE(1, 35, 35, 10),
369*4882a593Smuzhiyun };
370*4882a593Smuzhiyun 
371*4882a593Smuzhiyun static const struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = {
372*4882a593Smuzhiyun 	MPP_FUNC_CTRL(0, 35, NULL, mvebu_mmio_mpp_ctrl),
373*4882a593Smuzhiyun };
374*4882a593Smuzhiyun 
375*4882a593Smuzhiyun static struct pinctrl_gpio_range mv88f619x_gpio_ranges[] = {
376*4882a593Smuzhiyun 	MPP_GPIO_RANGE(0,  0,  0, 32),
377*4882a593Smuzhiyun 	MPP_GPIO_RANGE(1, 32, 32,  4),
378*4882a593Smuzhiyun };
379*4882a593Smuzhiyun 
380*4882a593Smuzhiyun static const struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = {
381*4882a593Smuzhiyun 	MPP_FUNC_CTRL(0, 49, NULL, mvebu_mmio_mpp_ctrl),
382*4882a593Smuzhiyun };
383*4882a593Smuzhiyun 
384*4882a593Smuzhiyun static struct pinctrl_gpio_range mv88f628x_gpio_ranges[] = {
385*4882a593Smuzhiyun 	MPP_GPIO_RANGE(0,  0,  0, 32),
386*4882a593Smuzhiyun 	MPP_GPIO_RANGE(1, 32, 32, 18),
387*4882a593Smuzhiyun };
388*4882a593Smuzhiyun 
389*4882a593Smuzhiyun static struct mvebu_pinctrl_soc_info mv88f6180_info = {
390*4882a593Smuzhiyun 	.variant = VARIANT_MV88F6180,
391*4882a593Smuzhiyun 	.controls = mv88f6180_mpp_controls,
392*4882a593Smuzhiyun 	.ncontrols = ARRAY_SIZE(mv88f6180_mpp_controls),
393*4882a593Smuzhiyun 	.modes = mv88f6xxx_mpp_modes,
394*4882a593Smuzhiyun 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
395*4882a593Smuzhiyun 	.gpioranges = mv88f6180_gpio_ranges,
396*4882a593Smuzhiyun 	.ngpioranges = ARRAY_SIZE(mv88f6180_gpio_ranges),
397*4882a593Smuzhiyun };
398*4882a593Smuzhiyun 
399*4882a593Smuzhiyun static struct mvebu_pinctrl_soc_info mv88f6190_info = {
400*4882a593Smuzhiyun 	.variant = VARIANT_MV88F6190,
401*4882a593Smuzhiyun 	.controls = mv88f619x_mpp_controls,
402*4882a593Smuzhiyun 	.ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
403*4882a593Smuzhiyun 	.modes = mv88f6xxx_mpp_modes,
404*4882a593Smuzhiyun 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
405*4882a593Smuzhiyun 	.gpioranges = mv88f619x_gpio_ranges,
406*4882a593Smuzhiyun 	.ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
407*4882a593Smuzhiyun };
408*4882a593Smuzhiyun 
409*4882a593Smuzhiyun static struct mvebu_pinctrl_soc_info mv88f6192_info = {
410*4882a593Smuzhiyun 	.variant = VARIANT_MV88F6192,
411*4882a593Smuzhiyun 	.controls = mv88f619x_mpp_controls,
412*4882a593Smuzhiyun 	.ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
413*4882a593Smuzhiyun 	.modes = mv88f6xxx_mpp_modes,
414*4882a593Smuzhiyun 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
415*4882a593Smuzhiyun 	.gpioranges = mv88f619x_gpio_ranges,
416*4882a593Smuzhiyun 	.ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
417*4882a593Smuzhiyun };
418*4882a593Smuzhiyun 
419*4882a593Smuzhiyun static struct mvebu_pinctrl_soc_info mv88f6281_info = {
420*4882a593Smuzhiyun 	.variant = VARIANT_MV88F6281,
421*4882a593Smuzhiyun 	.controls = mv88f628x_mpp_controls,
422*4882a593Smuzhiyun 	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
423*4882a593Smuzhiyun 	.modes = mv88f6xxx_mpp_modes,
424*4882a593Smuzhiyun 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
425*4882a593Smuzhiyun 	.gpioranges = mv88f628x_gpio_ranges,
426*4882a593Smuzhiyun 	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
427*4882a593Smuzhiyun };
428*4882a593Smuzhiyun 
429*4882a593Smuzhiyun static struct mvebu_pinctrl_soc_info mv88f6282_info = {
430*4882a593Smuzhiyun 	.variant = VARIANT_MV88F6282,
431*4882a593Smuzhiyun 	.controls = mv88f628x_mpp_controls,
432*4882a593Smuzhiyun 	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
433*4882a593Smuzhiyun 	.modes = mv88f6xxx_mpp_modes,
434*4882a593Smuzhiyun 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
435*4882a593Smuzhiyun 	.gpioranges = mv88f628x_gpio_ranges,
436*4882a593Smuzhiyun 	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
437*4882a593Smuzhiyun };
438*4882a593Smuzhiyun 
439*4882a593Smuzhiyun static struct mvebu_pinctrl_soc_info mv98dx4122_info = {
440*4882a593Smuzhiyun 	.variant = VARIANT_MV98DX4122,
441*4882a593Smuzhiyun 	.controls = mv88f628x_mpp_controls,
442*4882a593Smuzhiyun 	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
443*4882a593Smuzhiyun 	.modes = mv88f6xxx_mpp_modes,
444*4882a593Smuzhiyun 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
445*4882a593Smuzhiyun 	.gpioranges = mv88f628x_gpio_ranges,
446*4882a593Smuzhiyun 	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
447*4882a593Smuzhiyun };
448*4882a593Smuzhiyun 
449*4882a593Smuzhiyun static struct mvebu_pinctrl_soc_info mv98dx1135_info = {
450*4882a593Smuzhiyun 	.variant = VARIANT_MV98DX1135,
451*4882a593Smuzhiyun 	.controls = mv88f628x_mpp_controls,
452*4882a593Smuzhiyun 	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
453*4882a593Smuzhiyun 	.modes = mv88f6xxx_mpp_modes,
454*4882a593Smuzhiyun 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
455*4882a593Smuzhiyun 	.gpioranges = mv88f628x_gpio_ranges,
456*4882a593Smuzhiyun 	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
457*4882a593Smuzhiyun };
458*4882a593Smuzhiyun 
459*4882a593Smuzhiyun 
460*4882a593Smuzhiyun static const struct of_device_id kirkwood_pinctrl_of_match[] = {
461*4882a593Smuzhiyun 	{ .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info },
462*4882a593Smuzhiyun 	{ .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info },
463*4882a593Smuzhiyun 	{ .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info },
464*4882a593Smuzhiyun 	{ .compatible = "marvell,88f6281-pinctrl", .data = &mv88f6281_info },
465*4882a593Smuzhiyun 	{ .compatible = "marvell,88f6282-pinctrl", .data = &mv88f6282_info },
466*4882a593Smuzhiyun 	{ .compatible = "marvell,98dx4122-pinctrl", .data = &mv98dx4122_info },
467*4882a593Smuzhiyun 	{ .compatible = "marvell,98dx1135-pinctrl", .data = &mv98dx1135_info },
468*4882a593Smuzhiyun 	{ }
469*4882a593Smuzhiyun };
470*4882a593Smuzhiyun 
kirkwood_pinctrl_probe(struct platform_device * pdev)471*4882a593Smuzhiyun static int kirkwood_pinctrl_probe(struct platform_device *pdev)
472*4882a593Smuzhiyun {
473*4882a593Smuzhiyun 	const struct of_device_id *match =
474*4882a593Smuzhiyun 		of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
475*4882a593Smuzhiyun 
476*4882a593Smuzhiyun 	pdev->dev.platform_data = (void *)match->data;
477*4882a593Smuzhiyun 
478*4882a593Smuzhiyun 	return mvebu_pinctrl_simple_mmio_probe(pdev);
479*4882a593Smuzhiyun }
480*4882a593Smuzhiyun 
481*4882a593Smuzhiyun static struct platform_driver kirkwood_pinctrl_driver = {
482*4882a593Smuzhiyun 	.driver = {
483*4882a593Smuzhiyun 		.name = "kirkwood-pinctrl",
484*4882a593Smuzhiyun 		.of_match_table = kirkwood_pinctrl_of_match,
485*4882a593Smuzhiyun 	},
486*4882a593Smuzhiyun 	.probe = kirkwood_pinctrl_probe,
487*4882a593Smuzhiyun };
488*4882a593Smuzhiyun builtin_platform_driver(kirkwood_pinctrl_driver);
489