summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-07 16:56:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-07 16:56:45 -0400
commitedb2a385ec331fda7ecb5502d63e5e8be86b7a84 (patch)
tree329a2717306193d89052f460cff9db04c1fcee9b /drivers
parent3a979e8c07e3ee9933016368db0a55943b00a089 (diff)
parent86c5dd6860a60e9b69558ecfce2c4769045d110c (diff)
Merge tag 'pinctrl-v4.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control updates from Linus Walleij: "This is the bulk of pin control changes for v4.18. No core changes this time! Just a calm all-over-the-place drivers, updates and fixes cycle as it seems. New drivers/subdrivers: - Actions Semiconductor S900 driver with more Actions variants for S700, S500 in the pipe. Also generic GPIO support on top of the same driver and IRQ support is in the pipe. - Renesas r8a77470 PFC support. - Renesas r8a77990 PFC support. - Allwinner Sunxi H6 R_PIO support. - Rockchip PX30 support. - Meson Meson8m2 support. - Remove support for the ill-fated Samsung Exynos 5440 SoC. Improvements: - Context save/restore support in pinctrl-single. - External interrupt support for the Mediatek MT7622. - Qualcomm ACPI HID QCOM8002 supported. Fixes: - Fix up suspend/resume support for Exynos 5433. - Fix Strago DMI fixes on the Intel Cherryview" * tag 'pinctrl-v4.18-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (72 commits) pinctrl: cherryview: limit Strago DMI workarounds to version 1.0 pinctrl: at91-pio4: add missing of_node_put pinctrl: armada-37xx: Fix spurious irq management gpiolib: discourage gpiochip_add_pin[group]_range for DT pinctrls pinctrl: msm: fix gpio-hog related boot issues MAINTAINERS: update entry for Mediatek pin controller pinctrl: mediatek: remove unused fields in struct mtk_eint_hw pinctrl: mediatek: use generic EINT register maps for each SoC pinctrl: mediatek: add EINT support to MT7622 SoC pinctrl: mediatek: refactor EINT related code for all MediaTek pinctrl can fit dt-bindings: pinctrl: add external interrupt support to MT7622 pinctrl pinctrl: freescale: Switch to SPDX identifier pinctrl: samsung: Fix suspend/resume for Exynos5433 GPF1..5 banks pinctrl: sh-pfc: rcar-gen3: Fix grammar in static pin comments pinctrl: sh-pfc: r8a77965: Add I2C pin support pinctrl: sh-pfc: r8a77990: Add EthernetAVB pins, groups and functions pinctrl: sh-pfc: r8a77990: Add I2C{1,2,4,5,6,7} pins, groups and functions pinctrl: sh-pfc: r8a77990: Add SCIF pins, groups and functions pinctrl: sh-pfc: r8a77990: Add bias pinconf support pinctrl: sh-pfc: Initial R8A77990 PFC support ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/gpiolib.c10
-rw-r--r--drivers/pinctrl/Kconfig1
-rw-r--r--drivers/pinctrl/Makefile1
-rw-r--r--drivers/pinctrl/actions/Kconfig15
-rw-r--r--drivers/pinctrl/actions/Makefile2
-rw-r--r--drivers/pinctrl/actions/pinctrl-owl.c785
-rw-r--r--drivers/pinctrl/actions/pinctrl-owl.h162
-rw-r--r--drivers/pinctrl/actions/pinctrl-s900.c1888
-rw-r--r--drivers/pinctrl/bcm/Kconfig1
-rw-r--r--drivers/pinctrl/bcm/pinctrl-bcm2835.c100
-rw-r--r--drivers/pinctrl/berlin/berlin-bg2.c5
-rw-r--r--drivers/pinctrl/berlin/berlin-bg2cd.c5
-rw-r--r--drivers/pinctrl/berlin/berlin-bg2q.c5
-rw-r--r--drivers/pinctrl/berlin/berlin-bg4ct.c13
-rw-r--r--drivers/pinctrl/berlin/berlin.c5
-rw-r--r--drivers/pinctrl/berlin/berlin.h5
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx.c42
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx.h6
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx1-core.c27
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx1.c15
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx1.h6
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx21.c15
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx23.c19
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx25.c28
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx27.c19
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx28.c19
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx35.c24
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx50.c19
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx51.c21
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx53.c21
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx6dl.c16
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx6q.c21
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx6sl.c16
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx6sll.c8
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx6sx.c16
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx6ul.c16
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx7d.c16
-rw-r--r--drivers/pinctrl/freescale/pinctrl-imx7ulp.c17
-rw-r--r--drivers/pinctrl/freescale/pinctrl-mxs.c13
-rw-r--r--drivers/pinctrl/freescale/pinctrl-mxs.h8
-rw-r--r--drivers/pinctrl/freescale/pinctrl-vf610.c15
-rw-r--r--drivers/pinctrl/intel/pinctrl-cherryview.c4
-rw-r--r--drivers/pinctrl/mediatek/Kconfig6
-rw-r--r--drivers/pinctrl/mediatek/Makefile1
-rw-r--r--drivers/pinctrl/mediatek/mtk-eint.c492
-rw-r--r--drivers/pinctrl/mediatek/mtk-eint.h106
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mt2701.c25
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mt2712.c25
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mt7622.c143
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mt8127.c25
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mt8135.c25
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mt8173.c25
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mtk-common.c608
-rw-r--r--drivers/pinctrl/mediatek/pinctrl-mtk-common.h13
-rw-r--r--drivers/pinctrl/meson/pinctrl-meson-axg.c107
-rw-r--r--drivers/pinctrl/meson/pinctrl-meson-gxbb.c4
-rw-r--r--drivers/pinctrl/meson/pinctrl-meson-gxl.c4
-rw-r--r--drivers/pinctrl/meson/pinctrl-meson8.c23
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-armada-37xx.c32
-rw-r--r--drivers/pinctrl/mvebu/pinctrl-armada-xp.c22
-rw-r--r--drivers/pinctrl/pinctrl-at91-pio4.c4
-rw-r--r--drivers/pinctrl/pinctrl-rockchip.c246
-rw-r--r--drivers/pinctrl/pinctrl-single.c72
-rw-r--r--drivers/pinctrl/qcom/pinctrl-msm.c92
-rw-r--r--drivers/pinctrl/qcom/pinctrl-qdf2xxx.c114
-rw-r--r--drivers/pinctrl/samsung/Kconfig10
-rw-r--r--drivers/pinctrl/samsung/Makefile1
-rw-r--r--drivers/pinctrl/samsung/pinctrl-exynos-arm.c30
-rw-r--r--drivers/pinctrl/samsung/pinctrl-exynos-arm64.c20
-rw-r--r--drivers/pinctrl/samsung/pinctrl-exynos.h2
-rw-r--r--drivers/pinctrl/samsung/pinctrl-exynos5440.c1005
-rw-r--r--drivers/pinctrl/samsung/pinctrl-samsung.c29
-rw-r--r--drivers/pinctrl/sh-pfc/Kconfig10
-rw-r--r--drivers/pinctrl/sh-pfc/Makefile2
-rw-r--r--drivers/pinctrl/sh-pfc/core.c12
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a77470.c2343
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a7795-es1.c6
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a7795.c8
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a7796.c8
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a77965.c1592
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a77970.c32
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a77980.c52
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-r8a77990.c2695
-rw-r--r--drivers/pinctrl/sh-pfc/sh_pfc.h10
-rw-r--r--drivers/pinctrl/sunxi/Kconfig4
-rw-r--r--drivers/pinctrl/sunxi/Makefile1
-rw-r--r--drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c128
-rw-r--r--drivers/pinctrl/tegra/pinctrl-tegra.c11
-rw-r--r--drivers/pinctrl/tegra/pinctrl-tegra.h11
-rw-r--r--drivers/pinctrl/tegra/pinctrl-tegra20.c30
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c49
-rw-r--r--drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c54
92 files changed, 11689 insertions, 2130 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 55d596f3035e..5dfd3c17fffc 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2078,6 +2078,11 @@ EXPORT_SYMBOL_GPL(gpiochip_generic_config);
2078 * @pctldev: the pin controller to map to 2078 * @pctldev: the pin controller to map to
2079 * @gpio_offset: the start offset in the current gpio_chip number space 2079 * @gpio_offset: the start offset in the current gpio_chip number space
2080 * @pin_group: name of the pin group inside the pin controller 2080 * @pin_group: name of the pin group inside the pin controller
2081 *
2082 * Calling this function directly from a DeviceTree-supported
2083 * pinctrl driver is DEPRECATED. Please see Section 2.1 of
2084 * Documentation/devicetree/bindings/gpio/gpio.txt on how to
2085 * bind pinctrl and gpio drivers via the "gpio-ranges" property.
2081 */ 2086 */
2082int gpiochip_add_pingroup_range(struct gpio_chip *chip, 2087int gpiochip_add_pingroup_range(struct gpio_chip *chip,
2083 struct pinctrl_dev *pctldev, 2088 struct pinctrl_dev *pctldev,
@@ -2131,6 +2136,11 @@ EXPORT_SYMBOL_GPL(gpiochip_add_pingroup_range);
2131 * 2136 *
2132 * Returns: 2137 * Returns:
2133 * 0 on success, or a negative error-code on failure. 2138 * 0 on success, or a negative error-code on failure.
2139 *
2140 * Calling this function directly from a DeviceTree-supported
2141 * pinctrl driver is DEPRECATED. Please see Section 2.1 of
2142 * Documentation/devicetree/bindings/gpio/gpio.txt on how to
2143 * bind pinctrl and gpio drivers via the "gpio-ranges" property.
2134 */ 2144 */
2135int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name, 2145int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
2136 unsigned int gpio_offset, unsigned int pin_offset, 2146 unsigned int gpio_offset, unsigned int pin_offset,
diff --git a/drivers/pinctrl/Kconfig b/drivers/pinctrl/Kconfig
index 01fe8e0455a0..dd50371225bc 100644
--- a/drivers/pinctrl/Kconfig
+++ b/drivers/pinctrl/Kconfig
@@ -337,6 +337,7 @@ config PINCTRL_OCELOT
337 select GENERIC_PINMUX_FUNCTIONS 337 select GENERIC_PINMUX_FUNCTIONS
338 select REGMAP_MMIO 338 select REGMAP_MMIO
339 339
340source "drivers/pinctrl/actions/Kconfig"
340source "drivers/pinctrl/aspeed/Kconfig" 341source "drivers/pinctrl/aspeed/Kconfig"
341source "drivers/pinctrl/bcm/Kconfig" 342source "drivers/pinctrl/bcm/Kconfig"
342source "drivers/pinctrl/berlin/Kconfig" 343source "drivers/pinctrl/berlin/Kconfig"
diff --git a/drivers/pinctrl/Makefile b/drivers/pinctrl/Makefile
index 657332b121fb..de40863e7297 100644
--- a/drivers/pinctrl/Makefile
+++ b/drivers/pinctrl/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_PINCTRL_INGENIC) += pinctrl-ingenic.o
43obj-$(CONFIG_PINCTRL_RK805) += pinctrl-rk805.o 43obj-$(CONFIG_PINCTRL_RK805) += pinctrl-rk805.o
44obj-$(CONFIG_PINCTRL_OCELOT) += pinctrl-ocelot.o 44obj-$(CONFIG_PINCTRL_OCELOT) += pinctrl-ocelot.o
45 45
46obj-y += actions/
46obj-$(CONFIG_ARCH_ASPEED) += aspeed/ 47obj-$(CONFIG_ARCH_ASPEED) += aspeed/
47obj-y += bcm/ 48obj-y += bcm/
48obj-$(CONFIG_PINCTRL_BERLIN) += berlin/ 49obj-$(CONFIG_PINCTRL_BERLIN) += berlin/
diff --git a/drivers/pinctrl/actions/Kconfig b/drivers/pinctrl/actions/Kconfig
new file mode 100644
index 000000000000..490927b4ea76
--- /dev/null
+++ b/drivers/pinctrl/actions/Kconfig
@@ -0,0 +1,15 @@
1config PINCTRL_OWL
2 bool "Actions Semi OWL pinctrl driver"
3 depends on (ARCH_ACTIONS || COMPILE_TEST) && OF
4 select PINMUX
5 select PINCONF
6 select GENERIC_PINCONF
7 select GPIOLIB
8 help
9 Say Y here to enable Actions Semi OWL pinctrl driver
10
11config PINCTRL_S900
12 bool "Actions Semi S900 pinctrl driver"
13 depends on PINCTRL_OWL
14 help
15 Say Y here to enable Actions Semi S900 pinctrl driver
diff --git a/drivers/pinctrl/actions/Makefile b/drivers/pinctrl/actions/Makefile
new file mode 100644
index 000000000000..bd232d28400f
--- /dev/null
+++ b/drivers/pinctrl/actions/Makefile
@@ -0,0 +1,2 @@
1obj-$(CONFIG_PINCTRL_OWL) += pinctrl-owl.o
2obj-$(CONFIG_PINCTRL_S900) += pinctrl-s900.o
diff --git a/drivers/pinctrl/actions/pinctrl-owl.c b/drivers/pinctrl/actions/pinctrl-owl.c
new file mode 100644
index 000000000000..76243caa08c6
--- /dev/null
+++ b/drivers/pinctrl/actions/pinctrl-owl.c
@@ -0,0 +1,785 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * OWL SoC's Pinctrl driver
4 *
5 * Copyright (c) 2014 Actions Semi Inc.
6 * Author: David Liu <liuwei@actions-semi.com>
7 *
8 * Copyright (c) 2018 Linaro Ltd.
9 * Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
10 */
11
12#include <linux/clk.h>
13#include <linux/err.h>
14#include <linux/gpio/driver.h>
15#include <linux/io.h>
16#include <linux/module.h>
17#include <linux/of.h>
18#include <linux/platform_device.h>
19#include <linux/pinctrl/machine.h>
20#include <linux/pinctrl/pinctrl.h>
21#include <linux/pinctrl/pinmux.h>
22#include <linux/pinctrl/pinconf.h>
23#include <linux/pinctrl/pinconf-generic.h>
24#include <linux/slab.h>
25#include <linux/spinlock.h>
26
27#include "../core.h"
28#include "../pinctrl-utils.h"
29#include "pinctrl-owl.h"
30
31/**
32 * struct owl_pinctrl - pinctrl state of the device
33 * @dev: device handle
34 * @pctrldev: pinctrl handle
35 * @chip: gpio chip
36 * @lock: spinlock to protect registers
37 * @soc: reference to soc_data
38 * @base: pinctrl register base address
39 */
40struct owl_pinctrl {
41 struct device *dev;
42 struct pinctrl_dev *pctrldev;
43 struct gpio_chip chip;
44 raw_spinlock_t lock;
45 struct clk *clk;
46 const struct owl_pinctrl_soc_data *soc;
47 void __iomem *base;
48};
49
50static void owl_update_bits(void __iomem *base, u32 mask, u32 val)
51{
52 u32 reg_val;
53
54 reg_val = readl_relaxed(base);
55
56 reg_val = (reg_val & ~mask) | (val & mask);
57
58 writel_relaxed(reg_val, base);
59}
60
61static u32 owl_read_field(struct owl_pinctrl *pctrl, u32 reg,
62 u32 bit, u32 width)
63{
64 u32 tmp, mask;
65
66 tmp = readl_relaxed(pctrl->base + reg);
67 mask = (1 << width) - 1;
68
69 return (tmp >> bit) & mask;
70}
71
72static void owl_write_field(struct owl_pinctrl *pctrl, u32 reg, u32 arg,
73 u32 bit, u32 width)
74{
75 u32 mask;
76
77 mask = (1 << width) - 1;
78 mask = mask << bit;
79
80 owl_update_bits(pctrl->base + reg, mask, (arg << bit));
81}
82
83static int owl_get_groups_count(struct pinctrl_dev *pctrldev)
84{
85 struct owl_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrldev);
86
87 return pctrl->soc->ngroups;
88}
89
90static const char *owl_get_group_name(struct pinctrl_dev *pctrldev,
91 unsigned int group)
92{
93 struct owl_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrldev);
94
95 return pctrl->soc->groups[group].name;
96}
97
98static int owl_get_group_pins(struct pinctrl_dev *pctrldev,
99 unsigned int group,
100 const unsigned int **pins,
101 unsigned int *num_pins)
102{
103 struct owl_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrldev);
104
105 *pins = pctrl->soc->groups[group].pads;
106 *num_pins = pctrl->soc->groups[group].npads;
107
108 return 0;
109}
110
111static void owl_pin_dbg_show(struct pinctrl_dev *pctrldev,
112 struct seq_file *s,
113 unsigned int offset)
114{
115 struct owl_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrldev);
116
117 seq_printf(s, "%s", dev_name(pctrl->dev));
118}
119
120static struct pinctrl_ops owl_pinctrl_ops = {
121 .get_groups_count = owl_get_groups_count,
122 .get_group_name = owl_get_group_name,
123 .get_group_pins = owl_get_group_pins,
124 .pin_dbg_show = owl_pin_dbg_show,
125 .dt_node_to_map = pinconf_generic_dt_node_to_map_all,
126 .dt_free_map = pinctrl_utils_free_map,
127};
128
129static int owl_get_funcs_count(struct pinctrl_dev *pctrldev)
130{
131 struct owl_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrldev);
132
133 return pctrl->soc->nfunctions;
134}
135
136static const char *owl_get_func_name(struct pinctrl_dev *pctrldev,
137 unsigned int function)
138{
139 struct owl_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrldev);
140
141 return pctrl->soc->functions[function].name;
142}
143
144static int owl_get_func_groups(struct pinctrl_dev *pctrldev,
145 unsigned int function,
146 const char * const **groups,
147 unsigned int * const num_groups)
148{
149 struct owl_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrldev);
150
151 *groups = pctrl->soc->functions[function].groups;
152 *num_groups = pctrl->soc->functions[function].ngroups;
153
154 return 0;
155}
156
157static inline int get_group_mfp_mask_val(const struct owl_pingroup *g,
158 int function,
159 u32 *mask,
160 u32 *val)
161{
162 int id;
163 u32 option_num;
164 u32 option_mask;
165
166 for (id = 0; id < g->nfuncs; id++) {
167 if (g->funcs[id] == function)
168 break;
169 }
170 if (WARN_ON(id == g->nfuncs))
171 return -EINVAL;
172
173 option_num = (1 << g->mfpctl_width);
174 if (id > option_num)
175 id -= option_num;
176
177 option_mask = option_num - 1;
178 *mask = (option_mask << g->mfpctl_shift);
179 *val = (id << g->mfpctl_shift);
180
181 return 0;
182}
183
184static int owl_set_mux(struct pinctrl_dev *pctrldev,
185 unsigned int function,
186 unsigned int group)
187{
188 struct owl_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrldev);
189 const struct owl_pingroup *g;
190 unsigned long flags;
191 u32 val, mask;
192
193 g = &pctrl->soc->groups[group];
194
195 if (get_group_mfp_mask_val(g, function, &mask, &val))
196 return -EINVAL;
197
198 raw_spin_lock_irqsave(&pctrl->lock, flags);
199
200 owl_update_bits(pctrl->base + g->mfpctl_reg, mask, val);
201
202 raw_spin_unlock_irqrestore(&pctrl->lock, flags);
203
204 return 0;
205}
206
207static struct pinmux_ops owl_pinmux_ops = {
208 .get_functions_count = owl_get_funcs_count,
209 .get_function_name = owl_get_func_name,
210 .get_function_groups = owl_get_func_groups,
211 .set_mux = owl_set_mux,
212};
213
214static int owl_pad_pinconf_reg(const struct owl_padinfo *info,
215 unsigned int param,
216 u32 *reg,
217 u32 *bit,
218 u32 *width)
219{
220 switch (param) {
221 case PIN_CONFIG_BIAS_BUS_HOLD:
222 case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
223 case PIN_CONFIG_BIAS_PULL_DOWN:
224 case PIN_CONFIG_BIAS_PULL_UP:
225 if (!info->pullctl)
226 return -EINVAL;
227 *reg = info->pullctl->reg;
228 *bit = info->pullctl->shift;
229 *width = info->pullctl->width;
230 break;
231 case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
232 if (!info->st)
233 return -EINVAL;
234 *reg = info->st->reg;
235 *bit = info->st->shift;
236 *width = info->st->width;
237 break;
238 default:
239 return -ENOTSUPP;
240 }
241
242 return 0;
243}
244
245static int owl_pad_pinconf_arg2val(const struct owl_padinfo *info,
246 unsigned int param,
247 u32 *arg)
248{
249 switch (param) {
250 case PIN_CONFIG_BIAS_BUS_HOLD:
251 *arg = OWL_PINCONF_PULL_HOLD;
252 break;
253 case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
254 *arg = OWL_PINCONF_PULL_HIZ;
255 break;
256 case PIN_CONFIG_BIAS_PULL_DOWN:
257 *arg = OWL_PINCONF_PULL_DOWN;
258 break;
259 case PIN_CONFIG_BIAS_PULL_UP:
260 *arg = OWL_PINCONF_PULL_UP;
261 break;
262 case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
263 *arg = (*arg >= 1 ? 1 : 0);
264 break;
265 default:
266 return -ENOTSUPP;
267 }
268
269 return 0;
270}
271
272static int owl_pad_pinconf_val2arg(const struct owl_padinfo *padinfo,
273 unsigned int param,
274 u32 *arg)
275{
276 switch (param) {
277 case PIN_CONFIG_BIAS_BUS_HOLD:
278 *arg = *arg == OWL_PINCONF_PULL_HOLD;
279 break;
280 case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
281 *arg = *arg == OWL_PINCONF_PULL_HIZ;
282 break;
283 case PIN_CONFIG_BIAS_PULL_DOWN:
284 *arg = *arg == OWL_PINCONF_PULL_DOWN;
285 break;
286 case PIN_CONFIG_BIAS_PULL_UP:
287 *arg = *arg == OWL_PINCONF_PULL_UP;
288 break;
289 case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
290 *arg = *arg == 1;
291 break;
292 default:
293 return -ENOTSUPP;
294 }
295
296 return 0;
297}
298
299static int owl_pin_config_get(struct pinctrl_dev *pctrldev,
300 unsigned int pin,
301 unsigned long *config)
302{
303 int ret = 0;
304 struct owl_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrldev);
305 const struct owl_padinfo *info;
306 unsigned int param = pinconf_to_config_param(*config);
307 u32 reg, bit, width, arg;
308
309 info = &pctrl->soc->padinfo[pin];
310
311 ret = owl_pad_pinconf_reg(info, param, &reg, &bit, &width);
312 if (ret)
313 return ret;
314
315 arg = owl_read_field(pctrl, reg, bit, width);
316
317 ret = owl_pad_pinconf_val2arg(info, param, &arg);
318 if (ret)
319 return ret;
320
321 *config = pinconf_to_config_packed(param, arg);
322
323 return ret;
324}
325
326static int owl_pin_config_set(struct pinctrl_dev *pctrldev,
327 unsigned int pin,
328 unsigned long *configs,
329 unsigned int num_configs)
330{
331 struct owl_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrldev);
332 const struct owl_padinfo *info;
333 unsigned long flags;
334 unsigned int param;
335 u32 reg, bit, width, arg;
336 int ret, i;
337
338 info = &pctrl->soc->padinfo[pin];
339
340 for (i = 0; i < num_configs; i++) {
341 param = pinconf_to_config_param(configs[i]);
342 arg = pinconf_to_config_argument(configs[i]);
343
344 ret = owl_pad_pinconf_reg(info, param, &reg, &bit, &width);
345 if (ret)
346 return ret;
347
348 ret = owl_pad_pinconf_arg2val(info, param, &arg);
349 if (ret)
350 return ret;
351
352 raw_spin_lock_irqsave(&pctrl->lock, flags);
353
354 owl_write_field(pctrl, reg, arg, bit, width);
355
356 raw_spin_unlock_irqrestore(&pctrl->lock, flags);
357 }
358
359 return ret;
360}
361
362static int owl_group_pinconf_reg(const struct owl_pingroup *g,
363 unsigned int param,
364 u32 *reg,
365 u32 *bit,
366 u32 *width)
367{
368 switch (param) {
369 case PIN_CONFIG_DRIVE_STRENGTH:
370 if (g->drv_reg < 0)
371 return -EINVAL;
372 *reg = g->drv_reg;
373 *bit = g->drv_shift;
374 *width = g->drv_width;
375 break;
376 case PIN_CONFIG_SLEW_RATE:
377 if (g->sr_reg < 0)
378 return -EINVAL;
379 *reg = g->sr_reg;
380 *bit = g->sr_shift;
381 *width = g->sr_width;
382 break;
383 default:
384 return -ENOTSUPP;
385 }
386
387 return 0;
388}
389
390static int owl_group_pinconf_arg2val(const struct owl_pingroup *g,
391 unsigned int param,
392 u32 *arg)
393{
394 switch (param) {
395 case PIN_CONFIG_DRIVE_STRENGTH:
396 switch (*arg) {
397 case 2:
398 *arg = OWL_PINCONF_DRV_2MA;
399 break;
400 case 4:
401 *arg = OWL_PINCONF_DRV_4MA;
402 break;
403 case 8:
404 *arg = OWL_PINCONF_DRV_8MA;
405 break;
406 case 12:
407 *arg = OWL_PINCONF_DRV_12MA;
408 break;
409 default:
410 return -EINVAL;
411 }
412 break;
413 case PIN_CONFIG_SLEW_RATE:
414 if (*arg)
415 *arg = OWL_PINCONF_SLEW_FAST;
416 else
417 *arg = OWL_PINCONF_SLEW_SLOW;
418 break;
419 default:
420 return -ENOTSUPP;
421 }
422
423 return 0;
424}
425
426static int owl_group_pinconf_val2arg(const struct owl_pingroup *g,
427 unsigned int param,
428 u32 *arg)
429{
430 switch (param) {
431 case PIN_CONFIG_DRIVE_STRENGTH:
432 switch (*arg) {
433 case OWL_PINCONF_DRV_2MA:
434 *arg = 2;
435 break;
436 case OWL_PINCONF_DRV_4MA:
437 *arg = 4;
438 break;
439 case OWL_PINCONF_DRV_8MA:
440 *arg = 8;
441 break;
442 case OWL_PINCONF_DRV_12MA:
443 *arg = 12;
444 break;
445 default:
446 return -EINVAL;
447 }
448 break;
449 case PIN_CONFIG_SLEW_RATE:
450 if (*arg)
451 *arg = 1;
452 else
453 *arg = 0;
454 break;
455 default:
456 return -ENOTSUPP;
457 }
458
459 return 0;
460}
461
462static int owl_group_config_get(struct pinctrl_dev *pctrldev,
463 unsigned int group,
464 unsigned long *config)
465{
466 const struct owl_pingroup *g;
467 struct owl_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrldev);
468 unsigned int param = pinconf_to_config_param(*config);
469 u32 reg, bit, width, arg;
470 int ret;
471
472 g = &pctrl->soc->groups[group];
473
474 ret = owl_group_pinconf_reg(g, param, &reg, &bit, &width);
475 if (ret)
476 return ret;
477
478 arg = owl_read_field(pctrl, reg, bit, width);
479
480 ret = owl_group_pinconf_val2arg(g, param, &arg);
481 if (ret)
482 return ret;
483
484 *config = pinconf_to_config_packed(param, arg);
485
486 return ret;
487
488}
489
490static int owl_group_config_set(struct pinctrl_dev *pctrldev,
491 unsigned int group,
492 unsigned long *configs,
493 unsigned int num_configs)
494{
495 const struct owl_pingroup *g;
496 struct owl_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctrldev);
497 unsigned long flags;
498 unsigned int param;
499 u32 reg, bit, width, arg;
500 int ret, i;
501
502 g = &pctrl->soc->groups[group];
503
504 for (i = 0; i < num_configs; i++) {
505 param = pinconf_to_config_param(configs[i]);
506 arg = pinconf_to_config_argument(configs[i]);
507
508 ret = owl_group_pinconf_reg(g, param, &reg, &bit, &width);
509 if (ret)
510 return ret;
511
512 ret = owl_group_pinconf_arg2val(g, param, &arg);
513 if (ret)
514 return ret;
515
516 /* Update register */
517 raw_spin_lock_irqsave(&pctrl->lock, flags);
518
519 owl_write_field(pctrl, reg, arg, bit, width);
520
521 raw_spin_unlock_irqrestore(&pctrl->lock, flags);
522 }
523
524 return 0;
525}
526
527static const struct pinconf_ops owl_pinconf_ops = {
528 .is_generic = true,
529 .pin_config_get = owl_pin_config_get,
530 .pin_config_set = owl_pin_config_set,
531 .pin_config_group_get = owl_group_config_get,
532 .pin_config_group_set = owl_group_config_set,
533};
534
535static struct pinctrl_desc owl_pinctrl_desc = {
536 .pctlops = &owl_pinctrl_ops,
537 .pmxops = &owl_pinmux_ops,
538 .confops = &owl_pinconf_ops,
539 .owner = THIS_MODULE,
540};
541
542static const struct owl_gpio_port *
543owl_gpio_get_port(struct owl_pinctrl *pctrl, unsigned int *pin)
544{
545 unsigned int start = 0, i;
546
547 for (i = 0; i < pctrl->soc->nports; i++) {
548 const struct owl_gpio_port *port = &pctrl->soc->ports[i];
549
550 if (*pin >= start && *pin < start + port->pins) {
551 *pin -= start;
552 return port;
553 }
554
555 start += port->pins;
556 }
557
558 return NULL;
559}
560
561static void owl_gpio_update_reg(void __iomem *base, unsigned int pin, int flag)
562{
563 u32 val;
564
565 val = readl_relaxed(base);
566
567 if (flag)
568 val |= BIT(pin);
569 else
570 val &= ~BIT(pin);
571
572 writel_relaxed(val, base);
573}
574
575static int owl_gpio_request(struct gpio_chip *chip, unsigned int offset)
576{
577 struct owl_pinctrl *pctrl = gpiochip_get_data(chip);
578 const struct owl_gpio_port *port;
579 void __iomem *gpio_base;
580 unsigned long flags;
581
582 port = owl_gpio_get_port(pctrl, &offset);
583 if (WARN_ON(port == NULL))
584 return -ENODEV;
585
586 gpio_base = pctrl->base + port->offset;
587
588 /*
589 * GPIOs have higher priority over other modules, so either setting
590 * them as OUT or IN is sufficient
591 */
592 raw_spin_lock_irqsave(&pctrl->lock, flags);
593 owl_gpio_update_reg(gpio_base + port->outen, offset, true);
594 raw_spin_unlock_irqrestore(&pctrl->lock, flags);
595
596 return 0;
597}
598
599static void owl_gpio_free(struct gpio_chip *chip, unsigned int offset)
600{
601 struct owl_pinctrl *pctrl = gpiochip_get_data(chip);
602 const struct owl_gpio_port *port;
603 void __iomem *gpio_base;
604 unsigned long flags;
605
606 port = owl_gpio_get_port(pctrl, &offset);
607 if (WARN_ON(port == NULL))
608 return;
609
610 gpio_base = pctrl->base + port->offset;
611
612 raw_spin_lock_irqsave(&pctrl->lock, flags);
613 /* disable gpio output */
614 owl_gpio_update_reg(gpio_base + port->outen, offset, false);
615
616 /* disable gpio input */
617 owl_gpio_update_reg(gpio_base + port->inen, offset, false);
618 raw_spin_unlock_irqrestore(&pctrl->lock, flags);
619}
620
621static int owl_gpio_get(struct gpio_chip *chip, unsigned int offset)
622{
623 struct owl_pinctrl *pctrl = gpiochip_get_data(chip);
624 const struct owl_gpio_port *port;
625 void __iomem *gpio_base;
626 unsigned long flags;
627 u32 val;
628
629 port = owl_gpio_get_port(pctrl, &offset);
630 if (WARN_ON(port == NULL))
631 return -ENODEV;
632
633 gpio_base = pctrl->base + port->offset;
634
635 raw_spin_lock_irqsave(&pctrl->lock, flags);
636 val = readl_relaxed(gpio_base + port->dat);
637 raw_spin_unlock_irqrestore(&pctrl->lock, flags);
638
639 return !!(val & BIT(offset));
640}
641
642static void owl_gpio_set(struct gpio_chip *chip, unsigned int offset, int value)
643{
644 struct owl_pinctrl *pctrl = gpiochip_get_data(chip);
645 const struct owl_gpio_port *port;
646 void __iomem *gpio_base;
647 unsigned long flags;
648
649 port = owl_gpio_get_port(pctrl, &offset);
650 if (WARN_ON(port == NULL))
651 return;
652
653 gpio_base = pctrl->base + port->offset;
654
655 raw_spin_lock_irqsave(&pctrl->lock, flags);
656 owl_gpio_update_reg(gpio_base + port->dat, offset, value);
657 raw_spin_unlock_irqrestore(&pctrl->lock, flags);
658}
659
660static int owl_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
661{
662 struct owl_pinctrl *pctrl = gpiochip_get_data(chip);
663 const struct owl_gpio_port *port;
664 void __iomem *gpio_base;
665 unsigned long flags;
666
667 port = owl_gpio_get_port(pctrl, &offset);
668 if (WARN_ON(port == NULL))
669 return -ENODEV;
670
671 gpio_base = pctrl->base + port->offset;
672
673 raw_spin_lock_irqsave(&pctrl->lock, flags);
674 owl_gpio_update_reg(gpio_base + port->outen, offset, false);
675 owl_gpio_update_reg(gpio_base + port->inen, offset, true);
676 raw_spin_unlock_irqrestore(&pctrl->lock, flags);
677
678 return 0;
679}
680
681static int owl_gpio_direction_output(struct gpio_chip *chip,
682 unsigned int offset, int value)
683{
684 struct owl_pinctrl *pctrl = gpiochip_get_data(chip);
685 const struct owl_gpio_port *port;
686 void __iomem *gpio_base;
687 unsigned long flags;
688
689 port = owl_gpio_get_port(pctrl, &offset);
690 if (WARN_ON(port == NULL))
691 return -ENODEV;
692
693 gpio_base = pctrl->base + port->offset;
694
695 raw_spin_lock_irqsave(&pctrl->lock, flags);
696 owl_gpio_update_reg(gpio_base + port->inen, offset, false);
697 owl_gpio_update_reg(gpio_base + port->outen, offset, true);
698 owl_gpio_update_reg(gpio_base + port->dat, offset, value);
699 raw_spin_unlock_irqrestore(&pctrl->lock, flags);
700
701 return 0;
702}
703
704static int owl_gpio_init(struct owl_pinctrl *pctrl)
705{
706 struct gpio_chip *chip;
707 int ret;
708
709 chip = &pctrl->chip;
710 chip->base = -1;
711 chip->ngpio = pctrl->soc->ngpios;
712 chip->label = dev_name(pctrl->dev);
713 chip->parent = pctrl->dev;
714 chip->owner = THIS_MODULE;
715 chip->of_node = pctrl->dev->of_node;
716
717 ret = gpiochip_add_data(&pctrl->chip, pctrl);
718 if (ret) {
719 dev_err(pctrl->dev, "failed to register gpiochip\n");
720 return ret;
721 }
722
723 return 0;
724}
725
726int owl_pinctrl_probe(struct platform_device *pdev,
727 struct owl_pinctrl_soc_data *soc_data)
728{
729 struct resource *res;
730 struct owl_pinctrl *pctrl;
731 int ret;
732
733 pctrl = devm_kzalloc(&pdev->dev, sizeof(*pctrl), GFP_KERNEL);
734 if (!pctrl)
735 return -ENOMEM;
736
737 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
738 pctrl->base = devm_ioremap_resource(&pdev->dev, res);
739 if (IS_ERR(pctrl->base))
740 return PTR_ERR(pctrl->base);
741
742 /* enable GPIO/MFP clock */
743 pctrl->clk = devm_clk_get(&pdev->dev, NULL);
744 if (IS_ERR(pctrl->clk)) {
745 dev_err(&pdev->dev, "no clock defined\n");
746 return PTR_ERR(pctrl->clk);
747 }
748
749 ret = clk_prepare_enable(pctrl->clk);
750 if (ret) {
751 dev_err(&pdev->dev, "clk enable failed\n");
752 return ret;
753 }
754
755 raw_spin_lock_init(&pctrl->lock);
756
757 owl_pinctrl_desc.name = dev_name(&pdev->dev);
758 owl_pinctrl_desc.pins = soc_data->pins;
759 owl_pinctrl_desc.npins = soc_data->npins;
760
761 pctrl->chip.direction_input = owl_gpio_direction_input;
762 pctrl->chip.direction_output = owl_gpio_direction_output;
763 pctrl->chip.get = owl_gpio_get;
764 pctrl->chip.set = owl_gpio_set;
765 pctrl->chip.request = owl_gpio_request;
766 pctrl->chip.free = owl_gpio_free;
767
768 pctrl->soc = soc_data;
769 pctrl->dev = &pdev->dev;
770
771 pctrl->pctrldev = devm_pinctrl_register(&pdev->dev,
772 &owl_pinctrl_desc, pctrl);
773 if (IS_ERR(pctrl->pctrldev)) {
774 dev_err(&pdev->dev, "could not register Actions OWL pinmux driver\n");
775 return PTR_ERR(pctrl->pctrldev);
776 }
777
778 ret = owl_gpio_init(pctrl);
779 if (ret)
780 return ret;
781
782 platform_set_drvdata(pdev, pctrl);
783
784 return 0;
785}
diff --git a/drivers/pinctrl/actions/pinctrl-owl.h b/drivers/pinctrl/actions/pinctrl-owl.h
new file mode 100644
index 000000000000..74342378937c
--- /dev/null
+++ b/drivers/pinctrl/actions/pinctrl-owl.h
@@ -0,0 +1,162 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * OWL SoC's Pinctrl definitions
4 *
5 * Copyright (c) 2014 Actions Semi Inc.
6 * Author: David Liu <liuwei@actions-semi.com>
7 *
8 * Copyright (c) 2018 Linaro Ltd.
9 * Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
10 */
11
12#ifndef __PINCTRL_OWL_H__
13#define __PINCTRL_OWL_H__
14
15#define OWL_PINCONF_SLEW_SLOW 0
16#define OWL_PINCONF_SLEW_FAST 1
17
18enum owl_pinconf_pull {
19 OWL_PINCONF_PULL_HIZ,
20 OWL_PINCONF_PULL_DOWN,
21 OWL_PINCONF_PULL_UP,
22 OWL_PINCONF_PULL_HOLD,
23};
24
25enum owl_pinconf_drv {
26 OWL_PINCONF_DRV_2MA,
27 OWL_PINCONF_DRV_4MA,
28 OWL_PINCONF_DRV_8MA,
29 OWL_PINCONF_DRV_12MA,
30};
31
32/**
33 * struct owl_pullctl - Actions pad pull control register
34 * @reg: offset to the pull control register
35 * @shift: shift value of the register
36 * @width: width of the register
37 */
38struct owl_pullctl {
39 int reg;
40 unsigned int shift;
41 unsigned int width;
42};
43
44/**
45 * struct owl_st - Actions pad schmitt trigger enable register
46 * @reg: offset to the schmitt trigger enable register
47 * @shift: shift value of the register
48 * @width: width of the register
49 */
50struct owl_st {
51 int reg;
52 unsigned int shift;
53 unsigned int width;
54};
55
56/**
57 * struct owl_pingroup - Actions pingroup definition
58 * @name: name of the pin group
59 * @pads: list of pins assigned to this pingroup
60 * @npads: size of @pads array
61 * @funcs: list of pinmux functions for this pingroup
62 * @nfuncs: size of @funcs array
63 * @mfpctl_reg: multiplexing control register offset
64 * @mfpctl_shift: multiplexing control register bit mask
65 * @mfpctl_width: multiplexing control register width
66 * @drv_reg: drive control register offset
67 * @drv_shift: drive control register bit mask
68 * @drv_width: driver control register width
69 * @sr_reg: slew rate control register offset
70 * @sr_shift: slew rate control register bit mask
71 * @sr_width: slew rate control register width
72 */
73struct owl_pingroup {
74 const char *name;
75 unsigned int *pads;
76 unsigned int npads;
77 unsigned int *funcs;
78 unsigned int nfuncs;
79
80 int mfpctl_reg;
81 unsigned int mfpctl_shift;
82 unsigned int mfpctl_width;
83
84 int drv_reg;
85 unsigned int drv_shift;
86 unsigned int drv_width;
87
88 int sr_reg;
89 unsigned int sr_shift;
90 unsigned int sr_width;
91};
92
93/**
94 * struct owl_padinfo - Actions pinctrl pad info
95 * @pad: pad name of the SoC
96 * @pullctl: pull control register info
97 * @st: schmitt trigger register info
98 */
99struct owl_padinfo {
100 int pad;
101 struct owl_pullctl *pullctl;
102 struct owl_st *st;
103};
104
105/**
106 * struct owl_pinmux_func - Actions pinctrl mux functions
107 * @name: name of the pinmux function.
108 * @groups: array of pin groups that may select this function.
109 * @ngroups: number of entries in @groups.
110 */
111struct owl_pinmux_func {
112 const char *name;
113 const char * const *groups;
114 unsigned int ngroups;
115};
116
117/**
118 * struct owl_gpio_port - Actions GPIO port info
119 * @offset: offset of the GPIO port.
120 * @pins: number of pins belongs to the GPIO port.
121 * @outen: offset of the output enable register.
122 * @inen: offset of the input enable register.
123 * @dat: offset of the data register.
124 */
125struct owl_gpio_port {
126 unsigned int offset;
127 unsigned int pins;
128 unsigned int outen;
129 unsigned int inen;
130 unsigned int dat;
131};
132
133/**
134 * struct owl_pinctrl_soc_data - Actions pin controller driver configuration
135 * @pins: array describing all pins of the pin controller.
136 * @npins: number of entries in @pins.
137 * @functions: array describing all mux functions of this SoC.
138 * @nfunction: number of entries in @functions.
139 * @groups: array describing all pin groups of this SoC.
140 * @ngroups: number of entries in @groups.
141 * @padinfo: array describing the pad info of this SoC.
142 * @ngpios: number of pingroups the driver should expose as GPIOs.
143 * @port: array describing all GPIO ports of this SoC.
144 * @nports: number of GPIO ports in this SoC.
145 */
146struct owl_pinctrl_soc_data {
147 const struct pinctrl_pin_desc *pins;
148 unsigned int npins;
149 const struct owl_pinmux_func *functions;
150 unsigned int nfunctions;
151 const struct owl_pingroup *groups;
152 unsigned int ngroups;
153 const struct owl_padinfo *padinfo;
154 unsigned int ngpios;
155 const struct owl_gpio_port *ports;
156 unsigned int nports;
157};
158
159int owl_pinctrl_probe(struct platform_device *pdev,
160 struct owl_pinctrl_soc_data *soc_data);
161
162#endif /* __PINCTRL_OWL_H__ */
diff --git a/drivers/pinctrl/actions/pinctrl-s900.c b/drivers/pinctrl/actions/pinctrl-s900.c
new file mode 100644
index 000000000000..5503c7945764
--- /dev/null
+++ b/drivers/pinctrl/actions/pinctrl-s900.c
@@ -0,0 +1,1888 @@
1// SPDX-License-Identifier: GPL-2.0+
2/*
3 * OWL S900 Pinctrl driver
4 *
5 * Copyright (c) 2014 Actions Semi Inc.
6 * Author: David Liu <liuwei@actions-semi.com>
7 *
8 * Copyright (c) 2018 Linaro Ltd.
9 * Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
10 */
11
12#include <linux/module.h>
13#include <linux/of.h>
14#include <linux/platform_device.h>
15#include <linux/pinctrl/pinctrl.h>
16#include "pinctrl-owl.h"
17
18/* Pinctrl registers offset */
19#define MFCTL0 (0x0040)
20#define MFCTL1 (0x0044)
21#define MFCTL2 (0x0048)
22#define MFCTL3 (0x004C)
23#define PAD_PULLCTL0 (0x0060)
24#define PAD_PULLCTL1 (0x0064)
25#define PAD_PULLCTL2 (0x0068)
26#define PAD_ST0 (0x006C)
27#define PAD_ST1 (0x0070)
28#define PAD_CTL (0x0074)
29#define PAD_DRV0 (0x0080)
30#define PAD_DRV1 (0x0084)
31#define PAD_DRV2 (0x0088)
32#define PAD_SR0 (0x0270)
33#define PAD_SR1 (0x0274)
34#define PAD_SR2 (0x0278)
35
36#define OWL_GPIO_PORT_A 0
37#define OWL_GPIO_PORT_B 1
38#define OWL_GPIO_PORT_C 2
39#define OWL_GPIO_PORT_D 3
40#define OWL_GPIO_PORT_E 4
41#define OWL_GPIO_PORT_F 5
42
43#define _GPIOA(offset) (offset)
44#define _GPIOB(offset) (32 + (offset))
45#define _GPIOC(offset) (64 + (offset))
46#define _GPIOD(offset) (76 + (offset))
47#define _GPIOE(offset) (106 + (offset))
48#define _GPIOF(offset) (138 + (offset))
49
50#define NUM_GPIOS (_GPIOF(7) + 1)
51#define _PIN(offset) (NUM_GPIOS + (offset))
52
53#define ETH_TXD0 _GPIOA(0)
54#define ETH_TXD1 _GPIOA(1)
55#define ETH_TXEN _GPIOA(2)
56#define ETH_RXER _GPIOA(3)
57#define ETH_CRS_DV _GPIOA(4)
58#define ETH_RXD1 _GPIOA(5)
59#define ETH_RXD0 _GPIOA(6)
60#define ETH_REF_CLK _GPIOA(7)
61#define ETH_MDC _GPIOA(8)
62#define ETH_MDIO _GPIOA(9)
63#define SIRQ0 _GPIOA(10)
64#define SIRQ1 _GPIOA(11)
65#define SIRQ2 _GPIOA(12)
66#define I2S_D0 _GPIOA(13)
67#define I2S_BCLK0 _GPIOA(14)
68#define I2S_LRCLK0 _GPIOA(15)
69#define I2S_MCLK0 _GPIOA(16)
70#define I2S_D1 _GPIOA(17)
71#define I2S_BCLK1 _GPIOA(18)
72#define I2S_LRCLK1 _GPIOA(19)
73#define I2S_MCLK1 _GPIOA(20)
74#define ERAM_A5 _GPIOA(21)
75#define ERAM_A6 _GPIOA(22)
76#define ERAM_A7 _GPIOA(23)
77#define ERAM_A8 _GPIOA(24)
78#define ERAM_A9 _GPIOA(25)
79#define ERAM_A10 _GPIOA(26)
80#define ERAM_A11 _GPIOA(27)
81#define SD0_D0 _GPIOA(28)
82#define SD0_D1 _GPIOA(29)
83#define SD0_D2 _GPIOA(30)
84#define SD0_D3 _GPIOA(31)
85
86#define SD1_D0 _GPIOB(0)
87#define SD1_D1 _GPIOB(1)
88#define SD1_D2 _GPIOB(2)
89#define SD1_D3 _GPIOB(3)
90#define SD0_CMD _GPIOB(4)
91#define SD0_CLK _GPIOB(5)
92#define SD1_CMD _GPIOB(6)
93#define SD1_CLK _GPIOB(7)
94#define SPI0_SCLK _GPIOB(8)
95#define SPI0_SS _GPIOB(9)
96#define SPI0_MISO _GPIOB(10)
97#define SPI0_MOSI _GPIOB(11)
98#define UART0_RX _GPIOB(12)
99#define UART0_TX _GPIOB(13)
100#define UART2_RX _GPIOB(14)
101#define UART2_TX _GPIOB(15)
102#define UART2_RTSB _GPIOB(16)
103#define UART2_CTSB _GPIOB(17)
104#define UART4_RX _GPIOB(18)
105#define UART4_TX _GPIOB(19)
106#define I2C0_SCLK _GPIOB(20)
107#define I2C0_SDATA _GPIOB(21)
108#define I2C1_SCLK _GPIOB(22)
109#define I2C1_SDATA _GPIOB(23)
110#define I2C2_SCLK _GPIOB(24)
111#define I2C2_SDATA _GPIOB(25)
112#define CSI0_DN0 _GPIOB(26)
113#define CSI0_DP0 _GPIOB(27)
114#define CSI0_DN1 _GPIOB(28)
115#define CSI0_DP1 _GPIOB(29)
116#define CSI0_CN _GPIOB(30)
117#define CSI0_CP _GPIOB(31)
118
119#define CSI0_DN2 _GPIOC(0)
120#define CSI0_DP2 _GPIOC(1)
121#define CSI0_DN3 _GPIOC(2)
122#define CSI0_DP3 _GPIOC(3)
123#define SENSOR0_PCLK _GPIOC(4)
124#define CSI1_DN0 _GPIOC(5)
125#define CSI1_DP0 _GPIOC(6)
126#define CSI1_DN1 _GPIOC(7)
127#define CSI1_DP1 _GPIOC(8)
128#define CSI1_CN _GPIOC(9)
129#define CSI1_CP _GPIOC(10)
130#define SENSOR0_CKOUT _GPIOC(11)
131
132#define LVDS_OEP _GPIOD(0)
133#define LVDS_OEN _GPIOD(1)
134#define LVDS_ODP _GPIOD(2)
135#define LVDS_ODN _GPIOD(3)
136#define LVDS_OCP _GPIOD(4)
137#define LVDS_OCN _GPIOD(5)
138#define LVDS_OBP _GPIOD(6)
139#define LVDS_OBN _GPIOD(7)
140#define LVDS_OAP _GPIOD(8)
141#define LVDS_OAN _GPIOD(9)
142#define LVDS_EEP _GPIOD(10)
143#define LVDS_EEN _GPIOD(11)
144#define LVDS_EDP _GPIOD(12)
145#define LVDS_EDN _GPIOD(13)
146#define LVDS_ECP _GPIOD(14)
147#define LVDS_ECN _GPIOD(15)
148#define LVDS_EBP _GPIOD(16)
149#define LVDS_EBN _GPIOD(17)
150#define LVDS_EAP _GPIOD(18)
151#define LVDS_EAN _GPIOD(19)
152#define DSI_DP3 _GPIOD(20)
153#define DSI_DN3 _GPIOD(21)
154#define DSI_DP1 _GPIOD(22)
155#define DSI_DN1 _GPIOD(23)
156#define DSI_CP _GPIOD(24)
157#define DSI_CN _GPIOD(25)
158#define DSI_DP0 _GPIOD(26)
159#define DSI_DN0 _GPIOD(27)
160#define DSI_DP2 _GPIOD(28)
161#define DSI_DN2 _GPIOD(29)
162
163#define NAND0_D0 _GPIOE(0)
164#define NAND0_D1 _GPIOE(1)
165#define NAND0_D2 _GPIOE(2)
166#define NAND0_D3 _GPIOE(3)
167#define NAND0_D4 _GPIOE(4)
168#define NAND0_D5 _GPIOE(5)
169#define NAND0_D6 _GPIOE(6)
170#define NAND0_D7 _GPIOE(7)
171#define NAND0_DQS _GPIOE(8)
172#define NAND0_DQSN _GPIOE(9)
173#define NAND0_ALE _GPIOE(10)
174#define NAND0_CLE _GPIOE(11)
175#define NAND0_CEB0 _GPIOE(12)
176#define NAND0_CEB1 _GPIOE(13)
177#define NAND0_CEB2 _GPIOE(14)
178#define NAND0_CEB3 _GPIOE(15)
179#define NAND1_D0 _GPIOE(16)
180#define NAND1_D1 _GPIOE(17)
181#define NAND1_D2 _GPIOE(18)
182#define NAND1_D3 _GPIOE(19)
183#define NAND1_D4 _GPIOE(20)
184#define NAND1_D5 _GPIOE(21)
185#define NAND1_D6 _GPIOE(22)
186#define NAND1_D7 _GPIOE(23)
187#define NAND1_DQS _GPIOE(24)
188#define NAND1_DQSN _GPIOE(25)
189#define NAND1_ALE _GPIOE(26)
190#define NAND1_CLE _GPIOE(27)
191#define NAND1_CEB0 _GPIOE(28)
192#define NAND1_CEB1 _GPIOE(29)
193#define NAND1_CEB2 _GPIOE(30)
194#define NAND1_CEB3 _GPIOE(31)
195
196#define PCM1_IN _GPIOF(0)
197#define PCM1_CLK _GPIOF(1)
198#define PCM1_SYNC _GPIOF(2)
199#define PCM1_OUT _GPIOF(3)
200#define UART3_RX _GPIOF(4)
201#define UART3_TX _GPIOF(5)
202#define UART3_RTSB _GPIOF(6)
203#define UART3_CTSB _GPIOF(7)
204
205/* System */
206#define SGPIO0 _PIN(0)
207#define SGPIO1 _PIN(1)
208#define SGPIO2 _PIN(2)
209#define SGPIO3 _PIN(3)
210
211#define NUM_PADS (_PIN(3) + 1)
212
213/* Pad names as specified in datasheet */
214static const struct pinctrl_pin_desc s900_pads[] = {
215 PINCTRL_PIN(ETH_TXD0, "eth_txd0"),
216 PINCTRL_PIN(ETH_TXD1, "eth_txd1"),
217 PINCTRL_PIN(ETH_TXEN, "eth_txen"),
218 PINCTRL_PIN(ETH_RXER, "eth_rxer"),
219 PINCTRL_PIN(ETH_CRS_DV, "eth_crs_dv"),
220 PINCTRL_PIN(ETH_RXD1, "eth_rxd1"),
221 PINCTRL_PIN(ETH_RXD0, "eth_rxd0"),
222 PINCTRL_PIN(ETH_REF_CLK, "eth_ref_clk"),
223 PINCTRL_PIN(ETH_MDC, "eth_mdc"),
224 PINCTRL_PIN(ETH_MDIO, "eth_mdio"),
225 PINCTRL_PIN(SIRQ0, "sirq0"),
226 PINCTRL_PIN(SIRQ1, "sirq1"),
227 PINCTRL_PIN(SIRQ2, "sirq2"),
228 PINCTRL_PIN(I2S_D0, "i2s_d0"),
229 PINCTRL_PIN(I2S_BCLK0, "i2s_bclk0"),
230 PINCTRL_PIN(I2S_LRCLK0, "i2s_lrclk0"),
231 PINCTRL_PIN(I2S_MCLK0, "i2s_mclk0"),
232 PINCTRL_PIN(I2S_D1, "i2s_d1"),
233 PINCTRL_PIN(I2S_BCLK1, "i2s_bclk1"),
234 PINCTRL_PIN(I2S_LRCLK1, "i2s_lrclk1"),
235 PINCTRL_PIN(I2S_MCLK1, "i2s_mclk1"),
236 PINCTRL_PIN(PCM1_IN, "pcm1_in"),
237 PINCTRL_PIN(PCM1_CLK, "pcm1_clk"),
238 PINCTRL_PIN(PCM1_SYNC, "pcm1_sync"),
239 PINCTRL_PIN(PCM1_OUT, "pcm1_out"),
240 PINCTRL_PIN(ERAM_A5, "eram_a5"),
241 PINCTRL_PIN(ERAM_A6, "eram_a6"),
242 PINCTRL_PIN(ERAM_A7, "eram_a7"),
243 PINCTRL_PIN(ERAM_A8, "eram_a8"),
244 PINCTRL_PIN(ERAM_A9, "eram_a9"),
245 PINCTRL_PIN(ERAM_A10, "eram_a10"),
246 PINCTRL_PIN(ERAM_A11, "eram_a11"),
247 PINCTRL_PIN(LVDS_OEP, "lvds_oep"),
248 PINCTRL_PIN(LVDS_OEN, "lvds_oen"),
249 PINCTRL_PIN(LVDS_ODP, "lvds_odp"),
250 PINCTRL_PIN(LVDS_ODN, "lvds_odn"),
251 PINCTRL_PIN(LVDS_OCP, "lvds_ocp"),
252 PINCTRL_PIN(LVDS_OCN, "lvds_ocn"),
253 PINCTRL_PIN(LVDS_OBP, "lvds_obp"),
254 PINCTRL_PIN(LVDS_OBN, "lvds_obn"),
255 PINCTRL_PIN(LVDS_OAP, "lvds_oap"),
256 PINCTRL_PIN(LVDS_OAN, "lvds_oan"),
257 PINCTRL_PIN(LVDS_EEP, "lvds_eep"),
258 PINCTRL_PIN(LVDS_EEN, "lvds_een"),
259 PINCTRL_PIN(LVDS_EDP, "lvds_edp"),
260 PINCTRL_PIN(LVDS_EDN, "lvds_edn"),
261 PINCTRL_PIN(LVDS_ECP, "lvds_ecp"),
262 PINCTRL_PIN(LVDS_ECN, "lvds_ecn"),
263 PINCTRL_PIN(LVDS_EBP, "lvds_ebp"),
264 PINCTRL_PIN(LVDS_EBN, "lvds_ebn"),
265 PINCTRL_PIN(LVDS_EAP, "lvds_eap"),
266 PINCTRL_PIN(LVDS_EAN, "lvds_ean"),
267 PINCTRL_PIN(SD0_D0, "sd0_d0"),
268 PINCTRL_PIN(SD0_D1, "sd0_d1"),
269 PINCTRL_PIN(SD0_D2, "sd0_d2"),
270 PINCTRL_PIN(SD0_D3, "sd0_d3"),
271 PINCTRL_PIN(SD1_D0, "sd1_d0"),
272 PINCTRL_PIN(SD1_D1, "sd1_d1"),
273 PINCTRL_PIN(SD1_D2, "sd1_d2"),
274 PINCTRL_PIN(SD1_D3, "sd1_d3"),
275 PINCTRL_PIN(SD0_CMD, "sd0_cmd"),
276 PINCTRL_PIN(SD0_CLK, "sd0_clk"),
277 PINCTRL_PIN(SD1_CMD, "sd1_cmd"),
278 PINCTRL_PIN(SD1_CLK, "sd1_clk"),
279 PINCTRL_PIN(SPI0_SCLK, "spi0_sclk"),
280 PINCTRL_PIN(SPI0_SS, "spi0_ss"),
281 PINCTRL_PIN(SPI0_MISO, "spi0_miso"),
282 PINCTRL_PIN(SPI0_MOSI, "spi0_mosi"),
283 PINCTRL_PIN(UART0_RX, "uart0_rx"),
284 PINCTRL_PIN(UART0_TX, "uart0_tx"),
285 PINCTRL_PIN(UART2_RX, "uart2_rx"),
286 PINCTRL_PIN(UART2_TX, "uart2_tx"),
287 PINCTRL_PIN(UART2_RTSB, "uart2_rtsb"),
288 PINCTRL_PIN(UART2_CTSB, "uart2_ctsb"),
289 PINCTRL_PIN(UART3_RX, "uart3_rx"),
290 PINCTRL_PIN(UART3_TX, "uart3_tx"),
291 PINCTRL_PIN(UART3_RTSB, "uart3_rtsb"),
292 PINCTRL_PIN(UART3_CTSB, "uart3_ctsb"),
293 PINCTRL_PIN(UART4_RX, "uart4_rx"),
294 PINCTRL_PIN(UART4_TX, "uart4_tx"),
295 PINCTRL_PIN(I2C0_SCLK, "i2c0_sclk"),
296 PINCTRL_PIN(I2C0_SDATA, "i2c0_sdata"),
297 PINCTRL_PIN(I2C1_SCLK, "i2c1_sclk"),
298 PINCTRL_PIN(I2C1_SDATA, "i2c1_sdata"),
299 PINCTRL_PIN(I2C2_SCLK, "i2c2_sclk"),
300 PINCTRL_PIN(I2C2_SDATA, "i2c2_sdata"),
301 PINCTRL_PIN(CSI0_DN0, "csi0_dn0"),
302 PINCTRL_PIN(CSI0_DP0, "csi0_dp0"),
303 PINCTRL_PIN(CSI0_DN1, "csi0_dn1"),
304 PINCTRL_PIN(CSI0_DP1, "csi0_dp1"),
305 PINCTRL_PIN(CSI0_CN, "csi0_cn"),
306 PINCTRL_PIN(CSI0_CP, "csi0_cp"),
307 PINCTRL_PIN(CSI0_DN2, "csi0_dn2"),
308 PINCTRL_PIN(CSI0_DP2, "csi0_dp2"),
309 PINCTRL_PIN(CSI0_DN3, "csi0_dn3"),
310 PINCTRL_PIN(CSI0_DP3, "csi0_dp3"),
311 PINCTRL_PIN(DSI_DP3, "dsi_dp3"),
312 PINCTRL_PIN(DSI_DN3, "dsi_dn3"),
313 PINCTRL_PIN(DSI_DP1, "dsi_dp1"),
314 PINCTRL_PIN(DSI_DN1, "dsi_dn1"),
315 PINCTRL_PIN(DSI_CP, "dsi_cp"),
316 PINCTRL_PIN(DSI_CN, "dsi_cn"),
317 PINCTRL_PIN(DSI_DP0, "dsi_dp0"),
318 PINCTRL_PIN(DSI_DN0, "dsi_dn0"),
319 PINCTRL_PIN(DSI_DP2, "dsi_dp2"),
320 PINCTRL_PIN(DSI_DN2, "dsi_dn2"),
321 PINCTRL_PIN(SENSOR0_PCLK, "sensor0_pclk"),
322 PINCTRL_PIN(CSI1_DN0, "csi1_dn0"),
323 PINCTRL_PIN(CSI1_DP0, "csi1_dp0"),
324 PINCTRL_PIN(CSI1_DN1, "csi1_dn1"),
325 PINCTRL_PIN(CSI1_DP1, "csi1_dp1"),
326 PINCTRL_PIN(CSI1_CN, "csi1_cn"),
327 PINCTRL_PIN(CSI1_CP, "csi1_cp"),
328 PINCTRL_PIN(SENSOR0_CKOUT, "sensor0_ckout"),
329 PINCTRL_PIN(NAND0_D0, "nand0_d0"),
330 PINCTRL_PIN(NAND0_D1, "nand0_d1"),
331 PINCTRL_PIN(NAND0_D2, "nand0_d2"),
332 PINCTRL_PIN(NAND0_D3, "nand0_d3"),
333 PINCTRL_PIN(NAND0_D4, "nand0_d4"),
334 PINCTRL_PIN(NAND0_D5, "nand0_d5"),
335 PINCTRL_PIN(NAND0_D6, "nand0_d6"),
336 PINCTRL_PIN(NAND0_D7, "nand0_d7"),
337 PINCTRL_PIN(NAND0_DQS, "nand0_dqs"),
338 PINCTRL_PIN(NAND0_DQSN, "nand0_dqsn"),
339 PINCTRL_PIN(NAND0_ALE, "nand0_ale"),
340 PINCTRL_PIN(NAND0_CLE, "nand0_cle"),
341 PINCTRL_PIN(NAND0_CEB0, "nand0_ceb0"),
342 PINCTRL_PIN(NAND0_CEB1, "nand0_ceb1"),
343 PINCTRL_PIN(NAND0_CEB2, "nand0_ceb2"),
344 PINCTRL_PIN(NAND0_CEB3, "nand0_ceb3"),
345 PINCTRL_PIN(NAND1_D0, "nand1_d0"),
346 PINCTRL_PIN(NAND1_D1, "nand1_d1"),
347 PINCTRL_PIN(NAND1_D2, "nand1_d2"),
348 PINCTRL_PIN(NAND1_D3, "nand1_d3"),
349 PINCTRL_PIN(NAND1_D4, "nand1_d4"),
350 PINCTRL_PIN(NAND1_D5, "nand1_d5"),
351 PINCTRL_PIN(NAND1_D6, "nand1_d6"),
352 PINCTRL_PIN(NAND1_D7, "nand1_d7"),
353 PINCTRL_PIN(NAND1_DQS, "nand1_dqs"),
354 PINCTRL_PIN(NAND1_DQSN, "nand1_dqsn"),
355 PINCTRL_PIN(NAND1_ALE, "nand1_ale"),
356 PINCTRL_PIN(NAND1_CLE, "nand1_cle"),
357 PINCTRL_PIN(NAND1_CEB0, "nand1_ceb0"),
358 PINCTRL_PIN(NAND1_CEB1, "nand1_ceb1"),
359 PINCTRL_PIN(NAND1_CEB2, "nand1_ceb2"),
360 PINCTRL_PIN(NAND1_CEB3, "nand1_ceb3"),
361 PINCTRL_PIN(SGPIO0, "sgpio0"),
362 PINCTRL_PIN(SGPIO1, "sgpio1"),
363 PINCTRL_PIN(SGPIO2, "sgpio2"),
364 PINCTRL_PIN(SGPIO3, "sgpio3")
365};
366
367enum s900_pinmux_functions {
368 S900_MUX_ERAM,
369 S900_MUX_ETH_RMII,
370 S900_MUX_ETH_SMII,
371 S900_MUX_SPI0,
372 S900_MUX_SPI1,
373 S900_MUX_SPI2,
374 S900_MUX_SPI3,
375 S900_MUX_SENS0,
376 S900_MUX_UART0,
377 S900_MUX_UART1,
378 S900_MUX_UART2,
379 S900_MUX_UART3,
380 S900_MUX_UART4,
381 S900_MUX_UART5,
382 S900_MUX_UART6,
383 S900_MUX_I2S0,
384 S900_MUX_I2S1,
385 S900_MUX_PCM0,
386 S900_MUX_PCM1,
387 S900_MUX_JTAG,
388 S900_MUX_PWM0,
389 S900_MUX_PWM1,
390 S900_MUX_PWM2,
391 S900_MUX_PWM3,
392 S900_MUX_PWM4,
393 S900_MUX_PWM5,
394 S900_MUX_SD0,
395 S900_MUX_SD1,
396 S900_MUX_SD2,
397 S900_MUX_SD3,
398 S900_MUX_I2C0,
399 S900_MUX_I2C1,
400 S900_MUX_I2C2,
401 S900_MUX_I2C3,
402 S900_MUX_I2C4,
403 S900_MUX_I2C5,
404 S900_MUX_LVDS,
405 S900_MUX_USB20,
406 S900_MUX_USB30,
407 S900_MUX_GPU,
408 S900_MUX_MIPI_CSI0,
409 S900_MUX_MIPI_CSI1,
410 S900_MUX_MIPI_DSI,
411 S900_MUX_NAND0,
412 S900_MUX_NAND1,
413 S900_MUX_SPDIF,
414 S900_MUX_SIRQ0,
415 S900_MUX_SIRQ1,
416 S900_MUX_SIRQ2,
417 S900_MUX_AUX_START,
418 S900_MUX_MAX,
419 S900_MUX_RESERVED
420};
421
422/* mfp0_22 */
423static unsigned int lvds_oxx_uart4_mfp_pads[] = { LVDS_OAP, LVDS_OAN };
424static unsigned int lvds_oxx_uart4_mfp_funcs[] = { S900_MUX_ERAM,
425 S900_MUX_UART4 };
426/* mfp0_21_20 */
427static unsigned int rmii_mdc_mfp_pads[] = { ETH_MDC };
428static unsigned int rmii_mdc_mfp_funcs[] = { S900_MUX_ETH_RMII,
429 S900_MUX_PWM2,
430 S900_MUX_UART2,
431 S900_MUX_RESERVED };
432static unsigned int rmii_mdio_mfp_pads[] = { ETH_MDIO };
433static unsigned int rmii_mdio_mfp_funcs[] = { S900_MUX_ETH_RMII,
434 S900_MUX_PWM3,
435 S900_MUX_UART2,
436 S900_MUX_RESERVED };
437/* mfp0_19 */
438static unsigned int sirq0_mfp_pads[] = { SIRQ0 };
439static unsigned int sirq0_mfp_funcs[] = { S900_MUX_SIRQ0,
440 S900_MUX_PWM0 };
441static unsigned int sirq1_mfp_pads[] = { SIRQ1 };
442static unsigned int sirq1_mfp_funcs[] = { S900_MUX_SIRQ1,
443 S900_MUX_PWM1 };
444/* mfp0_18_16 */
445static unsigned int rmii_txd0_mfp_pads[] = { ETH_TXD0 };
446static unsigned int rmii_txd0_mfp_funcs[] = { S900_MUX_ETH_RMII,
447 S900_MUX_ETH_SMII,
448 S900_MUX_SPI2,
449 S900_MUX_UART6,
450 S900_MUX_SENS0,
451 S900_MUX_PWM0 };
452static unsigned int rmii_txd1_mfp_pads[] = { ETH_TXD1 };
453static unsigned int rmii_txd1_mfp_funcs[] = { S900_MUX_ETH_RMII,
454 S900_MUX_ETH_SMII,
455 S900_MUX_SPI2,
456 S900_MUX_UART6,
457 S900_MUX_SENS0,
458 S900_MUX_PWM1 };
459/* mfp0_15_13 */
460static unsigned int rmii_txen_mfp_pads[] = { ETH_TXEN };
461static unsigned int rmii_txen_mfp_funcs[] = { S900_MUX_ETH_RMII,
462 S900_MUX_UART2,
463 S900_MUX_SPI3,
464 S900_MUX_RESERVED,
465 S900_MUX_RESERVED,
466 S900_MUX_PWM2,
467 S900_MUX_SENS0 };
468
469static unsigned int rmii_rxer_mfp_pads[] = { ETH_RXER };
470static unsigned int rmii_rxer_mfp_funcs[] = { S900_MUX_ETH_RMII,
471 S900_MUX_UART2,
472 S900_MUX_SPI3,
473 S900_MUX_RESERVED,
474 S900_MUX_RESERVED,
475 S900_MUX_PWM3,
476 S900_MUX_SENS0 };
477/* mfp0_12_11 */
478static unsigned int rmii_crs_dv_mfp_pads[] = { ETH_CRS_DV };
479static unsigned int rmii_crs_dv_mfp_funcs[] = { S900_MUX_ETH_RMII,
480 S900_MUX_ETH_SMII,
481 S900_MUX_SPI2,
482 S900_MUX_UART4 };
483/* mfp0_10_8 */
484static unsigned int rmii_rxd1_mfp_pads[] = { ETH_RXD1 };
485static unsigned int rmii_rxd1_mfp_funcs[] = { S900_MUX_ETH_RMII,
486 S900_MUX_UART2,
487 S900_MUX_SPI3,
488 S900_MUX_RESERVED,
489 S900_MUX_UART5,
490 S900_MUX_PWM0,
491 S900_MUX_SENS0 };
492static unsigned int rmii_rxd0_mfp_pads[] = { ETH_RXD0 };
493static unsigned int rmii_rxd0_mfp_funcs[] = { S900_MUX_ETH_RMII,
494 S900_MUX_UART2,
495 S900_MUX_SPI3,
496 S900_MUX_RESERVED,
497 S900_MUX_UART5,
498 S900_MUX_PWM1,
499 S900_MUX_SENS0 };
500/* mfp0_7_6 */
501static unsigned int rmii_ref_clk_mfp_pads[] = { ETH_REF_CLK };
502static unsigned int rmii_ref_clk_mfp_funcs[] = { S900_MUX_ETH_RMII,
503 S900_MUX_UART4,
504 S900_MUX_SPI2,
505 S900_MUX_RESERVED };
506/* mfp0_5 */
507static unsigned int i2s_d0_mfp_pads[] = { I2S_D0 };
508static unsigned int i2s_d0_mfp_funcs[] = { S900_MUX_I2S0,
509 S900_MUX_PCM0 };
510static unsigned int i2s_d1_mfp_pads[] = { I2S_D1 };
511static unsigned int i2s_d1_mfp_funcs[] = { S900_MUX_I2S1,
512 S900_MUX_PCM0 };
513
514/* mfp0_4_3 */
515static unsigned int i2s_lr_m_clk0_mfp_pads[] = { I2S_LRCLK0,
516 I2S_MCLK0 };
517static unsigned int i2s_lr_m_clk0_mfp_funcs[] = { S900_MUX_I2S0,
518 S900_MUX_PCM0,
519 S900_MUX_PCM1,
520 S900_MUX_RESERVED };
521/* mfp0_2 */
522static unsigned int i2s_bclk0_mfp_pads[] = { I2S_BCLK0 };
523static unsigned int i2s_bclk0_mfp_funcs[] = { S900_MUX_I2S0,
524 S900_MUX_PCM0 };
525static unsigned int i2s_bclk1_mclk1_mfp_pads[] = { I2S_BCLK1,
526 I2S_LRCLK1,
527 I2S_MCLK1 };
528static unsigned int i2s_bclk1_mclk1_mfp_funcs[] = { S900_MUX_I2S1,
529 S900_MUX_PCM0 };
530/* mfp0_1_0 */
531static unsigned int pcm1_in_out_mfp_pads[] = { PCM1_IN,
532 PCM1_OUT };
533static unsigned int pcm1_in_out_mfp_funcs[] = { S900_MUX_PCM1,
534 S900_MUX_SPI1,
535 S900_MUX_I2C3,
536 S900_MUX_UART4 };
537static unsigned int pcm1_clk_mfp_pads[] = { PCM1_CLK };
538static unsigned int pcm1_clk_mfp_funcs[] = { S900_MUX_PCM1,
539 S900_MUX_SPI1,
540 S900_MUX_PWM4,
541 S900_MUX_UART4 };
542static unsigned int pcm1_sync_mfp_pads[] = { PCM1_SYNC };
543static unsigned int pcm1_sync_mfp_funcs[] = { S900_MUX_PCM1,
544 S900_MUX_SPI1,
545 S900_MUX_PWM5,
546 S900_MUX_UART4 };
547/* mfp1_31_29 */
548static unsigned int eram_a5_mfp_pads[] = { ERAM_A5 };
549static unsigned int eram_a5_mfp_funcs[] = { S900_MUX_UART4,
550 S900_MUX_JTAG,
551 S900_MUX_ERAM,
552 S900_MUX_PWM0,
553 S900_MUX_RESERVED,
554 S900_MUX_SENS0 };
555static unsigned int eram_a6_mfp_pads[] = { ERAM_A6 };
556static unsigned int eram_a6_mfp_funcs[] = { S900_MUX_UART4,
557 S900_MUX_JTAG,
558 S900_MUX_ERAM,
559 S900_MUX_PWM1,
560 S900_MUX_RESERVED,
561 S900_MUX_SENS0,
562};
563static unsigned int eram_a7_mfp_pads[] = { ERAM_A7 };
564static unsigned int eram_a7_mfp_funcs[] = { S900_MUX_RESERVED,
565 S900_MUX_JTAG,
566 S900_MUX_ERAM,
567 S900_MUX_RESERVED,
568 S900_MUX_RESERVED,
569 S900_MUX_SENS0 };
570/* mfp1_28_26 */
571static unsigned int eram_a8_mfp_pads[] = { ERAM_A8 };
572static unsigned int eram_a8_mfp_funcs[] = { S900_MUX_RESERVED,
573 S900_MUX_JTAG,
574 S900_MUX_ERAM,
575 S900_MUX_PWM1,
576 S900_MUX_RESERVED,
577 S900_MUX_SENS0 };
578static unsigned int eram_a9_mfp_pads[] = { ERAM_A9 };
579static unsigned int eram_a9_mfp_funcs[] = { S900_MUX_USB20,
580 S900_MUX_UART5,
581 S900_MUX_ERAM,
582 S900_MUX_PWM2,
583 S900_MUX_RESERVED,
584 S900_MUX_SENS0 };
585static unsigned int eram_a10_mfp_pads[] = { ERAM_A10 };
586static unsigned int eram_a10_mfp_funcs[] = { S900_MUX_USB30,
587 S900_MUX_JTAG,
588 S900_MUX_ERAM,
589 S900_MUX_PWM3,
590 S900_MUX_RESERVED,
591 S900_MUX_SENS0,
592 S900_MUX_RESERVED,
593 S900_MUX_RESERVED };
594/* mfp1_25_23 */
595static unsigned int eram_a11_mfp_pads[] = { ERAM_A11 };
596static unsigned int eram_a11_mfp_funcs[] = { S900_MUX_RESERVED,
597 S900_MUX_RESERVED,
598 S900_MUX_ERAM,
599 S900_MUX_PWM2,
600 S900_MUX_UART5,
601 S900_MUX_RESERVED,
602 S900_MUX_SENS0,
603 S900_MUX_RESERVED };
604/* mfp1_22 */
605static unsigned int lvds_oep_odn_mfp_pads[] = { LVDS_OEP,
606 LVDS_OEN,
607 LVDS_ODP,
608 LVDS_ODN };
609static unsigned int lvds_oep_odn_mfp_funcs[] = { S900_MUX_LVDS,
610 S900_MUX_UART2 };
611static unsigned int lvds_ocp_obn_mfp_pads[] = { LVDS_OCP,
612 LVDS_OCN,
613 LVDS_OBP,
614 LVDS_OBN };
615static unsigned int lvds_ocp_obn_mfp_funcs[] = { S900_MUX_LVDS,
616 S900_MUX_PCM1 };
617static unsigned int lvds_oap_oan_mfp_pads[] = { LVDS_OAP,
618 LVDS_OAN };
619static unsigned int lvds_oap_oan_mfp_funcs[] = { S900_MUX_LVDS,
620 S900_MUX_ERAM };
621/* mfp1_21 */
622static unsigned int lvds_e_mfp_pads[] = { LVDS_EEP,
623 LVDS_EEN,
624 LVDS_EDP,
625 LVDS_EDN,
626 LVDS_ECP,
627 LVDS_ECN,
628 LVDS_EBP,
629 LVDS_EBN,
630 LVDS_EAP,
631 LVDS_EAN };
632static unsigned int lvds_e_mfp_funcs[] = { S900_MUX_LVDS,
633 S900_MUX_ERAM };
634/* mfp1_5_4 */
635static unsigned int spi0_sclk_mosi_mfp_pads[] = { SPI0_SCLK,
636 SPI0_MOSI };
637static unsigned int spi0_sclk_mosi_mfp_funcs[] = { S900_MUX_SPI0,
638 S900_MUX_ERAM,
639 S900_MUX_I2C3,
640 S900_MUX_PCM0 };
641/* mfp1_3_1 */
642static unsigned int spi0_ss_mfp_pads[] = { SPI0_SS };
643static unsigned int spi0_ss_mfp_funcs[] = { S900_MUX_SPI0,
644 S900_MUX_ERAM,
645 S900_MUX_I2S1,
646 S900_MUX_PCM1,
647 S900_MUX_PCM0,
648 S900_MUX_PWM4 };
649static unsigned int spi0_miso_mfp_pads[] = { SPI0_MISO };
650static unsigned int spi0_miso_mfp_funcs[] = { S900_MUX_SPI0,
651 S900_MUX_ERAM,
652 S900_MUX_I2S1,
653 S900_MUX_PCM1,
654 S900_MUX_PCM0,
655 S900_MUX_PWM5 };
656/* mfp2_23 */
657static unsigned int uart2_rtsb_mfp_pads[] = { UART2_RTSB };
658static unsigned int uart2_rtsb_mfp_funcs[] = { S900_MUX_UART2,
659 S900_MUX_UART0 };
660/* mfp2_22 */
661static unsigned int uart2_ctsb_mfp_pads[] = { UART2_CTSB };
662static unsigned int uart2_ctsb_mfp_funcs[] = { S900_MUX_UART2,
663 S900_MUX_UART0 };
664/* mfp2_21 */
665static unsigned int uart3_rtsb_mfp_pads[] = { UART3_RTSB };
666static unsigned int uart3_rtsb_mfp_funcs[] = { S900_MUX_UART3,
667 S900_MUX_UART5 };
668/* mfp2_20 */
669static unsigned int uart3_ctsb_mfp_pads[] = { UART3_CTSB };
670static unsigned int uart3_ctsb_mfp_funcs[] = { S900_MUX_UART3,
671 S900_MUX_UART5 };
672/* mfp2_19_17 */
673static unsigned int sd0_d0_mfp_pads[] = { SD0_D0 };
674static unsigned int sd0_d0_mfp_funcs[] = { S900_MUX_SD0,
675 S900_MUX_ERAM,
676 S900_MUX_RESERVED,
677 S900_MUX_JTAG,
678 S900_MUX_UART2,
679 S900_MUX_UART5,
680 S900_MUX_GPU };
681/* mfp2_16_14 */
682static unsigned int sd0_d1_mfp_pads[] = { SD0_D1 };
683static unsigned int sd0_d1_mfp_funcs[] = { S900_MUX_SD0,
684 S900_MUX_ERAM,
685 S900_MUX_GPU,
686 S900_MUX_RESERVED,
687 S900_MUX_UART2,
688 S900_MUX_UART5 };
689/* mfp_13_11 */
690static unsigned int sd0_d2_d3_mfp_pads[] = { SD0_D2,
691 SD0_D3 };
692static unsigned int sd0_d2_d3_mfp_funcs[] = { S900_MUX_SD0,
693 S900_MUX_ERAM,
694 S900_MUX_RESERVED,
695 S900_MUX_JTAG,
696 S900_MUX_UART2,
697 S900_MUX_UART1,
698 S900_MUX_GPU };
699/* mfp2_10_9 */
700static unsigned int sd1_d0_d3_mfp_pads[] = { SD1_D0, SD1_D1,
701 SD1_D2, SD1_D3 };
702static unsigned int sd1_d0_d3_mfp_funcs[] = { S900_MUX_SD1,
703 S900_MUX_ERAM };
704/* mfp2_8_7 */
705static unsigned int sd0_cmd_mfp_pads[] = { SD0_CMD };
706static unsigned int sd0_cmd_mfp_funcs[] = { S900_MUX_SD0,
707 S900_MUX_ERAM,
708 S900_MUX_GPU,
709 S900_MUX_JTAG };
710/* mfp2_6_5 */
711static unsigned int sd0_clk_mfp_pads[] = { SD0_CLK };
712static unsigned int sd0_clk_mfp_funcs[] = { S900_MUX_SD0,
713 S900_MUX_ERAM,
714 S900_MUX_JTAG,
715 S900_MUX_GPU };
716/* mfp2_4_3 */
717static unsigned int sd1_cmd_clk_mfp_pads[] = { SD1_CMD, SD1_CLK };
718static unsigned int sd1_cmd_clk_mfp_funcs[] = { S900_MUX_SD1,
719 S900_MUX_ERAM };
720/* mfp2_2_0 */
721static unsigned int uart0_rx_mfp_pads[] = { UART0_RX };
722static unsigned int uart0_rx_mfp_funcs[] = { S900_MUX_UART0,
723 S900_MUX_UART2,
724 S900_MUX_SPI1,
725 S900_MUX_I2C5,
726 S900_MUX_PCM1,
727 S900_MUX_I2S1 };
728/* mfp3_27 */
729static unsigned int nand0_d0_ceb3_mfp_pads[] = { NAND0_D0, NAND0_D1,
730 NAND0_D2, NAND0_D3,
731 NAND0_D4, NAND0_D5,
732 NAND0_D6, NAND0_D7,
733 NAND0_DQSN, NAND0_CEB3 };
734static unsigned int nand0_d0_ceb3_mfp_funcs[] = { S900_MUX_NAND0,
735 S900_MUX_SD2 };
736/* mfp3_21_19 */
737static unsigned int uart0_tx_mfp_pads[] = { UART0_TX };
738static unsigned int uart0_tx_mfp_funcs[] = { S900_MUX_UART0,
739 S900_MUX_UART2,
740 S900_MUX_SPI1,
741 S900_MUX_I2C5,
742 S900_MUX_SPDIF,
743 S900_MUX_PCM1,
744 S900_MUX_I2S1 };
745/* mfp3_18_16 */
746static unsigned int i2c0_mfp_pads[] = { I2C0_SCLK, I2C0_SDATA };
747static unsigned int i2c0_mfp_funcs[] = { S900_MUX_I2C0,
748 S900_MUX_UART2,
749 S900_MUX_I2C1,
750 S900_MUX_UART1,
751 S900_MUX_SPI1 };
752/* mfp3_15 */
753static unsigned int csi0_cn_cp_mfp_pads[] = { CSI0_CN, CSI0_CP };
754static unsigned int csi0_cn_cp_mfp_funcs[] = { S900_MUX_SENS0,
755 S900_MUX_SENS0 };
756/* mfp3_14 */
757static unsigned int csi0_dn0_dp3_mfp_pads[] = { CSI0_DN0, CSI0_DP0,
758 CSI0_DN1, CSI0_DP1,
759 CSI0_CN, CSI0_CP,
760 CSI0_DP2, CSI0_DN2,
761 CSI0_DN3, CSI0_DP3 };
762static unsigned int csi0_dn0_dp3_mfp_funcs[] = { S900_MUX_MIPI_CSI0,
763 S900_MUX_SENS0 };
764/* mfp3_13 */
765static unsigned int csi1_dn0_cp_mfp_pads[] = { CSI1_DN0, CSI1_DP0,
766 CSI1_DN1, CSI1_DP1,
767 CSI1_CN, CSI1_CP };
768static unsigned int csi1_dn0_cp_mfp_funcs[] = { S900_MUX_MIPI_CSI1,
769 S900_MUX_SENS0 };
770/* mfp3_12_dsi */
771static unsigned int dsi_dp3_dn1_mfp_pads[] = { DSI_DP3, DSI_DN2,
772 DSI_DP1, DSI_DN1 };
773static unsigned int dsi_dp3_dn1_mfp_funcs[] = { S900_MUX_MIPI_DSI,
774 S900_MUX_UART2 };
775static unsigned int dsi_cp_dn0_mfp_pads[] = { DSI_CP, DSI_CN,
776 DSI_DP0, DSI_DN0 };
777static unsigned int dsi_cp_dn0_mfp_funcs[] = { S900_MUX_MIPI_DSI,
778 S900_MUX_PCM1 };
779static unsigned int dsi_dp2_dn2_mfp_pads[] = { DSI_DP2, DSI_DN2 };
780static unsigned int dsi_dp2_dn2_mfp_funcs[] = { S900_MUX_MIPI_DSI,
781 S900_MUX_UART4 };
782/* mfp3_11 */
783static unsigned int nand1_d0_ceb1_mfp_pads[] = { NAND1_D0, NAND1_D1,
784 NAND1_D2, NAND1_D3,
785 NAND1_D4, NAND1_D5,
786 NAND1_D6, NAND1_D7,
787 NAND1_DQSN, NAND1_CEB1 };
788static unsigned int nand1_d0_ceb1_mfp_funcs[] = { S900_MUX_NAND1,
789 S900_MUX_SD3 };
790/* mfp3_10 */
791static unsigned int nand1_ceb3_mfp_pads[] = { NAND1_CEB3 };
792static unsigned int nand1_ceb3_mfp_funcs[] = { S900_MUX_NAND1,
793 S900_MUX_PWM0 };
794static unsigned int nand1_ceb0_mfp_pads[] = { NAND1_CEB0 };
795static unsigned int nand1_ceb0_mfp_funcs[] = { S900_MUX_NAND1,
796 S900_MUX_PWM1 };
797/* mfp3_9 */
798static unsigned int csi1_dn0_dp0_mfp_pads[] = { CSI1_DN0, CSI1_DP0 };
799static unsigned int csi1_dn0_dp0_mfp_funcs[] = { S900_MUX_SENS0,
800 S900_MUX_SENS0 };
801/* mfp3_8 */
802static unsigned int uart4_rx_tx_mfp_pads[] = { UART4_RX, UART4_TX };
803static unsigned int uart4_rx_tx_mfp_funcs[] = { S900_MUX_UART4,
804 S900_MUX_I2C4 };
805/* PADDRV group data */
806/* drv0 */
807static unsigned int sgpio3_drv_pads[] = { SGPIO3 };
808static unsigned int sgpio2_drv_pads[] = { SGPIO2 };
809static unsigned int sgpio1_drv_pads[] = { SGPIO1 };
810static unsigned int sgpio0_drv_pads[] = { SGPIO0 };
811static unsigned int rmii_tx_d0_d1_drv_pads[] = { ETH_TXD0, ETH_TXD1 };
812static unsigned int rmii_txen_rxer_drv_pads[] = { ETH_TXEN, ETH_RXER };
813static unsigned int rmii_crs_dv_drv_pads[] = { ETH_CRS_DV };
814static unsigned int rmii_rx_d1_d0_drv_pads[] = { ETH_RXD1, ETH_RXD0 };
815static unsigned int rmii_ref_clk_drv_pads[] = { ETH_REF_CLK };
816static unsigned int rmii_mdc_mdio_drv_pads[] = { ETH_MDC, ETH_MDIO };
817static unsigned int sirq_0_1_drv_pads[] = { SIRQ0, SIRQ1 };
818static unsigned int sirq2_drv_pads[] = { SIRQ2 };
819static unsigned int i2s_d0_d1_drv_pads[] = { I2S_D0, I2S_D1 };
820static unsigned int i2s_lr_m_clk0_drv_pads[] = { I2S_LRCLK0, I2S_MCLK0 };
821static unsigned int i2s_blk1_mclk1_drv_pads[] = { I2S_BCLK0, I2S_BCLK1,
822 I2S_LRCLK1, I2S_MCLK1 };
823static unsigned int pcm1_in_out_drv_pads[] = { PCM1_IN, PCM1_CLK,
824 PCM1_SYNC, PCM1_OUT };
825/* drv1 */
826static unsigned int lvds_oap_oan_drv_pads[] = { LVDS_OAP, LVDS_OAN };
827static unsigned int lvds_oep_odn_drv_pads[] = { LVDS_OEP, LVDS_OEN,
828 LVDS_ODP, LVDS_ODN };
829static unsigned int lvds_ocp_obn_drv_pads[] = { LVDS_OCP, LVDS_OCN,
830 LVDS_OBP, LVDS_OBN };
831static unsigned int lvds_e_drv_pads[] = { LVDS_EEP, LVDS_EEN,
832 LVDS_EDP, LVDS_EDN,
833 LVDS_ECP, LVDS_ECN,
834 LVDS_EBP, LVDS_EBN };
835static unsigned int sd0_d3_d0_drv_pads[] = { SD0_D3, SD0_D2,
836 SD0_D1, SD0_D0 };
837static unsigned int sd1_d3_d0_drv_pads[] = { SD1_D3, SD1_D2,
838 SD1_D1, SD1_D0 };
839static unsigned int sd0_sd1_cmd_clk_drv_pads[] = { SD0_CLK, SD0_CMD,
840 SD1_CLK, SD1_CMD };
841static unsigned int spi0_sclk_mosi_drv_pads[] = { SPI0_SCLK, SPI0_MOSI };
842static unsigned int spi0_ss_miso_drv_pads[] = { SPI0_SS, SPI0_MISO };
843static unsigned int uart0_rx_tx_drv_pads[] = { UART0_RX, UART0_TX };
844static unsigned int uart4_rx_tx_drv_pads[] = { UART4_RX, UART4_TX };
845static unsigned int uart2_drv_pads[] = { UART2_RX, UART2_TX,
846 UART2_RTSB, UART2_CTSB };
847static unsigned int uart3_drv_pads[] = { UART3_RX, UART3_TX,
848 UART3_RTSB, UART3_CTSB };
849/* drv2 */
850static unsigned int i2c0_drv_pads[] = { I2C0_SCLK, I2C0_SDATA };
851static unsigned int i2c1_drv_pads[] = { I2C1_SCLK, I2C1_SDATA };
852static unsigned int i2c2_drv_pads[] = { I2C2_SCLK, I2C2_SDATA };
853static unsigned int sensor0_drv_pads[] = { SENSOR0_PCLK,
854 SENSOR0_CKOUT };
855/* SR group data */
856/* sr0 */
857static unsigned int sgpio3_sr_pads[] = { SGPIO3 };
858static unsigned int sgpio2_sr_pads[] = { SGPIO2 };
859static unsigned int sgpio1_sr_pads[] = { SGPIO1 };
860static unsigned int sgpio0_sr_pads[] = { SGPIO0 };
861static unsigned int rmii_tx_d0_d1_sr_pads[] = { ETH_TXD0, ETH_TXD1 };
862static unsigned int rmii_txen_rxer_sr_pads[] = { ETH_TXEN, ETH_RXER };
863static unsigned int rmii_crs_dv_sr_pads[] = { ETH_CRS_DV };
864static unsigned int rmii_rx_d1_d0_sr_pads[] = { ETH_RXD1, ETH_RXD0 };
865static unsigned int rmii_ref_clk_sr_pads[] = { ETH_REF_CLK };
866static unsigned int rmii_mdc_mdio_sr_pads[] = { ETH_MDC, ETH_MDIO };
867static unsigned int sirq_0_1_sr_pads[] = { SIRQ0, SIRQ1 };
868static unsigned int sirq2_sr_pads[] = { SIRQ2 };
869static unsigned int i2s_do_d1_sr_pads[] = { I2S_D0, I2S_D1 };
870static unsigned int i2s_lr_m_clk0_sr_pads[] = { I2S_LRCLK0, I2S_MCLK0 };
871static unsigned int i2s_bclk0_mclk1_sr_pads[] = { I2S_BCLK0, I2S_BCLK1,
872 I2S_LRCLK1, I2S_MCLK1 };
873static unsigned int pcm1_in_out_sr_pads[] = { PCM1_IN, PCM1_CLK,
874 PCM1_SYNC, PCM1_OUT };
875/* sr1 */
876static unsigned int sd1_d3_d0_sr_pads[] = { SD1_D3, SD1_D2,
877 SD1_D1, SD1_D0 };
878static unsigned int sd0_sd1_clk_cmd_sr_pads[] = { SD0_CLK, SD0_CMD,
879 SD1_CLK, SD1_CMD };
880static unsigned int spi0_sclk_mosi_sr_pads[] = { SPI0_SCLK, SPI0_MOSI };
881static unsigned int spi0_ss_miso_sr_pads[] = { SPI0_SS, SPI0_MISO };
882static unsigned int uart0_rx_tx_sr_pads[] = { UART0_RX, UART0_TX };
883static unsigned int uart4_rx_tx_sr_pads[] = { UART4_RX, UART4_TX };
884static unsigned int uart2_sr_pads[] = { UART2_RX, UART2_TX,
885 UART2_RTSB, UART2_CTSB };
886static unsigned int uart3_sr_pads[] = { UART3_RX, UART3_TX,
887 UART3_RTSB, UART3_CTSB };
888/* sr2 */
889static unsigned int i2c0_sr_pads[] = { I2C0_SCLK, I2C0_SDATA };
890static unsigned int i2c1_sr_pads[] = { I2C1_SCLK, I2C1_SDATA };
891static unsigned int i2c2_sr_pads[] = { I2C2_SCLK, I2C2_SDATA };
892static unsigned int sensor0_sr_pads[] = { SENSOR0_PCLK,
893 SENSOR0_CKOUT };
894
895#define MUX_PG(group_name, reg, shift, width) \
896 { \
897 .name = #group_name, \
898 .pads = group_name##_pads, \
899 .npads = ARRAY_SIZE(group_name##_pads), \
900 .funcs = group_name##_funcs, \
901 .nfuncs = ARRAY_SIZE(group_name##_funcs), \
902 .mfpctl_reg = MFCTL##reg, \
903 .mfpctl_shift = shift, \
904 .mfpctl_width = width, \
905 .drv_reg = -1, \
906 .drv_shift = -1, \
907 .drv_width = -1, \
908 .sr_reg = -1, \
909 .sr_shift = -1, \
910 .sr_width = -1, \
911 }
912
913#define DRV_PG(group_name, reg, shift, width) \
914 { \
915 .name = #group_name, \
916 .pads = group_name##_pads, \
917 .npads = ARRAY_SIZE(group_name##_pads), \
918 .mfpctl_reg = -1, \
919 .mfpctl_shift = -1, \
920 .mfpctl_width = -1, \
921 .drv_reg = PAD_DRV##reg, \
922 .drv_shift = shift, \
923 .drv_width = width, \
924 .sr_reg = -1, \
925 .sr_shift = -1, \
926 .sr_width = -1, \
927 }
928
929#define SR_PG(group_name, reg, shift, width) \
930 { \
931 .name = #group_name, \
932 .pads = group_name##_pads, \
933 .npads = ARRAY_SIZE(group_name##_pads), \
934 .mfpctl_reg = -1, \
935 .mfpctl_shift = -1, \
936 .mfpctl_width = -1, \
937 .drv_reg = -1, \
938 .drv_shift = -1, \
939 .drv_width = -1, \
940 .sr_reg = PAD_SR##reg, \
941 .sr_shift = shift, \
942 .sr_width = width, \
943 }
944
945/* Pinctrl groups */
946static const struct owl_pingroup s900_groups[] = {
947 MUX_PG(lvds_oxx_uart4_mfp, 0, 22, 1),
948 MUX_PG(rmii_mdc_mfp, 0, 20, 2),
949 MUX_PG(rmii_mdio_mfp, 0, 20, 2),
950 MUX_PG(sirq0_mfp, 0, 19, 1),
951 MUX_PG(sirq1_mfp, 0, 19, 1),
952 MUX_PG(rmii_txd0_mfp, 0, 16, 3),
953 MUX_PG(rmii_txd1_mfp, 0, 16, 3),
954 MUX_PG(rmii_txen_mfp, 0, 13, 3),
955 MUX_PG(rmii_rxer_mfp, 0, 13, 3),
956 MUX_PG(rmii_crs_dv_mfp, 0, 11, 2),
957 MUX_PG(rmii_rxd1_mfp, 0, 8, 3),
958 MUX_PG(rmii_rxd0_mfp, 0, 8, 3),
959 MUX_PG(rmii_ref_clk_mfp, 0, 6, 2),
960 MUX_PG(i2s_d0_mfp, 0, 5, 1),
961 MUX_PG(i2s_d1_mfp, 0, 5, 1),
962 MUX_PG(i2s_lr_m_clk0_mfp, 0, 3, 2),
963 MUX_PG(i2s_bclk0_mfp, 0, 2, 1),
964 MUX_PG(i2s_bclk1_mclk1_mfp, 0, 2, 1),
965 MUX_PG(pcm1_in_out_mfp, 0, 0, 2),
966 MUX_PG(pcm1_clk_mfp, 0, 0, 2),
967 MUX_PG(pcm1_sync_mfp, 0, 0, 2),
968 MUX_PG(eram_a5_mfp, 1, 29, 3),
969 MUX_PG(eram_a6_mfp, 1, 29, 3),
970 MUX_PG(eram_a7_mfp, 1, 29, 3),
971 MUX_PG(eram_a8_mfp, 1, 26, 3),
972 MUX_PG(eram_a9_mfp, 1, 26, 3),
973 MUX_PG(eram_a10_mfp, 1, 26, 3),
974 MUX_PG(eram_a11_mfp, 1, 23, 3),
975 MUX_PG(lvds_oep_odn_mfp, 1, 22, 1),
976 MUX_PG(lvds_ocp_obn_mfp, 1, 22, 1),
977 MUX_PG(lvds_oap_oan_mfp, 1, 22, 1),
978 MUX_PG(lvds_e_mfp, 1, 21, 1),
979 MUX_PG(spi0_sclk_mosi_mfp, 1, 4, 2),
980 MUX_PG(spi0_ss_mfp, 1, 1, 3),
981 MUX_PG(spi0_miso_mfp, 1, 1, 3),
982 MUX_PG(uart2_rtsb_mfp, 2, 23, 1),
983 MUX_PG(uart2_ctsb_mfp, 2, 22, 1),
984 MUX_PG(uart3_rtsb_mfp, 2, 21, 1),
985 MUX_PG(uart3_ctsb_mfp, 2, 20, 1),
986 MUX_PG(sd0_d0_mfp, 2, 17, 3),
987 MUX_PG(sd0_d1_mfp, 2, 14, 3),
988 MUX_PG(sd0_d2_d3_mfp, 2, 11, 3),
989 MUX_PG(sd1_d0_d3_mfp, 2, 9, 2),
990 MUX_PG(sd0_cmd_mfp, 2, 7, 2),
991 MUX_PG(sd0_clk_mfp, 2, 5, 2),
992 MUX_PG(sd1_cmd_clk_mfp, 2, 3, 2),
993 MUX_PG(uart0_rx_mfp, 2, 0, 3),
994 MUX_PG(nand0_d0_ceb3_mfp, 3, 27, 1),
995 MUX_PG(uart0_tx_mfp, 3, 19, 3),
996 MUX_PG(i2c0_mfp, 3, 16, 3),
997 MUX_PG(csi0_cn_cp_mfp, 3, 15, 1),
998 MUX_PG(csi0_dn0_dp3_mfp, 3, 14, 1),
999 MUX_PG(csi1_dn0_cp_mfp, 3, 13, 1),
1000 MUX_PG(dsi_dp3_dn1_mfp, 3, 12, 1),
1001 MUX_PG(dsi_cp_dn0_mfp, 3, 12, 1),
1002 MUX_PG(dsi_dp2_dn2_mfp, 3, 12, 1),
1003 MUX_PG(nand1_d0_ceb1_mfp, 3, 11, 1),
1004 MUX_PG(nand1_ceb3_mfp, 3, 10, 1),
1005 MUX_PG(nand1_ceb0_mfp, 3, 10, 1),
1006 MUX_PG(csi1_dn0_dp0_mfp, 3, 9, 1),
1007 MUX_PG(uart4_rx_tx_mfp, 3, 8, 1),
1008
1009 DRV_PG(sgpio3_drv, 0, 30, 2),
1010 DRV_PG(sgpio2_drv, 0, 28, 2),
1011 DRV_PG(sgpio1_drv, 0, 26, 2),
1012 DRV_PG(sgpio0_drv, 0, 24, 2),
1013 DRV_PG(rmii_tx_d0_d1_drv, 0, 22, 2),
1014 DRV_PG(rmii_txen_rxer_drv, 0, 20, 2),
1015 DRV_PG(rmii_crs_dv_drv, 0, 18, 2),
1016 DRV_PG(rmii_rx_d1_d0_drv, 0, 16, 2),
1017 DRV_PG(rmii_ref_clk_drv, 0, 14, 2),
1018 DRV_PG(rmii_mdc_mdio_drv, 0, 12, 2),
1019 DRV_PG(sirq_0_1_drv, 0, 10, 2),
1020 DRV_PG(sirq2_drv, 0, 8, 2),
1021 DRV_PG(i2s_d0_d1_drv, 0, 6, 2),
1022 DRV_PG(i2s_lr_m_clk0_drv, 0, 4, 2),
1023 DRV_PG(i2s_blk1_mclk1_drv, 0, 2, 2),
1024 DRV_PG(pcm1_in_out_drv, 0, 0, 2),
1025 DRV_PG(lvds_oap_oan_drv, 1, 28, 2),
1026 DRV_PG(lvds_oep_odn_drv, 1, 26, 2),
1027 DRV_PG(lvds_ocp_obn_drv, 1, 24, 2),
1028 DRV_PG(lvds_e_drv, 1, 22, 2),
1029 DRV_PG(sd0_d3_d0_drv, 1, 20, 2),
1030 DRV_PG(sd1_d3_d0_drv, 1, 18, 2),
1031 DRV_PG(sd0_sd1_cmd_clk_drv, 1, 16, 2),
1032 DRV_PG(spi0_sclk_mosi_drv, 1, 14, 2),
1033 DRV_PG(spi0_ss_miso_drv, 1, 12, 2),
1034 DRV_PG(uart0_rx_tx_drv, 1, 10, 2),
1035 DRV_PG(uart4_rx_tx_drv, 1, 8, 2),
1036 DRV_PG(uart2_drv, 1, 6, 2),
1037 DRV_PG(uart3_drv, 1, 4, 2),
1038 DRV_PG(i2c0_drv, 2, 30, 2),
1039 DRV_PG(i2c1_drv, 2, 28, 2),
1040 DRV_PG(i2c2_drv, 2, 26, 2),
1041 DRV_PG(sensor0_drv, 2, 20, 2),
1042
1043 SR_PG(sgpio3_sr, 0, 15, 1),
1044 SR_PG(sgpio2_sr, 0, 14, 1),
1045 SR_PG(sgpio1_sr, 0, 13, 1),
1046 SR_PG(sgpio0_sr, 0, 12, 1),
1047 SR_PG(rmii_tx_d0_d1_sr, 0, 11, 1),
1048 SR_PG(rmii_txen_rxer_sr, 0, 10, 1),
1049 SR_PG(rmii_crs_dv_sr, 0, 9, 1),
1050 SR_PG(rmii_rx_d1_d0_sr, 0, 8, 1),
1051 SR_PG(rmii_ref_clk_sr, 0, 7, 1),
1052 SR_PG(rmii_mdc_mdio_sr, 0, 6, 1),
1053 SR_PG(sirq_0_1_sr, 0, 5, 1),
1054 SR_PG(sirq2_sr, 0, 4, 1),
1055 SR_PG(i2s_do_d1_sr, 0, 3, 1),
1056 SR_PG(i2s_lr_m_clk0_sr, 0, 2, 1),
1057 SR_PG(i2s_bclk0_mclk1_sr, 0, 1, 1),
1058 SR_PG(pcm1_in_out_sr, 0, 0, 1),
1059 SR_PG(sd1_d3_d0_sr, 1, 25, 1),
1060 SR_PG(sd0_sd1_clk_cmd_sr, 1, 24, 1),
1061 SR_PG(spi0_sclk_mosi_sr, 1, 23, 1),
1062 SR_PG(spi0_ss_miso_sr, 1, 22, 1),
1063 SR_PG(uart0_rx_tx_sr, 1, 21, 1),
1064 SR_PG(uart4_rx_tx_sr, 1, 20, 1),
1065 SR_PG(uart2_sr, 1, 19, 1),
1066 SR_PG(uart3_sr, 1, 18, 1),
1067 SR_PG(i2c0_sr, 2, 31, 1),
1068 SR_PG(i2c1_sr, 2, 30, 1),
1069 SR_PG(i2c2_sr, 2, 29, 1),
1070 SR_PG(sensor0_sr, 2, 25, 1)
1071};
1072
1073static const char * const eram_groups[] = {
1074 "lvds_oxx_uart4_mfp",
1075 "eram_a5_mfp",
1076 "eram_a6_mfp",
1077 "eram_a7_mfp",
1078 "eram_a8_mfp",
1079 "eram_a9_mfp",
1080 "eram_a10_mfp",
1081 "eram_a11_mfp",
1082 "lvds_oap_oan_mfp",
1083 "lvds_e_mfp",
1084 "spi0_sclk_mosi_mfp",
1085 "spi0_ss_mfp",
1086 "spi0_miso_mfp",
1087 "sd0_d0_mfp",
1088 "sd0_d1_mfp",
1089 "sd0_d2_d3_mfp",
1090 "sd1_d0_d3_mfp",
1091 "sd0_cmd_mfp",
1092 "sd0_clk_mfp",
1093 "sd1_cmd_clk_mfp",
1094};
1095
1096static const char * const eth_rmii_groups[] = {
1097 "rmii_mdc_mfp",
1098 "rmii_mdio_mfp",
1099 "rmii_txd0_mfp",
1100 "rmii_txd1_mfp",
1101 "rmii_txen_mfp",
1102 "rmii_rxer_mfp",
1103 "rmii_crs_dv_mfp",
1104 "rmii_rxd1_mfp",
1105 "rmii_rxd0_mfp",
1106 "rmii_ref_clk_mfp",
1107 "eth_smi_dummy",
1108};
1109
1110static const char * const eth_smii_groups[] = {
1111 "rmii_txd0_mfp",
1112 "rmii_txd1_mfp",
1113 "rmii_crs_dv_mfp",
1114 "eth_smi_dummy",
1115};
1116
1117static const char * const spi0_groups[] = {
1118 "spi0_sclk_mosi_mfp",
1119 "spi0_ss_mfp",
1120 "spi0_miso_mfp",
1121 "spi0_sclk_mosi_mfp",
1122 "spi0_ss_mfp",
1123 "spi0_miso_mfp",
1124};
1125
1126static const char * const spi1_groups[] = {
1127 "pcm1_in_out_mfp",
1128 "pcm1_clk_mfp",
1129 "pcm1_sync_mfp",
1130 "uart0_rx_mfp",
1131 "uart0_tx_mfp",
1132 "i2c0_mfp",
1133};
1134
1135static const char * const spi2_groups[] = {
1136 "rmii_txd0_mfp",
1137 "rmii_txd1_mfp",
1138 "rmii_crs_dv_mfp",
1139 "rmii_ref_clk_mfp",
1140};
1141
1142static const char * const spi3_groups[] = {
1143 "rmii_txen_mfp",
1144 "rmii_rxer_mfp",
1145};
1146
1147static const char * const sens0_groups[] = {
1148 "rmii_txd0_mfp",
1149 "rmii_txd1_mfp",
1150 "rmii_txen_mfp",
1151 "rmii_rxer_mfp",
1152 "rmii_rxd1_mfp",
1153 "rmii_rxd0_mfp",
1154 "eram_a5_mfp",
1155 "eram_a6_mfp",
1156 "eram_a7_mfp",
1157 "eram_a8_mfp",
1158 "eram_a9_mfp",
1159 "csi0_cn_cp_mfp",
1160 "csi0_dn0_dp3_mfp",
1161 "csi1_dn0_cp_mfp",
1162 "csi1_dn0_dp0_mfp",
1163};
1164
1165static const char * const uart0_groups[] = {
1166 "uart2_rtsb_mfp",
1167 "uart2_ctsb_mfp",
1168 "uart0_rx_mfp",
1169 "uart0_tx_mfp",
1170};
1171
1172static const char * const uart1_groups[] = {
1173 "sd0_d2_d3_mfp",
1174 "i2c0_mfp",
1175};
1176
1177static const char * const uart2_groups[] = {
1178 "rmii_mdc_mfp",
1179 "rmii_mdio_mfp",
1180 "rmii_txen_mfp",
1181 "rmii_rxer_mfp",
1182 "rmii_rxd1_mfp",
1183 "rmii_rxd0_mfp",
1184 "lvds_oep_odn_mfp",
1185 "uart2_rtsb_mfp",
1186 "uart2_ctsb_mfp",
1187 "sd0_d0_mfp",
1188 "sd0_d1_mfp",
1189 "sd0_d2_d3_mfp",
1190 "uart0_rx_mfp",
1191 "uart0_tx_mfp_pads",
1192 "i2c0_mfp_pads",
1193 "dsi_dp3_dn1_mfp",
1194 "uart2_dummy"
1195};
1196
1197static const char * const uart3_groups[] = {
1198 "uart3_rtsb_mfp",
1199 "uart3_ctsb_mfp",
1200 "uart3_dummy"
1201};
1202
1203static const char * const uart4_groups[] = {
1204 "lvds_oxx_uart4_mfp",
1205 "rmii_crs_dv_mfp",
1206 "rmii_ref_clk_mfp",
1207 "pcm1_in_out_mfp",
1208 "pcm1_clk_mfp",
1209 "pcm1_sync_mfp",
1210 "eram_a5_mfp",
1211 "eram_a6_mfp",
1212 "dsi_dp2_dn2_mfp",
1213 "uart4_rx_tx_mfp_pads",
1214 "uart4_dummy"
1215};
1216
1217static const char * const uart5_groups[] = {
1218 "rmii_rxd1_mfp",
1219 "rmii_rxd0_mfp",
1220 "eram_a9_mfp",
1221 "eram_a11_mfp",
1222 "uart3_rtsb_mfp",
1223 "uart3_ctsb_mfp",
1224 "sd0_d0_mfp",
1225 "sd0_d1_mfp",
1226};
1227
1228static const char * const uart6_groups[] = {
1229 "rmii_txd0_mfp",
1230 "rmii_txd1_mfp",
1231};
1232
1233static const char * const i2s0_groups[] = {
1234 "i2s_d0_mfp",
1235 "i2s_lr_m_clk0_mfp",
1236 "i2s_bclk0_mfp",
1237 "i2s0_dummy",
1238};
1239
1240static const char * const i2s1_groups[] = {
1241 "i2s_d1_mfp",
1242 "i2s_bclk1_mclk1_mfp",
1243 "spi0_ss_mfp",
1244 "spi0_miso_mfp",
1245 "uart0_rx_mfp",
1246 "uart0_tx_mfp",
1247 "i2s1_dummy",
1248};
1249
1250static const char * const pcm0_groups[] = {
1251 "i2s_d0_mfp",
1252 "i2s_d1_mfp",
1253 "i2s_lr_m_clk0_mfp",
1254 "i2s_bclk0_mfp",
1255 "i2s_bclk1_mclk1_mfp",
1256 "spi0_sclk_mosi_mfp",
1257 "spi0_ss_mfp",
1258 "spi0_miso_mfp",
1259};
1260
1261static const char * const pcm1_groups[] = {
1262 "i2s_lr_m_clk0_mfp",
1263 "pcm1_in_out_mfp",
1264 "pcm1_clk_mfp",
1265 "pcm1_sync_mfp",
1266 "lvds_oep_odn_mfp",
1267 "spi0_ss_mfp",
1268 "spi0_miso_mfp",
1269 "uart0_rx_mfp",
1270 "uart0_tx_mfp",
1271 "dsi_cp_dn0_mfp",
1272 "pcm1_dummy",
1273};
1274
1275static const char * const jtag_groups[] = {
1276 "eram_a5_mfp",
1277 "eram_a6_mfp",
1278 "eram_a7_mfp",
1279 "eram_a8_mfp",
1280 "eram_a10_mfp",
1281 "eram_a10_mfp",
1282 "sd0_d2_d3_mfp",
1283 "sd0_cmd_mfp",
1284 "sd0_clk_mfp",
1285};
1286
1287static const char * const pwm0_groups[] = {
1288 "sirq0_mfp",
1289 "rmii_txd0_mfp",
1290 "rmii_rxd1_mfp",
1291 "eram_a5_mfp",
1292 "nand1_ceb3_mfp",
1293};
1294
1295static const char * const pwm1_groups[] = {
1296 "sirq1_mfp",
1297 "rmii_txd1_mfp",
1298 "rmii_rxd0_mfp",
1299 "eram_a6_mfp",
1300 "eram_a8_mfp",
1301 "nand1_ceb0_mfp",
1302};
1303
1304static const char * const pwm2_groups[] = {
1305 "rmii_mdc_mfp",
1306 "rmii_txen_mfp",
1307 "eram_a9_mfp",
1308 "eram_a11_mfp",
1309};
1310
1311static const char * const pwm3_groups[] = {
1312 "rmii_mdio_mfp",
1313 "rmii_rxer_mfp",
1314 "eram_a10_mfp",
1315};
1316
1317static const char * const pwm4_groups[] = {
1318 "pcm1_clk_mfp",
1319 "spi0_ss_mfp",
1320};
1321
1322static const char * const pwm5_groups[] = {
1323 "pcm1_sync_mfp",
1324 "spi0_miso_mfp",
1325};
1326
1327static const char * const sd0_groups[] = {
1328 "sd0_d0_mfp",
1329 "sd0_d1_mfp",
1330 "sd0_d2_d3_mfp",
1331 "sd0_cmd_mfp",
1332 "sd0_clk_mfp",
1333};
1334
1335static const char * const sd1_groups[] = {
1336 "sd1_d0_d3_mfp",
1337 "sd1_cmd_clk_mfp",
1338 "sd1_dummy",
1339};
1340
1341static const char * const sd2_groups[] = {
1342 "nand0_d0_ceb3_mfp",
1343};
1344
1345static const char * const sd3_groups[] = {
1346 "nand1_d0_ceb1_mfp",
1347};
1348
1349static const char * const i2c0_groups[] = {
1350 "i2c0_mfp",
1351};
1352
1353static const char * const i2c1_groups[] = {
1354 "i2c0_mfp",
1355 "i2c1_dummy"
1356};
1357
1358static const char * const i2c2_groups[] = {
1359 "i2c2_dummy"
1360};
1361
1362static const char * const i2c3_groups[] = {
1363 "pcm1_in_out_mfp",
1364 "spi0_sclk_mosi_mfp",
1365};
1366
1367static const char * const i2c4_groups[] = {
1368 "uart4_rx_tx_mfp",
1369};
1370
1371static const char * const i2c5_groups[] = {
1372 "uart0_rx_mfp",
1373 "uart0_tx_mfp",
1374};
1375
1376
1377static const char * const lvds_groups[] = {
1378 "lvds_oep_odn_mfp",
1379 "lvds_ocp_obn_mfp",
1380 "lvds_oap_oan_mfp",
1381 "lvds_e_mfp",
1382};
1383
1384static const char * const usb20_groups[] = {
1385 "eram_a9_mfp",
1386};
1387
1388static const char * const usb30_groups[] = {
1389 "eram_a10_mfp",
1390};
1391
1392static const char * const gpu_groups[] = {
1393 "sd0_d0_mfp",
1394 "sd0_d1_mfp",
1395 "sd0_d2_d3_mfp",
1396 "sd0_cmd_mfp",
1397 "sd0_clk_mfp",
1398};
1399
1400static const char * const mipi_csi0_groups[] = {
1401 "csi0_dn0_dp3_mfp",
1402};
1403
1404static const char * const mipi_csi1_groups[] = {
1405 "csi1_dn0_cp_mfp",
1406};
1407
1408static const char * const mipi_dsi_groups[] = {
1409 "dsi_dp3_dn1_mfp",
1410 "dsi_cp_dn0_mfp",
1411 "dsi_dp2_dn2_mfp",
1412 "mipi_dsi_dummy",
1413};
1414
1415static const char * const nand0_groups[] = {
1416 "nand0_d0_ceb3_mfp",
1417 "nand0_dummy",
1418};
1419
1420static const char * const nand1_groups[] = {
1421 "nand1_d0_ceb1_mfp",
1422 "nand1_ceb3_mfp",
1423 "nand1_ceb0_mfp",
1424 "nand1_dummy",
1425};
1426
1427static const char * const spdif_groups[] = {
1428 "uart0_tx_mfp",
1429};
1430
1431static const char * const sirq0_groups[] = {
1432 "sirq0_mfp",
1433 "sirq0_dummy",
1434};
1435
1436static const char * const sirq1_groups[] = {
1437 "sirq1_mfp",
1438 "sirq1_dummy",
1439};
1440
1441static const char * const sirq2_groups[] = {
1442 "sirq2_dummy",
1443};
1444
1445#define FUNCTION(fname) \
1446 { \
1447 .name = #fname, \
1448 .groups = fname##_groups, \
1449 .ngroups = ARRAY_SIZE(fname##_groups), \
1450 }
1451
1452static const struct owl_pinmux_func s900_functions[] = {
1453 [S900_MUX_ERAM] = FUNCTION(eram),
1454 [S900_MUX_ETH_RMII] = FUNCTION(eth_rmii),
1455 [S900_MUX_ETH_SMII] = FUNCTION(eth_smii),
1456 [S900_MUX_SPI0] = FUNCTION(spi0),
1457 [S900_MUX_SPI1] = FUNCTION(spi1),
1458 [S900_MUX_SPI2] = FUNCTION(spi2),
1459 [S900_MUX_SPI3] = FUNCTION(spi3),
1460 [S900_MUX_SENS0] = FUNCTION(sens0),
1461 [S900_MUX_UART0] = FUNCTION(uart0),
1462 [S900_MUX_UART1] = FUNCTION(uart1),
1463 [S900_MUX_UART2] = FUNCTION(uart2),
1464 [S900_MUX_UART3] = FUNCTION(uart3),
1465 [S900_MUX_UART4] = FUNCTION(uart4),
1466 [S900_MUX_UART5] = FUNCTION(uart5),
1467 [S900_MUX_UART6] = FUNCTION(uart6),
1468 [S900_MUX_I2S0] = FUNCTION(i2s0),
1469 [S900_MUX_I2S1] = FUNCTION(i2s1),
1470 [S900_MUX_PCM0] = FUNCTION(pcm0),
1471 [S900_MUX_PCM1] = FUNCTION(pcm1),
1472 [S900_MUX_JTAG] = FUNCTION(jtag),
1473 [S900_MUX_PWM0] = FUNCTION(pwm0),
1474 [S900_MUX_PWM1] = FUNCTION(pwm1),
1475 [S900_MUX_PWM2] = FUNCTION(pwm2),
1476 [S900_MUX_PWM3] = FUNCTION(pwm3),
1477 [S900_MUX_PWM4] = FUNCTION(pwm4),
1478 [S900_MUX_PWM5] = FUNCTION(pwm5),
1479 [S900_MUX_SD0] = FUNCTION(sd0),
1480 [S900_MUX_SD1] = FUNCTION(sd1),
1481 [S900_MUX_SD2] = FUNCTION(sd2),
1482 [S900_MUX_SD3] = FUNCTION(sd3),
1483 [S900_MUX_I2C0] = FUNCTION(i2c0),
1484 [S900_MUX_I2C1] = FUNCTION(i2c1),
1485 [S900_MUX_I2C2] = FUNCTION(i2c2),
1486 [S900_MUX_I2C3] = FUNCTION(i2c3),
1487 [S900_MUX_I2C4] = FUNCTION(i2c4),
1488 [S900_MUX_I2C5] = FUNCTION(i2c5),
1489 [S900_MUX_LVDS] = FUNCTION(lvds),
1490 [S900_MUX_USB30] = FUNCTION(usb30),
1491 [S900_MUX_USB20] = FUNCTION(usb20),
1492 [S900_MUX_GPU] = FUNCTION(gpu),
1493 [S900_MUX_MIPI_CSI0] = FUNCTION(mipi_csi0),
1494 [S900_MUX_MIPI_CSI1] = FUNCTION(mipi_csi1),
1495 [S900_MUX_MIPI_DSI] = FUNCTION(mipi_dsi),
1496 [S900_MUX_NAND0] = FUNCTION(nand0),
1497 [S900_MUX_NAND1] = FUNCTION(nand1),
1498 [S900_MUX_SPDIF] = FUNCTION(spdif),
1499 [S900_MUX_SIRQ0] = FUNCTION(sirq0),
1500 [S900_MUX_SIRQ1] = FUNCTION(sirq1),
1501 [S900_MUX_SIRQ2] = FUNCTION(sirq2)
1502};
1503/* PAD PULL UP/DOWN CONFIGURES */
1504#define PULLCTL_CONF(pull_reg, pull_sft, pull_wdt) \
1505 { \
1506 .reg = PAD_PULLCTL##pull_reg, \
1507 .shift = pull_sft, \
1508 .width = pull_wdt, \
1509 }
1510
1511#define PAD_PULLCTL_CONF(pad_name, pull_reg, pull_sft, pull_wdt) \
1512 struct owl_pullctl pad_name##_pullctl_conf \
1513 = PULLCTL_CONF(pull_reg, pull_sft, pull_wdt)
1514
1515#define ST_CONF(st_reg, st_sft, st_wdt) \
1516 { \
1517 .reg = PAD_ST##st_reg, \
1518 .shift = st_sft, \
1519 .width = st_wdt, \
1520 }
1521
1522#define PAD_ST_CONF(pad_name, st_reg, st_sft, st_wdt) \
1523 struct owl_st pad_name##_st_conf \
1524 = ST_CONF(st_reg, st_sft, st_wdt)
1525
1526/* PAD_PULLCTL0 */
1527static PAD_PULLCTL_CONF(ETH_RXER, 0, 18, 2);
1528static PAD_PULLCTL_CONF(SIRQ0, 0, 16, 2);
1529static PAD_PULLCTL_CONF(SIRQ1, 0, 14, 2);
1530static PAD_PULLCTL_CONF(SIRQ2, 0, 12, 2);
1531static PAD_PULLCTL_CONF(I2C0_SDATA, 0, 10, 2);
1532static PAD_PULLCTL_CONF(I2C0_SCLK, 0, 8, 2);
1533static PAD_PULLCTL_CONF(ERAM_A5, 0, 6, 2);
1534static PAD_PULLCTL_CONF(ERAM_A6, 0, 4, 2);
1535static PAD_PULLCTL_CONF(ERAM_A7, 0, 2, 2);
1536static PAD_PULLCTL_CONF(ERAM_A10, 0, 0, 2);
1537
1538/* PAD_PULLCTL1 */
1539static PAD_PULLCTL_CONF(PCM1_IN, 1, 30, 2);
1540static PAD_PULLCTL_CONF(PCM1_OUT, 1, 28, 2);
1541static PAD_PULLCTL_CONF(SD0_D0, 1, 26, 2);
1542static PAD_PULLCTL_CONF(SD0_D1, 1, 24, 2);
1543static PAD_PULLCTL_CONF(SD0_D2, 1, 22, 2);
1544static PAD_PULLCTL_CONF(SD0_D3, 1, 20, 2);
1545static PAD_PULLCTL_CONF(SD0_CMD, 1, 18, 2);
1546static PAD_PULLCTL_CONF(SD0_CLK, 1, 16, 2);
1547static PAD_PULLCTL_CONF(SD1_CMD, 1, 14, 2);
1548static PAD_PULLCTL_CONF(SD1_D0, 1, 12, 2);
1549static PAD_PULLCTL_CONF(SD1_D1, 1, 10, 2);
1550static PAD_PULLCTL_CONF(SD1_D2, 1, 8, 2);
1551static PAD_PULLCTL_CONF(SD1_D3, 1, 6, 2);
1552static PAD_PULLCTL_CONF(UART0_RX, 1, 4, 2);
1553static PAD_PULLCTL_CONF(UART0_TX, 1, 2, 2);
1554
1555/* PAD_PULLCTL2 */
1556static PAD_PULLCTL_CONF(I2C2_SDATA, 2, 26, 2);
1557static PAD_PULLCTL_CONF(I2C2_SCLK, 2, 24, 2);
1558static PAD_PULLCTL_CONF(SPI0_SCLK, 2, 22, 2);
1559static PAD_PULLCTL_CONF(SPI0_MOSI, 2, 20, 2);
1560static PAD_PULLCTL_CONF(I2C1_SDATA, 2, 18, 2);
1561static PAD_PULLCTL_CONF(I2C1_SCLK, 2, 16, 2);
1562static PAD_PULLCTL_CONF(NAND0_D0, 2, 15, 1);
1563static PAD_PULLCTL_CONF(NAND0_D1, 2, 15, 1);
1564static PAD_PULLCTL_CONF(NAND0_D2, 2, 15, 1);
1565static PAD_PULLCTL_CONF(NAND0_D3, 2, 15, 1);
1566static PAD_PULLCTL_CONF(NAND0_D4, 2, 15, 1);
1567static PAD_PULLCTL_CONF(NAND0_D5, 2, 15, 1);
1568static PAD_PULLCTL_CONF(NAND0_D6, 2, 15, 1);
1569static PAD_PULLCTL_CONF(NAND0_D7, 2, 15, 1);
1570static PAD_PULLCTL_CONF(NAND0_DQSN, 2, 14, 1);
1571static PAD_PULLCTL_CONF(NAND0_DQS, 2, 13, 1);
1572static PAD_PULLCTL_CONF(NAND1_D0, 2, 12, 1);
1573static PAD_PULLCTL_CONF(NAND1_D1, 2, 12, 1);
1574static PAD_PULLCTL_CONF(NAND1_D2, 2, 12, 1);
1575static PAD_PULLCTL_CONF(NAND1_D3, 2, 12, 1);
1576static PAD_PULLCTL_CONF(NAND1_D4, 2, 12, 1);
1577static PAD_PULLCTL_CONF(NAND1_D5, 2, 12, 1);
1578static PAD_PULLCTL_CONF(NAND1_D6, 2, 12, 1);
1579static PAD_PULLCTL_CONF(NAND1_D7, 2, 12, 1);
1580static PAD_PULLCTL_CONF(NAND1_DQSN, 2, 11, 1);
1581static PAD_PULLCTL_CONF(NAND1_DQS, 2, 10, 1);
1582static PAD_PULLCTL_CONF(SGPIO2, 2, 8, 2);
1583static PAD_PULLCTL_CONF(SGPIO3, 2, 6, 2);
1584static PAD_PULLCTL_CONF(UART4_RX, 2, 4, 2);
1585static PAD_PULLCTL_CONF(UART4_TX, 2, 2, 2);
1586
1587/* PAD_ST0 */
1588static PAD_ST_CONF(I2C0_SDATA, 0, 30, 1);
1589static PAD_ST_CONF(UART0_RX, 0, 29, 1);
1590static PAD_ST_CONF(ETH_MDC, 0, 28, 1);
1591static PAD_ST_CONF(I2S_MCLK1, 0, 23, 1);
1592static PAD_ST_CONF(ETH_REF_CLK, 0, 22, 1);
1593static PAD_ST_CONF(ETH_TXEN, 0, 21, 1);
1594static PAD_ST_CONF(ETH_TXD0, 0, 20, 1);
1595static PAD_ST_CONF(I2S_LRCLK1, 0, 19, 1);
1596static PAD_ST_CONF(SGPIO2, 0, 18, 1);
1597static PAD_ST_CONF(SGPIO3, 0, 17, 1);
1598static PAD_ST_CONF(UART4_TX, 0, 16, 1);
1599static PAD_ST_CONF(I2S_D1, 0, 15, 1);
1600static PAD_ST_CONF(UART0_TX, 0, 14, 1);
1601static PAD_ST_CONF(SPI0_SCLK, 0, 13, 1);
1602static PAD_ST_CONF(SD0_CLK, 0, 12, 1);
1603static PAD_ST_CONF(ERAM_A5, 0, 11, 1);
1604static PAD_ST_CONF(I2C0_SCLK, 0, 7, 1);
1605static PAD_ST_CONF(ERAM_A9, 0, 6, 1);
1606static PAD_ST_CONF(LVDS_OEP, 0, 5, 1);
1607static PAD_ST_CONF(LVDS_ODN, 0, 4, 1);
1608static PAD_ST_CONF(LVDS_OAP, 0, 3, 1);
1609static PAD_ST_CONF(I2S_BCLK1, 0, 2, 1);
1610
1611/* PAD_ST1 */
1612static PAD_ST_CONF(I2S_LRCLK0, 1, 29, 1);
1613static PAD_ST_CONF(UART4_RX, 1, 28, 1);
1614static PAD_ST_CONF(UART3_CTSB, 1, 27, 1);
1615static PAD_ST_CONF(UART3_RTSB, 1, 26, 1);
1616static PAD_ST_CONF(UART3_RX, 1, 25, 1);
1617static PAD_ST_CONF(UART2_RTSB, 1, 24, 1);
1618static PAD_ST_CONF(UART2_CTSB, 1, 23, 1);
1619static PAD_ST_CONF(UART2_RX, 1, 22, 1);
1620static PAD_ST_CONF(ETH_RXD0, 1, 21, 1);
1621static PAD_ST_CONF(ETH_RXD1, 1, 20, 1);
1622static PAD_ST_CONF(ETH_CRS_DV, 1, 19, 1);
1623static PAD_ST_CONF(ETH_RXER, 1, 18, 1);
1624static PAD_ST_CONF(ETH_TXD1, 1, 17, 1);
1625static PAD_ST_CONF(LVDS_OCP, 1, 16, 1);
1626static PAD_ST_CONF(LVDS_OBP, 1, 15, 1);
1627static PAD_ST_CONF(LVDS_OBN, 1, 14, 1);
1628static PAD_ST_CONF(PCM1_OUT, 1, 12, 1);
1629static PAD_ST_CONF(PCM1_CLK, 1, 11, 1);
1630static PAD_ST_CONF(PCM1_IN, 1, 10, 1);
1631static PAD_ST_CONF(PCM1_SYNC, 1, 9, 1);
1632static PAD_ST_CONF(I2C1_SCLK, 1, 8, 1);
1633static PAD_ST_CONF(I2C1_SDATA, 1, 7, 1);
1634static PAD_ST_CONF(I2C2_SCLK, 1, 6, 1);
1635static PAD_ST_CONF(I2C2_SDATA, 1, 5, 1);
1636static PAD_ST_CONF(SPI0_MOSI, 1, 4, 1);
1637static PAD_ST_CONF(SPI0_MISO, 1, 3, 1);
1638static PAD_ST_CONF(SPI0_SS, 1, 2, 1);
1639static PAD_ST_CONF(I2S_BCLK0, 1, 1, 1);
1640static PAD_ST_CONF(I2S_MCLK0, 1, 0, 1);
1641
1642#define PAD_INFO(name) \
1643 { \
1644 .pad = name, \
1645 .pullctl = NULL, \
1646 .st = NULL, \
1647 }
1648
1649#define PAD_INFO_ST(name) \
1650 { \
1651 .pad = name, \
1652 .pullctl = NULL, \
1653 .st = &name##_st_conf, \
1654 }
1655
1656#define PAD_INFO_PULLCTL(name) \
1657 { \
1658 .pad = name, \
1659 .pullctl = &name##_pullctl_conf, \
1660 .st = NULL, \
1661 }
1662
1663#define PAD_INFO_PULLCTL_ST(name) \
1664 { \
1665 .pad = name, \
1666 .pullctl = &name##_pullctl_conf, \
1667 .st = &name##_st_conf, \
1668 }
1669
1670/* Pad info table */
1671static struct owl_padinfo s900_padinfo[NUM_PADS] = {
1672 [ETH_TXD0] = PAD_INFO_ST(ETH_TXD0),
1673 [ETH_TXD1] = PAD_INFO_ST(ETH_TXD1),
1674 [ETH_TXEN] = PAD_INFO_ST(ETH_TXEN),
1675 [ETH_RXER] = PAD_INFO_PULLCTL_ST(ETH_RXER),
1676 [ETH_CRS_DV] = PAD_INFO_ST(ETH_CRS_DV),
1677 [ETH_RXD1] = PAD_INFO_ST(ETH_RXD1),
1678 [ETH_RXD0] = PAD_INFO_ST(ETH_RXD0),
1679 [ETH_REF_CLK] = PAD_INFO_ST(ETH_REF_CLK),
1680 [ETH_MDC] = PAD_INFO_ST(ETH_MDC),
1681 [ETH_MDIO] = PAD_INFO(ETH_MDIO),
1682 [SIRQ0] = PAD_INFO_PULLCTL(SIRQ0),
1683 [SIRQ1] = PAD_INFO_PULLCTL(SIRQ1),
1684 [SIRQ2] = PAD_INFO_PULLCTL(SIRQ2),
1685 [I2S_D0] = PAD_INFO(I2S_D0),
1686 [I2S_BCLK0] = PAD_INFO_ST(I2S_BCLK0),
1687 [I2S_LRCLK0] = PAD_INFO_ST(I2S_LRCLK0),
1688 [I2S_MCLK0] = PAD_INFO_ST(I2S_MCLK0),
1689 [I2S_D1] = PAD_INFO_ST(I2S_D1),
1690 [I2S_BCLK1] = PAD_INFO_ST(I2S_BCLK1),
1691 [I2S_LRCLK1] = PAD_INFO_ST(I2S_LRCLK1),
1692 [I2S_MCLK1] = PAD_INFO_ST(I2S_MCLK1),
1693 [PCM1_IN] = PAD_INFO_PULLCTL_ST(PCM1_IN),
1694 [PCM1_CLK] = PAD_INFO_ST(PCM1_CLK),
1695 [PCM1_SYNC] = PAD_INFO_ST(PCM1_SYNC),
1696 [PCM1_OUT] = PAD_INFO_PULLCTL_ST(PCM1_OUT),
1697 [ERAM_A5] = PAD_INFO_PULLCTL_ST(ERAM_A5),
1698 [ERAM_A6] = PAD_INFO_PULLCTL(ERAM_A6),
1699 [ERAM_A7] = PAD_INFO_PULLCTL(ERAM_A7),
1700 [ERAM_A8] = PAD_INFO(ERAM_A8),
1701 [ERAM_A9] = PAD_INFO_ST(ERAM_A9),
1702 [ERAM_A10] = PAD_INFO_PULLCTL(ERAM_A10),
1703 [ERAM_A11] = PAD_INFO(ERAM_A11),
1704 [LVDS_OEP] = PAD_INFO_ST(LVDS_OEP),
1705 [LVDS_OEN] = PAD_INFO(LVDS_OEN),
1706 [LVDS_ODP] = PAD_INFO(LVDS_ODP),
1707 [LVDS_ODN] = PAD_INFO_ST(LVDS_ODN),
1708 [LVDS_OCP] = PAD_INFO_ST(LVDS_OCP),
1709 [LVDS_OCN] = PAD_INFO(LVDS_OCN),
1710 [LVDS_OBP] = PAD_INFO_ST(LVDS_OBP),
1711 [LVDS_OBN] = PAD_INFO_ST(LVDS_OBN),
1712 [LVDS_OAP] = PAD_INFO_ST(LVDS_OAP),
1713 [LVDS_OAN] = PAD_INFO(LVDS_OAN),
1714 [LVDS_EEP] = PAD_INFO(LVDS_EEP),
1715 [LVDS_EEN] = PAD_INFO(LVDS_EEN),
1716 [LVDS_EDP] = PAD_INFO(LVDS_EDP),
1717 [LVDS_EDN] = PAD_INFO(LVDS_EDN),
1718 [LVDS_ECP] = PAD_INFO(LVDS_ECP),
1719 [LVDS_ECN] = PAD_INFO(LVDS_ECN),
1720 [LVDS_EBP] = PAD_INFO(LVDS_EBP),
1721 [LVDS_EBN] = PAD_INFO(LVDS_EBN),
1722 [LVDS_EAP] = PAD_INFO(LVDS_EAP),
1723 [LVDS_EAN] = PAD_INFO(LVDS_EAN),
1724 [SD0_D0] = PAD_INFO_PULLCTL(SD0_D0),
1725 [SD0_D1] = PAD_INFO_PULLCTL(SD0_D1),
1726 [SD0_D2] = PAD_INFO_PULLCTL(SD0_D2),
1727 [SD0_D3] = PAD_INFO_PULLCTL(SD0_D3),
1728 [SD1_D0] = PAD_INFO_PULLCTL(SD1_D0),
1729 [SD1_D1] = PAD_INFO_PULLCTL(SD1_D1),
1730 [SD1_D2] = PAD_INFO_PULLCTL(SD1_D2),
1731 [SD1_D3] = PAD_INFO_PULLCTL(SD1_D3),
1732 [SD0_CMD] = PAD_INFO_PULLCTL(SD0_CMD),
1733 [SD0_CLK] = PAD_INFO_PULLCTL_ST(SD0_CLK),
1734 [SD1_CMD] = PAD_INFO_PULLCTL(SD1_CMD),
1735 [SD1_CLK] = PAD_INFO(SD1_CLK),
1736 [SPI0_SCLK] = PAD_INFO_PULLCTL_ST(SPI0_SCLK),
1737 [SPI0_SS] = PAD_INFO_ST(SPI0_SS),
1738 [SPI0_MISO] = PAD_INFO_ST(SPI0_MISO),
1739 [SPI0_MOSI] = PAD_INFO_PULLCTL_ST(SPI0_MOSI),
1740 [UART0_RX] = PAD_INFO_PULLCTL_ST(UART0_RX),
1741 [UART0_TX] = PAD_INFO_PULLCTL_ST(UART0_TX),
1742 [UART2_RX] = PAD_INFO_ST(UART2_RX),
1743 [UART2_TX] = PAD_INFO(UART2_TX),
1744 [UART2_RTSB] = PAD_INFO_ST(UART2_RTSB),
1745 [UART2_CTSB] = PAD_INFO_ST(UART2_CTSB),
1746 [UART3_RX] = PAD_INFO_ST(UART3_RX),
1747 [UART3_TX] = PAD_INFO(UART3_TX),
1748 [UART3_RTSB] = PAD_INFO_ST(UART3_RTSB),
1749 [UART3_CTSB] = PAD_INFO_ST(UART3_CTSB),
1750 [UART4_RX] = PAD_INFO_PULLCTL_ST(UART4_RX),
1751 [UART4_TX] = PAD_INFO_PULLCTL_ST(UART4_TX),
1752 [I2C0_SCLK] = PAD_INFO_PULLCTL_ST(I2C0_SCLK),
1753 [I2C0_SDATA] = PAD_INFO_PULLCTL_ST(I2C0_SDATA),
1754 [I2C1_SCLK] = PAD_INFO_PULLCTL_ST(I2C1_SCLK),
1755 [I2C1_SDATA] = PAD_INFO_PULLCTL_ST(I2C1_SDATA),
1756 [I2C2_SCLK] = PAD_INFO_PULLCTL_ST(I2C2_SCLK),
1757 [I2C2_SDATA] = PAD_INFO_PULLCTL_ST(I2C2_SDATA),
1758 [CSI0_DN0] = PAD_INFO(CSI0_DN0),
1759 [CSI0_DP0] = PAD_INFO(CSI0_DP0),
1760 [CSI0_DN1] = PAD_INFO(CSI0_DN1),
1761 [CSI0_DP1] = PAD_INFO(CSI0_DP1),
1762 [CSI0_CN] = PAD_INFO(CSI0_CN),
1763 [CSI0_CP] = PAD_INFO(CSI0_CP),
1764 [CSI0_DN2] = PAD_INFO(CSI0_DN2),
1765 [CSI0_DP2] = PAD_INFO(CSI0_DP2),
1766 [CSI0_DN3] = PAD_INFO(CSI0_DN3),
1767 [CSI0_DP3] = PAD_INFO(CSI0_DP3),
1768 [DSI_DP3] = PAD_INFO(DSI_DP3),
1769 [DSI_DN3] = PAD_INFO(DSI_DN3),
1770 [DSI_DP1] = PAD_INFO(DSI_DP1),
1771 [DSI_DN1] = PAD_INFO(DSI_DN1),
1772 [DSI_CP] = PAD_INFO(DSI_CP),
1773 [DSI_CN] = PAD_INFO(DSI_CN),
1774 [DSI_DP0] = PAD_INFO(DSI_DP0),
1775 [DSI_DN0] = PAD_INFO(DSI_DN0),
1776 [DSI_DP2] = PAD_INFO(DSI_DP2),
1777 [DSI_DN2] = PAD_INFO(DSI_DN2),
1778 [SENSOR0_PCLK] = PAD_INFO(SENSOR0_PCLK),
1779 [CSI1_DN0] = PAD_INFO(CSI1_DN0),
1780 [CSI1_DP0] = PAD_INFO(CSI1_DP0),
1781 [CSI1_DN1] = PAD_INFO(CSI1_DN1),
1782 [CSI1_DP1] = PAD_INFO(CSI1_DP1),
1783 [CSI1_CN] = PAD_INFO(CSI1_CN),
1784 [CSI1_CP] = PAD_INFO(CSI1_CP),
1785 [SENSOR0_CKOUT] = PAD_INFO(SENSOR0_CKOUT),
1786 [NAND0_D0] = PAD_INFO_PULLCTL(NAND0_D0),
1787 [NAND0_D1] = PAD_INFO_PULLCTL(NAND0_D1),
1788 [NAND0_D2] = PAD_INFO_PULLCTL(NAND0_D2),
1789 [NAND0_D3] = PAD_INFO_PULLCTL(NAND0_D3),
1790 [NAND0_D4] = PAD_INFO_PULLCTL(NAND0_D4),
1791 [NAND0_D5] = PAD_INFO_PULLCTL(NAND0_D5),
1792 [NAND0_D6] = PAD_INFO_PULLCTL(NAND0_D6),
1793 [NAND0_D7] = PAD_INFO_PULLCTL(NAND0_D7),
1794 [NAND0_DQS] = PAD_INFO_PULLCTL(NAND0_DQS),
1795 [NAND0_DQSN] = PAD_INFO_PULLCTL(NAND0_DQSN),
1796 [NAND0_ALE] = PAD_INFO(NAND0_ALE),
1797 [NAND0_CLE] = PAD_INFO(NAND0_CLE),
1798 [NAND0_CEB0] = PAD_INFO(NAND0_CEB0),
1799 [NAND0_CEB1] = PAD_INFO(NAND0_CEB1),
1800 [NAND0_CEB2] = PAD_INFO(NAND0_CEB2),
1801 [NAND0_CEB3] = PAD_INFO(NAND0_CEB3),
1802 [NAND1_D0] = PAD_INFO_PULLCTL(NAND1_D0),
1803 [NAND1_D1] = PAD_INFO_PULLCTL(NAND1_D1),
1804 [NAND1_D2] = PAD_INFO_PULLCTL(NAND1_D2),
1805 [NAND1_D3] = PAD_INFO_PULLCTL(NAND1_D3),
1806 [NAND1_D4] = PAD_INFO_PULLCTL(NAND1_D4),
1807 [NAND1_D5] = PAD_INFO_PULLCTL(NAND1_D5),
1808 [NAND1_D6] = PAD_INFO_PULLCTL(NAND1_D6),
1809 [NAND1_D7] = PAD_INFO_PULLCTL(NAND1_D7),
1810 [NAND1_DQS] = PAD_INFO_PULLCTL(NAND1_DQS),
1811 [NAND1_DQSN] = PAD_INFO_PULLCTL(NAND1_DQSN),
1812 [NAND1_ALE] = PAD_INFO(NAND1_ALE),
1813 [NAND1_CLE] = PAD_INFO(NAND1_CLE),
1814 [NAND1_CEB0] = PAD_INFO(NAND1_CEB0),
1815 [NAND1_CEB1] = PAD_INFO(NAND1_CEB1),
1816 [NAND1_CEB2] = PAD_INFO(NAND1_CEB2),
1817 [NAND1_CEB3] = PAD_INFO(NAND1_CEB3),
1818 [SGPIO0] = PAD_INFO(SGPIO0),
1819 [SGPIO1] = PAD_INFO(SGPIO1),
1820 [SGPIO2] = PAD_INFO_PULLCTL_ST(SGPIO2),
1821 [SGPIO3] = PAD_INFO_PULLCTL_ST(SGPIO3)
1822};
1823
1824#define OWL_GPIO_PORT(port, base, count, _outen, _inen, _dat) \
1825 [OWL_GPIO_PORT_##port] = { \
1826 .offset = base, \
1827 .pins = count, \
1828 .outen = _outen, \
1829 .inen = _inen, \
1830 .dat = _dat, \
1831 }
1832
1833static const struct owl_gpio_port s900_gpio_ports[] = {
1834 OWL_GPIO_PORT(A, 0x0000, 32, 0x0, 0x4, 0x8),
1835 OWL_GPIO_PORT(B, 0x000C, 32, 0x0, 0x4, 0x8),
1836 OWL_GPIO_PORT(C, 0x0018, 12, 0x0, 0x4, 0x8),
1837 OWL_GPIO_PORT(D, 0x0024, 30, 0x0, 0x4, 0x8),
1838 OWL_GPIO_PORT(E, 0x0030, 32, 0x0, 0x4, 0x8),
1839 OWL_GPIO_PORT(F, 0x00F0, 8, 0x0, 0x4, 0x8)
1840};
1841
1842static struct owl_pinctrl_soc_data s900_pinctrl_data = {
1843 .padinfo = s900_padinfo,
1844 .pins = (const struct pinctrl_pin_desc *)s900_pads,
1845 .npins = ARRAY_SIZE(s900_pads),
1846 .functions = s900_functions,
1847 .nfunctions = ARRAY_SIZE(s900_functions),
1848 .groups = s900_groups,
1849 .ngroups = ARRAY_SIZE(s900_groups),
1850 .ngpios = NUM_GPIOS,
1851 .ports = s900_gpio_ports,
1852 .nports = ARRAY_SIZE(s900_gpio_ports)
1853};
1854
1855static int s900_pinctrl_probe(struct platform_device *pdev)
1856{
1857 return owl_pinctrl_probe(pdev, &s900_pinctrl_data);
1858}
1859
1860static const struct of_device_id s900_pinctrl_of_match[] = {
1861 { .compatible = "actions,s900-pinctrl", },
1862 { }
1863};
1864
1865static struct platform_driver s900_pinctrl_driver = {
1866 .driver = {
1867 .name = "pinctrl-s900",
1868 .of_match_table = of_match_ptr(s900_pinctrl_of_match),
1869 },
1870 .probe = s900_pinctrl_probe,
1871};
1872
1873static int __init s900_pinctrl_init(void)
1874{
1875 return platform_driver_register(&s900_pinctrl_driver);
1876}
1877arch_initcall(s900_pinctrl_init);
1878
1879static void __exit s900_pinctrl_exit(void)
1880{
1881 platform_driver_unregister(&s900_pinctrl_driver);
1882}
1883module_exit(s900_pinctrl_exit);
1884
1885MODULE_AUTHOR("Actions Semi Inc.");
1886MODULE_AUTHOR("Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>");
1887MODULE_DESCRIPTION("Actions Semi S900 SoC Pinctrl Driver");
1888MODULE_LICENSE("GPL");
diff --git a/drivers/pinctrl/bcm/Kconfig b/drivers/pinctrl/bcm/Kconfig
index e8c4e4f934a6..0f38d51f47c6 100644
--- a/drivers/pinctrl/bcm/Kconfig
+++ b/drivers/pinctrl/bcm/Kconfig
@@ -20,6 +20,7 @@ config PINCTRL_BCM2835
20 bool 20 bool
21 select PINMUX 21 select PINMUX
22 select PINCONF 22 select PINCONF
23 select GENERIC_PINCONF
23 select GPIOLIB_IRQCHIP 24 select GPIOLIB_IRQCHIP
24 25
25config PINCTRL_IPROC_GPIO 26config PINCTRL_IPROC_GPIO
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index 785c366fd6d6..136ccaf53df8 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -36,11 +36,13 @@
36#include <linux/pinctrl/pinconf.h> 36#include <linux/pinctrl/pinconf.h>
37#include <linux/pinctrl/pinctrl.h> 37#include <linux/pinctrl/pinctrl.h>
38#include <linux/pinctrl/pinmux.h> 38#include <linux/pinctrl/pinmux.h>
39#include <linux/pinctrl/pinconf-generic.h>
39#include <linux/platform_device.h> 40#include <linux/platform_device.h>
40#include <linux/seq_file.h> 41#include <linux/seq_file.h>
41#include <linux/slab.h> 42#include <linux/slab.h>
42#include <linux/spinlock.h> 43#include <linux/spinlock.h>
43#include <linux/types.h> 44#include <linux/types.h>
45#include <dt-bindings/pinctrl/bcm2835.h>
44 46
45#define MODULE_NAME "pinctrl-bcm2835" 47#define MODULE_NAME "pinctrl-bcm2835"
46#define BCM2835_NUM_GPIOS 54 48#define BCM2835_NUM_GPIOS 54
@@ -72,13 +74,9 @@
72 74
73enum bcm2835_pinconf_param { 75enum bcm2835_pinconf_param {
74 /* argument: bcm2835_pinconf_pull */ 76 /* argument: bcm2835_pinconf_pull */
75 BCM2835_PINCONF_PARAM_PULL, 77 BCM2835_PINCONF_PARAM_PULL = (PIN_CONFIG_END + 1),
76}; 78};
77 79
78#define BCM2835_PINCONF_PACK(_param_, _arg_) ((_param_) << 16 | (_arg_))
79#define BCM2835_PINCONF_UNPACK_PARAM(_conf_) ((_conf_) >> 16)
80#define BCM2835_PINCONF_UNPACK_ARG(_conf_) ((_conf_) & 0xffff)
81
82struct bcm2835_pinctrl { 80struct bcm2835_pinctrl {
83 struct device *dev; 81 struct device *dev;
84 void __iomem *base; 82 void __iomem *base;
@@ -213,14 +211,6 @@ static const char * const bcm2835_gpio_groups[] = {
213}; 211};
214 212
215enum bcm2835_fsel { 213enum bcm2835_fsel {
216 BCM2835_FSEL_GPIO_IN = 0,
217 BCM2835_FSEL_GPIO_OUT = 1,
218 BCM2835_FSEL_ALT0 = 4,
219 BCM2835_FSEL_ALT1 = 5,
220 BCM2835_FSEL_ALT2 = 6,
221 BCM2835_FSEL_ALT3 = 7,
222 BCM2835_FSEL_ALT4 = 3,
223 BCM2835_FSEL_ALT5 = 2,
224 BCM2835_FSEL_COUNT = 8, 214 BCM2835_FSEL_COUNT = 8,
225 BCM2835_FSEL_MASK = 0x7, 215 BCM2835_FSEL_MASK = 0x7,
226}; 216};
@@ -714,7 +704,7 @@ static int bcm2835_pctl_dt_node_to_map_pull(struct bcm2835_pinctrl *pc,
714 configs = kzalloc(sizeof(*configs), GFP_KERNEL); 704 configs = kzalloc(sizeof(*configs), GFP_KERNEL);
715 if (!configs) 705 if (!configs)
716 return -ENOMEM; 706 return -ENOMEM;
717 configs[0] = BCM2835_PINCONF_PACK(BCM2835_PINCONF_PARAM_PULL, pull); 707 configs[0] = pinconf_to_config_packed(BCM2835_PINCONF_PARAM_PULL, pull);
718 708
719 map->type = PIN_MAP_TYPE_CONFIGS_PIN; 709 map->type = PIN_MAP_TYPE_CONFIGS_PIN;
720 map->data.configs.group_or_pin = bcm2835_gpio_pins[pin].name; 710 map->data.configs.group_or_pin = bcm2835_gpio_pins[pin].name;
@@ -727,7 +717,7 @@ static int bcm2835_pctl_dt_node_to_map_pull(struct bcm2835_pinctrl *pc,
727 717
728static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, 718static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
729 struct device_node *np, 719 struct device_node *np,
730 struct pinctrl_map **map, unsigned *num_maps) 720 struct pinctrl_map **map, unsigned int *num_maps)
731{ 721{
732 struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 722 struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
733 struct property *pins, *funcs, *pulls; 723 struct property *pins, *funcs, *pulls;
@@ -736,6 +726,12 @@ static int bcm2835_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
736 int i, err; 726 int i, err;
737 u32 pin, func, pull; 727 u32 pin, func, pull;
738 728
729 /* Check for generic binding in this node */
730 err = pinconf_generic_dt_node_to_map_all(pctldev, np, map, num_maps);
731 if (err || *num_maps)
732 return err;
733
734 /* Generic binding did not find anything continue with legacy parse */
739 pins = of_find_property(np, "brcm,pins", NULL); 735 pins = of_find_property(np, "brcm,pins", NULL);
740 if (!pins) { 736 if (!pins) {
741 dev_err(pc->dev, "%pOF: missing brcm,pins property\n", np); 737 dev_err(pc->dev, "%pOF: missing brcm,pins property\n", np);
@@ -917,37 +913,67 @@ static int bcm2835_pinconf_get(struct pinctrl_dev *pctldev,
917 return -ENOTSUPP; 913 return -ENOTSUPP;
918} 914}
919 915
916static void bcm2835_pull_config_set(struct bcm2835_pinctrl *pc,
917 unsigned int pin, unsigned int arg)
918{
919 u32 off, bit;
920
921 off = GPIO_REG_OFFSET(pin);
922 bit = GPIO_REG_SHIFT(pin);
923
924 bcm2835_gpio_wr(pc, GPPUD, arg & 3);
925 /*
926 * BCM2835 datasheet say to wait 150 cycles, but not of what.
927 * But the VideoCore firmware delay for this operation
928 * based nearly on the same amount of VPU cycles and this clock
929 * runs at 250 MHz.
930 */
931 udelay(1);
932 bcm2835_gpio_wr(pc, GPPUDCLK0 + (off * 4), BIT(bit));
933 udelay(1);
934 bcm2835_gpio_wr(pc, GPPUDCLK0 + (off * 4), 0);
935}
936
920static int bcm2835_pinconf_set(struct pinctrl_dev *pctldev, 937static int bcm2835_pinconf_set(struct pinctrl_dev *pctldev,
921 unsigned pin, unsigned long *configs, 938 unsigned int pin, unsigned long *configs,
922 unsigned num_configs) 939 unsigned int num_configs)
923{ 940{
924 struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev); 941 struct bcm2835_pinctrl *pc = pinctrl_dev_get_drvdata(pctldev);
925 enum bcm2835_pinconf_param param; 942 u32 param, arg;
926 u16 arg;
927 u32 off, bit;
928 int i; 943 int i;
929 944
930 for (i = 0; i < num_configs; i++) { 945 for (i = 0; i < num_configs; i++) {
931 param = BCM2835_PINCONF_UNPACK_PARAM(configs[i]); 946 param = pinconf_to_config_param(configs[i]);
932 arg = BCM2835_PINCONF_UNPACK_ARG(configs[i]); 947 arg = pinconf_to_config_argument(configs[i]);
933 948
934 if (param != BCM2835_PINCONF_PARAM_PULL) 949 switch (param) {
935 return -EINVAL; 950 /* Set legacy brcm,pull */
951 case BCM2835_PINCONF_PARAM_PULL:
952 bcm2835_pull_config_set(pc, pin, arg);
953 break;
936 954
937 off = GPIO_REG_OFFSET(pin); 955 /* Set pull generic bindings */
938 bit = GPIO_REG_SHIFT(pin); 956 case PIN_CONFIG_BIAS_DISABLE:
957 bcm2835_pull_config_set(pc, pin, BCM2835_PUD_OFF);
958 break;
939 959
940 bcm2835_gpio_wr(pc, GPPUD, arg & 3); 960 case PIN_CONFIG_BIAS_PULL_DOWN:
941 /* 961 bcm2835_pull_config_set(pc, pin, BCM2835_PUD_DOWN);
942 * BCM2835 datasheet say to wait 150 cycles, but not of what. 962 break;
943 * But the VideoCore firmware delay for this operation 963
944 * based nearly on the same amount of VPU cycles and this clock 964 case PIN_CONFIG_BIAS_PULL_UP:
945 * runs at 250 MHz. 965 bcm2835_pull_config_set(pc, pin, BCM2835_PUD_UP);
946 */ 966 break;
947 udelay(1); 967
948 bcm2835_gpio_wr(pc, GPPUDCLK0 + (off * 4), BIT(bit)); 968 /* Set output-high or output-low */
949 udelay(1); 969 case PIN_CONFIG_OUTPUT:
950 bcm2835_gpio_wr(pc, GPPUDCLK0 + (off * 4), 0); 970 bcm2835_gpio_set_bit(pc, arg ? GPSET0 : GPCLR0, pin);
971 break;
972
973 default:
974 return -EINVAL;
975
976 } /* switch param type */
951 } /* for each config */ 977 } /* for each config */
952 978
953 return 0; 979 return 0;
diff --git a/drivers/pinctrl/berlin/berlin-bg2.c b/drivers/pinctrl/berlin/berlin-bg2.c
index bf2e17d0d6e4..acbd413340e8 100644
--- a/drivers/pinctrl/berlin/berlin-bg2.c
+++ b/drivers/pinctrl/berlin/berlin-bg2.c
@@ -1,13 +1,10 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Marvell Berlin BG2 pinctrl driver. 3 * Marvell Berlin BG2 pinctrl driver.
3 * 4 *
4 * Copyright (C) 2014 Marvell Technology Group Ltd. 5 * Copyright (C) 2014 Marvell Technology Group Ltd.
5 * 6 *
6 * Antoine Ténart <antoine.tenart@free-electrons.com> 7 * Antoine Ténart <antoine.tenart@free-electrons.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */ 8 */
12 9
13#include <linux/init.h> 10#include <linux/init.h>
diff --git a/drivers/pinctrl/berlin/berlin-bg2cd.c b/drivers/pinctrl/berlin/berlin-bg2cd.c
index 9bee7bd1650f..c0f5d86d5d01 100644
--- a/drivers/pinctrl/berlin/berlin-bg2cd.c
+++ b/drivers/pinctrl/berlin/berlin-bg2cd.c
@@ -1,13 +1,10 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Marvell Berlin BG2CD pinctrl driver. 3 * Marvell Berlin BG2CD pinctrl driver.
3 * 4 *
4 * Copyright (C) 2014 Marvell Technology Group Ltd. 5 * Copyright (C) 2014 Marvell Technology Group Ltd.
5 * 6 *
6 * Antoine Ténart <antoine.tenart@free-electrons.com> 7 * Antoine Ténart <antoine.tenart@free-electrons.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */ 8 */
12 9
13#include <linux/init.h> 10#include <linux/init.h>
diff --git a/drivers/pinctrl/berlin/berlin-bg2q.c b/drivers/pinctrl/berlin/berlin-bg2q.c
index eee6763f114c..20a3216ede07 100644
--- a/drivers/pinctrl/berlin/berlin-bg2q.c
+++ b/drivers/pinctrl/berlin/berlin-bg2q.c
@@ -1,13 +1,10 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Marvell Berlin BG2Q pinctrl driver 3 * Marvell Berlin BG2Q pinctrl driver
3 * 4 *
4 * Copyright (C) 2014 Marvell Technology Group Ltd. 5 * Copyright (C) 2014 Marvell Technology Group Ltd.
5 * 6 *
6 * Antoine Ténart <antoine.tenart@free-electrons.com> 7 * Antoine Ténart <antoine.tenart@free-electrons.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */ 8 */
12 9
13#include <linux/init.h> 10#include <linux/init.h>
diff --git a/drivers/pinctrl/berlin/berlin-bg4ct.c b/drivers/pinctrl/berlin/berlin-bg4ct.c
index e6740656ee7c..6a7fe929a68b 100644
--- a/drivers/pinctrl/berlin/berlin-bg4ct.c
+++ b/drivers/pinctrl/berlin/berlin-bg4ct.c
@@ -1,21 +1,10 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Marvell berlin4ct pinctrl driver 3 * Marvell berlin4ct pinctrl driver
3 * 4 *
4 * Copyright (C) 2015 Marvell Technology Group Ltd. 5 * Copyright (C) 2015 Marvell Technology Group Ltd.
5 * 6 *
6 * Author: Jisheng Zhang <jszhang@marvell.com> 7 * Author: Jisheng Zhang <jszhang@marvell.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License along with
18 * this program. If not, see <http://www.gnu.org/licenses/>.
19 */ 8 */
20 9
21#include <linux/init.h> 10#include <linux/init.h>
diff --git a/drivers/pinctrl/berlin/berlin.c b/drivers/pinctrl/berlin/berlin.c
index cc3bd2efafe3..a620a8e8fa78 100644
--- a/drivers/pinctrl/berlin/berlin.c
+++ b/drivers/pinctrl/berlin/berlin.c
@@ -1,13 +1,10 @@
1// SPDX-License-Identifier: GPL-2.0
1/* 2/*
2 * Marvell Berlin SoC pinctrl core driver 3 * Marvell Berlin SoC pinctrl core driver
3 * 4 *
4 * Copyright (C) 2014 Marvell Technology Group Ltd. 5 * Copyright (C) 2014 Marvell Technology Group Ltd.
5 * 6 *
6 * Antoine Ténart <antoine.tenart@free-electrons.com> 7 * Antoine Ténart <antoine.tenart@free-electrons.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */ 8 */
12 9
13#include <linux/io.h> 10#include <linux/io.h>
diff --git a/drivers/pinctrl/berlin/berlin.h b/drivers/pinctrl/berlin/berlin.h
index e9b30f95b03e..d7787754d1ed 100644
--- a/drivers/pinctrl/berlin/berlin.h
+++ b/drivers/pinctrl/berlin/berlin.h
@@ -1,13 +1,10 @@
1/* SPDX-License-Identifier: GPL-2.0 */
1/* 2/*
2 * Marvell Berlin SoC pinctrl driver. 3 * Marvell Berlin SoC pinctrl driver.
3 * 4 *
4 * Copyright (C) 2014 Marvell Technology Group Ltd. 5 * Copyright (C) 2014 Marvell Technology Group Ltd.
5 * 6 *
6 * Antoine Ténart <antoine.tenart@free-electrons.com> 7 * Antoine Ténart <antoine.tenart@free-electrons.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */ 8 */
12 9
13#ifndef __PINCTRL_BERLIN_H 10#ifndef __PINCTRL_BERLIN_H
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 24aaddd760a0..e582a21cfe54 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -1,16 +1,11 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * Core driver for the imx pin controller 2//
3 * 3// Core driver for the imx pin controller
4 * Copyright (C) 2012 Freescale Semiconductor, Inc. 4//
5 * Copyright (C) 2012 Linaro Ltd. 5// Copyright (C) 2012 Freescale Semiconductor, Inc.
6 * 6// Copyright (C) 2012 Linaro Ltd.
7 * Author: Dong Aisheng <dong.aisheng@linaro.org> 7//
8 * 8// Author: Dong Aisheng <dong.aisheng@linaro.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */
14 9
15#include <linux/err.h> 10#include <linux/err.h>
16#include <linux/init.h> 11#include <linux/init.h>
@@ -371,7 +366,7 @@ static void imx_pinconf_dbg_show(struct pinctrl_dev *pctldev,
371 unsigned long config; 366 unsigned long config;
372 367
373 if (!pin_reg || pin_reg->conf_reg == -1) { 368 if (!pin_reg || pin_reg->conf_reg == -1) {
374 seq_printf(s, "N/A"); 369 seq_puts(s, "N/A");
375 return; 370 return;
376 } 371 }
377 372
@@ -390,7 +385,7 @@ static void imx_pinconf_group_dbg_show(struct pinctrl_dev *pctldev,
390 if (group > pctldev->num_groups) 385 if (group > pctldev->num_groups)
391 return; 386 return;
392 387
393 seq_printf(s, "\n"); 388 seq_puts(s, "\n");
394 grp = pinctrl_generic_get_group(pctldev, group); 389 grp = pinctrl_generic_get_group(pctldev, group);
395 if (!grp) 390 if (!grp)
396 return; 391 return;
@@ -414,11 +409,18 @@ static const struct pinconf_ops imx_pinconf_ops = {
414}; 409};
415 410
416/* 411/*
417 * Each pin represented in fsl,pins consists of 5 u32 PIN_FUNC_ID and 412 * Each pin represented in fsl,pins consists of a number of u32 PIN_FUNC_ID
418 * 1 u32 CONFIG, so 24 types in total for each pin. 413 * and 1 u32 CONFIG, the total size is PIN_FUNC_ID + CONFIG for each pin.
414 * For generic_pinconf case, there's no extra u32 CONFIG.
415 *
416 * PIN_FUNC_ID format:
417 * Default:
418 * <mux_reg conf_reg input_reg mux_mode input_val>
419 * SHARE_MUX_CONF_REG:
420 * <mux_conf_reg input_reg mux_mode input_val>
419 */ 421 */
420#define FSL_PIN_SIZE 24 422#define FSL_PIN_SIZE 24
421#define SHARE_FSL_PIN_SIZE 20 423#define FSL_PIN_SHARE_SIZE 20
422 424
423static int imx_pinctrl_parse_groups(struct device_node *np, 425static int imx_pinctrl_parse_groups(struct device_node *np,
424 struct group_desc *grp, 426 struct group_desc *grp,
@@ -434,7 +436,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
434 dev_dbg(ipctl->dev, "group(%d): %s\n", index, np->name); 436 dev_dbg(ipctl->dev, "group(%d): %s\n", index, np->name);
435 437
436 if (info->flags & SHARE_MUX_CONF_REG) 438 if (info->flags & SHARE_MUX_CONF_REG)
437 pin_size = SHARE_FSL_PIN_SIZE; 439 pin_size = FSL_PIN_SHARE_SIZE;
438 else 440 else
439 pin_size = FSL_PIN_SIZE; 441 pin_size = FSL_PIN_SIZE;
440 442
@@ -617,7 +619,7 @@ static int imx_pinctrl_probe_dt(struct platform_device *pdev,
617 nfuncs = 1; 619 nfuncs = 1;
618 } else { 620 } else {
619 nfuncs = of_get_child_count(np); 621 nfuncs = of_get_child_count(np);
620 if (nfuncs <= 0) { 622 if (nfuncs == 0) {
621 dev_err(&pdev->dev, "no functions defined\n"); 623 dev_err(&pdev->dev, "no functions defined\n");
622 return -EINVAL; 624 return -EINVAL;
623 } 625 }
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h
index 038e8c0e5b96..4b8225ccb03a 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.h
+++ b/drivers/pinctrl/freescale/pinctrl-imx.h
@@ -1,3 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0+ */
1/* 2/*
2 * IMX pinmux core definitions 3 * IMX pinmux core definitions
3 * 4 *
@@ -5,11 +6,6 @@
5 * Copyright (C) 2012 Linaro Ltd. 6 * Copyright (C) 2012 Linaro Ltd.
6 * 7 *
7 * Author: Dong Aisheng <dong.aisheng@linaro.org> 8 * Author: Dong Aisheng <dong.aisheng@linaro.org>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */ 9 */
14 10
15#ifndef __DRIVERS_PINCTRL_IMX_H 11#ifndef __DRIVERS_PINCTRL_IMX_H
diff --git a/drivers/pinctrl/freescale/pinctrl-imx1-core.c b/drivers/pinctrl/freescale/pinctrl-imx1-core.c
index a4e9f430d452..5af89de0ff02 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx1-core.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx1-core.c
@@ -1,19 +1,14 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * Core driver for the imx pin controller in imx1/21/27 2//
3 * 3// Core driver for the imx pin controller in imx1/21/27
4 * Copyright (C) 2013 Pengutronix 4//
5 * Author: Markus Pargmann <mpa@pengutronix.de> 5// Copyright (C) 2013 Pengutronix
6 * 6// Author: Markus Pargmann <mpa@pengutronix.de>
7 * Based on pinctrl-imx.c: 7//
8 * Author: Dong Aisheng <dong.aisheng@linaro.org> 8// Based on pinctrl-imx.c:
9 * Copyright (C) 2012 Freescale Semiconductor, Inc. 9// Author: Dong Aisheng <dong.aisheng@linaro.org>
10 * Copyright (C) 2012 Linaro Ltd. 10// Copyright (C) 2012 Freescale Semiconductor, Inc.
11 * 11// Copyright (C) 2012 Linaro Ltd.
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 */
17 12
18#include <linux/bitops.h> 13#include <linux/bitops.h>
19#include <linux/err.h> 14#include <linux/err.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx1.c b/drivers/pinctrl/freescale/pinctrl-imx1.c
index fc8efc748734..faf770f13bc7 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx1.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx1.c
@@ -1,13 +1,8 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * i.MX1 pinctrl driver based on imx pinmux core 2//
3 * 3// i.MX1 pinctrl driver based on imx pinmux core
4 * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru> 4//
5 * 5// Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru>
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 6
12#include <linux/init.h> 7#include <linux/init.h>
13#include <linux/of.h> 8#include <linux/of.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx1.h b/drivers/pinctrl/freescale/pinctrl-imx1.h
index 174074308d6c..f1b9dabf7601 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx1.h
+++ b/drivers/pinctrl/freescale/pinctrl-imx1.h
@@ -1,3 +1,4 @@
1/* SPDX-License-Identifier: GPL-2.0+ */
1/* 2/*
2 * IMX pinmux core definitions 3 * IMX pinmux core definitions
3 * 4 *
@@ -5,11 +6,6 @@
5 * Copyright (C) 2012 Linaro Ltd. 6 * Copyright (C) 2012 Linaro Ltd.
6 * 7 *
7 * Author: Dong Aisheng <dong.aisheng@linaro.org> 8 * Author: Dong Aisheng <dong.aisheng@linaro.org>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */ 9 */
14 10
15#ifndef __DRIVERS_PINCTRL_IMX1_H 11#ifndef __DRIVERS_PINCTRL_IMX1_H
diff --git a/drivers/pinctrl/freescale/pinctrl-imx21.c b/drivers/pinctrl/freescale/pinctrl-imx21.c
index 73e26bc12f09..8a102275a053 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx21.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx21.c
@@ -1,13 +1,8 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * i.MX21 pinctrl driver based on imx pinmux core 2//
3 * 3// i.MX21 pinctrl driver based on imx pinmux core
4 * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru> 4//
5 * 5// Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru>
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 6
12#include <linux/init.h> 7#include <linux/init.h>
13#include <linux/of.h> 8#include <linux/of.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx23.c b/drivers/pinctrl/freescale/pinctrl-imx23.c
index c9405685971b..144020764a4b 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx23.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx23.c
@@ -1,16 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * Freescale i.MX23 pinctrl driver 2//
3 * 3// Freescale i.MX23 pinctrl driver
4 * Author: Shawn Guo <shawn.guo@linaro.org> 4//
5 * Copyright 2012 Freescale Semiconductor, Inc. 5// Author: Shawn Guo <shawn.guo@linaro.org>
6 * 6// Copyright 2012 Freescale Semiconductor, Inc.
7 * The code contained herein is licensed under the GNU General Public
8 * License. You may obtain a copy of the GNU General Public License
9 * Version 2 or later at the following locations:
10 *
11 * http://www.opensource.org/licenses/gpl-license.html
12 * http://www.gnu.org/copyleft/gpl.html
13 */
14 7
15#include <linux/init.h> 8#include <linux/init.h>
16#include <linux/of_device.h> 9#include <linux/of_device.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx25.c b/drivers/pinctrl/freescale/pinctrl-imx25.c
index db6d9d1382f9..a899a398b6bb 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx25.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx25.c
@@ -1,19 +1,15 @@
1/* 1// SPDX-License-Identifier: GPL-2.0
2 * imx25 pinctrl driver. 2//
3 * 3// imx25 pinctrl driver.
4 * Copyright 2013 Eukréa Electromatique <denis@eukrea.com> 4//
5 * 5// Copyright 2013 Eukréa Electromatique <denis@eukrea.com>
6 * This driver was mostly copied from the imx51 pinctrl driver which has: 6//
7 * 7// This driver was mostly copied from the imx51 pinctrl driver which has:
8 * Copyright (C) 2012 Freescale Semiconductor, Inc. 8//
9 * Copyright (C) 2012 Linaro, Inc. 9// Copyright (C) 2012 Freescale Semiconductor, Inc.
10 * 10// Copyright (C) 2012 Linaro, Inc.
11 * Author: Denis Carikli <denis@eukrea.com> 11//
12 * 12// Author: Denis Carikli <denis@eukrea.com>
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as published
15 * by the Free Software Foundation.
16 */
17 13
18#include <linux/err.h> 14#include <linux/err.h>
19#include <linux/init.h> 15#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx27.c b/drivers/pinctrl/freescale/pinctrl-imx27.c
index e5992036fc6c..b4dfc1676cbc 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx27.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx27.c
@@ -1,15 +1,10 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * imx27 pinctrl driver based on imx pinmux core 2//
3 * 3// imx27 pinctrl driver based on imx pinmux core
4 * Copyright (C) 2013 Pengutronix 4//
5 * 5// Copyright (C) 2013 Pengutronix
6 * Author: Markus Pargmann <mpa@pengutronix.de> 6//
7 * 7// Author: Markus Pargmann <mpa@pengutronix.de>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13 8
14#include <linux/err.h> 9#include <linux/err.h>
15#include <linux/init.h> 10#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx28.c b/drivers/pinctrl/freescale/pinctrl-imx28.c
index 87deb9ec938a..13730dd193f1 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx28.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx28.c
@@ -1,16 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * Freescale i.MX28 pinctrl driver 2//
3 * 3// Freescale i.MX28 pinctrl driver
4 * Author: Shawn Guo <shawn.guo@linaro.org> 4//
5 * Copyright 2012 Freescale Semiconductor, Inc. 5// Author: Shawn Guo <shawn.guo@linaro.org>
6 * 6// Copyright 2012 Freescale Semiconductor, Inc.
7 * The code contained herein is licensed under the GNU General Public
8 * License. You may obtain a copy of the GNU General Public License
9 * Version 2 or later at the following locations:
10 *
11 * http://www.opensource.org/licenses/gpl-license.html
12 * http://www.gnu.org/copyleft/gpl.html
13 */
14 7
15#include <linux/init.h> 8#include <linux/init.h>
16#include <linux/of_device.h> 9#include <linux/of_device.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx35.c b/drivers/pinctrl/freescale/pinctrl-imx35.c
index 6927946ae4b5..871bb419e2f0 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx35.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx35.c
@@ -1,17 +1,13 @@
1/* 1// SPDX-License-Identifier: GPL-2.0
2 * imx35 pinctrl driver. 2//
3 * 3// imx35 pinctrl driver.
4 * This driver was mostly copied from the imx51 pinctrl driver which has: 4//
5 * 5// This driver was mostly copied from the imx51 pinctrl driver which has:
6 * Copyright (C) 2012 Freescale Semiconductor, Inc. 6//
7 * Copyright (C) 2012 Linaro, Inc. 7// Copyright (C) 2012 Freescale Semiconductor, Inc.
8 * 8// Copyright (C) 2012 Linaro, Inc.
9 * Author: Dong Aisheng <dong.aisheng@linaro.org> 9//
10 * 10// Author: Dong Aisheng <dong.aisheng@linaro.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as published
13 * by the Free Software Foundation.
14 */
15 11
16#include <linux/err.h> 12#include <linux/err.h>
17#include <linux/init.h> 13#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx50.c b/drivers/pinctrl/freescale/pinctrl-imx50.c
index eb349b97290f..cf182c040e0b 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx50.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx50.c
@@ -1,15 +1,10 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * imx50 pinctrl driver based on imx pinmux core 2//
3 * 3// imx50 pinctrl driver based on imx pinmux core
4 * Copyright (C) 2013 Greg Ungerer <gerg@uclinux.org> 4//
5 * Copyright (C) 2012 Freescale Semiconductor, Inc. 5// Copyright (C) 2013 Greg Ungerer <gerg@uclinux.org>
6 * Copyright (C) 2012 Linaro, Inc. 6// Copyright (C) 2012 Freescale Semiconductor, Inc.
7 * 7// Copyright (C) 2012 Linaro, Inc.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13 8
14#include <linux/err.h> 9#include <linux/err.h>
15#include <linux/init.h> 10#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx51.c b/drivers/pinctrl/freescale/pinctrl-imx51.c
index 49acd991b5fb..e5c261e2bf1e 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx51.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx51.c
@@ -1,16 +1,11 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * imx51 pinctrl driver based on imx pinmux core 2//
3 * 3// imx51 pinctrl driver based on imx pinmux core
4 * Copyright (C) 2012 Freescale Semiconductor, Inc. 4//
5 * Copyright (C) 2012 Linaro, Inc. 5// Copyright (C) 2012 Freescale Semiconductor, Inc.
6 * 6// Copyright (C) 2012 Linaro, Inc.
7 * Author: Dong Aisheng <dong.aisheng@linaro.org> 7//
8 * 8// Author: Dong Aisheng <dong.aisheng@linaro.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */
14 9
15#include <linux/err.h> 10#include <linux/err.h>
16#include <linux/init.h> 11#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx53.c b/drivers/pinctrl/freescale/pinctrl-imx53.c
index 6dd0c60eaea4..64c97aaf20c7 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx53.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx53.c
@@ -1,16 +1,11 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * imx53 pinctrl driver based on imx pinmux core 2//
3 * 3// imx53 pinctrl driver based on imx pinmux core
4 * Copyright (C) 2012 Freescale Semiconductor, Inc. 4//
5 * Copyright (C) 2012 Linaro, Inc. 5// Copyright (C) 2012 Freescale Semiconductor, Inc.
6 * 6// Copyright (C) 2012 Linaro, Inc.
7 * Author: Dong Aisheng <dong.aisheng@linaro.org> 7//
8 * 8// Author: Dong Aisheng <dong.aisheng@linaro.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */
14 9
15#include <linux/err.h> 10#include <linux/err.h>
16#include <linux/init.h> 11#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx6dl.c b/drivers/pinctrl/freescale/pinctrl-imx6dl.c
index 91b85fc01de8..0858b4d79ed2 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx6dl.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx6dl.c
@@ -1,13 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0
2 * Freescale imx6dl pinctrl driver 2//
3 * 3// Freescale imx6dl pinctrl driver
4 * Author: Shawn Guo <shawn.guo@linaro.org> 4//
5 * Copyright (C) 2013 Freescale Semiconductor, Inc. 5// Author: Shawn Guo <shawn.guo@linaro.org>
6 * 6// Copyright (C) 2013 Freescale Semiconductor, Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11 7
12#include <linux/err.h> 8#include <linux/err.h>
13#include <linux/init.h> 9#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx6q.c b/drivers/pinctrl/freescale/pinctrl-imx6q.c
index 5f653d69d0f5..078ed6a331fd 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx6q.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx6q.c
@@ -1,16 +1,11 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * imx6q pinctrl driver based on imx pinmux core 2//
3 * 3// imx6q pinctrl driver based on imx pinmux core
4 * Copyright (C) 2012 Freescale Semiconductor, Inc. 4//
5 * Copyright (C) 2012 Linaro, Inc. 5// Copyright (C) 2012 Freescale Semiconductor, Inc.
6 * 6// Copyright (C) 2012 Linaro, Inc.
7 * Author: Dong Aisheng <dong.aisheng@linaro.org> 7//
8 * 8// Author: Dong Aisheng <dong.aisheng@linaro.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */
14 9
15#include <linux/err.h> 10#include <linux/err.h>
16#include <linux/init.h> 11#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx6sl.c b/drivers/pinctrl/freescale/pinctrl-imx6sl.c
index 1167dc273c04..9d2e6f987aa7 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx6sl.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx6sl.c
@@ -1,13 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0
2 * Freescale imx6sl pinctrl driver 2//
3 * 3// Freescale imx6sl pinctrl driver
4 * Author: Shawn Guo <shawn.guo@linaro.org> 4//
5 * Copyright (C) 2013 Freescale Semiconductor, Inc. 5// Author: Shawn Guo <shawn.guo@linaro.org>
6 * 6// Copyright (C) 2013 Freescale Semiconductor, Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11 7
12#include <linux/err.h> 8#include <linux/err.h>
13#include <linux/init.h> 9#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx6sll.c b/drivers/pinctrl/freescale/pinctrl-imx6sll.c
index 0fbea9cf536d..0618f4d887fd 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx6sll.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx6sll.c
@@ -1,9 +1,7 @@
1// SPDX-License-Identifier: GPL-2.0 1// SPDX-License-Identifier: GPL-2.0
2/* 2//
3 * Copyright (C) 2016 Freescale Semiconductor, Inc. 3// Copyright (C) 2016 Freescale Semiconductor, Inc.
4 * Copyright 2017-2018 NXP. 4// Copyright 2017-2018 NXP.
5 *
6 */
7 5
8#include <linux/err.h> 6#include <linux/err.h>
9#include <linux/init.h> 7#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx6sx.c b/drivers/pinctrl/freescale/pinctrl-imx6sx.c
index 15ea56c75f68..c7e2b1f94f01 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx6sx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx6sx.c
@@ -1,13 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0
2 * Freescale imx6sx pinctrl driver 2//
3 * 3// Freescale imx6sx pinctrl driver
4 * Author: Anson Huang <Anson.Huang@freescale.com> 4//
5 * Copyright (C) 2014 Freescale Semiconductor, Inc. 5// Author: Anson Huang <Anson.Huang@freescale.com>
6 * 6// Copyright (C) 2014 Freescale Semiconductor, Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11 7
12#include <linux/err.h> 8#include <linux/err.h>
13#include <linux/init.h> 9#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx6ul.c b/drivers/pinctrl/freescale/pinctrl-imx6ul.c
index 4580717ade19..7e37627c63f5 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx6ul.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx6ul.c
@@ -1,13 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0
2 * Freescale imx6ul pinctrl driver 2//
3 * 3// Freescale imx6ul pinctrl driver
4 * Author: Anson Huang <Anson.Huang@freescale.com> 4//
5 * Copyright (C) 2015 Freescale Semiconductor, Inc. 5// Author: Anson Huang <Anson.Huang@freescale.com>
6 * 6// Copyright (C) 2015 Freescale Semiconductor, Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11 7
12#include <linux/err.h> 8#include <linux/err.h>
13#include <linux/init.h> 9#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx7d.c b/drivers/pinctrl/freescale/pinctrl-imx7d.c
index 0b0a2f33b06a..369d3e59fdd6 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx7d.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx7d.c
@@ -1,13 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0
2 * Freescale imx7d pinctrl driver 2//
3 * 3// Freescale imx7d pinctrl driver
4 * Author: Anson Huang <Anson.Huang@freescale.com> 4//
5 * Copyright (C) 2014-2015 Freescale Semiconductor, Inc. 5// Author: Anson Huang <Anson.Huang@freescale.com>
6 * 6// Copyright (C) 2014-2015 Freescale Semiconductor, Inc.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11 7
12#include <linux/err.h> 8#include <linux/err.h>
13#include <linux/init.h> 9#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-imx7ulp.c b/drivers/pinctrl/freescale/pinctrl-imx7ulp.c
index f363e45fd246..f521bdb53f62 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx7ulp.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx7ulp.c
@@ -1,14 +1,9 @@
1/* 1// SPDX-License-Identifier: GPL-2.0
2 * Copyright (C) 2016 Freescale Semiconductor, Inc. 2//
3 * Copyright (C) 2017 NXP 3// Copyright (C) 2016 Freescale Semiconductor, Inc.
4 * 4// Copyright (C) 2017 NXP
5 * Author: Dong Aisheng <aisheng.dong@nxp.com> 5//
6 * 6// Author: Dong Aisheng <aisheng.dong@nxp.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12 7
13#include <linux/err.h> 8#include <linux/err.h>
14#include <linux/init.h> 9#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-mxs.c b/drivers/pinctrl/freescale/pinctrl-mxs.c
index 6852010a6d70..594f3e5ce9a9 100644
--- a/drivers/pinctrl/freescale/pinctrl-mxs.c
+++ b/drivers/pinctrl/freescale/pinctrl-mxs.c
@@ -1,13 +1,6 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * Copyright 2012 Freescale Semiconductor, Inc. 2//
3 * 3// Copyright 2012 Freescale Semiconductor, Inc.
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */
11 4
12#include <linux/err.h> 5#include <linux/err.h>
13#include <linux/init.h> 6#include <linux/init.h>
diff --git a/drivers/pinctrl/freescale/pinctrl-mxs.h b/drivers/pinctrl/freescale/pinctrl-mxs.h
index 34dbf75208dc..ab9f834b03e6 100644
--- a/drivers/pinctrl/freescale/pinctrl-mxs.h
+++ b/drivers/pinctrl/freescale/pinctrl-mxs.h
@@ -1,12 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0+ */
1/* 2/*
2 * Copyright 2012 Freescale Semiconductor, Inc. 3 * Copyright 2012 Freescale Semiconductor, Inc.
3 *
4 * The code contained herein is licensed under the GNU General Public
5 * License. You may obtain a copy of the GNU General Public License
6 * Version 2 or later at the following locations:
7 *
8 * http://www.opensource.org/licenses/gpl-license.html
9 * http://www.gnu.org/copyleft/gpl.html
10 */ 4 */
11 5
12#ifndef __PINCTRL_MXS_H 6#ifndef __PINCTRL_MXS_H
diff --git a/drivers/pinctrl/freescale/pinctrl-vf610.c b/drivers/pinctrl/freescale/pinctrl-vf610.c
index c078f859ae15..37602b053ed2 100644
--- a/drivers/pinctrl/freescale/pinctrl-vf610.c
+++ b/drivers/pinctrl/freescale/pinctrl-vf610.c
@@ -1,13 +1,8 @@
1/* 1// SPDX-License-Identifier: GPL-2.0+
2 * VF610 pinctrl driver based on imx pinmux and pinconf core 2//
3 * 3// VF610 pinctrl driver based on imx pinmux and pinconf core
4 * Copyright 2013 Freescale Semiconductor, Inc. 4//
5 * 5// Copyright 2013 Freescale Semiconductor, Inc.
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 6
12#include <linux/err.h> 7#include <linux/err.h>
13#include <linux/init.h> 8#include <linux/init.h>
diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c
index fee9225ca559..0f1019ae3993 100644
--- a/drivers/pinctrl/intel/pinctrl-cherryview.c
+++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
@@ -1527,6 +1527,7 @@ static const struct dmi_system_id chv_no_valid_mask[] = {
1527 .matches = { 1527 .matches = {
1528 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"), 1528 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
1529 DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_Strago"), 1529 DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_Strago"),
1530 DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
1530 }, 1531 },
1531 }, 1532 },
1532 { 1533 {
@@ -1534,6 +1535,7 @@ static const struct dmi_system_id chv_no_valid_mask[] = {
1534 .matches = { 1535 .matches = {
1535 DMI_MATCH(DMI_SYS_VENDOR, "HP"), 1536 DMI_MATCH(DMI_SYS_VENDOR, "HP"),
1536 DMI_MATCH(DMI_PRODUCT_NAME, "Setzer"), 1537 DMI_MATCH(DMI_PRODUCT_NAME, "Setzer"),
1538 DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
1537 }, 1539 },
1538 }, 1540 },
1539 { 1541 {
@@ -1541,6 +1543,7 @@ static const struct dmi_system_id chv_no_valid_mask[] = {
1541 .matches = { 1543 .matches = {
1542 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"), 1544 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
1543 DMI_MATCH(DMI_PRODUCT_NAME, "Cyan"), 1545 DMI_MATCH(DMI_PRODUCT_NAME, "Cyan"),
1546 DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
1544 }, 1547 },
1545 }, 1548 },
1546 { 1549 {
@@ -1548,6 +1551,7 @@ static const struct dmi_system_id chv_no_valid_mask[] = {
1548 .matches = { 1551 .matches = {
1549 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"), 1552 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
1550 DMI_MATCH(DMI_PRODUCT_NAME, "Celes"), 1553 DMI_MATCH(DMI_PRODUCT_NAME, "Celes"),
1554 DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
1551 }, 1555 },
1552 }, 1556 },
1553 {} 1557 {}
diff --git a/drivers/pinctrl/mediatek/Kconfig b/drivers/pinctrl/mediatek/Kconfig
index 862c5dbc6977..9905dc672f6b 100644
--- a/drivers/pinctrl/mediatek/Kconfig
+++ b/drivers/pinctrl/mediatek/Kconfig
@@ -1,12 +1,18 @@
1menu "MediaTek pinctrl drivers" 1menu "MediaTek pinctrl drivers"
2 depends on ARCH_MEDIATEK || COMPILE_TEST 2 depends on ARCH_MEDIATEK || COMPILE_TEST
3 3
4config EINT_MTK
5 bool "MediaTek External Interrupt Support"
6 depends on PINCTRL_MTK || PINCTRL_MT7622 || COMPILE_TEST
7 select IRQ_DOMAIN
8
4config PINCTRL_MTK 9config PINCTRL_MTK
5 bool 10 bool
6 depends on OF 11 depends on OF
7 select PINMUX 12 select PINMUX
8 select GENERIC_PINCONF 13 select GENERIC_PINCONF
9 select GPIOLIB 14 select GPIOLIB
15 select EINT_MTK
10 select OF_GPIO 16 select OF_GPIO
11 17
12# For ARMv7 SoCs 18# For ARMv7 SoCs
diff --git a/drivers/pinctrl/mediatek/Makefile b/drivers/pinctrl/mediatek/Makefile
index 7959e773533f..3de7156df345 100644
--- a/drivers/pinctrl/mediatek/Makefile
+++ b/drivers/pinctrl/mediatek/Makefile
@@ -1,5 +1,6 @@
1# SPDX-License-Identifier: GPL-2.0 1# SPDX-License-Identifier: GPL-2.0
2# Core 2# Core
3obj-$(CONFIG_EINT_MTK) += mtk-eint.o
3obj-$(CONFIG_PINCTRL_MTK) += pinctrl-mtk-common.o 4obj-$(CONFIG_PINCTRL_MTK) += pinctrl-mtk-common.o
4 5
5# SoC Drivers 6# SoC Drivers
diff --git a/drivers/pinctrl/mediatek/mtk-eint.c b/drivers/pinctrl/mediatek/mtk-eint.c
new file mode 100644
index 000000000000..30f3316747e2
--- /dev/null
+++ b/drivers/pinctrl/mediatek/mtk-eint.c
@@ -0,0 +1,492 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (c) 2014-2018 MediaTek Inc.
3
4/*
5 * Library for MediaTek External Interrupt Support
6 *
7 * Author: Maoguang Meng <maoguang.meng@mediatek.com>
8 * Sean Wang <sean.wang@mediatek.com>
9 *
10 */
11
12#include <linux/delay.h>
13#include <linux/err.h>
14#include <linux/gpio.h>
15#include <linux/io.h>
16#include <linux/irqdomain.h>
17#include <linux/of_irq.h>
18#include <linux/platform_device.h>
19
20#include "mtk-eint.h"
21
22#define MTK_EINT_EDGE_SENSITIVE 0
23#define MTK_EINT_LEVEL_SENSITIVE 1
24#define MTK_EINT_DBNC_SET_DBNC_BITS 4
25#define MTK_EINT_DBNC_RST_BIT (0x1 << 1)
26#define MTK_EINT_DBNC_SET_EN (0x1 << 0)
27
28static const struct mtk_eint_regs mtk_generic_eint_regs = {
29 .stat = 0x000,
30 .ack = 0x040,
31 .mask = 0x080,
32 .mask_set = 0x0c0,
33 .mask_clr = 0x100,
34 .sens = 0x140,
35 .sens_set = 0x180,
36 .sens_clr = 0x1c0,
37 .soft = 0x200,
38 .soft_set = 0x240,
39 .soft_clr = 0x280,
40 .pol = 0x300,
41 .pol_set = 0x340,
42 .pol_clr = 0x380,
43 .dom_en = 0x400,
44 .dbnc_ctrl = 0x500,
45 .dbnc_set = 0x600,
46 .dbnc_clr = 0x700,
47};
48
49static void __iomem *mtk_eint_get_offset(struct mtk_eint *eint,
50 unsigned int eint_num,
51 unsigned int offset)
52{
53 unsigned int eint_base = 0;
54 void __iomem *reg;
55
56 if (eint_num >= eint->hw->ap_num)
57 eint_base = eint->hw->ap_num;
58
59 reg = eint->base + offset + ((eint_num - eint_base) / 32) * 4;
60
61 return reg;
62}
63
64static unsigned int mtk_eint_can_en_debounce(struct mtk_eint *eint,
65 unsigned int eint_num)
66{
67 unsigned int sens;
68 unsigned int bit = BIT(eint_num % 32);
69 void __iomem *reg = mtk_eint_get_offset(eint, eint_num,
70 eint->regs->sens);
71
72 if (readl(reg) & bit)
73 sens = MTK_EINT_LEVEL_SENSITIVE;
74 else
75 sens = MTK_EINT_EDGE_SENSITIVE;
76
77 if (eint_num < eint->hw->db_cnt && sens != MTK_EINT_EDGE_SENSITIVE)
78 return 1;
79 else
80 return 0;
81}
82
83static int mtk_eint_flip_edge(struct mtk_eint *eint, int hwirq)
84{
85 int start_level, curr_level;
86 unsigned int reg_offset;
87 u32 mask = BIT(hwirq & 0x1f);
88 u32 port = (hwirq >> 5) & eint->hw->port_mask;
89 void __iomem *reg = eint->base + (port << 2);
90
91 curr_level = eint->gpio_xlate->get_gpio_state(eint->pctl, hwirq);
92
93 do {
94 start_level = curr_level;
95 if (start_level)
96 reg_offset = eint->regs->pol_clr;
97 else
98 reg_offset = eint->regs->pol_set;
99 writel(mask, reg + reg_offset);
100
101 curr_level = eint->gpio_xlate->get_gpio_state(eint->pctl,
102 hwirq);
103 } while (start_level != curr_level);
104
105 return start_level;
106}
107
108static void mtk_eint_mask(struct irq_data *d)
109{
110 struct mtk_eint *eint = irq_data_get_irq_chip_data(d);
111 u32 mask = BIT(d->hwirq & 0x1f);
112 void __iomem *reg = mtk_eint_get_offset(eint, d->hwirq,
113 eint->regs->mask_set);
114
115 writel(mask, reg);
116}
117
118static void mtk_eint_unmask(struct irq_data *d)
119{
120 struct mtk_eint *eint = irq_data_get_irq_chip_data(d);
121 u32 mask = BIT(d->hwirq & 0x1f);
122 void __iomem *reg = mtk_eint_get_offset(eint, d->hwirq,
123 eint->regs->mask_clr);
124
125 writel(mask, reg);
126
127 if (eint->dual_edge[d->hwirq])
128 mtk_eint_flip_edge(eint, d->hwirq);
129}
130
131static unsigned int mtk_eint_get_mask(struct mtk_eint *eint,
132 unsigned int eint_num)
133{
134 unsigned int bit = BIT(eint_num % 32);
135 void __iomem *reg = mtk_eint_get_offset(eint, eint_num,
136 eint->regs->mask);
137
138 return !!(readl(reg) & bit);
139}
140
141static void mtk_eint_ack(struct irq_data *d)
142{
143 struct mtk_eint *eint = irq_data_get_irq_chip_data(d);
144 u32 mask = BIT(d->hwirq & 0x1f);
145 void __iomem *reg = mtk_eint_get_offset(eint, d->hwirq,
146 eint->regs->ack);
147
148 writel(mask, reg);
149}
150
151static int mtk_eint_set_type(struct irq_data *d, unsigned int type)
152{
153 struct mtk_eint *eint = irq_data_get_irq_chip_data(d);
154 u32 mask = BIT(d->hwirq & 0x1f);
155 void __iomem *reg;
156
157 if (((type & IRQ_TYPE_EDGE_BOTH) && (type & IRQ_TYPE_LEVEL_MASK)) ||
158 ((type & IRQ_TYPE_LEVEL_MASK) == IRQ_TYPE_LEVEL_MASK)) {
159 dev_err(eint->dev,
160 "Can't configure IRQ%d (EINT%lu) for type 0x%X\n",
161 d->irq, d->hwirq, type);
162 return -EINVAL;
163 }
164
165 if ((type & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH)
166 eint->dual_edge[d->hwirq] = 1;
167 else
168 eint->dual_edge[d->hwirq] = 0;
169
170 if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_EDGE_FALLING)) {
171 reg = mtk_eint_get_offset(eint, d->hwirq, eint->regs->pol_clr);
172 writel(mask, reg);
173 } else {
174 reg = mtk_eint_get_offset(eint, d->hwirq, eint->regs->pol_set);
175 writel(mask, reg);
176 }
177
178 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
179 reg = mtk_eint_get_offset(eint, d->hwirq, eint->regs->sens_clr);
180 writel(mask, reg);
181 } else {
182 reg = mtk_eint_get_offset(eint, d->hwirq, eint->regs->sens_set);
183 writel(mask, reg);
184 }
185
186 if (eint->dual_edge[d->hwirq])
187 mtk_eint_flip_edge(eint, d->hwirq);
188
189 return 0;
190}
191
192static int mtk_eint_irq_set_wake(struct irq_data *d, unsigned int on)
193{
194 struct mtk_eint *eint = irq_data_get_irq_chip_data(d);
195 int shift = d->hwirq & 0x1f;
196 int reg = d->hwirq >> 5;
197
198 if (on)
199 eint->wake_mask[reg] |= BIT(shift);
200 else
201 eint->wake_mask[reg] &= ~BIT(shift);
202
203 return 0;
204}
205
206static void mtk_eint_chip_write_mask(const struct mtk_eint *eint,
207 void __iomem *base, u32 *buf)
208{
209 int port;
210 void __iomem *reg;
211
212 for (port = 0; port < eint->hw->ports; port++) {
213 reg = base + (port << 2);
214 writel_relaxed(~buf[port], reg + eint->regs->mask_set);
215 writel_relaxed(buf[port], reg + eint->regs->mask_clr);
216 }
217}
218
219static void mtk_eint_chip_read_mask(const struct mtk_eint *eint,
220 void __iomem *base, u32 *buf)
221{
222 int port;
223 void __iomem *reg;
224
225 for (port = 0; port < eint->hw->ports; port++) {
226 reg = base + eint->regs->mask + (port << 2);
227 buf[port] = ~readl_relaxed(reg);
228 /* Mask is 0 when irq is enabled, and 1 when disabled. */
229 }
230}
231
232static int mtk_eint_irq_request_resources(struct irq_data *d)
233{
234 struct mtk_eint *eint = irq_data_get_irq_chip_data(d);
235 struct gpio_chip *gpio_c;
236 unsigned int gpio_n;
237 int err;
238
239 err = eint->gpio_xlate->get_gpio_n(eint->pctl, d->hwirq,
240 &gpio_n, &gpio_c);
241 if (err < 0) {
242 dev_err(eint->dev, "Can not find pin\n");
243 return err;
244 }
245
246 err = gpiochip_lock_as_irq(gpio_c, gpio_n);
247 if (err < 0) {
248 dev_err(eint->dev, "unable to lock HW IRQ %lu for IRQ\n",
249 irqd_to_hwirq(d));
250 return err;
251 }
252
253 err = eint->gpio_xlate->set_gpio_as_eint(eint->pctl, d->hwirq);
254 if (err < 0) {
255 dev_err(eint->dev, "Can not eint mode\n");
256 return err;
257 }
258
259 return 0;
260}
261
262static void mtk_eint_irq_release_resources(struct irq_data *d)
263{
264 struct mtk_eint *eint = irq_data_get_irq_chip_data(d);
265 struct gpio_chip *gpio_c;
266 unsigned int gpio_n;
267
268 eint->gpio_xlate->get_gpio_n(eint->pctl, d->hwirq, &gpio_n,
269 &gpio_c);
270
271 gpiochip_unlock_as_irq(gpio_c, gpio_n);
272}
273
274static struct irq_chip mtk_eint_irq_chip = {
275 .name = "mt-eint",
276 .irq_disable = mtk_eint_mask,
277 .irq_mask = mtk_eint_mask,
278 .irq_unmask = mtk_eint_unmask,
279 .irq_ack = mtk_eint_ack,
280 .irq_set_type = mtk_eint_set_type,
281 .irq_set_wake = mtk_eint_irq_set_wake,
282 .irq_request_resources = mtk_eint_irq_request_resources,
283 .irq_release_resources = mtk_eint_irq_release_resources,
284};
285
286static unsigned int mtk_eint_hw_init(struct mtk_eint *eint)
287{
288 void __iomem *reg = eint->base + eint->regs->dom_en;
289 unsigned int i;
290
291 for (i = 0; i < eint->hw->ap_num; i += 32) {
292 writel(0xffffffff, reg);
293 reg += 4;
294 }
295
296 return 0;
297}
298
299static inline void
300mtk_eint_debounce_process(struct mtk_eint *eint, int index)
301{
302 unsigned int rst, ctrl_offset;
303 unsigned int bit, dbnc;
304
305 ctrl_offset = (index / 4) * 4 + eint->regs->dbnc_ctrl;
306 dbnc = readl(eint->base + ctrl_offset);
307 bit = MTK_EINT_DBNC_SET_EN << ((index % 4) * 8);
308 if ((bit & dbnc) > 0) {
309 ctrl_offset = (index / 4) * 4 + eint->regs->dbnc_set;
310 rst = MTK_EINT_DBNC_RST_BIT << ((index % 4) * 8);
311 writel(rst, eint->base + ctrl_offset);
312 }
313}
314
315static void mtk_eint_irq_handler(struct irq_desc *desc)
316{
317 struct irq_chip *chip = irq_desc_get_chip(desc);
318 struct mtk_eint *eint = irq_desc_get_handler_data(desc);
319 unsigned int status, eint_num;
320 int offset, index, virq;
321 void __iomem *reg = mtk_eint_get_offset(eint, 0, eint->regs->stat);
322 int dual_edge, start_level, curr_level;
323
324 chained_irq_enter(chip, desc);
325 for (eint_num = 0; eint_num < eint->hw->ap_num; eint_num += 32,
326 reg += 4) {
327 status = readl(reg);
328 while (status) {
329 offset = __ffs(status);
330 index = eint_num + offset;
331 virq = irq_find_mapping(eint->domain, index);
332 status &= ~BIT(offset);
333
334 dual_edge = eint->dual_edge[index];
335 if (dual_edge) {
336 /*
337 * Clear soft-irq in case we raised it last
338 * time.
339 */
340 writel(BIT(offset), reg - eint->regs->stat +
341 eint->regs->soft_clr);
342
343 start_level =
344 eint->gpio_xlate->get_gpio_state(eint->pctl,
345 index);
346 }
347
348 generic_handle_irq(virq);
349
350 if (dual_edge) {
351 curr_level = mtk_eint_flip_edge(eint, index);
352
353 /*
354 * If level changed, we might lost one edge
355 * interrupt, raised it through soft-irq.
356 */
357 if (start_level != curr_level)
358 writel(BIT(offset), reg -
359 eint->regs->stat +
360 eint->regs->soft_set);
361 }
362
363 if (index < eint->hw->db_cnt)
364 mtk_eint_debounce_process(eint, index);
365 }
366 }
367 chained_irq_exit(chip, desc);
368}
369
370int mtk_eint_do_suspend(struct mtk_eint *eint)
371{
372 mtk_eint_chip_read_mask(eint, eint->base, eint->cur_mask);
373 mtk_eint_chip_write_mask(eint, eint->base, eint->wake_mask);
374
375 return 0;
376}
377
378int mtk_eint_do_resume(struct mtk_eint *eint)
379{
380 mtk_eint_chip_write_mask(eint, eint->base, eint->cur_mask);
381
382 return 0;
383}
384
385int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_num,
386 unsigned int debounce)
387{
388 int virq, eint_offset;
389 unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask,
390 dbnc;
391 static const unsigned int debounce_time[] = {500, 1000, 16000, 32000,
392 64000, 128000, 256000};
393 struct irq_data *d;
394
395 virq = irq_find_mapping(eint->domain, eint_num);
396 eint_offset = (eint_num % 4) * 8;
397 d = irq_get_irq_data(virq);
398
399 set_offset = (eint_num / 4) * 4 + eint->regs->dbnc_set;
400 clr_offset = (eint_num / 4) * 4 + eint->regs->dbnc_clr;
401
402 if (!mtk_eint_can_en_debounce(eint, eint_num))
403 return -EINVAL;
404
405 dbnc = ARRAY_SIZE(debounce_time);
406 for (i = 0; i < ARRAY_SIZE(debounce_time); i++) {
407 if (debounce <= debounce_time[i]) {
408 dbnc = i;
409 break;
410 }
411 }
412
413 if (!mtk_eint_get_mask(eint, eint_num)) {
414 mtk_eint_mask(d);
415 unmask = 1;
416 } else {
417 unmask = 0;
418 }
419
420 clr_bit = 0xff << eint_offset;
421 writel(clr_bit, eint->base + clr_offset);
422
423 bit = ((dbnc << MTK_EINT_DBNC_SET_DBNC_BITS) | MTK_EINT_DBNC_SET_EN) <<
424 eint_offset;
425 rst = MTK_EINT_DBNC_RST_BIT << eint_offset;
426 writel(rst | bit, eint->base + set_offset);
427
428 /*
429 * Delay a while (more than 2T) to wait for hw debounce counter reset
430 * work correctly.
431 */
432 udelay(1);
433 if (unmask == 1)
434 mtk_eint_unmask(d);
435
436 return 0;
437}
438
439int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
440{
441 int irq;
442
443 irq = irq_find_mapping(eint->domain, eint_n);
444 if (!irq)
445 return -EINVAL;
446
447 return irq;
448}
449
450int mtk_eint_do_init(struct mtk_eint *eint)
451{
452 int i;
453
454 /* If clients don't assign a specific regs, let's use generic one */
455 if (!eint->regs)
456 eint->regs = &mtk_generic_eint_regs;
457
458 eint->wake_mask = devm_kcalloc(eint->dev, eint->hw->ports,
459 sizeof(*eint->wake_mask), GFP_KERNEL);
460 if (!eint->wake_mask)
461 return -ENOMEM;
462
463 eint->cur_mask = devm_kcalloc(eint->dev, eint->hw->ports,
464 sizeof(*eint->cur_mask), GFP_KERNEL);
465 if (!eint->cur_mask)
466 return -ENOMEM;
467
468 eint->dual_edge = devm_kcalloc(eint->dev, eint->hw->ap_num,
469 sizeof(int), GFP_KERNEL);
470 if (!eint->dual_edge)
471 return -ENOMEM;
472
473 eint->domain = irq_domain_add_linear(eint->dev->of_node,
474 eint->hw->ap_num,
475 &irq_domain_simple_ops, NULL);
476 if (!eint->domain)
477 return -ENOMEM;
478
479 mtk_eint_hw_init(eint);
480 for (i = 0; i < eint->hw->ap_num; i++) {
481 int virq = irq_create_mapping(eint->domain, i);
482
483 irq_set_chip_and_handler(virq, &mtk_eint_irq_chip,
484 handle_level_irq);
485 irq_set_chip_data(virq, eint);
486 }
487
488 irq_set_chained_handler_and_data(eint->irq, mtk_eint_irq_handler,
489 eint);
490
491 return 0;
492}
diff --git a/drivers/pinctrl/mediatek/mtk-eint.h b/drivers/pinctrl/mediatek/mtk-eint.h
new file mode 100644
index 000000000000..c286a9b940f2
--- /dev/null
+++ b/drivers/pinctrl/mediatek/mtk-eint.h
@@ -0,0 +1,106 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (C) 2014-2018 MediaTek Inc.
4 *
5 * Author: Maoguang Meng <maoguang.meng@mediatek.com>
6 * Sean Wang <sean.wang@mediatek.com>
7 *
8 */
9#ifndef __MTK_EINT_H
10#define __MTK_EINT_H
11
12#include <linux/irqdomain.h>
13
14struct mtk_eint_regs {
15 unsigned int stat;
16 unsigned int ack;
17 unsigned int mask;
18 unsigned int mask_set;
19 unsigned int mask_clr;
20 unsigned int sens;
21 unsigned int sens_set;
22 unsigned int sens_clr;
23 unsigned int soft;
24 unsigned int soft_set;
25 unsigned int soft_clr;
26 unsigned int pol;
27 unsigned int pol_set;
28 unsigned int pol_clr;
29 unsigned int dom_en;
30 unsigned int dbnc_ctrl;
31 unsigned int dbnc_set;
32 unsigned int dbnc_clr;
33};
34
35struct mtk_eint_hw {
36 u8 port_mask;
37 u8 ports;
38 unsigned int ap_num;
39 unsigned int db_cnt;
40};
41
42struct mtk_eint;
43
44struct mtk_eint_xt {
45 int (*get_gpio_n)(void *data, unsigned long eint_n,
46 unsigned int *gpio_n,
47 struct gpio_chip **gpio_chip);
48 int (*get_gpio_state)(void *data, unsigned long eint_n);
49 int (*set_gpio_as_eint)(void *data, unsigned long eint_n);
50};
51
52struct mtk_eint {
53 struct device *dev;
54 void __iomem *base;
55 struct irq_domain *domain;
56 int irq;
57
58 int *dual_edge;
59 u32 *wake_mask;
60 u32 *cur_mask;
61
62 /* Used to fit into various EINT device */
63 const struct mtk_eint_hw *hw;
64 const struct mtk_eint_regs *regs;
65
66 /* Used to fit into various pinctrl device */
67 void *pctl;
68 const struct mtk_eint_xt *gpio_xlate;
69};
70
71#if IS_ENABLED(CONFIG_EINT_MTK)
72int mtk_eint_do_init(struct mtk_eint *eint);
73int mtk_eint_do_suspend(struct mtk_eint *eint);
74int mtk_eint_do_resume(struct mtk_eint *eint);
75int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_n,
76 unsigned int debounce);
77int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n);
78
79#else
80static inline int mtk_eint_do_init(struct mtk_eint *eint)
81{
82 return -EOPNOTSUPP;
83}
84
85static inline int mtk_eint_do_suspend(struct mtk_eint *eint)
86{
87 return -EOPNOTSUPP;
88}
89
90static inline int mtk_eint_do_resume(struct mtk_eint *eint)
91{
92 return -EOPNOTSUPP;
93}
94
95int mtk_eint_set_debounce(struct mtk_eint *eint, unsigned long eint_n,
96 unsigned int debounce)
97{
98 return -EOPNOTSUPP;
99}
100
101int mtk_eint_find_irq(struct mtk_eint *eint, unsigned long eint_n)
102{
103 return -EOPNOTSUPP;
104}
105#endif
106#endif /* __MTK_EINT_H */
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt2701.c b/drivers/pinctrl/mediatek/pinctrl-mt2701.c
index f86f3b379607..e91c314f3b75 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt2701.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt2701.c
@@ -531,31 +531,12 @@ static const struct mtk_pinctrl_devdata mt2701_pinctrl_data = {
531 .port_shf = 4, 531 .port_shf = 4,
532 .port_mask = 0x1f, 532 .port_mask = 0x1f,
533 .port_align = 4, 533 .port_align = 4,
534 .eint_offsets = { 534 .eint_hw = {
535 .name = "mt2701_eint",
536 .stat = 0x000,
537 .ack = 0x040,
538 .mask = 0x080,
539 .mask_set = 0x0c0,
540 .mask_clr = 0x100,
541 .sens = 0x140,
542 .sens_set = 0x180,
543 .sens_clr = 0x1c0,
544 .soft = 0x200,
545 .soft_set = 0x240,
546 .soft_clr = 0x280,
547 .pol = 0x300,
548 .pol_set = 0x340,
549 .pol_clr = 0x380,
550 .dom_en = 0x400,
551 .dbnc_ctrl = 0x500,
552 .dbnc_set = 0x600,
553 .dbnc_clr = 0x700,
554 .port_mask = 6, 535 .port_mask = 6,
555 .ports = 6, 536 .ports = 6,
537 .ap_num = 169,
538 .db_cnt = 16,
556 }, 539 },
557 .ap_num = 169,
558 .db_cnt = 16,
559}; 540};
560 541
561static int mt2701_pinctrl_probe(struct platform_device *pdev) 542static int mt2701_pinctrl_probe(struct platform_device *pdev)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt2712.c b/drivers/pinctrl/mediatek/pinctrl-mt2712.c
index 81e11f9e70f1..8398d55c01cb 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt2712.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt2712.c
@@ -576,31 +576,12 @@ static const struct mtk_pinctrl_devdata mt2712_pinctrl_data = {
576 .port_shf = 4, 576 .port_shf = 4,
577 .port_mask = 0xf, 577 .port_mask = 0xf,
578 .port_align = 4, 578 .port_align = 4,
579 .eint_offsets = { 579 .eint_hw = {
580 .name = "mt2712_eint",
581 .stat = 0x000,
582 .ack = 0x040,
583 .mask = 0x080,
584 .mask_set = 0x0c0,
585 .mask_clr = 0x100,
586 .sens = 0x140,
587 .sens_set = 0x180,
588 .sens_clr = 0x1c0,
589 .soft = 0x200,
590 .soft_set = 0x240,
591 .soft_clr = 0x280,
592 .pol = 0x300,
593 .pol_set = 0x340,
594 .pol_clr = 0x380,
595 .dom_en = 0x400,
596 .dbnc_ctrl = 0x500,
597 .dbnc_set = 0x600,
598 .dbnc_clr = 0x700,
599 .port_mask = 0xf, 580 .port_mask = 0xf,
600 .ports = 8, 581 .ports = 8,
582 .ap_num = 229,
583 .db_cnt = 40,
601 }, 584 },
602 .ap_num = 229,
603 .db_cnt = 40,
604}; 585};
605 586
606static int mt2712_pinctrl_probe(struct platform_device *pdev) 587static int mt2712_pinctrl_probe(struct platform_device *pdev)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7622.c b/drivers/pinctrl/mediatek/pinctrl-mt7622.c
index 06e8406c4440..ad6da1184c9f 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt7622.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt7622.c
@@ -19,6 +19,7 @@
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/mfd/syscon.h> 20#include <linux/mfd/syscon.h>
21#include <linux/of.h> 21#include <linux/of.h>
22#include <linux/of_irq.h>
22#include <linux/of_platform.h> 23#include <linux/of_platform.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24#include <linux/pinctrl/pinctrl.h> 25#include <linux/pinctrl/pinctrl.h>
@@ -30,6 +31,7 @@
30#include "../core.h" 31#include "../core.h"
31#include "../pinconf.h" 32#include "../pinconf.h"
32#include "../pinmux.h" 33#include "../pinmux.h"
34#include "mtk-eint.h"
33 35
34#define PINCTRL_PINCTRL_DEV KBUILD_MODNAME 36#define PINCTRL_PINCTRL_DEV KBUILD_MODNAME
35#define MTK_RANGE(_a) { .range = (_a), .nranges = ARRAY_SIZE(_a), } 37#define MTK_RANGE(_a) { .range = (_a), .nranges = ARRAY_SIZE(_a), }
@@ -123,6 +125,8 @@ struct mtk_pin_soc {
123 unsigned int ngrps; 125 unsigned int ngrps;
124 const struct function_desc *funcs; 126 const struct function_desc *funcs;
125 unsigned int nfuncs; 127 unsigned int nfuncs;
128 const struct mtk_eint_regs *eint_regs;
129 const struct mtk_eint_hw *eint_hw;
126}; 130};
127 131
128struct mtk_pinctrl { 132struct mtk_pinctrl {
@@ -131,6 +135,7 @@ struct mtk_pinctrl {
131 struct device *dev; 135 struct device *dev;
132 struct gpio_chip chip; 136 struct gpio_chip chip;
133 const struct mtk_pin_soc *soc; 137 const struct mtk_pin_soc *soc;
138 struct mtk_eint *eint;
134}; 139};
135 140
136static const struct mtk_pin_field_calc mt7622_pin_mode_range[] = { 141static const struct mtk_pin_field_calc mt7622_pin_mode_range[] = {
@@ -913,6 +918,13 @@ static const struct pin_config_item mtk_conf_items[] = {
913}; 918};
914#endif 919#endif
915 920
921static const struct mtk_eint_hw mt7622_eint_hw = {
922 .port_mask = 7,
923 .ports = 7,
924 .ap_num = ARRAY_SIZE(mt7622_pins),
925 .db_cnt = 20,
926};
927
916static const struct mtk_pin_soc mt7622_data = { 928static const struct mtk_pin_soc mt7622_data = {
917 .reg_cal = mt7622_reg_cals, 929 .reg_cal = mt7622_reg_cals,
918 .pins = mt7622_pins, 930 .pins = mt7622_pins,
@@ -921,6 +933,7 @@ static const struct mtk_pin_soc mt7622_data = {
921 .ngrps = ARRAY_SIZE(mt7622_groups), 933 .ngrps = ARRAY_SIZE(mt7622_groups),
922 .funcs = mt7622_functions, 934 .funcs = mt7622_functions,
923 .nfuncs = ARRAY_SIZE(mt7622_functions), 935 .nfuncs = ARRAY_SIZE(mt7622_functions),
936 .eint_hw = &mt7622_eint_hw,
924}; 937};
925 938
926static void mtk_w32(struct mtk_pinctrl *pctl, u32 reg, u32 val) 939static void mtk_w32(struct mtk_pinctrl *pctl, u32 reg, u32 val)
@@ -1441,6 +1454,32 @@ static int mtk_gpio_direction_output(struct gpio_chip *chip, unsigned int gpio,
1441 return pinctrl_gpio_direction_output(chip->base + gpio); 1454 return pinctrl_gpio_direction_output(chip->base + gpio);
1442} 1455}
1443 1456
1457static int mtk_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
1458{
1459 struct mtk_pinctrl *hw = gpiochip_get_data(chip);
1460 unsigned long eint_n;
1461
1462 eint_n = offset;
1463
1464 return mtk_eint_find_irq(hw->eint, eint_n);
1465}
1466
1467static int mtk_gpio_set_config(struct gpio_chip *chip, unsigned int offset,
1468 unsigned long config)
1469{
1470 struct mtk_pinctrl *hw = gpiochip_get_data(chip);
1471 unsigned long eint_n;
1472 u32 debounce;
1473
1474 if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE)
1475 return -ENOTSUPP;
1476
1477 debounce = pinconf_to_config_argument(config);
1478 eint_n = offset;
1479
1480 return mtk_eint_set_debounce(hw->eint, eint_n, debounce);
1481}
1482
1444static int mtk_build_gpiochip(struct mtk_pinctrl *hw, struct device_node *np) 1483static int mtk_build_gpiochip(struct mtk_pinctrl *hw, struct device_node *np)
1445{ 1484{
1446 struct gpio_chip *chip = &hw->chip; 1485 struct gpio_chip *chip = &hw->chip;
@@ -1454,6 +1493,8 @@ static int mtk_build_gpiochip(struct mtk_pinctrl *hw, struct device_node *np)
1454 chip->direction_output = mtk_gpio_direction_output; 1493 chip->direction_output = mtk_gpio_direction_output;
1455 chip->get = mtk_gpio_get; 1494 chip->get = mtk_gpio_get;
1456 chip->set = mtk_gpio_set; 1495 chip->set = mtk_gpio_set;
1496 chip->to_irq = mtk_gpio_to_irq,
1497 chip->set_config = mtk_gpio_set_config,
1457 chip->base = -1; 1498 chip->base = -1;
1458 chip->ngpio = hw->soc->npins; 1499 chip->ngpio = hw->soc->npins;
1459 chip->of_node = np; 1500 chip->of_node = np;
@@ -1514,6 +1555,103 @@ static int mtk_build_functions(struct mtk_pinctrl *hw)
1514 return 0; 1555 return 0;
1515} 1556}
1516 1557
1558static int mtk_xt_get_gpio_n(void *data, unsigned long eint_n,
1559 unsigned int *gpio_n,
1560 struct gpio_chip **gpio_chip)
1561{
1562 struct mtk_pinctrl *hw = (struct mtk_pinctrl *)data;
1563
1564 *gpio_chip = &hw->chip;
1565 *gpio_n = eint_n;
1566
1567 return 0;
1568}
1569
1570static int mtk_xt_get_gpio_state(void *data, unsigned long eint_n)
1571{
1572 struct mtk_pinctrl *hw = (struct mtk_pinctrl *)data;
1573 struct gpio_chip *gpio_chip;
1574 unsigned int gpio_n;
1575 int err;
1576
1577 err = mtk_xt_get_gpio_n(hw, eint_n, &gpio_n, &gpio_chip);
1578 if (err)
1579 return err;
1580
1581 return mtk_gpio_get(gpio_chip, gpio_n);
1582}
1583
1584static int mtk_xt_set_gpio_as_eint(void *data, unsigned long eint_n)
1585{
1586 struct mtk_pinctrl *hw = (struct mtk_pinctrl *)data;
1587 struct gpio_chip *gpio_chip;
1588 unsigned int gpio_n;
1589 int err;
1590
1591 err = mtk_xt_get_gpio_n(hw, eint_n, &gpio_n, &gpio_chip);
1592 if (err)
1593 return err;
1594
1595 err = mtk_hw_set_value(hw, gpio_n, PINCTRL_PIN_REG_MODE,
1596 MTK_GPIO_MODE);
1597 if (err)
1598 return err;
1599
1600 err = mtk_hw_set_value(hw, gpio_n, PINCTRL_PIN_REG_DIR, MTK_INPUT);
1601 if (err)
1602 return err;
1603
1604 err = mtk_hw_set_value(hw, gpio_n, PINCTRL_PIN_REG_SMT, MTK_ENABLE);
1605 if (err)
1606 return err;
1607
1608 return 0;
1609}
1610
1611static const struct mtk_eint_xt mtk_eint_xt = {
1612 .get_gpio_n = mtk_xt_get_gpio_n,
1613 .get_gpio_state = mtk_xt_get_gpio_state,
1614 .set_gpio_as_eint = mtk_xt_set_gpio_as_eint,
1615};
1616
1617static int
1618mtk_build_eint(struct mtk_pinctrl *hw, struct platform_device *pdev)
1619{
1620 struct device_node *np = pdev->dev.of_node;
1621 struct resource *res;
1622
1623 if (!IS_ENABLED(CONFIG_EINT_MTK))
1624 return 0;
1625
1626 if (!of_property_read_bool(np, "interrupt-controller"))
1627 return -ENODEV;
1628
1629 hw->eint = devm_kzalloc(hw->dev, sizeof(*hw->eint), GFP_KERNEL);
1630 if (!hw->eint)
1631 return -ENOMEM;
1632
1633 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "eint");
1634 if (!res) {
1635 dev_err(&pdev->dev, "Unable to get eint resource\n");
1636 return -ENODEV;
1637 }
1638
1639 hw->eint->base = devm_ioremap_resource(&pdev->dev, res);
1640 if (IS_ERR(hw->eint->base))
1641 return PTR_ERR(hw->eint->base);
1642
1643 hw->eint->irq = irq_of_parse_and_map(np, 0);
1644 if (!hw->eint->irq)
1645 return -EINVAL;
1646
1647 hw->eint->dev = &pdev->dev;
1648 hw->eint->hw = hw->soc->eint_hw;
1649 hw->eint->pctl = hw;
1650 hw->eint->gpio_xlate = &mtk_eint_xt;
1651
1652 return mtk_eint_do_init(hw->eint);
1653}
1654
1517static const struct of_device_id mtk_pinctrl_of_match[] = { 1655static const struct of_device_id mtk_pinctrl_of_match[] = {
1518 { .compatible = "mediatek,mt7622-pinctrl", .data = &mt7622_data}, 1656 { .compatible = "mediatek,mt7622-pinctrl", .data = &mt7622_data},
1519 { } 1657 { }
@@ -1577,6 +1715,11 @@ static int mtk_pinctrl_probe(struct platform_device *pdev)
1577 return err; 1715 return err;
1578 } 1716 }
1579 1717
1718 err = mtk_build_eint(hw, pdev);
1719 if (err)
1720 dev_warn(&pdev->dev,
1721 "Failed to add EINT, but pinctrl still can work\n");
1722
1580 platform_set_drvdata(pdev, hw); 1723 platform_set_drvdata(pdev, hw);
1581 1724
1582 return 0; 1725 return 0;
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8127.c b/drivers/pinctrl/mediatek/pinctrl-mt8127.c
index d76491574841..2e4cc9257e00 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt8127.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt8127.c
@@ -300,31 +300,12 @@ static const struct mtk_pinctrl_devdata mt8127_pinctrl_data = {
300 .port_shf = 4, 300 .port_shf = 4,
301 .port_mask = 0xf, 301 .port_mask = 0xf,
302 .port_align = 4, 302 .port_align = 4,
303 .eint_offsets = { 303 .eint_hw = {
304 .name = "mt8127_eint",
305 .stat = 0x000,
306 .ack = 0x040,
307 .mask = 0x080,
308 .mask_set = 0x0c0,
309 .mask_clr = 0x100,
310 .sens = 0x140,
311 .sens_set = 0x180,
312 .sens_clr = 0x1c0,
313 .soft = 0x200,
314 .soft_set = 0x240,
315 .soft_clr = 0x280,
316 .pol = 0x300,
317 .pol_set = 0x340,
318 .pol_clr = 0x380,
319 .dom_en = 0x400,
320 .dbnc_ctrl = 0x500,
321 .dbnc_set = 0x600,
322 .dbnc_clr = 0x700,
323 .port_mask = 7, 304 .port_mask = 7,
324 .ports = 6, 305 .ports = 6,
306 .ap_num = 143,
307 .db_cnt = 16,
325 }, 308 },
326 .ap_num = 143,
327 .db_cnt = 16,
328}; 309};
329 310
330static int mt8127_pinctrl_probe(struct platform_device *pdev) 311static int mt8127_pinctrl_probe(struct platform_device *pdev)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8135.c b/drivers/pinctrl/mediatek/pinctrl-mt8135.c
index d8c645f16f21..7f5edfaffdc5 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt8135.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt8135.c
@@ -313,31 +313,12 @@ static const struct mtk_pinctrl_devdata mt8135_pinctrl_data = {
313 .port_shf = 4, 313 .port_shf = 4,
314 .port_mask = 0xf, 314 .port_mask = 0xf,
315 .port_align = 4, 315 .port_align = 4,
316 .eint_offsets = { 316 .eint_hw = {
317 .name = "mt8135_eint",
318 .stat = 0x000,
319 .ack = 0x040,
320 .mask = 0x080,
321 .mask_set = 0x0c0,
322 .mask_clr = 0x100,
323 .sens = 0x140,
324 .sens_set = 0x180,
325 .sens_clr = 0x1c0,
326 .soft = 0x200,
327 .soft_set = 0x240,
328 .soft_clr = 0x280,
329 .pol = 0x300,
330 .pol_set = 0x340,
331 .pol_clr = 0x380,
332 .dom_en = 0x400,
333 .dbnc_ctrl = 0x500,
334 .dbnc_set = 0x600,
335 .dbnc_clr = 0x700,
336 .port_mask = 7, 317 .port_mask = 7,
337 .ports = 6, 318 .ports = 6,
319 .ap_num = 192,
320 .db_cnt = 16,
338 }, 321 },
339 .ap_num = 192,
340 .db_cnt = 16,
341}; 322};
342 323
343static int mt8135_pinctrl_probe(struct platform_device *pdev) 324static int mt8135_pinctrl_probe(struct platform_device *pdev)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8173.c b/drivers/pinctrl/mediatek/pinctrl-mt8173.c
index 8bfd427b9135..c449c9a043da 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt8173.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt8173.c
@@ -340,31 +340,12 @@ static const struct mtk_pinctrl_devdata mt8173_pinctrl_data = {
340 .port_shf = 4, 340 .port_shf = 4,
341 .port_mask = 0xf, 341 .port_mask = 0xf,
342 .port_align = 4, 342 .port_align = 4,
343 .eint_offsets = { 343 .eint_hw = {
344 .name = "mt8173_eint",
345 .stat = 0x000,
346 .ack = 0x040,
347 .mask = 0x080,
348 .mask_set = 0x0c0,
349 .mask_clr = 0x100,
350 .sens = 0x140,
351 .sens_set = 0x180,
352 .sens_clr = 0x1c0,
353 .soft = 0x200,
354 .soft_set = 0x240,
355 .soft_clr = 0x280,
356 .pol = 0x300,
357 .pol_set = 0x340,
358 .pol_clr = 0x380,
359 .dom_en = 0x400,
360 .dbnc_ctrl = 0x500,
361 .dbnc_set = 0x600,
362 .dbnc_clr = 0x700,
363 .port_mask = 7, 344 .port_mask = 7,
364 .ports = 6, 345 .ports = 6,
346 .ap_num = 224,
347 .db_cnt = 16,
365 }, 348 },
366 .ap_num = 224,
367 .db_cnt = 16,
368}; 349};
369 350
370static int mt8173_pinctrl_probe(struct platform_device *pdev) 351static int mt8173_pinctrl_probe(struct platform_device *pdev)
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index c3975a04d1cd..b3799695d8db 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -38,6 +38,7 @@
38#include "../core.h" 38#include "../core.h"
39#include "../pinconf.h" 39#include "../pinconf.h"
40#include "../pinctrl-utils.h" 40#include "../pinctrl-utils.h"
41#include "mtk-eint.h"
41#include "pinctrl-mtk-common.h" 42#include "pinctrl-mtk-common.h"
42 43
43#define MAX_GPIO_MODE_PER_REG 5 44#define MAX_GPIO_MODE_PER_REG 5
@@ -831,243 +832,38 @@ static int mtk_gpio_get(struct gpio_chip *chip, unsigned offset)
831 832
832static int mtk_gpio_to_irq(struct gpio_chip *chip, unsigned offset) 833static int mtk_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
833{ 834{
834 const struct mtk_desc_pin *pin;
835 struct mtk_pinctrl *pctl = gpiochip_get_data(chip); 835 struct mtk_pinctrl *pctl = gpiochip_get_data(chip);
836 int irq;
837
838 pin = pctl->devdata->pins + offset;
839 if (pin->eint.eintnum == NO_EINT_SUPPORT)
840 return -EINVAL;
841
842 irq = irq_find_mapping(pctl->domain, pin->eint.eintnum);
843 if (!irq)
844 return -EINVAL;
845
846 return irq;
847}
848
849static int mtk_pinctrl_irq_request_resources(struct irq_data *d)
850{
851 struct mtk_pinctrl *pctl = irq_data_get_irq_chip_data(d);
852 const struct mtk_desc_pin *pin;
853 int ret;
854
855 pin = mtk_find_pin_by_eint_num(pctl, d->hwirq);
856
857 if (!pin) {
858 dev_err(pctl->dev, "Can not find pin\n");
859 return -EINVAL;
860 }
861
862 ret = gpiochip_lock_as_irq(pctl->chip, pin->pin.number);
863 if (ret) {
864 dev_err(pctl->dev, "unable to lock HW IRQ %lu for IRQ\n",
865 irqd_to_hwirq(d));
866 return ret;
867 }
868
869 /* set mux to INT mode */
870 mtk_pmx_set_mode(pctl->pctl_dev, pin->pin.number, pin->eint.eintmux);
871 /* set gpio direction to input */
872 mtk_pmx_gpio_set_direction(pctl->pctl_dev, NULL, pin->pin.number, true);
873 /* set input-enable */
874 mtk_pconf_set_ies_smt(pctl, pin->pin.number, 1, PIN_CONFIG_INPUT_ENABLE);
875
876 return 0;
877}
878
879static void mtk_pinctrl_irq_release_resources(struct irq_data *d)
880{
881 struct mtk_pinctrl *pctl = irq_data_get_irq_chip_data(d);
882 const struct mtk_desc_pin *pin;
883
884 pin = mtk_find_pin_by_eint_num(pctl, d->hwirq);
885
886 if (!pin) {
887 dev_err(pctl->dev, "Can not find pin\n");
888 return;
889 }
890
891 gpiochip_unlock_as_irq(pctl->chip, pin->pin.number);
892}
893
894static void __iomem *mtk_eint_get_offset(struct mtk_pinctrl *pctl,
895 unsigned int eint_num, unsigned int offset)
896{
897 unsigned int eint_base = 0;
898 void __iomem *reg;
899
900 if (eint_num >= pctl->devdata->ap_num)
901 eint_base = pctl->devdata->ap_num;
902
903 reg = pctl->eint_reg_base + offset + ((eint_num - eint_base) / 32) * 4;
904
905 return reg;
906}
907
908/*
909 * mtk_can_en_debounce: Check the EINT number is able to enable debounce or not
910 * @eint_num: the EINT number to setmtk_pinctrl
911 */
912static unsigned int mtk_eint_can_en_debounce(struct mtk_pinctrl *pctl,
913 unsigned int eint_num)
914{
915 unsigned int sens;
916 unsigned int bit = BIT(eint_num % 32);
917 const struct mtk_eint_offsets *eint_offsets =
918 &pctl->devdata->eint_offsets;
919
920 void __iomem *reg = mtk_eint_get_offset(pctl, eint_num,
921 eint_offsets->sens);
922
923 if (readl(reg) & bit)
924 sens = MT_LEVEL_SENSITIVE;
925 else
926 sens = MT_EDGE_SENSITIVE;
927
928 if ((eint_num < pctl->devdata->db_cnt) && (sens != MT_EDGE_SENSITIVE))
929 return 1;
930 else
931 return 0;
932}
933
934/*
935 * mtk_eint_get_mask: To get the eint mask
936 * @eint_num: the EINT number to get
937 */
938static unsigned int mtk_eint_get_mask(struct mtk_pinctrl *pctl,
939 unsigned int eint_num)
940{
941 unsigned int bit = BIT(eint_num % 32);
942 const struct mtk_eint_offsets *eint_offsets =
943 &pctl->devdata->eint_offsets;
944
945 void __iomem *reg = mtk_eint_get_offset(pctl, eint_num,
946 eint_offsets->mask);
947
948 return !!(readl(reg) & bit);
949}
950
951static int mtk_eint_flip_edge(struct mtk_pinctrl *pctl, int hwirq)
952{
953 int start_level, curr_level;
954 unsigned int reg_offset;
955 const struct mtk_eint_offsets *eint_offsets = &(pctl->devdata->eint_offsets);
956 u32 mask = BIT(hwirq & 0x1f);
957 u32 port = (hwirq >> 5) & eint_offsets->port_mask;
958 void __iomem *reg = pctl->eint_reg_base + (port << 2);
959 const struct mtk_desc_pin *pin; 836 const struct mtk_desc_pin *pin;
960 837 unsigned long eint_n;
961 pin = mtk_find_pin_by_eint_num(pctl, hwirq);
962 curr_level = mtk_gpio_get(pctl->chip, pin->pin.number);
963 do {
964 start_level = curr_level;
965 if (start_level)
966 reg_offset = eint_offsets->pol_clr;
967 else
968 reg_offset = eint_offsets->pol_set;
969 writel(mask, reg + reg_offset);
970
971 curr_level = mtk_gpio_get(pctl->chip, pin->pin.number);
972 } while (start_level != curr_level);
973
974 return start_level;
975}
976
977static void mtk_eint_mask(struct irq_data *d)
978{
979 struct mtk_pinctrl *pctl = irq_data_get_irq_chip_data(d);
980 const struct mtk_eint_offsets *eint_offsets =
981 &pctl->devdata->eint_offsets;
982 u32 mask = BIT(d->hwirq & 0x1f);
983 void __iomem *reg = mtk_eint_get_offset(pctl, d->hwirq,
984 eint_offsets->mask_set);
985
986 writel(mask, reg);
987}
988
989static void mtk_eint_unmask(struct irq_data *d)
990{
991 struct mtk_pinctrl *pctl = irq_data_get_irq_chip_data(d);
992 const struct mtk_eint_offsets *eint_offsets =
993 &pctl->devdata->eint_offsets;
994 u32 mask = BIT(d->hwirq & 0x1f);
995 void __iomem *reg = mtk_eint_get_offset(pctl, d->hwirq,
996 eint_offsets->mask_clr);
997
998 writel(mask, reg);
999
1000 if (pctl->eint_dual_edges[d->hwirq])
1001 mtk_eint_flip_edge(pctl, d->hwirq);
1002}
1003
1004static int mtk_gpio_set_debounce(struct gpio_chip *chip, unsigned offset,
1005 unsigned debounce)
1006{
1007 struct mtk_pinctrl *pctl = dev_get_drvdata(chip->parent);
1008 int eint_num, virq, eint_offset;
1009 unsigned int set_offset, bit, clr_bit, clr_offset, rst, i, unmask, dbnc;
1010 static const unsigned int debounce_time[] = {500, 1000, 16000, 32000, 64000,
1011 128000, 256000};
1012 const struct mtk_desc_pin *pin;
1013 struct irq_data *d;
1014 838
1015 pin = pctl->devdata->pins + offset; 839 pin = pctl->devdata->pins + offset;
1016 if (pin->eint.eintnum == NO_EINT_SUPPORT) 840 if (pin->eint.eintnum == NO_EINT_SUPPORT)
1017 return -EINVAL; 841 return -EINVAL;
1018 842
1019 eint_num = pin->eint.eintnum; 843 eint_n = pin->eint.eintnum;
1020 virq = irq_find_mapping(pctl->domain, eint_num);
1021 eint_offset = (eint_num % 4) * 8;
1022 d = irq_get_irq_data(virq);
1023 844
1024 set_offset = (eint_num / 4) * 4 + pctl->devdata->eint_offsets.dbnc_set; 845 return mtk_eint_find_irq(pctl->eint, eint_n);
1025 clr_offset = (eint_num / 4) * 4 + pctl->devdata->eint_offsets.dbnc_clr;
1026 if (!mtk_eint_can_en_debounce(pctl, eint_num))
1027 return -ENOSYS;
1028
1029 dbnc = ARRAY_SIZE(debounce_time);
1030 for (i = 0; i < ARRAY_SIZE(debounce_time); i++) {
1031 if (debounce <= debounce_time[i]) {
1032 dbnc = i;
1033 break;
1034 }
1035 }
1036
1037 if (!mtk_eint_get_mask(pctl, eint_num)) {
1038 mtk_eint_mask(d);
1039 unmask = 1;
1040 } else {
1041 unmask = 0;
1042 }
1043
1044 clr_bit = 0xff << eint_offset;
1045 writel(clr_bit, pctl->eint_reg_base + clr_offset);
1046
1047 bit = ((dbnc << EINT_DBNC_SET_DBNC_BITS) | EINT_DBNC_SET_EN) <<
1048 eint_offset;
1049 rst = EINT_DBNC_RST_BIT << eint_offset;
1050 writel(rst | bit, pctl->eint_reg_base + set_offset);
1051
1052 /* Delay a while (more than 2T) to wait for hw debounce counter reset
1053 work correctly */
1054 udelay(1);
1055 if (unmask == 1)
1056 mtk_eint_unmask(d);
1057
1058 return 0;
1059} 846}
1060 847
1061static int mtk_gpio_set_config(struct gpio_chip *chip, unsigned offset, 848static int mtk_gpio_set_config(struct gpio_chip *chip, unsigned offset,
1062 unsigned long config) 849 unsigned long config)
1063{ 850{
851 struct mtk_pinctrl *pctl = gpiochip_get_data(chip);
852 const struct mtk_desc_pin *pin;
853 unsigned long eint_n;
1064 u32 debounce; 854 u32 debounce;
1065 855
1066 if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE) 856 if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE)
1067 return -ENOTSUPP; 857 return -ENOTSUPP;
1068 858
859 pin = pctl->devdata->pins + offset;
860 if (pin->eint.eintnum == NO_EINT_SUPPORT)
861 return -EINVAL;
862
1069 debounce = pinconf_to_config_argument(config); 863 debounce = pinconf_to_config_argument(config);
1070 return mtk_gpio_set_debounce(chip, offset, debounce); 864 eint_n = pin->eint.eintnum;
865
866 return mtk_eint_set_debounce(pctl->eint, eint_n, debounce);
1071} 867}
1072 868
1073static const struct gpio_chip mtk_gpio_chip = { 869static const struct gpio_chip mtk_gpio_chip = {
@@ -1084,117 +880,18 @@ static const struct gpio_chip mtk_gpio_chip = {
1084 .of_gpio_n_cells = 2, 880 .of_gpio_n_cells = 2,
1085}; 881};
1086 882
1087static int mtk_eint_set_type(struct irq_data *d,
1088 unsigned int type)
1089{
1090 struct mtk_pinctrl *pctl = irq_data_get_irq_chip_data(d);
1091 const struct mtk_eint_offsets *eint_offsets =
1092 &pctl->devdata->eint_offsets;
1093 u32 mask = BIT(d->hwirq & 0x1f);
1094 void __iomem *reg;
1095
1096 if (((type & IRQ_TYPE_EDGE_BOTH) && (type & IRQ_TYPE_LEVEL_MASK)) ||
1097 ((type & IRQ_TYPE_LEVEL_MASK) == IRQ_TYPE_LEVEL_MASK)) {
1098 dev_err(pctl->dev, "Can't configure IRQ%d (EINT%lu) for type 0x%X\n",
1099 d->irq, d->hwirq, type);
1100 return -EINVAL;
1101 }
1102
1103 if ((type & IRQ_TYPE_EDGE_BOTH) == IRQ_TYPE_EDGE_BOTH)
1104 pctl->eint_dual_edges[d->hwirq] = 1;
1105 else
1106 pctl->eint_dual_edges[d->hwirq] = 0;
1107
1108 if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_EDGE_FALLING)) {
1109 reg = mtk_eint_get_offset(pctl, d->hwirq,
1110 eint_offsets->pol_clr);
1111 writel(mask, reg);
1112 } else {
1113 reg = mtk_eint_get_offset(pctl, d->hwirq,
1114 eint_offsets->pol_set);
1115 writel(mask, reg);
1116 }
1117
1118 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
1119 reg = mtk_eint_get_offset(pctl, d->hwirq,
1120 eint_offsets->sens_clr);
1121 writel(mask, reg);
1122 } else {
1123 reg = mtk_eint_get_offset(pctl, d->hwirq,
1124 eint_offsets->sens_set);
1125 writel(mask, reg);
1126 }
1127
1128 if (pctl->eint_dual_edges[d->hwirq])
1129 mtk_eint_flip_edge(pctl, d->hwirq);
1130
1131 return 0;
1132}
1133
1134static int mtk_eint_irq_set_wake(struct irq_data *d, unsigned int on)
1135{
1136 struct mtk_pinctrl *pctl = irq_data_get_irq_chip_data(d);
1137 int shift = d->hwirq & 0x1f;
1138 int reg = d->hwirq >> 5;
1139
1140 if (on)
1141 pctl->wake_mask[reg] |= BIT(shift);
1142 else
1143 pctl->wake_mask[reg] &= ~BIT(shift);
1144
1145 return 0;
1146}
1147
1148static void mtk_eint_chip_write_mask(const struct mtk_eint_offsets *chip,
1149 void __iomem *eint_reg_base, u32 *buf)
1150{
1151 int port;
1152 void __iomem *reg;
1153
1154 for (port = 0; port < chip->ports; port++) {
1155 reg = eint_reg_base + (port << 2);
1156 writel_relaxed(~buf[port], reg + chip->mask_set);
1157 writel_relaxed(buf[port], reg + chip->mask_clr);
1158 }
1159}
1160
1161static void mtk_eint_chip_read_mask(const struct mtk_eint_offsets *chip,
1162 void __iomem *eint_reg_base, u32 *buf)
1163{
1164 int port;
1165 void __iomem *reg;
1166
1167 for (port = 0; port < chip->ports; port++) {
1168 reg = eint_reg_base + chip->mask + (port << 2);
1169 buf[port] = ~readl_relaxed(reg);
1170 /* Mask is 0 when irq is enabled, and 1 when disabled. */
1171 }
1172}
1173
1174static int mtk_eint_suspend(struct device *device) 883static int mtk_eint_suspend(struct device *device)
1175{ 884{
1176 void __iomem *reg;
1177 struct mtk_pinctrl *pctl = dev_get_drvdata(device); 885 struct mtk_pinctrl *pctl = dev_get_drvdata(device);
1178 const struct mtk_eint_offsets *eint_offsets =
1179 &pctl->devdata->eint_offsets;
1180
1181 reg = pctl->eint_reg_base;
1182 mtk_eint_chip_read_mask(eint_offsets, reg, pctl->cur_mask);
1183 mtk_eint_chip_write_mask(eint_offsets, reg, pctl->wake_mask);
1184 886
1185 return 0; 887 return mtk_eint_do_suspend(pctl->eint);
1186} 888}
1187 889
1188static int mtk_eint_resume(struct device *device) 890static int mtk_eint_resume(struct device *device)
1189{ 891{
1190 struct mtk_pinctrl *pctl = dev_get_drvdata(device); 892 struct mtk_pinctrl *pctl = dev_get_drvdata(device);
1191 const struct mtk_eint_offsets *eint_offsets =
1192 &pctl->devdata->eint_offsets;
1193
1194 mtk_eint_chip_write_mask(eint_offsets,
1195 pctl->eint_reg_base, pctl->cur_mask);
1196 893
1197 return 0; 894 return mtk_eint_do_resume(pctl->eint);
1198} 895}
1199 896
1200const struct dev_pm_ops mtk_eint_pm_ops = { 897const struct dev_pm_ops mtk_eint_pm_ops = {
@@ -1202,117 +899,6 @@ const struct dev_pm_ops mtk_eint_pm_ops = {
1202 .resume_noirq = mtk_eint_resume, 899 .resume_noirq = mtk_eint_resume,
1203}; 900};
1204 901
1205static void mtk_eint_ack(struct irq_data *d)
1206{
1207 struct mtk_pinctrl *pctl = irq_data_get_irq_chip_data(d);
1208 const struct mtk_eint_offsets *eint_offsets =
1209 &pctl->devdata->eint_offsets;
1210 u32 mask = BIT(d->hwirq & 0x1f);
1211 void __iomem *reg = mtk_eint_get_offset(pctl, d->hwirq,
1212 eint_offsets->ack);
1213
1214 writel(mask, reg);
1215}
1216
1217static struct irq_chip mtk_pinctrl_irq_chip = {
1218 .name = "mt-eint",
1219 .irq_disable = mtk_eint_mask,
1220 .irq_mask = mtk_eint_mask,
1221 .irq_unmask = mtk_eint_unmask,
1222 .irq_ack = mtk_eint_ack,
1223 .irq_set_type = mtk_eint_set_type,
1224 .irq_set_wake = mtk_eint_irq_set_wake,
1225 .irq_request_resources = mtk_pinctrl_irq_request_resources,
1226 .irq_release_resources = mtk_pinctrl_irq_release_resources,
1227};
1228
1229static unsigned int mtk_eint_init(struct mtk_pinctrl *pctl)
1230{
1231 const struct mtk_eint_offsets *eint_offsets =
1232 &pctl->devdata->eint_offsets;
1233 void __iomem *reg = pctl->eint_reg_base + eint_offsets->dom_en;
1234 unsigned int i;
1235
1236 for (i = 0; i < pctl->devdata->ap_num; i += 32) {
1237 writel(0xffffffff, reg);
1238 reg += 4;
1239 }
1240 return 0;
1241}
1242
1243static inline void
1244mtk_eint_debounce_process(struct mtk_pinctrl *pctl, int index)
1245{
1246 unsigned int rst, ctrl_offset;
1247 unsigned int bit, dbnc;
1248 const struct mtk_eint_offsets *eint_offsets =
1249 &pctl->devdata->eint_offsets;
1250
1251 ctrl_offset = (index / 4) * 4 + eint_offsets->dbnc_ctrl;
1252 dbnc = readl(pctl->eint_reg_base + ctrl_offset);
1253 bit = EINT_DBNC_SET_EN << ((index % 4) * 8);
1254 if ((bit & dbnc) > 0) {
1255 ctrl_offset = (index / 4) * 4 + eint_offsets->dbnc_set;
1256 rst = EINT_DBNC_RST_BIT << ((index % 4) * 8);
1257 writel(rst, pctl->eint_reg_base + ctrl_offset);
1258 }
1259}
1260
1261static void mtk_eint_irq_handler(struct irq_desc *desc)
1262{
1263 struct irq_chip *chip = irq_desc_get_chip(desc);
1264 struct mtk_pinctrl *pctl = irq_desc_get_handler_data(desc);
1265 unsigned int status, eint_num;
1266 int offset, index, virq;
1267 const struct mtk_eint_offsets *eint_offsets =
1268 &pctl->devdata->eint_offsets;
1269 void __iomem *reg = mtk_eint_get_offset(pctl, 0, eint_offsets->stat);
1270 int dual_edges, start_level, curr_level;
1271 const struct mtk_desc_pin *pin;
1272
1273 chained_irq_enter(chip, desc);
1274 for (eint_num = 0;
1275 eint_num < pctl->devdata->ap_num;
1276 eint_num += 32, reg += 4) {
1277 status = readl(reg);
1278 while (status) {
1279 offset = __ffs(status);
1280 index = eint_num + offset;
1281 virq = irq_find_mapping(pctl->domain, index);
1282 status &= ~BIT(offset);
1283
1284 dual_edges = pctl->eint_dual_edges[index];
1285 if (dual_edges) {
1286 /* Clear soft-irq in case we raised it
1287 last time */
1288 writel(BIT(offset), reg - eint_offsets->stat +
1289 eint_offsets->soft_clr);
1290
1291 pin = mtk_find_pin_by_eint_num(pctl, index);
1292 start_level = mtk_gpio_get(pctl->chip,
1293 pin->pin.number);
1294 }
1295
1296 generic_handle_irq(virq);
1297
1298 if (dual_edges) {
1299 curr_level = mtk_eint_flip_edge(pctl, index);
1300
1301 /* If level changed, we might lost one edge
1302 interrupt, raised it through soft-irq */
1303 if (start_level != curr_level)
1304 writel(BIT(offset), reg -
1305 eint_offsets->stat +
1306 eint_offsets->soft_set);
1307 }
1308
1309 if (index < pctl->devdata->db_cnt)
1310 mtk_eint_debounce_process(pctl , index);
1311 }
1312 }
1313 chained_irq_exit(chip, desc);
1314}
1315
1316static int mtk_pctrl_build_state(struct platform_device *pdev) 902static int mtk_pctrl_build_state(struct platform_device *pdev)
1317{ 903{
1318 struct mtk_pinctrl *pctl = platform_get_drvdata(pdev); 904 struct mtk_pinctrl *pctl = platform_get_drvdata(pdev);
@@ -1345,6 +931,101 @@ static int mtk_pctrl_build_state(struct platform_device *pdev)
1345 return 0; 931 return 0;
1346} 932}
1347 933
934static int
935mtk_xt_get_gpio_n(void *data, unsigned long eint_n, unsigned int *gpio_n,
936 struct gpio_chip **gpio_chip)
937{
938 struct mtk_pinctrl *pctl = (struct mtk_pinctrl *)data;
939 const struct mtk_desc_pin *pin;
940
941 pin = mtk_find_pin_by_eint_num(pctl, eint_n);
942 if (!pin)
943 return -EINVAL;
944
945 *gpio_chip = pctl->chip;
946 *gpio_n = pin->pin.number;
947
948 return 0;
949}
950
951static int mtk_xt_get_gpio_state(void *data, unsigned long eint_n)
952{
953 struct mtk_pinctrl *pctl = (struct mtk_pinctrl *)data;
954 const struct mtk_desc_pin *pin;
955
956 pin = mtk_find_pin_by_eint_num(pctl, eint_n);
957 if (!pin)
958 return -EINVAL;
959
960 return mtk_gpio_get(pctl->chip, pin->pin.number);
961}
962
963static int mtk_xt_set_gpio_as_eint(void *data, unsigned long eint_n)
964{
965 struct mtk_pinctrl *pctl = (struct mtk_pinctrl *)data;
966 const struct mtk_desc_pin *pin;
967
968 pin = mtk_find_pin_by_eint_num(pctl, eint_n);
969 if (!pin)
970 return -EINVAL;
971
972 /* set mux to INT mode */
973 mtk_pmx_set_mode(pctl->pctl_dev, pin->pin.number, pin->eint.eintmux);
974 /* set gpio direction to input */
975 mtk_pmx_gpio_set_direction(pctl->pctl_dev, NULL, pin->pin.number,
976 true);
977 /* set input-enable */
978 mtk_pconf_set_ies_smt(pctl, pin->pin.number, 1,
979 PIN_CONFIG_INPUT_ENABLE);
980
981 return 0;
982}
983
984static const struct mtk_eint_xt mtk_eint_xt = {
985 .get_gpio_n = mtk_xt_get_gpio_n,
986 .get_gpio_state = mtk_xt_get_gpio_state,
987 .set_gpio_as_eint = mtk_xt_set_gpio_as_eint,
988};
989
990static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev)
991{
992 struct device_node *np = pdev->dev.of_node;
993 struct resource *res;
994
995 if (!of_property_read_bool(np, "interrupt-controller"))
996 return -ENODEV;
997
998 pctl->eint = devm_kzalloc(pctl->dev, sizeof(*pctl->eint), GFP_KERNEL);
999 if (!pctl->eint)
1000 return -ENOMEM;
1001
1002 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1003 if (!res) {
1004 dev_err(&pdev->dev, "Unable to get eint resource\n");
1005 return -ENODEV;
1006 }
1007
1008 pctl->eint->base = devm_ioremap_resource(&pdev->dev, res);
1009 if (IS_ERR(pctl->eint->base))
1010 return PTR_ERR(pctl->eint->base);
1011
1012 pctl->eint->irq = irq_of_parse_and_map(np, 0);
1013 if (!pctl->eint->irq)
1014 return -EINVAL;
1015
1016 pctl->eint->dev = &pdev->dev;
1017 /*
1018 * If pctl->eint->regs == NULL, it would fall back into using a generic
1019 * register map in mtk_eint_do_init calls.
1020 */
1021 pctl->eint->regs = pctl->devdata->eint_regs;
1022 pctl->eint->hw = &pctl->devdata->eint_hw;
1023 pctl->eint->pctl = pctl;
1024 pctl->eint->gpio_xlate = &mtk_eint_xt;
1025
1026 return mtk_eint_do_init(pctl->eint);
1027}
1028
1348int mtk_pctrl_init(struct platform_device *pdev, 1029int mtk_pctrl_init(struct platform_device *pdev,
1349 const struct mtk_pinctrl_devdata *data, 1030 const struct mtk_pinctrl_devdata *data,
1350 struct regmap *regmap) 1031 struct regmap *regmap)
@@ -1353,8 +1034,7 @@ int mtk_pctrl_init(struct platform_device *pdev,
1353 struct mtk_pinctrl *pctl; 1034 struct mtk_pinctrl *pctl;
1354 struct device_node *np = pdev->dev.of_node, *node; 1035 struct device_node *np = pdev->dev.of_node, *node;
1355 struct property *prop; 1036 struct property *prop;
1356 struct resource *res; 1037 int ret, i;
1357 int i, ret, irq, ports_buf;
1358 1038
1359 pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL); 1039 pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
1360 if (!pctl) 1040 if (!pctl)
@@ -1441,70 +1121,10 @@ int mtk_pctrl_init(struct platform_device *pdev,
1441 goto chip_error; 1121 goto chip_error;
1442 } 1122 }
1443 1123
1444 if (!of_property_read_bool(np, "interrupt-controller")) 1124 ret = mtk_eint_init(pctl, pdev);
1445 return 0; 1125 if (ret)
1446
1447 /* Get EINT register base from dts. */
1448 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1449 if (!res) {
1450 dev_err(&pdev->dev, "Unable to get Pinctrl resource\n");
1451 ret = -EINVAL;
1452 goto chip_error;
1453 }
1454
1455 pctl->eint_reg_base = devm_ioremap_resource(&pdev->dev, res);
1456 if (IS_ERR(pctl->eint_reg_base)) {
1457 ret = -EINVAL;
1458 goto chip_error;
1459 }
1460
1461 ports_buf = pctl->devdata->eint_offsets.ports;
1462 pctl->wake_mask = devm_kcalloc(&pdev->dev, ports_buf,
1463 sizeof(*pctl->wake_mask), GFP_KERNEL);
1464 if (!pctl->wake_mask) {
1465 ret = -ENOMEM;
1466 goto chip_error;
1467 }
1468
1469 pctl->cur_mask = devm_kcalloc(&pdev->dev, ports_buf,
1470 sizeof(*pctl->cur_mask), GFP_KERNEL);
1471 if (!pctl->cur_mask) {
1472 ret = -ENOMEM;
1473 goto chip_error;
1474 }
1475
1476 pctl->eint_dual_edges = devm_kcalloc(&pdev->dev, pctl->devdata->ap_num,
1477 sizeof(int), GFP_KERNEL);
1478 if (!pctl->eint_dual_edges) {
1479 ret = -ENOMEM;
1480 goto chip_error;
1481 }
1482
1483 irq = irq_of_parse_and_map(np, 0);
1484 if (!irq) {
1485 dev_err(&pdev->dev, "couldn't parse and map irq\n");
1486 ret = -EINVAL;
1487 goto chip_error;
1488 }
1489
1490 pctl->domain = irq_domain_add_linear(np,
1491 pctl->devdata->ap_num, &irq_domain_simple_ops, NULL);
1492 if (!pctl->domain) {
1493 dev_err(&pdev->dev, "Couldn't register IRQ domain\n");
1494 ret = -ENOMEM;
1495 goto chip_error; 1126 goto chip_error;
1496 }
1497
1498 mtk_eint_init(pctl);
1499 for (i = 0; i < pctl->devdata->ap_num; i++) {
1500 int virq = irq_create_mapping(pctl->domain, i);
1501
1502 irq_set_chip_and_handler(virq, &mtk_pinctrl_irq_chip,
1503 handle_level_irq);
1504 irq_set_chip_data(virq, pctl);
1505 }
1506 1127
1507 irq_set_chained_handler_and_data(irq, mtk_eint_irq_handler, pctl);
1508 return 0; 1128 return 0;
1509 1129
1510chip_error: 1130chip_error:
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
index 8543bc478a1e..bf13eb0a68d6 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
@@ -19,6 +19,8 @@
19#include <linux/regmap.h> 19#include <linux/regmap.h>
20#include <linux/pinctrl/pinconf-generic.h> 20#include <linux/pinctrl/pinconf-generic.h>
21 21
22#include "mtk-eint.h"
23
22#define NO_EINT_SUPPORT 255 24#define NO_EINT_SUPPORT 255
23#define MT_EDGE_SENSITIVE 0 25#define MT_EDGE_SENSITIVE 0
24#define MT_LEVEL_SENSITIVE 1 26#define MT_LEVEL_SENSITIVE 1
@@ -258,9 +260,8 @@ struct mtk_pinctrl_devdata {
258 unsigned char port_shf; 260 unsigned char port_shf;
259 unsigned char port_mask; 261 unsigned char port_mask;
260 unsigned char port_align; 262 unsigned char port_align;
261 struct mtk_eint_offsets eint_offsets; 263 struct mtk_eint_hw eint_hw;
262 unsigned int ap_num; 264 struct mtk_eint_regs *eint_regs;
263 unsigned int db_cnt;
264}; 265};
265 266
266struct mtk_pinctrl { 267struct mtk_pinctrl {
@@ -274,11 +275,7 @@ struct mtk_pinctrl {
274 const char **grp_names; 275 const char **grp_names;
275 struct pinctrl_dev *pctl_dev; 276 struct pinctrl_dev *pctl_dev;
276 const struct mtk_pinctrl_devdata *devdata; 277 const struct mtk_pinctrl_devdata *devdata;
277 void __iomem *eint_reg_base; 278 struct mtk_eint *eint;
278 struct irq_domain *domain;
279 int *eint_dual_edges;
280 u32 *wake_mask;
281 u32 *cur_mask;
282}; 279};
283 280
284int mtk_pctrl_init(struct platform_device *pdev, 281int mtk_pctrl_init(struct platform_device *pdev,
diff --git a/drivers/pinctrl/meson/pinctrl-meson-axg.c b/drivers/pinctrl/meson/pinctrl-meson-axg.c
index 99a6ceac8e53..46a0918bd284 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-axg.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-axg.c
@@ -312,6 +312,47 @@ static const unsigned int pdm_din1_pins[] = {GPIOA_16};
312static const unsigned int pdm_din2_pins[] = {GPIOA_17}; 312static const unsigned int pdm_din2_pins[] = {GPIOA_17};
313static const unsigned int pdm_din3_pins[] = {GPIOA_18}; 313static const unsigned int pdm_din3_pins[] = {GPIOA_18};
314 314
315/* mclk */
316static const unsigned int mclk_c_pins[] = {GPIOA_0};
317static const unsigned int mclk_b_pins[] = {GPIOA_1};
318
319/* tdm */
320static const unsigned int tdma_sclk_pins[] = {GPIOX_12};
321static const unsigned int tdma_sclk_slv_pins[] = {GPIOX_12};
322static const unsigned int tdma_fs_pins[] = {GPIOX_13};
323static const unsigned int tdma_fs_slv_pins[] = {GPIOX_13};
324static const unsigned int tdma_din0_pins[] = {GPIOX_14};
325static const unsigned int tdma_dout0_x14_pins[] = {GPIOX_14};
326static const unsigned int tdma_dout0_x15_pins[] = {GPIOX_15};
327static const unsigned int tdma_dout1_pins[] = {GPIOX_15};
328static const unsigned int tdma_din1_pins[] = {GPIOX_15};
329
330static const unsigned int tdmc_sclk_pins[] = {GPIOA_2};
331static const unsigned int tdmc_sclk_slv_pins[] = {GPIOA_2};
332static const unsigned int tdmc_fs_pins[] = {GPIOA_3};
333static const unsigned int tdmc_fs_slv_pins[] = {GPIOA_3};
334static const unsigned int tdmc_din0_pins[] = {GPIOA_4};
335static const unsigned int tdmc_dout0_pins[] = {GPIOA_4};
336static const unsigned int tdmc_din1_pins[] = {GPIOA_5};
337static const unsigned int tdmc_dout1_pins[] = {GPIOA_5};
338static const unsigned int tdmc_din2_pins[] = {GPIOA_6};
339static const unsigned int tdmc_dout2_pins[] = {GPIOA_6};
340static const unsigned int tdmc_din3_pins[] = {GPIOA_7};
341static const unsigned int tdmc_dout3_pins[] = {GPIOA_7};
342
343static const unsigned int tdmb_sclk_pins[] = {GPIOA_8};
344static const unsigned int tdmb_sclk_slv_pins[] = {GPIOA_8};
345static const unsigned int tdmb_fs_pins[] = {GPIOA_9};
346static const unsigned int tdmb_fs_slv_pins[] = {GPIOA_9};
347static const unsigned int tdmb_din0_pins[] = {GPIOA_10};
348static const unsigned int tdmb_dout0_pins[] = {GPIOA_10};
349static const unsigned int tdmb_din1_pins[] = {GPIOA_11};
350static const unsigned int tdmb_dout1_pins[] = {GPIOA_11};
351static const unsigned int tdmb_din2_pins[] = {GPIOA_12};
352static const unsigned int tdmb_dout2_pins[] = {GPIOA_12};
353static const unsigned int tdmb_din3_pins[] = {GPIOA_13};
354static const unsigned int tdmb_dout3_pins[] = {GPIOA_13};
355
315static struct meson_pmx_group meson_axg_periphs_groups[] = { 356static struct meson_pmx_group meson_axg_periphs_groups[] = {
316 GPIO_GROUP(GPIOZ_0), 357 GPIO_GROUP(GPIOZ_0),
317 GPIO_GROUP(GPIOZ_1), 358 GPIO_GROUP(GPIOZ_1),
@@ -495,6 +536,15 @@ static struct meson_pmx_group meson_axg_periphs_groups[] = {
495 GROUP(eth_rx_dv_x, 4), 536 GROUP(eth_rx_dv_x, 4),
496 GROUP(eth_mdio_x, 4), 537 GROUP(eth_mdio_x, 4),
497 GROUP(eth_mdc_x, 4), 538 GROUP(eth_mdc_x, 4),
539 GROUP(tdma_sclk, 1),
540 GROUP(tdma_sclk_slv, 2),
541 GROUP(tdma_fs, 1),
542 GROUP(tdma_fs_slv, 2),
543 GROUP(tdma_din0, 1),
544 GROUP(tdma_dout0_x14, 2),
545 GROUP(tdma_dout0_x15, 1),
546 GROUP(tdma_dout1, 2),
547 GROUP(tdma_din1, 3),
498 548
499 /* bank GPIOY */ 549 /* bank GPIOY */
500 GROUP(eth_txd0_y, 1), 550 GROUP(eth_txd0_y, 1),
@@ -544,6 +594,32 @@ static struct meson_pmx_group meson_axg_periphs_groups[] = {
544 GROUP(pdm_din1, 1), 594 GROUP(pdm_din1, 1),
545 GROUP(pdm_din2, 1), 595 GROUP(pdm_din2, 1),
546 GROUP(pdm_din3, 1), 596 GROUP(pdm_din3, 1),
597 GROUP(mclk_c, 1),
598 GROUP(mclk_b, 1),
599 GROUP(tdmc_sclk, 1),
600 GROUP(tdmc_sclk_slv, 2),
601 GROUP(tdmc_fs, 1),
602 GROUP(tdmc_fs_slv, 2),
603 GROUP(tdmc_din0, 2),
604 GROUP(tdmc_dout0, 1),
605 GROUP(tdmc_din1, 2),
606 GROUP(tdmc_dout1, 1),
607 GROUP(tdmc_din2, 2),
608 GROUP(tdmc_dout2, 1),
609 GROUP(tdmc_din3, 2),
610 GROUP(tdmc_dout3, 1),
611 GROUP(tdmb_sclk, 1),
612 GROUP(tdmb_sclk_slv, 2),
613 GROUP(tdmb_fs, 1),
614 GROUP(tdmb_fs_slv, 2),
615 GROUP(tdmb_din0, 2),
616 GROUP(tdmb_dout0, 1),
617 GROUP(tdmb_din1, 2),
618 GROUP(tdmb_dout1, 1),
619 GROUP(tdmb_din2, 2),
620 GROUP(tdmb_dout2, 1),
621 GROUP(tdmb_din3, 2),
622 GROUP(tdmb_dout3, 1),
547}; 623};
548 624
549/* uart_ao_a */ 625/* uart_ao_a */
@@ -845,6 +921,32 @@ static const char * const jtag_ao_groups[] = {
845 "jtag_ao_tdi", "jtag_ao_tdo", "jtag_ao_clk", "jtag_ao_tms", 921 "jtag_ao_tdi", "jtag_ao_tdo", "jtag_ao_clk", "jtag_ao_tms",
846}; 922};
847 923
924static const char * const mclk_c_groups[] = {
925 "mclk_c",
926};
927
928static const char * const mclk_b_groups[] = {
929 "mclk_b",
930};
931
932static const char * const tdma_groups[] = {
933 "tdma_sclk", "tdma_sclk_slv", "tdma_fs", "tdma_fs_slv",
934 "tdma_din0", "tdma_dout0_x14", "tdma_dout0_x15", "tdma_dout1",
935 "tdma_din1",
936};
937
938static const char * const tdmc_groups[] = {
939 "tdmc_sclk", "tdmc_sclk_slv", "tdmc_fs", "tdmc_fs_slv",
940 "tdmc_din0", "tdmc_dout0", "tdmc_din1", "tdmc_dout1",
941 "tdmc_din2", "tdmc_dout2", "tdmc_din3", "tdmc_dout3",
942};
943
944static const char * const tdmb_groups[] = {
945 "tdmb_sclk", "tdmb_sclk_slv", "tdmb_fs", "tdmb_fs_slv",
946 "tdmb_din0", "tdmb_dout0", "tdmb_din1", "tdmb_dout1",
947 "tdmb_din2", "tdmb_dout2", "tdmb_din3", "tdmb_dout3",
948};
949
848static struct meson_pmx_func meson_axg_periphs_functions[] = { 950static struct meson_pmx_func meson_axg_periphs_functions[] = {
849 FUNCTION(gpio_periphs), 951 FUNCTION(gpio_periphs),
850 FUNCTION(emmc), 952 FUNCTION(emmc),
@@ -870,6 +972,11 @@ static struct meson_pmx_func meson_axg_periphs_functions[] = {
870 FUNCTION(spdif_in), 972 FUNCTION(spdif_in),
871 FUNCTION(jtag_ee), 973 FUNCTION(jtag_ee),
872 FUNCTION(pdm), 974 FUNCTION(pdm),
975 FUNCTION(mclk_b),
976 FUNCTION(mclk_c),
977 FUNCTION(tdma),
978 FUNCTION(tdmb),
979 FUNCTION(tdmc),
873}; 980};
874 981
875static struct meson_pmx_func meson_axg_aobus_functions[] = { 982static struct meson_pmx_func meson_axg_aobus_functions[] = {
diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
index 9079020259c5..2c97a2e07a5f 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-gxbb.c
@@ -627,8 +627,8 @@ static const char * const sdio_groups[] = {
627}; 627};
628 628
629static const char * const nand_groups[] = { 629static const char * const nand_groups[] = {
630 "nand_ce0", "nand_ce1", "nand_rb0", "nand_ale", "nand_cle", 630 "emmc_nand_d07", "nand_ce0", "nand_ce1", "nand_rb0", "nand_ale",
631 "nand_wen_clk", "nand_ren_wr", "nand_dqs", 631 "nand_cle", "nand_wen_clk", "nand_ren_wr", "nand_dqs",
632}; 632};
633 633
634static const char * const uart_a_groups[] = { 634static const char * const uart_a_groups[] = {
diff --git a/drivers/pinctrl/meson/pinctrl-meson-gxl.c b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
index b3786cde963d..7dae1d7bf6b0 100644
--- a/drivers/pinctrl/meson/pinctrl-meson-gxl.c
+++ b/drivers/pinctrl/meson/pinctrl-meson-gxl.c
@@ -617,8 +617,8 @@ static const char * const sdio_groups[] = {
617}; 617};
618 618
619static const char * const nand_groups[] = { 619static const char * const nand_groups[] = {
620 "nand_ce0", "nand_ce1", "nand_rb0", "nand_ale", "nand_cle", 620 "emmc_nand_d07", "nand_ce0", "nand_ce1", "nand_rb0", "nand_ale",
621 "nand_wen_clk", "nand_ren_wr", "nand_dqs", 621 "nand_cle", "nand_wen_clk", "nand_ren_wr", "nand_dqs",
622}; 622};
623 623
624static const char * const uart_a_groups[] = { 624static const char * const uart_a_groups[] = {
diff --git a/drivers/pinctrl/meson/pinctrl-meson8.c b/drivers/pinctrl/meson/pinctrl-meson8.c
index 49c7ce03547b..c6d79315218f 100644
--- a/drivers/pinctrl/meson/pinctrl-meson8.c
+++ b/drivers/pinctrl/meson/pinctrl-meson8.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Pin controller and GPIO driver for Amlogic Meson8. 2 * Pin controller and GPIO driver for Amlogic Meson8 and Meson8m2.
3 * 3 *
4 * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com> 4 * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.com>
5 * 5 *
@@ -299,6 +299,10 @@ static const unsigned int spi_mosi_1_pins[] = { GPIOZ_12 };
299static const unsigned int spi_miso_1_pins[] = { GPIOZ_13 }; 299static const unsigned int spi_miso_1_pins[] = { GPIOZ_13 };
300static const unsigned int spi_ss2_1_pins[] = { GPIOZ_14 }; 300static const unsigned int spi_ss2_1_pins[] = { GPIOZ_14 };
301 301
302static const unsigned int eth_txd3_pins[] = { GPIOZ_0 };
303static const unsigned int eth_txd2_pins[] = { GPIOZ_1 };
304static const unsigned int eth_rxd3_pins[] = { GPIOZ_2 };
305static const unsigned int eth_rxd2_pins[] = { GPIOZ_3 };
302static const unsigned int eth_tx_clk_50m_pins[] = { GPIOZ_4 }; 306static const unsigned int eth_tx_clk_50m_pins[] = { GPIOZ_4 };
303static const unsigned int eth_tx_en_pins[] = { GPIOZ_5 }; 307static const unsigned int eth_tx_en_pins[] = { GPIOZ_5 };
304static const unsigned int eth_txd1_pins[] = { GPIOZ_6 }; 308static const unsigned int eth_txd1_pins[] = { GPIOZ_6 };
@@ -650,6 +654,12 @@ static struct meson_pmx_group meson8_cbus_groups[] = {
650 GROUP(eth_mdio, 6, 6), 654 GROUP(eth_mdio, 6, 6),
651 GROUP(eth_mdc, 6, 5), 655 GROUP(eth_mdc, 6, 5),
652 656
657 /* NOTE: the following four groups are only available on Meson8m2: */
658 GROUP(eth_rxd2, 6, 3),
659 GROUP(eth_rxd3, 6, 2),
660 GROUP(eth_txd2, 6, 1),
661 GROUP(eth_txd3, 6, 0),
662
653 GROUP(i2c_sda_a0, 5, 31), 663 GROUP(i2c_sda_a0, 5, 31),
654 GROUP(i2c_sck_a0, 5, 30), 664 GROUP(i2c_sck_a0, 5, 30),
655 665
@@ -877,7 +887,8 @@ static const char * const spi_groups[] = {
877static const char * const ethernet_groups[] = { 887static const char * const ethernet_groups[] = {
878 "eth_tx_clk_50m", "eth_tx_en", "eth_txd1", 888 "eth_tx_clk_50m", "eth_tx_en", "eth_txd1",
879 "eth_txd0", "eth_rx_clk_in", "eth_rx_dv", 889 "eth_txd0", "eth_rx_clk_in", "eth_rx_dv",
880 "eth_rxd1", "eth_rxd0", "eth_mdio", "eth_mdc" 890 "eth_rxd1", "eth_rxd0", "eth_mdio", "eth_mdc", "eth_rxd2",
891 "eth_rxd3", "eth_txd2", "eth_txd3"
881}; 892};
882 893
883static const char * const i2c_a_groups[] = { 894static const char * const i2c_a_groups[] = {
@@ -1080,6 +1091,14 @@ static const struct of_device_id meson8_pinctrl_dt_match[] = {
1080 .compatible = "amlogic,meson8-aobus-pinctrl", 1091 .compatible = "amlogic,meson8-aobus-pinctrl",
1081 .data = &meson8_aobus_pinctrl_data, 1092 .data = &meson8_aobus_pinctrl_data,
1082 }, 1093 },
1094 {
1095 .compatible = "amlogic,meson8m2-cbus-pinctrl",
1096 .data = &meson8_cbus_pinctrl_data,
1097 },
1098 {
1099 .compatible = "amlogic,meson8m2-aobus-pinctrl",
1100 .data = &meson8_aobus_pinctrl_data,
1101 },
1083 { }, 1102 { },
1084}; 1103};
1085 1104
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
index 5b63248c8209..674ffdf8103c 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c
@@ -214,18 +214,6 @@ static inline void armada_37xx_update_reg(unsigned int *reg,
214 } 214 }
215} 215}
216 216
217static int armada_37xx_get_func_reg(struct armada_37xx_pin_group *grp,
218 const char *func)
219{
220 int f;
221
222 for (f = 0; (f < NB_FUNCS) && grp->funcs[f]; f++)
223 if (!strcmp(grp->funcs[f], func))
224 return f;
225
226 return -ENOTSUPP;
227}
228
229static struct armada_37xx_pin_group *armada_37xx_find_next_grp_by_pin( 217static struct armada_37xx_pin_group *armada_37xx_find_next_grp_by_pin(
230 struct armada_37xx_pinctrl *info, int pin, int *grp) 218 struct armada_37xx_pinctrl *info, int pin, int *grp)
231{ 219{
@@ -344,10 +332,9 @@ static int armada_37xx_pmx_set_by_name(struct pinctrl_dev *pctldev,
344 dev_dbg(info->dev, "enable function %s group %s\n", 332 dev_dbg(info->dev, "enable function %s group %s\n",
345 name, grp->name); 333 name, grp->name);
346 334
347 func = armada_37xx_get_func_reg(grp, name); 335 func = match_string(grp->funcs, NB_FUNCS, name);
348
349 if (func < 0) 336 if (func < 0)
350 return func; 337 return -ENOTSUPP;
351 338
352 val = grp->val[func]; 339 val = grp->val[func];
353 340
@@ -679,12 +666,13 @@ static void armada_37xx_irq_handler(struct irq_desc *desc)
679 writel(1 << hwirq, 666 writel(1 << hwirq,
680 info->base + 667 info->base +
681 IRQ_STATUS + 4 * i); 668 IRQ_STATUS + 4 * i);
682 continue; 669 goto update_status;
683 } 670 }
684 } 671 }
685 672
686 generic_handle_irq(virq); 673 generic_handle_irq(virq);
687 674
675update_status:
688 /* Update status in case a new IRQ appears */ 676 /* Update status in case a new IRQ appears */
689 spin_lock_irqsave(&info->irq_lock, flags); 677 spin_lock_irqsave(&info->irq_lock, flags);
690 status = readl_relaxed(info->base + 678 status = readl_relaxed(info->base +
@@ -932,12 +920,12 @@ static int armada_37xx_fill_func(struct armada_37xx_pinctrl *info)
932 struct armada_37xx_pin_group *gp = &info->groups[g]; 920 struct armada_37xx_pin_group *gp = &info->groups[g];
933 int f; 921 int f;
934 922
935 for (f = 0; (f < NB_FUNCS) && gp->funcs[f]; f++) { 923 f = match_string(gp->funcs, NB_FUNCS, name);
936 if (strcmp(gp->funcs[f], name) == 0) { 924 if (f < 0)
937 *groups = gp->name; 925 continue;
938 groups++; 926
939 } 927 *groups = gp->name;
940 } 928 groups++;
941 } 929 }
942 } 930 }
943 return 0; 931 return 0;
diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
index b854f1ee5de5..5e828468e43d 100644
--- a/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
+++ b/drivers/pinctrl/mvebu/pinctrl-armada-xp.c
@@ -431,40 +431,40 @@ static struct mvebu_mpp_mode mv98dx3236_mpp_modes[] = {
431 MPP_MODE(19, 431 MPP_MODE(19,
432 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS), 432 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
433 MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V_98DX3236_PLUS), 433 MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V_98DX3236_PLUS),
434 MPP_VAR_FUNCTION(0x4, "dev", "rb", V_98DX3236_PLUS)), 434 MPP_VAR_FUNCTION(0x4, "nand", "rb", V_98DX3236_PLUS)),
435 MPP_MODE(20, 435 MPP_MODE(20,
436 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 436 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
437 MPP_VAR_FUNCTION(0x4, "dev", "we0", V_98DX3236_PLUS)), 437 MPP_VAR_FUNCTION(0x4, "dev", "we0", V_98DX3236_PLUS)),
438 MPP_MODE(21, 438 MPP_MODE(21,
439 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 439 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
440 MPP_VAR_FUNCTION(0x1, "dev", "ad0", V_98DX3236_PLUS)), 440 MPP_VAR_FUNCTION(0x4, "dev", "ad0", V_98DX3236_PLUS)),
441 MPP_MODE(22, 441 MPP_MODE(22,
442 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 442 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
443 MPP_VAR_FUNCTION(0x1, "dev", "ad1", V_98DX3236_PLUS)), 443 MPP_VAR_FUNCTION(0x4, "dev", "ad1", V_98DX3236_PLUS)),
444 MPP_MODE(23, 444 MPP_MODE(23,
445 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 445 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
446 MPP_VAR_FUNCTION(0x1, "dev", "ad2", V_98DX3236_PLUS)), 446 MPP_VAR_FUNCTION(0x4, "dev", "ad2", V_98DX3236_PLUS)),
447 MPP_MODE(24, 447 MPP_MODE(24,
448 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 448 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
449 MPP_VAR_FUNCTION(0x1, "dev", "ad3", V_98DX3236_PLUS)), 449 MPP_VAR_FUNCTION(0x4, "dev", "ad3", V_98DX3236_PLUS)),
450 MPP_MODE(25, 450 MPP_MODE(25,
451 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 451 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
452 MPP_VAR_FUNCTION(0x1, "dev", "ad4", V_98DX3236_PLUS)), 452 MPP_VAR_FUNCTION(0x4, "dev", "ad4", V_98DX3236_PLUS)),
453 MPP_MODE(26, 453 MPP_MODE(26,
454 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 454 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
455 MPP_VAR_FUNCTION(0x1, "dev", "ad5", V_98DX3236_PLUS)), 455 MPP_VAR_FUNCTION(0x4, "dev", "ad5", V_98DX3236_PLUS)),
456 MPP_MODE(27, 456 MPP_MODE(27,
457 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 457 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
458 MPP_VAR_FUNCTION(0x1, "dev", "ad6", V_98DX3236_PLUS)), 458 MPP_VAR_FUNCTION(0x4, "dev", "ad6", V_98DX3236_PLUS)),
459 MPP_MODE(28, 459 MPP_MODE(28,
460 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 460 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
461 MPP_VAR_FUNCTION(0x1, "dev", "ad7", V_98DX3236_PLUS)), 461 MPP_VAR_FUNCTION(0x4, "dev", "ad7", V_98DX3236_PLUS)),
462 MPP_MODE(29, 462 MPP_MODE(29,
463 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 463 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
464 MPP_VAR_FUNCTION(0x1, "dev", "a0", V_98DX3236_PLUS)), 464 MPP_VAR_FUNCTION(0x4, "dev", "a0", V_98DX3236_PLUS)),
465 MPP_MODE(30, 465 MPP_MODE(30,
466 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS), 466 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V_98DX3236_PLUS),
467 MPP_VAR_FUNCTION(0x1, "dev", "a1", V_98DX3236_PLUS)), 467 MPP_VAR_FUNCTION(0x4, "dev", "a1", V_98DX3236_PLUS)),
468 MPP_MODE(31, 468 MPP_MODE(31,
469 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS), 469 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V_98DX3236_PLUS),
470 MPP_VAR_FUNCTION(0x1, "slv_smi", "mdc", V_98DX3236_PLUS), 470 MPP_VAR_FUNCTION(0x1, "slv_smi", "mdc", V_98DX3236_PLUS),
diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
index 4b57a13758a4..bafb3d40545e 100644
--- a/drivers/pinctrl/pinctrl-at91-pio4.c
+++ b/drivers/pinctrl/pinctrl-at91-pio4.c
@@ -576,8 +576,10 @@ static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev,
576 for_each_child_of_node(np_config, np) { 576 for_each_child_of_node(np_config, np) {
577 ret = atmel_pctl_dt_subnode_to_map(pctldev, np, map, 577 ret = atmel_pctl_dt_subnode_to_map(pctldev, np, map,
578 &reserved_maps, num_maps); 578 &reserved_maps, num_maps);
579 if (ret < 0) 579 if (ret < 0) {
580 of_node_put(np);
580 break; 581 break;
582 }
581 } 583 }
582 } 584 }
583 585
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
index 3924779f5578..1882713e68f9 100644
--- a/drivers/pinctrl/pinctrl-rockchip.c
+++ b/drivers/pinctrl/pinctrl-rockchip.c
@@ -59,6 +59,7 @@
59#define GPIO_LS_SYNC 0x60 59#define GPIO_LS_SYNC 0x60
60 60
61enum rockchip_pinctrl_type { 61enum rockchip_pinctrl_type {
62 PX30,
62 RV1108, 63 RV1108,
63 RK2928, 64 RK2928,
64 RK3066B, 65 RK3066B,
@@ -701,6 +702,66 @@ static void rockchip_get_recalced_mux(struct rockchip_pin_bank *bank, int pin,
701 *bit = data->bit; 702 *bit = data->bit;
702} 703}
703 704
705static struct rockchip_mux_route_data px30_mux_route_data[] = {
706 {
707 /* cif-d2m0 */
708 .bank_num = 2,
709 .pin = 0,
710 .func = 1,
711 .route_offset = 0x184,
712 .route_val = BIT(16 + 7),
713 }, {
714 /* cif-d2m1 */
715 .bank_num = 3,
716 .pin = 3,
717 .func = 3,
718 .route_offset = 0x184,
719 .route_val = BIT(16 + 7) | BIT(7),
720 }, {
721 /* pdm-m0 */
722 .bank_num = 3,
723 .pin = 22,
724 .func = 2,
725 .route_offset = 0x184,
726 .route_val = BIT(16 + 8),
727 }, {
728 /* pdm-m1 */
729 .bank_num = 2,
730 .pin = 22,
731 .func = 1,
732 .route_offset = 0x184,
733 .route_val = BIT(16 + 8) | BIT(8),
734 }, {
735 /* uart2-rxm0 */
736 .bank_num = 1,
737 .pin = 27,
738 .func = 2,
739 .route_offset = 0x184,
740 .route_val = BIT(16 + 10),
741 }, {
742 /* uart2-rxm1 */
743 .bank_num = 2,
744 .pin = 14,
745 .func = 2,
746 .route_offset = 0x184,
747 .route_val = BIT(16 + 10) | BIT(10),
748 }, {
749 /* uart3-rxm0 */
750 .bank_num = 0,
751 .pin = 17,
752 .func = 2,
753 .route_offset = 0x184,
754 .route_val = BIT(16 + 9),
755 }, {
756 /* uart3-rxm1 */
757 .bank_num = 1,
758 .pin = 15,
759 .func = 2,
760 .route_offset = 0x184,
761 .route_val = BIT(16 + 9) | BIT(9),
762 },
763};
764
704static struct rockchip_mux_route_data rk3128_mux_route_data[] = { 765static struct rockchip_mux_route_data rk3128_mux_route_data[] = {
705 { 766 {
706 /* spi-0 */ 767 /* spi-0 */
@@ -1202,6 +1263,97 @@ static int rockchip_set_mux(struct rockchip_pin_bank *bank, int pin, int mux)
1202 return ret; 1263 return ret;
1203} 1264}
1204 1265
1266#define PX30_PULL_PMU_OFFSET 0x10
1267#define PX30_PULL_GRF_OFFSET 0x60
1268#define PX30_PULL_BITS_PER_PIN 2
1269#define PX30_PULL_PINS_PER_REG 8
1270#define PX30_PULL_BANK_STRIDE 16
1271
1272static void px30_calc_pull_reg_and_bit(struct rockchip_pin_bank *bank,
1273 int pin_num, struct regmap **regmap,
1274 int *reg, u8 *bit)
1275{
1276 struct rockchip_pinctrl *info = bank->drvdata;
1277
1278 /* The first 32 pins of the first bank are located in PMU */
1279 if (bank->bank_num == 0) {
1280 *regmap = info->regmap_pmu;
1281 *reg = PX30_PULL_PMU_OFFSET;
1282 } else {
1283 *regmap = info->regmap_base;
1284 *reg = PX30_PULL_GRF_OFFSET;
1285
1286 /* correct the offset, as we're starting with the 2nd bank */
1287 *reg -= 0x10;
1288 *reg += bank->bank_num * PX30_PULL_BANK_STRIDE;
1289 }
1290
1291 *reg += ((pin_num / PX30_PULL_PINS_PER_REG) * 4);
1292 *bit = (pin_num % PX30_PULL_PINS_PER_REG);
1293 *bit *= PX30_PULL_BITS_PER_PIN;
1294}
1295
1296#define PX30_DRV_PMU_OFFSET 0x20
1297#define PX30_DRV_GRF_OFFSET 0xf0
1298#define PX30_DRV_BITS_PER_PIN 2
1299#define PX30_DRV_PINS_PER_REG 8
1300#define PX30_DRV_BANK_STRIDE 16
1301
1302static void px30_calc_drv_reg_and_bit(struct rockchip_pin_bank *bank,
1303 int pin_num, struct regmap **regmap,
1304 int *reg, u8 *bit)
1305{
1306 struct rockchip_pinctrl *info = bank->drvdata;
1307
1308 /* The first 32 pins of the first bank are located in PMU */
1309 if (bank->bank_num == 0) {
1310 *regmap = info->regmap_pmu;
1311 *reg = PX30_DRV_PMU_OFFSET;
1312 } else {
1313 *regmap = info->regmap_base;
1314 *reg = PX30_DRV_GRF_OFFSET;
1315
1316 /* correct the offset, as we're starting with the 2nd bank */
1317 *reg -= 0x10;
1318 *reg += bank->bank_num * PX30_DRV_BANK_STRIDE;
1319 }
1320
1321 *reg += ((pin_num / PX30_DRV_PINS_PER_REG) * 4);
1322 *bit = (pin_num % PX30_DRV_PINS_PER_REG);
1323 *bit *= PX30_DRV_BITS_PER_PIN;
1324}
1325
1326#define PX30_SCHMITT_PMU_OFFSET 0x38
1327#define PX30_SCHMITT_GRF_OFFSET 0xc0
1328#define PX30_SCHMITT_PINS_PER_PMU_REG 16
1329#define PX30_SCHMITT_BANK_STRIDE 16
1330#define PX30_SCHMITT_PINS_PER_GRF_REG 8
1331
1332static int px30_calc_schmitt_reg_and_bit(struct rockchip_pin_bank *bank,
1333 int pin_num,
1334 struct regmap **regmap,
1335 int *reg, u8 *bit)
1336{
1337 struct rockchip_pinctrl *info = bank->drvdata;
1338 int pins_per_reg;
1339
1340 if (bank->bank_num == 0) {
1341 *regmap = info->regmap_pmu;
1342 *reg = PX30_SCHMITT_PMU_OFFSET;
1343 pins_per_reg = PX30_SCHMITT_PINS_PER_PMU_REG;
1344 } else {
1345 *regmap = info->regmap_base;
1346 *reg = PX30_SCHMITT_GRF_OFFSET;
1347 pins_per_reg = PX30_SCHMITT_PINS_PER_GRF_REG;
1348 *reg += (bank->bank_num - 1) * PX30_SCHMITT_BANK_STRIDE;
1349 }
1350
1351 *reg += ((pin_num / pins_per_reg) * 4);
1352 *bit = pin_num % pins_per_reg;
1353
1354 return 0;
1355}
1356
1205#define RV1108_PULL_PMU_OFFSET 0x10 1357#define RV1108_PULL_PMU_OFFSET 0x10
1206#define RV1108_PULL_OFFSET 0x110 1358#define RV1108_PULL_OFFSET 0x110
1207#define RV1108_PULL_PINS_PER_REG 8 1359#define RV1108_PULL_PINS_PER_REG 8
@@ -1798,6 +1950,7 @@ static int rockchip_get_pull(struct rockchip_pin_bank *bank, int pin_num)
1798 return !(data & BIT(bit)) 1950 return !(data & BIT(bit))
1799 ? PIN_CONFIG_BIAS_PULL_PIN_DEFAULT 1951 ? PIN_CONFIG_BIAS_PULL_PIN_DEFAULT
1800 : PIN_CONFIG_BIAS_DISABLE; 1952 : PIN_CONFIG_BIAS_DISABLE;
1953 case PX30:
1801 case RV1108: 1954 case RV1108:
1802 case RK3188: 1955 case RK3188:
1803 case RK3288: 1956 case RK3288:
@@ -1841,6 +1994,7 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank,
1841 data |= BIT(bit); 1994 data |= BIT(bit);
1842 ret = regmap_write(regmap, reg, data); 1995 ret = regmap_write(regmap, reg, data);
1843 break; 1996 break;
1997 case PX30:
1844 case RV1108: 1998 case RV1108:
1845 case RK3188: 1999 case RK3188:
1846 case RK3288: 2000 case RK3288:
@@ -2103,6 +2257,7 @@ static bool rockchip_pinconf_pull_valid(struct rockchip_pin_ctrl *ctrl,
2103 pull == PIN_CONFIG_BIAS_DISABLE); 2257 pull == PIN_CONFIG_BIAS_DISABLE);
2104 case RK3066B: 2258 case RK3066B:
2105 return pull ? false : true; 2259 return pull ? false : true;
2260 case PX30:
2106 case RV1108: 2261 case RV1108:
2107 case RK3188: 2262 case RK3188:
2108 case RK3288: 2263 case RK3288:
@@ -2555,6 +2710,57 @@ static int rockchip_gpio_direction_output(struct gpio_chip *gc,
2555 return pinctrl_gpio_direction_output(gc->base + offset); 2710 return pinctrl_gpio_direction_output(gc->base + offset);
2556} 2711}
2557 2712
2713static void rockchip_gpio_set_debounce(struct gpio_chip *gc,
2714 unsigned int offset, bool enable)
2715{
2716 struct rockchip_pin_bank *bank = gpiochip_get_data(gc);
2717 void __iomem *reg = bank->reg_base + GPIO_DEBOUNCE;
2718 unsigned long flags;
2719 u32 data;
2720
2721 clk_enable(bank->clk);
2722 raw_spin_lock_irqsave(&bank->slock, flags);
2723
2724 data = readl(reg);
2725 if (enable)
2726 data |= BIT(offset);
2727 else
2728 data &= ~BIT(offset);
2729 writel(data, reg);
2730
2731 raw_spin_unlock_irqrestore(&bank->slock, flags);
2732 clk_disable(bank->clk);
2733}
2734
2735/*
2736 * gpiolib set_config callback function. The setting of the pin
2737 * mux function as 'gpio output' will be handled by the pinctrl subsystem
2738 * interface.
2739 */
2740static int rockchip_gpio_set_config(struct gpio_chip *gc, unsigned int offset,
2741 unsigned long config)
2742{
2743 enum pin_config_param param = pinconf_to_config_param(config);
2744
2745 switch (param) {
2746 case PIN_CONFIG_INPUT_DEBOUNCE:
2747 rockchip_gpio_set_debounce(gc, offset, true);
2748 /*
2749 * Rockchip's gpio could only support up to one period
2750 * of the debounce clock(pclk), which is far away from
2751 * satisftying the requirement, as pclk is usually near
2752 * 100MHz shared by all peripherals. So the fact is it
2753 * has crippled debounce capability could only be useful
2754 * to prevent any spurious glitches from waking up the system
2755 * if the gpio is conguired as wakeup interrupt source. Let's
2756 * still return -ENOTSUPP as before, to make sure the caller
2757 * of gpiod_set_debounce won't change its behaviour.
2758 */
2759 default:
2760 return -ENOTSUPP;
2761 }
2762}
2763
2558/* 2764/*
2559 * gpiolib gpio_to_irq callback function. Creates a mapping between a GPIO pin 2765 * gpiolib gpio_to_irq callback function. Creates a mapping between a GPIO pin
2560 * and a virtual IRQ, if not already present. 2766 * and a virtual IRQ, if not already present.
@@ -2580,6 +2786,7 @@ static const struct gpio_chip rockchip_gpiolib_chip = {
2580 .get_direction = rockchip_gpio_get_direction, 2786 .get_direction = rockchip_gpio_get_direction,
2581 .direction_input = rockchip_gpio_direction_input, 2787 .direction_input = rockchip_gpio_direction_input,
2582 .direction_output = rockchip_gpio_direction_output, 2788 .direction_output = rockchip_gpio_direction_output,
2789 .set_config = rockchip_gpio_set_config,
2583 .to_irq = rockchip_gpio_to_irq, 2790 .to_irq = rockchip_gpio_to_irq,
2584 .owner = THIS_MODULE, 2791 .owner = THIS_MODULE,
2585}; 2792};
@@ -3237,6 +3444,43 @@ static int rockchip_pinctrl_probe(struct platform_device *pdev)
3237 return 0; 3444 return 0;
3238} 3445}
3239 3446
3447static struct rockchip_pin_bank px30_pin_banks[] = {
3448 PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", IOMUX_SOURCE_PMU,
3449 IOMUX_SOURCE_PMU,
3450 IOMUX_SOURCE_PMU,
3451 IOMUX_SOURCE_PMU
3452 ),
3453 PIN_BANK_IOMUX_FLAGS(1, 32, "gpio1", IOMUX_WIDTH_4BIT,
3454 IOMUX_WIDTH_4BIT,
3455 IOMUX_WIDTH_4BIT,
3456 IOMUX_WIDTH_4BIT
3457 ),
3458 PIN_BANK_IOMUX_FLAGS(2, 32, "gpio2", IOMUX_WIDTH_4BIT,
3459 IOMUX_WIDTH_4BIT,
3460 IOMUX_WIDTH_4BIT,
3461 IOMUX_WIDTH_4BIT
3462 ),
3463 PIN_BANK_IOMUX_FLAGS(3, 32, "gpio3", IOMUX_WIDTH_4BIT,
3464 IOMUX_WIDTH_4BIT,
3465 IOMUX_WIDTH_4BIT,
3466 IOMUX_WIDTH_4BIT
3467 ),
3468};
3469
3470static struct rockchip_pin_ctrl px30_pin_ctrl = {
3471 .pin_banks = px30_pin_banks,
3472 .nr_banks = ARRAY_SIZE(px30_pin_banks),
3473 .label = "PX30-GPIO",
3474 .type = PX30,
3475 .grf_mux_offset = 0x0,
3476 .pmu_mux_offset = 0x0,
3477 .iomux_routes = px30_mux_route_data,
3478 .niomux_routes = ARRAY_SIZE(px30_mux_route_data),
3479 .pull_calc_reg = px30_calc_pull_reg_and_bit,
3480 .drv_calc_reg = px30_calc_drv_reg_and_bit,
3481 .schmitt_calc_reg = px30_calc_schmitt_reg_and_bit,
3482};
3483
3240static struct rockchip_pin_bank rv1108_pin_banks[] = { 3484static struct rockchip_pin_bank rv1108_pin_banks[] = {
3241 PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", IOMUX_SOURCE_PMU, 3485 PIN_BANK_IOMUX_FLAGS(0, 32, "gpio0", IOMUX_SOURCE_PMU,
3242 IOMUX_SOURCE_PMU, 3486 IOMUX_SOURCE_PMU,
@@ -3545,6 +3789,8 @@ static struct rockchip_pin_ctrl rk3399_pin_ctrl = {
3545}; 3789};
3546 3790
3547static const struct of_device_id rockchip_pinctrl_dt_match[] = { 3791static const struct of_device_id rockchip_pinctrl_dt_match[] = {
3792 { .compatible = "rockchip,px30-pinctrl",
3793 .data = &px30_pin_ctrl },
3548 { .compatible = "rockchip,rv1108-pinctrl", 3794 { .compatible = "rockchip,rv1108-pinctrl",
3549 .data = &rv1108_pin_ctrl }, 3795 .data = &rv1108_pin_ctrl },
3550 { .compatible = "rockchip,rk2928-pinctrl", 3796 { .compatible = "rockchip,rk2928-pinctrl",
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index a7c5eb39b1eb..9c3c00515aa0 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -144,6 +144,7 @@ struct pcs_soc_data {
144 * struct pcs_device - pinctrl device instance 144 * struct pcs_device - pinctrl device instance
145 * @res: resources 145 * @res: resources
146 * @base: virtual address of the controller 146 * @base: virtual address of the controller
147 * @saved_vals: saved values for the controller
147 * @size: size of the ioremapped area 148 * @size: size of the ioremapped area
148 * @dev: device entry 149 * @dev: device entry
149 * @np: device tree node 150 * @np: device tree node
@@ -172,11 +173,13 @@ struct pcs_soc_data {
172struct pcs_device { 173struct pcs_device {
173 struct resource *res; 174 struct resource *res;
174 void __iomem *base; 175 void __iomem *base;
176 void *saved_vals;
175 unsigned size; 177 unsigned size;
176 struct device *dev; 178 struct device *dev;
177 struct device_node *np; 179 struct device_node *np;
178 struct pinctrl_dev *pctl; 180 struct pinctrl_dev *pctl;
179 unsigned flags; 181 unsigned flags;
182#define PCS_CONTEXT_LOSS_OFF (1 << 3)
180#define PCS_QUIRK_SHARED_IRQ (1 << 2) 183#define PCS_QUIRK_SHARED_IRQ (1 << 2)
181#define PCS_FEAT_IRQ (1 << 1) 184#define PCS_FEAT_IRQ (1 << 1)
182#define PCS_FEAT_PINCONF (1 << 0) 185#define PCS_FEAT_PINCONF (1 << 0)
@@ -1576,6 +1579,67 @@ static int pcs_irq_init_chained_handler(struct pcs_device *pcs,
1576} 1579}
1577 1580
1578#ifdef CONFIG_PM 1581#ifdef CONFIG_PM
1582static int pcs_save_context(struct pcs_device *pcs)
1583{
1584 int i, mux_bytes;
1585 u64 *regsl;
1586 u32 *regsw;
1587 u16 *regshw;
1588
1589 mux_bytes = pcs->width / BITS_PER_BYTE;
1590
1591 if (!pcs->saved_vals)
1592 pcs->saved_vals = devm_kzalloc(pcs->dev, pcs->size, GFP_ATOMIC);
1593
1594 switch (pcs->width) {
1595 case 64:
1596 regsl = (u64 *)pcs->saved_vals;
1597 for (i = 0; i < pcs->size / mux_bytes; i++)
1598 regsl[i] = pcs->read(pcs->base + i * mux_bytes);
1599 break;
1600 case 32:
1601 regsw = (u32 *)pcs->saved_vals;
1602 for (i = 0; i < pcs->size / mux_bytes; i++)
1603 regsw[i] = pcs->read(pcs->base + i * mux_bytes);
1604 break;
1605 case 16:
1606 regshw = (u16 *)pcs->saved_vals;
1607 for (i = 0; i < pcs->size / mux_bytes; i++)
1608 regshw[i] = pcs->read(pcs->base + i * mux_bytes);
1609 break;
1610 }
1611
1612 return 0;
1613}
1614
1615static void pcs_restore_context(struct pcs_device *pcs)
1616{
1617 int i, mux_bytes;
1618 u64 *regsl;
1619 u32 *regsw;
1620 u16 *regshw;
1621
1622 mux_bytes = pcs->width / BITS_PER_BYTE;
1623
1624 switch (pcs->width) {
1625 case 64:
1626 regsl = (u64 *)pcs->saved_vals;
1627 for (i = 0; i < pcs->size / mux_bytes; i++)
1628 pcs->write(regsl[i], pcs->base + i * mux_bytes);
1629 break;
1630 case 32:
1631 regsw = (u32 *)pcs->saved_vals;
1632 for (i = 0; i < pcs->size / mux_bytes; i++)
1633 pcs->write(regsw[i], pcs->base + i * mux_bytes);
1634 break;
1635 case 16:
1636 regshw = (u16 *)pcs->saved_vals;
1637 for (i = 0; i < pcs->size / mux_bytes; i++)
1638 pcs->write(regshw[i], pcs->base + i * mux_bytes);
1639 break;
1640 }
1641}
1642
1579static int pinctrl_single_suspend(struct platform_device *pdev, 1643static int pinctrl_single_suspend(struct platform_device *pdev,
1580 pm_message_t state) 1644 pm_message_t state)
1581{ 1645{
@@ -1585,6 +1649,9 @@ static int pinctrl_single_suspend(struct platform_device *pdev,
1585 if (!pcs) 1649 if (!pcs)
1586 return -EINVAL; 1650 return -EINVAL;
1587 1651
1652 if (pcs->flags & PCS_CONTEXT_LOSS_OFF)
1653 pcs_save_context(pcs);
1654
1588 return pinctrl_force_sleep(pcs->pctl); 1655 return pinctrl_force_sleep(pcs->pctl);
1589} 1656}
1590 1657
@@ -1596,6 +1663,9 @@ static int pinctrl_single_resume(struct platform_device *pdev)
1596 if (!pcs) 1663 if (!pcs)
1597 return -EINVAL; 1664 return -EINVAL;
1598 1665
1666 if (pcs->flags & PCS_CONTEXT_LOSS_OFF)
1667 pcs_restore_context(pcs);
1668
1599 return pinctrl_force_default(pcs->pctl); 1669 return pinctrl_force_default(pcs->pctl);
1600} 1670}
1601#endif 1671#endif
@@ -1824,7 +1894,7 @@ static const struct pcs_soc_data pinctrl_single_dra7 = {
1824}; 1894};
1825 1895
1826static const struct pcs_soc_data pinctrl_single_am437x = { 1896static const struct pcs_soc_data pinctrl_single_am437x = {
1827 .flags = PCS_QUIRK_SHARED_IRQ, 1897 .flags = PCS_QUIRK_SHARED_IRQ | PCS_CONTEXT_LOSS_OFF,
1828 .irq_enable_mask = (1 << 29), /* OMAP_WAKEUP_EN */ 1898 .irq_enable_mask = (1 << 29), /* OMAP_WAKEUP_EN */
1829 .irq_status_mask = (1 << 30), /* OMAP_WAKEUP_EVENT */ 1899 .irq_status_mask = (1 << 30), /* OMAP_WAKEUP_EVENT */
1830}; 1900};
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index ad80a17c9990..0e22f52b2a19 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -58,7 +58,10 @@ struct msm_pinctrl {
58 struct device *dev; 58 struct device *dev;
59 struct pinctrl_dev *pctrl; 59 struct pinctrl_dev *pctrl;
60 struct gpio_chip chip; 60 struct gpio_chip chip;
61 struct pinctrl_desc desc;
61 struct notifier_block restart_nb; 62 struct notifier_block restart_nb;
63
64 struct irq_chip irq_chip;
62 int irq; 65 int irq;
63 66
64 raw_spinlock_t lock; 67 raw_spinlock_t lock;
@@ -390,13 +393,6 @@ static const struct pinconf_ops msm_pinconf_ops = {
390 .pin_config_group_set = msm_config_group_set, 393 .pin_config_group_set = msm_config_group_set,
391}; 394};
392 395
393static struct pinctrl_desc msm_pinctrl_desc = {
394 .pctlops = &msm_pinctrl_ops,
395 .pmxops = &msm_pinmux_ops,
396 .confops = &msm_pinconf_ops,
397 .owner = THIS_MODULE,
398};
399
400static int msm_gpio_direction_input(struct gpio_chip *chip, unsigned offset) 396static int msm_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
401{ 397{
402 const struct msm_pingroup *g; 398 const struct msm_pingroup *g;
@@ -506,29 +502,46 @@ static void msm_gpio_dbg_show_one(struct seq_file *s,
506 int is_out; 502 int is_out;
507 int drive; 503 int drive;
508 int pull; 504 int pull;
509 u32 ctl_reg; 505 int val;
506 u32 ctl_reg, io_reg;
510 507
511 static const char * const pulls[] = { 508 static const char * const pulls_keeper[] = {
512 "no pull", 509 "no pull",
513 "pull down", 510 "pull down",
514 "keeper", 511 "keeper",
515 "pull up" 512 "pull up"
516 }; 513 };
517 514
515 static const char * const pulls_no_keeper[] = {
516 "no pull",
517 "pull down",
518 "pull up",
519 };
520
518 if (!gpiochip_line_is_valid(chip, offset)) 521 if (!gpiochip_line_is_valid(chip, offset))
519 return; 522 return;
520 523
521 g = &pctrl->soc->groups[offset]; 524 g = &pctrl->soc->groups[offset];
522 ctl_reg = readl(pctrl->regs + g->ctl_reg); 525 ctl_reg = readl(pctrl->regs + g->ctl_reg);
526 io_reg = readl(pctrl->regs + g->io_reg);
523 527
524 is_out = !!(ctl_reg & BIT(g->oe_bit)); 528 is_out = !!(ctl_reg & BIT(g->oe_bit));
525 func = (ctl_reg >> g->mux_bit) & 7; 529 func = (ctl_reg >> g->mux_bit) & 7;
526 drive = (ctl_reg >> g->drv_bit) & 7; 530 drive = (ctl_reg >> g->drv_bit) & 7;
527 pull = (ctl_reg >> g->pull_bit) & 3; 531 pull = (ctl_reg >> g->pull_bit) & 3;
528 532
529 seq_printf(s, " %-8s: %-3s %d", g->name, is_out ? "out" : "in", func); 533 if (is_out)
534 val = !!(io_reg & BIT(g->out_bit));
535 else
536 val = !!(io_reg & BIT(g->in_bit));
537
538 seq_printf(s, " %-8s: %-3s", g->name, is_out ? "out" : "in");
539 seq_printf(s, " %-4s func%d", val ? "high" : "low", func);
530 seq_printf(s, " %dmA", msm_regval_to_drive(drive)); 540 seq_printf(s, " %dmA", msm_regval_to_drive(drive));
531 seq_printf(s, " %s", pulls[pull]); 541 if (pctrl->soc->pull_no_keeper)
542 seq_printf(s, " %s", pulls_no_keeper[pull]);
543 else
544 seq_printf(s, " %s", pulls_keeper[pull]);
532 seq_puts(s, "\n"); 545 seq_puts(s, "\n");
533} 546}
534 547
@@ -776,15 +789,6 @@ static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
776 return 0; 789 return 0;
777} 790}
778 791
779static struct irq_chip msm_gpio_irq_chip = {
780 .name = "msmgpio",
781 .irq_mask = msm_gpio_irq_mask,
782 .irq_unmask = msm_gpio_irq_unmask,
783 .irq_ack = msm_gpio_irq_ack,
784 .irq_set_type = msm_gpio_irq_set_type,
785 .irq_set_wake = msm_gpio_irq_set_wake,
786};
787
788static void msm_gpio_irq_handler(struct irq_desc *desc) 792static void msm_gpio_irq_handler(struct irq_desc *desc)
789{ 793{
790 struct gpio_chip *gc = irq_desc_get_handler_data(desc); 794 struct gpio_chip *gc = irq_desc_get_handler_data(desc);
@@ -877,6 +881,13 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
877 chip->of_node = pctrl->dev->of_node; 881 chip->of_node = pctrl->dev->of_node;
878 chip->need_valid_mask = msm_gpio_needs_valid_mask(pctrl); 882 chip->need_valid_mask = msm_gpio_needs_valid_mask(pctrl);
879 883
884 pctrl->irq_chip.name = "msmgpio";
885 pctrl->irq_chip.irq_mask = msm_gpio_irq_mask;
886 pctrl->irq_chip.irq_unmask = msm_gpio_irq_unmask;
887 pctrl->irq_chip.irq_ack = msm_gpio_irq_ack;
888 pctrl->irq_chip.irq_set_type = msm_gpio_irq_set_type;
889 pctrl->irq_chip.irq_set_wake = msm_gpio_irq_set_wake;
890
880 ret = gpiochip_add_data(&pctrl->chip, pctrl); 891 ret = gpiochip_add_data(&pctrl->chip, pctrl);
881 if (ret) { 892 if (ret) {
882 dev_err(pctrl->dev, "Failed register gpiochip\n"); 893 dev_err(pctrl->dev, "Failed register gpiochip\n");
@@ -890,15 +901,28 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
890 return ret; 901 return ret;
891 } 902 }
892 903
893 ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev), 0, 0, chip->ngpio); 904 /*
894 if (ret) { 905 * For DeviceTree-supported systems, the gpio core checks the
895 dev_err(pctrl->dev, "Failed to add pin range\n"); 906 * pinctrl's device node for the "gpio-ranges" property.
896 gpiochip_remove(&pctrl->chip); 907 * If it is present, it takes care of adding the pin ranges
897 return ret; 908 * for the driver. In this case the driver can skip ahead.
909 *
910 * In order to remain compatible with older, existing DeviceTree
911 * files which don't set the "gpio-ranges" property or systems that
912 * utilize ACPI the driver has to call gpiochip_add_pin_range().
913 */
914 if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) {
915 ret = gpiochip_add_pin_range(&pctrl->chip,
916 dev_name(pctrl->dev), 0, 0, chip->ngpio);
917 if (ret) {
918 dev_err(pctrl->dev, "Failed to add pin range\n");
919 gpiochip_remove(&pctrl->chip);
920 return ret;
921 }
898 } 922 }
899 923
900 ret = gpiochip_irqchip_add(chip, 924 ret = gpiochip_irqchip_add(chip,
901 &msm_gpio_irq_chip, 925 &pctrl->irq_chip,
902 0, 926 0,
903 handle_edge_irq, 927 handle_edge_irq,
904 IRQ_TYPE_NONE); 928 IRQ_TYPE_NONE);
@@ -908,7 +932,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
908 return -ENOSYS; 932 return -ENOSYS;
909 } 933 }
910 934
911 gpiochip_set_chained_irqchip(chip, &msm_gpio_irq_chip, pctrl->irq, 935 gpiochip_set_chained_irqchip(chip, &pctrl->irq_chip, pctrl->irq,
912 msm_gpio_irq_handler); 936 msm_gpio_irq_handler);
913 937
914 return 0; 938 return 0;
@@ -979,11 +1003,15 @@ int msm_pinctrl_probe(struct platform_device *pdev,
979 return pctrl->irq; 1003 return pctrl->irq;
980 } 1004 }
981 1005
982 msm_pinctrl_desc.name = dev_name(&pdev->dev); 1006 pctrl->desc.owner = THIS_MODULE;
983 msm_pinctrl_desc.pins = pctrl->soc->pins; 1007 pctrl->desc.pctlops = &msm_pinctrl_ops;
984 msm_pinctrl_desc.npins = pctrl->soc->npins; 1008 pctrl->desc.pmxops = &msm_pinmux_ops;
985 pctrl->pctrl = devm_pinctrl_register(&pdev->dev, &msm_pinctrl_desc, 1009 pctrl->desc.confops = &msm_pinconf_ops;
986 pctrl); 1010 pctrl->desc.name = dev_name(&pdev->dev);
1011 pctrl->desc.pins = pctrl->soc->pins;
1012 pctrl->desc.npins = pctrl->soc->npins;
1013
1014 pctrl->pctrl = devm_pinctrl_register(&pdev->dev, &pctrl->desc, pctrl);
987 if (IS_ERR(pctrl->pctrl)) { 1015 if (IS_ERR(pctrl->pctrl)) {
988 dev_err(&pdev->dev, "Couldn't register pinctrl driver\n"); 1016 dev_err(&pdev->dev, "Couldn't register pinctrl driver\n");
989 return PTR_ERR(pctrl->pctrl); 1017 return PTR_ERR(pctrl->pctrl);
diff --git a/drivers/pinctrl/qcom/pinctrl-qdf2xxx.c b/drivers/pinctrl/qcom/pinctrl-qdf2xxx.c
index bb3ce5c3e18b..1dfbe42dd895 100644
--- a/drivers/pinctrl/qcom/pinctrl-qdf2xxx.c
+++ b/drivers/pinctrl/qcom/pinctrl-qdf2xxx.c
@@ -30,9 +30,7 @@
30 30
31#include "pinctrl-msm.h" 31#include "pinctrl-msm.h"
32 32
33static struct msm_pinctrl_soc_data qdf2xxx_pinctrl; 33/* A maximum of 256 allows us to use a u8 array to hold the GPIO numbers */
34
35/* A reasonable limit to the number of GPIOS */
36#define MAX_GPIOS 256 34#define MAX_GPIOS 256
37 35
38/* maximum size of each gpio name (enough room for "gpioXXX" + null) */ 36/* maximum size of each gpio name (enough room for "gpioXXX" + null) */
@@ -40,77 +38,111 @@ static struct msm_pinctrl_soc_data qdf2xxx_pinctrl;
40 38
41static int qdf2xxx_pinctrl_probe(struct platform_device *pdev) 39static int qdf2xxx_pinctrl_probe(struct platform_device *pdev)
42{ 40{
41 struct msm_pinctrl_soc_data *pinctrl;
43 struct pinctrl_pin_desc *pins; 42 struct pinctrl_pin_desc *pins;
44 struct msm_pingroup *groups; 43 struct msm_pingroup *groups;
45 char (*names)[NAME_SIZE]; 44 char (*names)[NAME_SIZE];
46 unsigned int i; 45 unsigned int i;
47 u32 num_gpios; 46 u32 num_gpios;
47 unsigned int avail_gpios; /* The number of GPIOs we support */
48 u8 gpios[MAX_GPIOS]; /* An array of supported GPIOs */
48 int ret; 49 int ret;
49 50
50 /* Query the number of GPIOs from ACPI */ 51 /* Query the number of GPIOs from ACPI */
51 ret = device_property_read_u32(&pdev->dev, "num-gpios", &num_gpios); 52 ret = device_property_read_u32(&pdev->dev, "num-gpios", &num_gpios);
52 if (ret < 0) { 53 if (ret < 0) {
53 dev_warn(&pdev->dev, "missing num-gpios property\n"); 54 dev_err(&pdev->dev, "missing 'num-gpios' property\n");
54 return ret; 55 return ret;
55 } 56 }
56
57 if (!num_gpios || num_gpios > MAX_GPIOS) { 57 if (!num_gpios || num_gpios > MAX_GPIOS) {
58 dev_warn(&pdev->dev, "invalid num-gpios property\n"); 58 dev_err(&pdev->dev, "invalid 'num-gpios' property\n");
59 return -ENODEV;
60 }
61
62 /* The number of GPIOs in the approved list */
63 ret = device_property_read_u8_array(&pdev->dev, "gpios", NULL, 0);
64 if (ret < 0) {
65 dev_err(&pdev->dev, "missing 'gpios' property\n");
66 return ret;
67 }
68 /*
69 * The number of available GPIOs should be non-zero, and no
70 * more than the total number of GPIOS.
71 */
72 if (!ret || ret > num_gpios) {
73 dev_err(&pdev->dev, "invalid 'gpios' property\n");
59 return -ENODEV; 74 return -ENODEV;
60 } 75 }
76 avail_gpios = ret;
61 77
78 ret = device_property_read_u8_array(&pdev->dev, "gpios", gpios,
79 avail_gpios);
80 if (ret < 0) {
81 dev_err(&pdev->dev, "could not read list of GPIOs\n");
82 return ret;
83 }
84
85 pinctrl = devm_kzalloc(&pdev->dev, sizeof(*pinctrl), GFP_KERNEL);
62 pins = devm_kcalloc(&pdev->dev, num_gpios, 86 pins = devm_kcalloc(&pdev->dev, num_gpios,
63 sizeof(struct pinctrl_pin_desc), GFP_KERNEL); 87 sizeof(struct pinctrl_pin_desc), GFP_KERNEL);
64 groups = devm_kcalloc(&pdev->dev, num_gpios, 88 groups = devm_kcalloc(&pdev->dev, num_gpios,
65 sizeof(struct msm_pingroup), GFP_KERNEL); 89 sizeof(struct msm_pingroup), GFP_KERNEL);
66 names = devm_kcalloc(&pdev->dev, num_gpios, NAME_SIZE, GFP_KERNEL); 90 names = devm_kcalloc(&pdev->dev, avail_gpios, NAME_SIZE, GFP_KERNEL);
67 91
68 if (!pins || !groups || !names) 92 if (!pinctrl || !pins || !groups || !names)
69 return -ENOMEM; 93 return -ENOMEM;
70 94
95 /*
96 * Initialize the array. GPIOs not listed in the 'gpios' array
97 * still need a number, but nothing else.
98 */
71 for (i = 0; i < num_gpios; i++) { 99 for (i = 0; i < num_gpios; i++) {
72 snprintf(names[i], NAME_SIZE, "gpio%u", i);
73
74 pins[i].number = i; 100 pins[i].number = i;
75 pins[i].name = names[i];
76
77 groups[i].npins = 1;
78 groups[i].name = names[i];
79 groups[i].pins = &pins[i].number; 101 groups[i].pins = &pins[i].number;
102 }
80 103
81 groups[i].ctl_reg = 0x10000 * i; 104 /* Populate the entries that are meant to be exposed as GPIOs. */
82 groups[i].io_reg = 0x04 + 0x10000 * i; 105 for (i = 0; i < avail_gpios; i++) {
83 groups[i].intr_cfg_reg = 0x08 + 0x10000 * i; 106 unsigned int gpio = gpios[i];
84 groups[i].intr_status_reg = 0x0c + 0x10000 * i; 107
85 groups[i].intr_target_reg = 0x08 + 0x10000 * i; 108 groups[gpio].npins = 1;
86 109 snprintf(names[i], NAME_SIZE, "gpio%u", gpio);
87 groups[i].mux_bit = 2; 110 pins[gpio].name = names[i];
88 groups[i].pull_bit = 0; 111 groups[gpio].name = names[i];
89 groups[i].drv_bit = 6; 112
90 groups[i].oe_bit = 9; 113 groups[gpio].ctl_reg = 0x10000 * gpio;
91 groups[i].in_bit = 0; 114 groups[gpio].io_reg = 0x04 + 0x10000 * gpio;
92 groups[i].out_bit = 1; 115 groups[gpio].intr_cfg_reg = 0x08 + 0x10000 * gpio;
93 groups[i].intr_enable_bit = 0; 116 groups[gpio].intr_status_reg = 0x0c + 0x10000 * gpio;
94 groups[i].intr_status_bit = 0; 117 groups[gpio].intr_target_reg = 0x08 + 0x10000 * gpio;
95 groups[i].intr_target_bit = 5; 118
96 groups[i].intr_target_kpss_val = 1; 119 groups[gpio].mux_bit = 2;
97 groups[i].intr_raw_status_bit = 4; 120 groups[gpio].pull_bit = 0;
98 groups[i].intr_polarity_bit = 1; 121 groups[gpio].drv_bit = 6;
99 groups[i].intr_detection_bit = 2; 122 groups[gpio].oe_bit = 9;
100 groups[i].intr_detection_width = 2; 123 groups[gpio].in_bit = 0;
124 groups[gpio].out_bit = 1;
125 groups[gpio].intr_enable_bit = 0;
126 groups[gpio].intr_status_bit = 0;
127 groups[gpio].intr_target_bit = 5;
128 groups[gpio].intr_target_kpss_val = 1;
129 groups[gpio].intr_raw_status_bit = 4;
130 groups[gpio].intr_polarity_bit = 1;
131 groups[gpio].intr_detection_bit = 2;
132 groups[gpio].intr_detection_width = 2;
101 } 133 }
102 134
103 qdf2xxx_pinctrl.pins = pins; 135 pinctrl->pins = pins;
104 qdf2xxx_pinctrl.groups = groups; 136 pinctrl->groups = groups;
105 qdf2xxx_pinctrl.npins = num_gpios; 137 pinctrl->npins = num_gpios;
106 qdf2xxx_pinctrl.ngroups = num_gpios; 138 pinctrl->ngroups = num_gpios;
107 qdf2xxx_pinctrl.ngpios = num_gpios; 139 pinctrl->ngpios = num_gpios;
108 140
109 return msm_pinctrl_probe(pdev, &qdf2xxx_pinctrl); 141 return msm_pinctrl_probe(pdev, pinctrl);
110} 142}
111 143
112static const struct acpi_device_id qdf2xxx_acpi_ids[] = { 144static const struct acpi_device_id qdf2xxx_acpi_ids[] = {
113 {"QCOM8001"}, 145 {"QCOM8002"},
114 {}, 146 {},
115}; 147};
116MODULE_DEVICE_TABLE(acpi, qdf2xxx_acpi_ids); 148MODULE_DEVICE_TABLE(acpi, qdf2xxx_acpi_ids);
diff --git a/drivers/pinctrl/samsung/Kconfig b/drivers/pinctrl/samsung/Kconfig
index 11b5eeb14c4a..425fadd6c346 100644
--- a/drivers/pinctrl/samsung/Kconfig
+++ b/drivers/pinctrl/samsung/Kconfig
@@ -8,26 +8,20 @@ config PINCTRL_SAMSUNG
8 select PINCONF 8 select PINCONF
9 9
10config PINCTRL_EXYNOS 10config PINCTRL_EXYNOS
11 bool "Pinctrl driver data for Samsung EXYNOS SoCs other than 5440" 11 bool "Pinctrl driver data for Samsung EXYNOS SoCs"
12 depends on OF && GPIOLIB && (ARCH_EXYNOS || ARCH_S5PV210) 12 depends on OF && GPIOLIB && (ARCH_EXYNOS || ARCH_S5PV210)
13 select PINCTRL_SAMSUNG 13 select PINCTRL_SAMSUNG
14 select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210) 14 select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
15 select PINCTRL_EXYNOS_ARM64 if ARM64 && ARCH_EXYNOS 15 select PINCTRL_EXYNOS_ARM64 if ARM64 && ARCH_EXYNOS
16 16
17config PINCTRL_EXYNOS_ARM 17config PINCTRL_EXYNOS_ARM
18 bool "ARMv7-specific pinctrl driver data for Exynos (except Exynos5440)" if COMPILE_TEST 18 bool "ARMv7-specific pinctrl driver data for Exynos" if COMPILE_TEST
19 depends on PINCTRL_EXYNOS 19 depends on PINCTRL_EXYNOS
20 20
21config PINCTRL_EXYNOS_ARM64 21config PINCTRL_EXYNOS_ARM64
22 bool "ARMv8-specific pinctrl driver data for Exynos" if COMPILE_TEST 22 bool "ARMv8-specific pinctrl driver data for Exynos" if COMPILE_TEST
23 depends on PINCTRL_EXYNOS 23 depends on PINCTRL_EXYNOS
24 24
25config PINCTRL_EXYNOS5440
26 bool "Samsung EXYNOS5440 SoC pinctrl driver"
27 depends on SOC_EXYNOS5440
28 select PINMUX
29 select PINCONF
30
31config PINCTRL_S3C24XX 25config PINCTRL_S3C24XX
32 bool "Samsung S3C24XX SoC pinctrl driver" 26 bool "Samsung S3C24XX SoC pinctrl driver"
33 depends on ARCH_S3C24XX && OF 27 depends on ARCH_S3C24XX && OF
diff --git a/drivers/pinctrl/samsung/Makefile b/drivers/pinctrl/samsung/Makefile
index df426561d067..ed951df6a112 100644
--- a/drivers/pinctrl/samsung/Makefile
+++ b/drivers/pinctrl/samsung/Makefile
@@ -5,6 +5,5 @@ obj-$(CONFIG_PINCTRL_SAMSUNG) += pinctrl-samsung.o
5obj-$(CONFIG_PINCTRL_EXYNOS) += pinctrl-exynos.o 5obj-$(CONFIG_PINCTRL_EXYNOS) += pinctrl-exynos.o
6obj-$(CONFIG_PINCTRL_EXYNOS_ARM) += pinctrl-exynos-arm.o 6obj-$(CONFIG_PINCTRL_EXYNOS_ARM) += pinctrl-exynos-arm.o
7obj-$(CONFIG_PINCTRL_EXYNOS_ARM64) += pinctrl-exynos-arm64.o 7obj-$(CONFIG_PINCTRL_EXYNOS_ARM64) += pinctrl-exynos-arm64.o
8obj-$(CONFIG_PINCTRL_EXYNOS5440) += pinctrl-exynos5440.o
9obj-$(CONFIG_PINCTRL_S3C24XX) += pinctrl-s3c24xx.o 8obj-$(CONFIG_PINCTRL_S3C24XX) += pinctrl-s3c24xx.o
10obj-$(CONFIG_PINCTRL_S3C64XX) += pinctrl-s3c64xx.o 9obj-$(CONFIG_PINCTRL_S3C64XX) += pinctrl-s3c64xx.o
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c
index 90c274490181..d82820fc349a 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos-arm.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm.c
@@ -88,6 +88,7 @@ static const struct samsung_retention_data s5pv210_retention_data __initconst =
88 88
89/* pin banks of s5pv210 pin-controller */ 89/* pin banks of s5pv210 pin-controller */
90static const struct samsung_pin_bank_data s5pv210_pin_bank[] __initconst = { 90static const struct samsung_pin_bank_data s5pv210_pin_bank[] __initconst = {
91 /* Must start with EINTG banks, ordered by EINT group number. */
91 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), 92 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
92 EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpa1", 0x04), 93 EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpa1", 0x04),
93 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08), 94 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
@@ -105,12 +106,12 @@ static const struct samsung_pin_bank_data s5pv210_pin_bank[] __initconst = {
105 EXYNOS_PIN_BANK_EINTG(7, 0x1c0, "gpg1", 0x38), 106 EXYNOS_PIN_BANK_EINTG(7, 0x1c0, "gpg1", 0x38),
106 EXYNOS_PIN_BANK_EINTG(7, 0x1e0, "gpg2", 0x3c), 107 EXYNOS_PIN_BANK_EINTG(7, 0x1e0, "gpg2", 0x3c),
107 EXYNOS_PIN_BANK_EINTG(7, 0x200, "gpg3", 0x40), 108 EXYNOS_PIN_BANK_EINTG(7, 0x200, "gpg3", 0x40),
108 EXYNOS_PIN_BANK_EINTN(7, 0x220, "gpi"),
109 EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x44), 109 EXYNOS_PIN_BANK_EINTG(8, 0x240, "gpj0", 0x44),
110 EXYNOS_PIN_BANK_EINTG(6, 0x260, "gpj1", 0x48), 110 EXYNOS_PIN_BANK_EINTG(6, 0x260, "gpj1", 0x48),
111 EXYNOS_PIN_BANK_EINTG(8, 0x280, "gpj2", 0x4c), 111 EXYNOS_PIN_BANK_EINTG(8, 0x280, "gpj2", 0x4c),
112 EXYNOS_PIN_BANK_EINTG(8, 0x2a0, "gpj3", 0x50), 112 EXYNOS_PIN_BANK_EINTG(8, 0x2a0, "gpj3", 0x50),
113 EXYNOS_PIN_BANK_EINTG(5, 0x2c0, "gpj4", 0x54), 113 EXYNOS_PIN_BANK_EINTG(5, 0x2c0, "gpj4", 0x54),
114 EXYNOS_PIN_BANK_EINTN(7, 0x220, "gpi"),
114 EXYNOS_PIN_BANK_EINTN(8, 0x2e0, "mp01"), 115 EXYNOS_PIN_BANK_EINTN(8, 0x2e0, "mp01"),
115 EXYNOS_PIN_BANK_EINTN(4, 0x300, "mp02"), 116 EXYNOS_PIN_BANK_EINTN(4, 0x300, "mp02"),
116 EXYNOS_PIN_BANK_EINTN(8, 0x320, "mp03"), 117 EXYNOS_PIN_BANK_EINTN(8, 0x320, "mp03"),
@@ -147,6 +148,7 @@ static atomic_t exynos_shared_retention_refcnt;
147 148
148/* pin banks of exynos3250 pin-controller 0 */ 149/* pin banks of exynos3250 pin-controller 0 */
149static const struct samsung_pin_bank_data exynos3250_pin_banks0[] __initconst = { 150static const struct samsung_pin_bank_data exynos3250_pin_banks0[] __initconst = {
151 /* Must start with EINTG banks, ordered by EINT group number. */
150 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), 152 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
151 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04), 153 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
152 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08), 154 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
@@ -158,6 +160,7 @@ static const struct samsung_pin_bank_data exynos3250_pin_banks0[] __initconst =
158 160
159/* pin banks of exynos3250 pin-controller 1 */ 161/* pin banks of exynos3250 pin-controller 1 */
160static const struct samsung_pin_bank_data exynos3250_pin_banks1[] __initconst = { 162static const struct samsung_pin_bank_data exynos3250_pin_banks1[] __initconst = {
163 /* Must start with EINTG banks, ordered by EINT group number. */
161 EXYNOS_PIN_BANK_EINTN(8, 0x120, "gpe0"), 164 EXYNOS_PIN_BANK_EINTN(8, 0x120, "gpe0"),
162 EXYNOS_PIN_BANK_EINTN(8, 0x140, "gpe1"), 165 EXYNOS_PIN_BANK_EINTN(8, 0x140, "gpe1"),
163 EXYNOS_PIN_BANK_EINTN(3, 0x180, "gpe2"), 166 EXYNOS_PIN_BANK_EINTN(3, 0x180, "gpe2"),
@@ -232,6 +235,7 @@ const struct samsung_pinctrl_of_match_data exynos3250_of_data __initconst = {
232 235
233/* pin banks of exynos4210 pin-controller 0 */ 236/* pin banks of exynos4210 pin-controller 0 */
234static const struct samsung_pin_bank_data exynos4210_pin_banks0[] __initconst = { 237static const struct samsung_pin_bank_data exynos4210_pin_banks0[] __initconst = {
238 /* Must start with EINTG banks, ordered by EINT group number. */
235 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), 239 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
236 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04), 240 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
237 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08), 241 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
@@ -252,6 +256,7 @@ static const struct samsung_pin_bank_data exynos4210_pin_banks0[] __initconst =
252 256
253/* pin banks of exynos4210 pin-controller 1 */ 257/* pin banks of exynos4210 pin-controller 1 */
254static const struct samsung_pin_bank_data exynos4210_pin_banks1[] __initconst = { 258static const struct samsung_pin_bank_data exynos4210_pin_banks1[] __initconst = {
259 /* Must start with EINTG banks, ordered by EINT group number. */
255 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj0", 0x00), 260 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpj0", 0x00),
256 EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpj1", 0x04), 261 EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpj1", 0x04),
257 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08), 262 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
@@ -276,6 +281,7 @@ static const struct samsung_pin_bank_data exynos4210_pin_banks1[] __initconst =
276 281
277/* pin banks of exynos4210 pin-controller 2 */ 282/* pin banks of exynos4210 pin-controller 2 */
278static const struct samsung_pin_bank_data exynos4210_pin_banks2[] __initconst = { 283static const struct samsung_pin_bank_data exynos4210_pin_banks2[] __initconst = {
284 /* Must start with EINTG banks, ordered by EINT group number. */
279 EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"), 285 EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"),
280}; 286};
281 287
@@ -346,6 +352,7 @@ const struct samsung_pinctrl_of_match_data exynos4210_of_data __initconst = {
346 352
347/* pin banks of exynos4x12 pin-controller 0 */ 353/* pin banks of exynos4x12 pin-controller 0 */
348static const struct samsung_pin_bank_data exynos4x12_pin_banks0[] __initconst = { 354static const struct samsung_pin_bank_data exynos4x12_pin_banks0[] __initconst = {
355 /* Must start with EINTG banks, ordered by EINT group number. */
349 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), 356 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
350 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04), 357 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
351 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08), 358 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpb", 0x08),
@@ -363,6 +370,7 @@ static const struct samsung_pin_bank_data exynos4x12_pin_banks0[] __initconst =
363 370
364/* pin banks of exynos4x12 pin-controller 1 */ 371/* pin banks of exynos4x12 pin-controller 1 */
365static const struct samsung_pin_bank_data exynos4x12_pin_banks1[] __initconst = { 372static const struct samsung_pin_bank_data exynos4x12_pin_banks1[] __initconst = {
373 /* Must start with EINTG banks, ordered by EINT group number. */
366 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08), 374 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpk0", 0x08),
367 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c), 375 EXYNOS_PIN_BANK_EINTG(7, 0x060, "gpk1", 0x0c),
368 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10), 376 EXYNOS_PIN_BANK_EINTG(7, 0x080, "gpk2", 0x10),
@@ -390,11 +398,13 @@ static const struct samsung_pin_bank_data exynos4x12_pin_banks1[] __initconst =
390 398
391/* pin banks of exynos4x12 pin-controller 2 */ 399/* pin banks of exynos4x12 pin-controller 2 */
392static const struct samsung_pin_bank_data exynos4x12_pin_banks2[] __initconst = { 400static const struct samsung_pin_bank_data exynos4x12_pin_banks2[] __initconst = {
401 /* Must start with EINTG banks, ordered by EINT group number. */
393 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00), 402 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
394}; 403};
395 404
396/* pin banks of exynos4x12 pin-controller 3 */ 405/* pin banks of exynos4x12 pin-controller 3 */
397static const struct samsung_pin_bank_data exynos4x12_pin_banks3[] __initconst = { 406static const struct samsung_pin_bank_data exynos4x12_pin_banks3[] __initconst = {
407 /* Must start with EINTG banks, ordered by EINT group number. */
398 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00), 408 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
399 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04), 409 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
400 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpv2", 0x08), 410 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpv2", 0x08),
@@ -449,6 +459,7 @@ const struct samsung_pinctrl_of_match_data exynos4x12_of_data __initconst = {
449 459
450/* pin banks of exynos5250 pin-controller 0 */ 460/* pin banks of exynos5250 pin-controller 0 */
451static const struct samsung_pin_bank_data exynos5250_pin_banks0[] __initconst = { 461static const struct samsung_pin_bank_data exynos5250_pin_banks0[] __initconst = {
462 /* Must start with EINTG banks, ordered by EINT group number. */
452 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), 463 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
453 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04), 464 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
454 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08), 465 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
@@ -478,6 +489,7 @@ static const struct samsung_pin_bank_data exynos5250_pin_banks0[] __initconst =
478 489
479/* pin banks of exynos5250 pin-controller 1 */ 490/* pin banks of exynos5250 pin-controller 1 */
480static const struct samsung_pin_bank_data exynos5250_pin_banks1[] __initconst = { 491static const struct samsung_pin_bank_data exynos5250_pin_banks1[] __initconst = {
492 /* Must start with EINTG banks, ordered by EINT group number. */
481 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00), 493 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00),
482 EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04), 494 EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04),
483 EXYNOS_PIN_BANK_EINTG(4, 0x040, "gpf0", 0x08), 495 EXYNOS_PIN_BANK_EINTG(4, 0x040, "gpf0", 0x08),
@@ -491,6 +503,7 @@ static const struct samsung_pin_bank_data exynos5250_pin_banks1[] __initconst =
491 503
492/* pin banks of exynos5250 pin-controller 2 */ 504/* pin banks of exynos5250 pin-controller 2 */
493static const struct samsung_pin_bank_data exynos5250_pin_banks2[] __initconst = { 505static const struct samsung_pin_bank_data exynos5250_pin_banks2[] __initconst = {
506 /* Must start with EINTG banks, ordered by EINT group number. */
494 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00), 507 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
495 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04), 508 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
496 EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv2", 0x08), 509 EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv2", 0x08),
@@ -500,6 +513,7 @@ static const struct samsung_pin_bank_data exynos5250_pin_banks2[] __initconst =
500 513
501/* pin banks of exynos5250 pin-controller 3 */ 514/* pin banks of exynos5250 pin-controller 3 */
502static const struct samsung_pin_bank_data exynos5250_pin_banks3[] __initconst = { 515static const struct samsung_pin_bank_data exynos5250_pin_banks3[] __initconst = {
516 /* Must start with EINTG banks, ordered by EINT group number. */
503 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00), 517 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
504}; 518};
505 519
@@ -550,6 +564,7 @@ const struct samsung_pinctrl_of_match_data exynos5250_of_data __initconst = {
550 564
551/* pin banks of exynos5260 pin-controller 0 */ 565/* pin banks of exynos5260 pin-controller 0 */
552static const struct samsung_pin_bank_data exynos5260_pin_banks0[] __initconst = { 566static const struct samsung_pin_bank_data exynos5260_pin_banks0[] __initconst = {
567 /* Must start with EINTG banks, ordered by EINT group number. */
553 EXYNOS_PIN_BANK_EINTG(4, 0x000, "gpa0", 0x00), 568 EXYNOS_PIN_BANK_EINTG(4, 0x000, "gpa0", 0x00),
554 EXYNOS_PIN_BANK_EINTG(7, 0x020, "gpa1", 0x04), 569 EXYNOS_PIN_BANK_EINTG(7, 0x020, "gpa1", 0x04),
555 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08), 570 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
@@ -575,6 +590,7 @@ static const struct samsung_pin_bank_data exynos5260_pin_banks0[] __initconst =
575 590
576/* pin banks of exynos5260 pin-controller 1 */ 591/* pin banks of exynos5260 pin-controller 1 */
577static const struct samsung_pin_bank_data exynos5260_pin_banks1[] __initconst = { 592static const struct samsung_pin_bank_data exynos5260_pin_banks1[] __initconst = {
593 /* Must start with EINTG banks, ordered by EINT group number. */
578 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpc0", 0x00), 594 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpc0", 0x00),
579 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpc1", 0x04), 595 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpc1", 0x04),
580 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpc2", 0x08), 596 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpc2", 0x08),
@@ -584,6 +600,7 @@ static const struct samsung_pin_bank_data exynos5260_pin_banks1[] __initconst =
584 600
585/* pin banks of exynos5260 pin-controller 2 */ 601/* pin banks of exynos5260 pin-controller 2 */
586static const struct samsung_pin_bank_data exynos5260_pin_banks2[] __initconst = { 602static const struct samsung_pin_bank_data exynos5260_pin_banks2[] __initconst = {
603 /* Must start with EINTG banks, ordered by EINT group number. */
587 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00), 604 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00),
588 EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04), 605 EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04),
589}; 606};
@@ -619,6 +636,7 @@ const struct samsung_pinctrl_of_match_data exynos5260_of_data __initconst = {
619 636
620/* pin banks of exynos5410 pin-controller 0 */ 637/* pin banks of exynos5410 pin-controller 0 */
621static const struct samsung_pin_bank_data exynos5410_pin_banks0[] __initconst = { 638static const struct samsung_pin_bank_data exynos5410_pin_banks0[] __initconst = {
639 /* Must start with EINTG banks, ordered by EINT group number. */
622 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), 640 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
623 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04), 641 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
624 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08), 642 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
@@ -630,7 +648,6 @@ static const struct samsung_pin_bank_data exynos5410_pin_banks0[] __initconst =
630 EXYNOS_PIN_BANK_EINTG(4, 0x100, "gpc3", 0x20), 648 EXYNOS_PIN_BANK_EINTG(4, 0x100, "gpc3", 0x20),
631 EXYNOS_PIN_BANK_EINTG(7, 0x120, "gpc1", 0x24), 649 EXYNOS_PIN_BANK_EINTG(7, 0x120, "gpc1", 0x24),
632 EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpc2", 0x28), 650 EXYNOS_PIN_BANK_EINTG(7, 0x140, "gpc2", 0x28),
633 EXYNOS_PIN_BANK_EINTN(2, 0x160, "gpm5"),
634 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpd1", 0x2c), 651 EXYNOS_PIN_BANK_EINTG(8, 0x180, "gpd1", 0x2c),
635 EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpe0", 0x30), 652 EXYNOS_PIN_BANK_EINTG(8, 0x1A0, "gpe0", 0x30),
636 EXYNOS_PIN_BANK_EINTG(2, 0x1C0, "gpe1", 0x34), 653 EXYNOS_PIN_BANK_EINTG(2, 0x1C0, "gpe1", 0x34),
@@ -641,6 +658,7 @@ static const struct samsung_pin_bank_data exynos5410_pin_banks0[] __initconst =
641 EXYNOS_PIN_BANK_EINTG(2, 0x260, "gpg2", 0x48), 658 EXYNOS_PIN_BANK_EINTG(2, 0x260, "gpg2", 0x48),
642 EXYNOS_PIN_BANK_EINTG(4, 0x280, "gph0", 0x4c), 659 EXYNOS_PIN_BANK_EINTG(4, 0x280, "gph0", 0x4c),
643 EXYNOS_PIN_BANK_EINTG(8, 0x2A0, "gph1", 0x50), 660 EXYNOS_PIN_BANK_EINTG(8, 0x2A0, "gph1", 0x50),
661 EXYNOS_PIN_BANK_EINTN(2, 0x160, "gpm5"),
644 EXYNOS_PIN_BANK_EINTN(8, 0x2C0, "gpm7"), 662 EXYNOS_PIN_BANK_EINTN(8, 0x2C0, "gpm7"),
645 EXYNOS_PIN_BANK_EINTN(6, 0x2E0, "gpy0"), 663 EXYNOS_PIN_BANK_EINTN(6, 0x2E0, "gpy0"),
646 EXYNOS_PIN_BANK_EINTN(4, 0x300, "gpy1"), 664 EXYNOS_PIN_BANK_EINTN(4, 0x300, "gpy1"),
@@ -658,6 +676,7 @@ static const struct samsung_pin_bank_data exynos5410_pin_banks0[] __initconst =
658 676
659/* pin banks of exynos5410 pin-controller 1 */ 677/* pin banks of exynos5410 pin-controller 1 */
660static const struct samsung_pin_bank_data exynos5410_pin_banks1[] __initconst = { 678static const struct samsung_pin_bank_data exynos5410_pin_banks1[] __initconst = {
679 /* Must start with EINTG banks, ordered by EINT group number. */
661 EXYNOS_PIN_BANK_EINTG(5, 0x000, "gpj0", 0x00), 680 EXYNOS_PIN_BANK_EINTG(5, 0x000, "gpj0", 0x00),
662 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpj1", 0x04), 681 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpj1", 0x04),
663 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpj2", 0x08), 682 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpj2", 0x08),
@@ -671,6 +690,7 @@ static const struct samsung_pin_bank_data exynos5410_pin_banks1[] __initconst =
671 690
672/* pin banks of exynos5410 pin-controller 2 */ 691/* pin banks of exynos5410 pin-controller 2 */
673static const struct samsung_pin_bank_data exynos5410_pin_banks2[] __initconst = { 692static const struct samsung_pin_bank_data exynos5410_pin_banks2[] __initconst = {
693 /* Must start with EINTG banks, ordered by EINT group number. */
674 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00), 694 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpv0", 0x00),
675 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04), 695 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpv1", 0x04),
676 EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv2", 0x08), 696 EXYNOS_PIN_BANK_EINTG(8, 0x060, "gpv2", 0x08),
@@ -680,6 +700,7 @@ static const struct samsung_pin_bank_data exynos5410_pin_banks2[] __initconst =
680 700
681/* pin banks of exynos5410 pin-controller 3 */ 701/* pin banks of exynos5410 pin-controller 3 */
682static const struct samsung_pin_bank_data exynos5410_pin_banks3[] __initconst = { 702static const struct samsung_pin_bank_data exynos5410_pin_banks3[] __initconst = {
703 /* Must start with EINTG banks, ordered by EINT group number. */
683 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00), 704 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
684}; 705};
685 706
@@ -727,6 +748,7 @@ const struct samsung_pinctrl_of_match_data exynos5410_of_data __initconst = {
727 748
728/* pin banks of exynos5420 pin-controller 0 */ 749/* pin banks of exynos5420 pin-controller 0 */
729static const struct samsung_pin_bank_data exynos5420_pin_banks0[] __initconst = { 750static const struct samsung_pin_bank_data exynos5420_pin_banks0[] __initconst = {
751 /* Must start with EINTG banks, ordered by EINT group number. */
730 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpy7", 0x00), 752 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpy7", 0x00),
731 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00), 753 EXYNOS_PIN_BANK_EINTW(8, 0xC00, "gpx0", 0x00),
732 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04), 754 EXYNOS_PIN_BANK_EINTW(8, 0xC20, "gpx1", 0x04),
@@ -736,6 +758,7 @@ static const struct samsung_pin_bank_data exynos5420_pin_banks0[] __initconst =
736 758
737/* pin banks of exynos5420 pin-controller 1 */ 759/* pin banks of exynos5420 pin-controller 1 */
738static const struct samsung_pin_bank_data exynos5420_pin_banks1[] __initconst = { 760static const struct samsung_pin_bank_data exynos5420_pin_banks1[] __initconst = {
761 /* Must start with EINTG banks, ordered by EINT group number. */
739 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpc0", 0x00), 762 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpc0", 0x00),
740 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpc1", 0x04), 763 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpc1", 0x04),
741 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpc2", 0x08), 764 EXYNOS_PIN_BANK_EINTG(7, 0x040, "gpc2", 0x08),
@@ -753,6 +776,7 @@ static const struct samsung_pin_bank_data exynos5420_pin_banks1[] __initconst =
753 776
754/* pin banks of exynos5420 pin-controller 2 */ 777/* pin banks of exynos5420 pin-controller 2 */
755static const struct samsung_pin_bank_data exynos5420_pin_banks2[] __initconst = { 778static const struct samsung_pin_bank_data exynos5420_pin_banks2[] __initconst = {
779 /* Must start with EINTG banks, ordered by EINT group number. */
756 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00), 780 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpe0", 0x00),
757 EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04), 781 EXYNOS_PIN_BANK_EINTG(2, 0x020, "gpe1", 0x04),
758 EXYNOS_PIN_BANK_EINTG(6, 0x040, "gpf0", 0x08), 782 EXYNOS_PIN_BANK_EINTG(6, 0x040, "gpf0", 0x08),
@@ -765,6 +789,7 @@ static const struct samsung_pin_bank_data exynos5420_pin_banks2[] __initconst =
765 789
766/* pin banks of exynos5420 pin-controller 3 */ 790/* pin banks of exynos5420 pin-controller 3 */
767static const struct samsung_pin_bank_data exynos5420_pin_banks3[] __initconst = { 791static const struct samsung_pin_bank_data exynos5420_pin_banks3[] __initconst = {
792 /* Must start with EINTG banks, ordered by EINT group number. */
768 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), 793 EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00),
769 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04), 794 EXYNOS_PIN_BANK_EINTG(6, 0x020, "gpa1", 0x04),
770 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08), 795 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpa2", 0x08),
@@ -778,6 +803,7 @@ static const struct samsung_pin_bank_data exynos5420_pin_banks3[] __initconst =
778 803
779/* pin banks of exynos5420 pin-controller 4 */ 804/* pin banks of exynos5420 pin-controller 4 */
780static const struct samsung_pin_bank_data exynos5420_pin_banks4[] __initconst = { 805static const struct samsung_pin_bank_data exynos5420_pin_banks4[] __initconst = {
806 /* Must start with EINTG banks, ordered by EINT group number. */
781 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00), 807 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00),
782}; 808};
783 809
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c b/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
index 71c9d1d9f345..b6e56422a700 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
+++ b/drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
@@ -45,6 +45,7 @@ static atomic_t exynos_shared_retention_refcnt;
45 45
46/* pin banks of exynos5433 pin-controller - ALIVE */ 46/* pin banks of exynos5433 pin-controller - ALIVE */
47static const struct samsung_pin_bank_data exynos5433_pin_banks0[] __initconst = { 47static const struct samsung_pin_bank_data exynos5433_pin_banks0[] __initconst = {
48 /* Must start with EINTG banks, ordered by EINT group number. */
48 EXYNOS5433_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00), 49 EXYNOS5433_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00),
49 EXYNOS5433_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04), 50 EXYNOS5433_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04),
50 EXYNOS5433_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08), 51 EXYNOS5433_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08),
@@ -58,27 +59,32 @@ static const struct samsung_pin_bank_data exynos5433_pin_banks0[] __initconst =
58 59
59/* pin banks of exynos5433 pin-controller - AUD */ 60/* pin banks of exynos5433 pin-controller - AUD */
60static const struct samsung_pin_bank_data exynos5433_pin_banks1[] __initconst = { 61static const struct samsung_pin_bank_data exynos5433_pin_banks1[] __initconst = {
62 /* Must start with EINTG banks, ordered by EINT group number. */
61 EXYNOS5433_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00), 63 EXYNOS5433_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00),
62 EXYNOS5433_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04), 64 EXYNOS5433_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04),
63}; 65};
64 66
65/* pin banks of exynos5433 pin-controller - CPIF */ 67/* pin banks of exynos5433 pin-controller - CPIF */
66static const struct samsung_pin_bank_data exynos5433_pin_banks2[] __initconst = { 68static const struct samsung_pin_bank_data exynos5433_pin_banks2[] __initconst = {
69 /* Must start with EINTG banks, ordered by EINT group number. */
67 EXYNOS5433_PIN_BANK_EINTG(2, 0x000, "gpv6", 0x00), 70 EXYNOS5433_PIN_BANK_EINTG(2, 0x000, "gpv6", 0x00),
68}; 71};
69 72
70/* pin banks of exynos5433 pin-controller - eSE */ 73/* pin banks of exynos5433 pin-controller - eSE */
71static const struct samsung_pin_bank_data exynos5433_pin_banks3[] __initconst = { 74static const struct samsung_pin_bank_data exynos5433_pin_banks3[] __initconst = {
75 /* Must start with EINTG banks, ordered by EINT group number. */
72 EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj2", 0x00), 76 EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj2", 0x00),
73}; 77};
74 78
75/* pin banks of exynos5433 pin-controller - FINGER */ 79/* pin banks of exynos5433 pin-controller - FINGER */
76static const struct samsung_pin_bank_data exynos5433_pin_banks4[] __initconst = { 80static const struct samsung_pin_bank_data exynos5433_pin_banks4[] __initconst = {
81 /* Must start with EINTG banks, ordered by EINT group number. */
77 EXYNOS5433_PIN_BANK_EINTG(4, 0x000, "gpd5", 0x00), 82 EXYNOS5433_PIN_BANK_EINTG(4, 0x000, "gpd5", 0x00),
78}; 83};
79 84
80/* pin banks of exynos5433 pin-controller - FSYS */ 85/* pin banks of exynos5433 pin-controller - FSYS */
81static const struct samsung_pin_bank_data exynos5433_pin_banks5[] __initconst = { 86static const struct samsung_pin_bank_data exynos5433_pin_banks5[] __initconst = {
87 /* Must start with EINTG banks, ordered by EINT group number. */
82 EXYNOS5433_PIN_BANK_EINTG(6, 0x000, "gph1", 0x00), 88 EXYNOS5433_PIN_BANK_EINTG(6, 0x000, "gph1", 0x00),
83 EXYNOS5433_PIN_BANK_EINTG(7, 0x020, "gpr4", 0x04), 89 EXYNOS5433_PIN_BANK_EINTG(7, 0x020, "gpr4", 0x04),
84 EXYNOS5433_PIN_BANK_EINTG(5, 0x040, "gpr0", 0x08), 90 EXYNOS5433_PIN_BANK_EINTG(5, 0x040, "gpr0", 0x08),
@@ -89,16 +95,19 @@ static const struct samsung_pin_bank_data exynos5433_pin_banks5[] __initconst =
89 95
90/* pin banks of exynos5433 pin-controller - IMEM */ 96/* pin banks of exynos5433 pin-controller - IMEM */
91static const struct samsung_pin_bank_data exynos5433_pin_banks6[] __initconst = { 97static const struct samsung_pin_bank_data exynos5433_pin_banks6[] __initconst = {
98 /* Must start with EINTG banks, ordered by EINT group number. */
92 EXYNOS5433_PIN_BANK_EINTG(8, 0x000, "gpf0", 0x00), 99 EXYNOS5433_PIN_BANK_EINTG(8, 0x000, "gpf0", 0x00),
93}; 100};
94 101
95/* pin banks of exynos5433 pin-controller - NFC */ 102/* pin banks of exynos5433 pin-controller - NFC */
96static const struct samsung_pin_bank_data exynos5433_pin_banks7[] __initconst = { 103static const struct samsung_pin_bank_data exynos5433_pin_banks7[] __initconst = {
104 /* Must start with EINTG banks, ordered by EINT group number. */
97 EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj0", 0x00), 105 EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj0", 0x00),
98}; 106};
99 107
100/* pin banks of exynos5433 pin-controller - PERIC */ 108/* pin banks of exynos5433 pin-controller - PERIC */
101static const struct samsung_pin_bank_data exynos5433_pin_banks8[] __initconst = { 109static const struct samsung_pin_bank_data exynos5433_pin_banks8[] __initconst = {
110 /* Must start with EINTG banks, ordered by EINT group number. */
102 EXYNOS5433_PIN_BANK_EINTG(6, 0x000, "gpv7", 0x00), 111 EXYNOS5433_PIN_BANK_EINTG(6, 0x000, "gpv7", 0x00),
103 EXYNOS5433_PIN_BANK_EINTG(5, 0x020, "gpb0", 0x04), 112 EXYNOS5433_PIN_BANK_EINTG(5, 0x020, "gpb0", 0x04),
104 EXYNOS5433_PIN_BANK_EINTG(8, 0x040, "gpc0", 0x08), 113 EXYNOS5433_PIN_BANK_EINTG(8, 0x040, "gpc0", 0x08),
@@ -120,6 +129,7 @@ static const struct samsung_pin_bank_data exynos5433_pin_banks8[] __initconst =
120 129
121/* pin banks of exynos5433 pin-controller - TOUCH */ 130/* pin banks of exynos5433 pin-controller - TOUCH */
122static const struct samsung_pin_bank_data exynos5433_pin_banks9[] __initconst = { 131static const struct samsung_pin_bank_data exynos5433_pin_banks9[] __initconst = {
132 /* Must start with EINTG banks, ordered by EINT group number. */
123 EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj1", 0x00), 133 EXYNOS5433_PIN_BANK_EINTG(3, 0x000, "gpj1", 0x00),
124}; 134};
125 135
@@ -267,6 +277,7 @@ const struct samsung_pinctrl_of_match_data exynos5433_of_data __initconst = {
267 277
268/* pin banks of exynos7 pin-controller - ALIVE */ 278/* pin banks of exynos7 pin-controller - ALIVE */
269static const struct samsung_pin_bank_data exynos7_pin_banks0[] __initconst = { 279static const struct samsung_pin_bank_data exynos7_pin_banks0[] __initconst = {
280 /* Must start with EINTG banks, ordered by EINT group number. */
270 EXYNOS_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00), 281 EXYNOS_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00),
271 EXYNOS_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04), 282 EXYNOS_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04),
272 EXYNOS_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08), 283 EXYNOS_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08),
@@ -275,6 +286,7 @@ static const struct samsung_pin_bank_data exynos7_pin_banks0[] __initconst = {
275 286
276/* pin banks of exynos7 pin-controller - BUS0 */ 287/* pin banks of exynos7 pin-controller - BUS0 */
277static const struct samsung_pin_bank_data exynos7_pin_banks1[] __initconst = { 288static const struct samsung_pin_bank_data exynos7_pin_banks1[] __initconst = {
289 /* Must start with EINTG banks, ordered by EINT group number. */
278 EXYNOS_PIN_BANK_EINTG(5, 0x000, "gpb0", 0x00), 290 EXYNOS_PIN_BANK_EINTG(5, 0x000, "gpb0", 0x00),
279 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpc0", 0x04), 291 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpc0", 0x04),
280 EXYNOS_PIN_BANK_EINTG(2, 0x040, "gpc1", 0x08), 292 EXYNOS_PIN_BANK_EINTG(2, 0x040, "gpc1", 0x08),
@@ -294,31 +306,37 @@ static const struct samsung_pin_bank_data exynos7_pin_banks1[] __initconst = {
294 306
295/* pin banks of exynos7 pin-controller - NFC */ 307/* pin banks of exynos7 pin-controller - NFC */
296static const struct samsung_pin_bank_data exynos7_pin_banks2[] __initconst = { 308static const struct samsung_pin_bank_data exynos7_pin_banks2[] __initconst = {
309 /* Must start with EINTG banks, ordered by EINT group number. */
297 EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj0", 0x00), 310 EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj0", 0x00),
298}; 311};
299 312
300/* pin banks of exynos7 pin-controller - TOUCH */ 313/* pin banks of exynos7 pin-controller - TOUCH */
301static const struct samsung_pin_bank_data exynos7_pin_banks3[] __initconst = { 314static const struct samsung_pin_bank_data exynos7_pin_banks3[] __initconst = {
315 /* Must start with EINTG banks, ordered by EINT group number. */
302 EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj1", 0x00), 316 EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj1", 0x00),
303}; 317};
304 318
305/* pin banks of exynos7 pin-controller - FF */ 319/* pin banks of exynos7 pin-controller - FF */
306static const struct samsung_pin_bank_data exynos7_pin_banks4[] __initconst = { 320static const struct samsung_pin_bank_data exynos7_pin_banks4[] __initconst = {
321 /* Must start with EINTG banks, ordered by EINT group number. */
307 EXYNOS_PIN_BANK_EINTG(4, 0x000, "gpg4", 0x00), 322 EXYNOS_PIN_BANK_EINTG(4, 0x000, "gpg4", 0x00),
308}; 323};
309 324
310/* pin banks of exynos7 pin-controller - ESE */ 325/* pin banks of exynos7 pin-controller - ESE */
311static const struct samsung_pin_bank_data exynos7_pin_banks5[] __initconst = { 326static const struct samsung_pin_bank_data exynos7_pin_banks5[] __initconst = {
327 /* Must start with EINTG banks, ordered by EINT group number. */
312 EXYNOS_PIN_BANK_EINTG(5, 0x000, "gpv7", 0x00), 328 EXYNOS_PIN_BANK_EINTG(5, 0x000, "gpv7", 0x00),
313}; 329};
314 330
315/* pin banks of exynos7 pin-controller - FSYS0 */ 331/* pin banks of exynos7 pin-controller - FSYS0 */
316static const struct samsung_pin_bank_data exynos7_pin_banks6[] __initconst = { 332static const struct samsung_pin_bank_data exynos7_pin_banks6[] __initconst = {
333 /* Must start with EINTG banks, ordered by EINT group number. */
317 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpr4", 0x00), 334 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpr4", 0x00),
318}; 335};
319 336
320/* pin banks of exynos7 pin-controller - FSYS1 */ 337/* pin banks of exynos7 pin-controller - FSYS1 */
321static const struct samsung_pin_bank_data exynos7_pin_banks7[] __initconst = { 338static const struct samsung_pin_bank_data exynos7_pin_banks7[] __initconst = {
339 /* Must start with EINTG banks, ordered by EINT group number. */
322 EXYNOS_PIN_BANK_EINTG(4, 0x000, "gpr0", 0x00), 340 EXYNOS_PIN_BANK_EINTG(4, 0x000, "gpr0", 0x00),
323 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpr1", 0x04), 341 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpr1", 0x04),
324 EXYNOS_PIN_BANK_EINTG(5, 0x040, "gpr2", 0x08), 342 EXYNOS_PIN_BANK_EINTG(5, 0x040, "gpr2", 0x08),
@@ -327,6 +345,7 @@ static const struct samsung_pin_bank_data exynos7_pin_banks7[] __initconst = {
327 345
328/* pin banks of exynos7 pin-controller - BUS1 */ 346/* pin banks of exynos7 pin-controller - BUS1 */
329static const struct samsung_pin_bank_data exynos7_pin_banks8[] __initconst = { 347static const struct samsung_pin_bank_data exynos7_pin_banks8[] __initconst = {
348 /* Must start with EINTG banks, ordered by EINT group number. */
330 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpf0", 0x00), 349 EXYNOS_PIN_BANK_EINTG(8, 0x020, "gpf0", 0x00),
331 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpf1", 0x04), 350 EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpf1", 0x04),
332 EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpf2", 0x08), 351 EXYNOS_PIN_BANK_EINTG(4, 0x060, "gpf2", 0x08),
@@ -340,6 +359,7 @@ static const struct samsung_pin_bank_data exynos7_pin_banks8[] __initconst = {
340}; 359};
341 360
342static const struct samsung_pin_bank_data exynos7_pin_banks9[] __initconst = { 361static const struct samsung_pin_bank_data exynos7_pin_banks9[] __initconst = {
362 /* Must start with EINTG banks, ordered by EINT group number. */
343 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00), 363 EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00),
344 EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04), 364 EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04),
345}; 365};
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.h b/drivers/pinctrl/samsung/pinctrl-exynos.h
index abd43aa7eb0d..da1ec13697e7 100644
--- a/drivers/pinctrl/samsung/pinctrl-exynos.h
+++ b/drivers/pinctrl/samsung/pinctrl-exynos.h
@@ -99,7 +99,7 @@
99 99
100#define EXYNOS5433_PIN_BANK_EINTW_EXT(pins, reg, id, offs, pctl_idx) \ 100#define EXYNOS5433_PIN_BANK_EINTW_EXT(pins, reg, id, offs, pctl_idx) \
101 { \ 101 { \
102 .type = &exynos5433_bank_type_alive, \ 102 .type = &exynos5433_bank_type_off, \
103 .pctl_offset = reg, \ 103 .pctl_offset = reg, \
104 .nr_pins = pins, \ 104 .nr_pins = pins, \
105 .eint_type = EINT_TYPE_WKUP, \ 105 .eint_type = EINT_TYPE_WKUP, \
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos5440.c b/drivers/pinctrl/samsung/pinctrl-exynos5440.c
deleted file mode 100644
index 3d8d5e812839..000000000000
--- a/drivers/pinctrl/samsung/pinctrl-exynos5440.c
+++ /dev/null
@@ -1,1005 +0,0 @@
1// SPDX-License-Identifier: GPL-2.0+
2//
3// pin-controller/pin-mux/pin-config/gpio-driver for Samsung's EXYNOS5440 SoC.
4//
5// Author: Thomas Abraham <thomas.ab@samsung.com>
6//
7// Copyright (c) 2012 Samsung Electronics Co., Ltd.
8// http://www.samsung.com
9
10#include <linux/init.h>
11#include <linux/platform_device.h>
12#include <linux/io.h>
13#include <linux/slab.h>
14#include <linux/err.h>
15#include <linux/gpio/driver.h>
16#include <linux/device.h>
17#include <linux/pinctrl/pinctrl.h>
18#include <linux/pinctrl/pinmux.h>
19#include <linux/pinctrl/pinconf.h>
20#include <linux/interrupt.h>
21#include <linux/irqdomain.h>
22#include <linux/of_irq.h>
23#include "../core.h"
24
25/* EXYNOS5440 GPIO and Pinctrl register offsets */
26#define GPIO_MUX 0x00
27#define GPIO_IE 0x04
28#define GPIO_INT 0x08
29#define GPIO_TYPE 0x0C
30#define GPIO_VAL 0x10
31#define GPIO_OE 0x14
32#define GPIO_IN 0x18
33#define GPIO_PE 0x1C
34#define GPIO_PS 0x20
35#define GPIO_SR 0x24
36#define GPIO_DS0 0x28
37#define GPIO_DS1 0x2C
38
39#define EXYNOS5440_MAX_PINS 23
40#define EXYNOS5440_MAX_GPIO_INT 8
41#define PIN_NAME_LENGTH 10
42
43#define GROUP_SUFFIX "-grp"
44#define FUNCTION_SUFFIX "-mux"
45
46/*
47 * pin configuration type and its value are packed together into a 16-bits.
48 * The upper 8-bits represent the configuration type and the lower 8-bits
49 * hold the value of the configuration type.
50 */
51#define PINCFG_TYPE_MASK 0xFF
52#define PINCFG_VALUE_SHIFT 8
53#define PINCFG_VALUE_MASK (0xFF << PINCFG_VALUE_SHIFT)
54#define PINCFG_PACK(type, value) (((value) << PINCFG_VALUE_SHIFT) | type)
55#define PINCFG_UNPACK_TYPE(cfg) ((cfg) & PINCFG_TYPE_MASK)
56#define PINCFG_UNPACK_VALUE(cfg) (((cfg) & PINCFG_VALUE_MASK) >> \
57 PINCFG_VALUE_SHIFT)
58
59/**
60 * enum pincfg_type - possible pin configuration types supported.
61 * @PINCFG_TYPE_PUD: Pull up/down configuration.
62 * @PINCFG_TYPE_DRV: Drive strength configuration.
63 * @PINCFG_TYPE_SKEW_RATE: Skew rate configuration.
64 * @PINCFG_TYPE_INPUT_TYPE: Pin input type configuration.
65 */
66enum pincfg_type {
67 PINCFG_TYPE_PUD,
68 PINCFG_TYPE_DRV,
69 PINCFG_TYPE_SKEW_RATE,
70 PINCFG_TYPE_INPUT_TYPE
71};
72
73/**
74 * struct exynos5440_pin_group: represent group of pins for pincfg setting.
75 * @name: name of the pin group, used to lookup the group.
76 * @pins: the pins included in this group.
77 * @num_pins: number of pins included in this group.
78 */
79struct exynos5440_pin_group {
80 const char *name;
81 const unsigned int *pins;
82 u8 num_pins;
83};
84
85/**
86 * struct exynos5440_pmx_func: represent a pin function.
87 * @name: name of the pin function, used to lookup the function.
88 * @groups: one or more names of pin groups that provide this function.
89 * @num_groups: number of groups included in @groups.
90 * @function: the function number to be programmed when selected.
91 */
92struct exynos5440_pmx_func {
93 const char *name;
94 const char **groups;
95 u8 num_groups;
96 unsigned long function;
97};
98
99/**
100 * struct exynos5440_pinctrl_priv_data: driver's private runtime data.
101 * @reg_base: ioremapped based address of the register space.
102 * @gc: gpio chip registered with gpiolib.
103 * @pin_groups: list of pin groups parsed from device tree.
104 * @nr_groups: number of pin groups available.
105 * @pmx_functions: list of pin functions parsed from device tree.
106 * @nr_functions: number of pin functions available.
107 * @range: gpio range to register with pinctrl
108 */
109struct exynos5440_pinctrl_priv_data {
110 void __iomem *reg_base;
111 struct gpio_chip *gc;
112 struct irq_domain *irq_domain;
113
114 const struct exynos5440_pin_group *pin_groups;
115 unsigned int nr_groups;
116 const struct exynos5440_pmx_func *pmx_functions;
117 unsigned int nr_functions;
118 struct pinctrl_gpio_range range;
119};
120
121/**
122 * struct exynos5440_gpio_intr_data: private data for gpio interrupts.
123 * @priv: driver's private runtime data.
124 * @gpio_int: gpio interrupt number.
125 */
126struct exynos5440_gpio_intr_data {
127 struct exynos5440_pinctrl_priv_data *priv;
128 unsigned int gpio_int;
129};
130
131/* list of all possible config options supported */
132static struct pin_config {
133 char *prop_cfg;
134 unsigned int cfg_type;
135} pcfgs[] = {
136 { "samsung,exynos5440-pin-pud", PINCFG_TYPE_PUD },
137 { "samsung,exynos5440-pin-drv", PINCFG_TYPE_DRV },
138 { "samsung,exynos5440-pin-skew-rate", PINCFG_TYPE_SKEW_RATE },
139 { "samsung,exynos5440-pin-input-type", PINCFG_TYPE_INPUT_TYPE },
140};
141
142/* check if the selector is a valid pin group selector */
143static int exynos5440_get_group_count(struct pinctrl_dev *pctldev)
144{
145 struct exynos5440_pinctrl_priv_data *priv;
146
147 priv = pinctrl_dev_get_drvdata(pctldev);
148 return priv->nr_groups;
149}
150
151/* return the name of the group selected by the group selector */
152static const char *exynos5440_get_group_name(struct pinctrl_dev *pctldev,
153 unsigned selector)
154{
155 struct exynos5440_pinctrl_priv_data *priv;
156
157 priv = pinctrl_dev_get_drvdata(pctldev);
158 return priv->pin_groups[selector].name;
159}
160
161/* return the pin numbers associated with the specified group */
162static int exynos5440_get_group_pins(struct pinctrl_dev *pctldev,
163 unsigned selector, const unsigned **pins, unsigned *num_pins)
164{
165 struct exynos5440_pinctrl_priv_data *priv;
166
167 priv = pinctrl_dev_get_drvdata(pctldev);
168 *pins = priv->pin_groups[selector].pins;
169 *num_pins = priv->pin_groups[selector].num_pins;
170 return 0;
171}
172
173/* create pinctrl_map entries by parsing device tree nodes */
174static int exynos5440_dt_node_to_map(struct pinctrl_dev *pctldev,
175 struct device_node *np, struct pinctrl_map **maps,
176 unsigned *nmaps)
177{
178 struct device *dev = pctldev->dev;
179 struct pinctrl_map *map;
180 unsigned long *cfg = NULL;
181 char *gname, *fname;
182 int cfg_cnt = 0, map_cnt = 0, idx = 0;
183
184 /* count the number of config options specfied in the node */
185 for (idx = 0; idx < ARRAY_SIZE(pcfgs); idx++)
186 if (of_find_property(np, pcfgs[idx].prop_cfg, NULL))
187 cfg_cnt++;
188
189 /*
190 * Find out the number of map entries to create. All the config options
191 * can be accomadated into a single config map entry.
192 */
193 if (cfg_cnt)
194 map_cnt = 1;
195 if (of_find_property(np, "samsung,exynos5440-pin-function", NULL))
196 map_cnt++;
197 if (!map_cnt) {
198 dev_err(dev, "node %s does not have either config or function "
199 "configurations\n", np->name);
200 return -EINVAL;
201 }
202
203 /* Allocate memory for pin-map entries */
204 map = kzalloc(sizeof(*map) * map_cnt, GFP_KERNEL);
205 if (!map)
206 return -ENOMEM;
207 *nmaps = 0;
208
209 /*
210 * Allocate memory for pin group name. The pin group name is derived
211 * from the node name from which these map entries are be created.
212 */
213 gname = kasprintf(GFP_KERNEL, "%s%s", np->name, GROUP_SUFFIX);
214 if (!gname)
215 goto free_map;
216
217 /*
218 * don't have config options? then skip over to creating function
219 * map entries.
220 */
221 if (!cfg_cnt)
222 goto skip_cfgs;
223
224 /* Allocate memory for config entries */
225 cfg = kzalloc(sizeof(*cfg) * cfg_cnt, GFP_KERNEL);
226 if (!cfg)
227 goto free_gname;
228
229 /* Prepare a list of config settings */
230 for (idx = 0, cfg_cnt = 0; idx < ARRAY_SIZE(pcfgs); idx++) {
231 u32 value;
232 if (!of_property_read_u32(np, pcfgs[idx].prop_cfg, &value))
233 cfg[cfg_cnt++] =
234 PINCFG_PACK(pcfgs[idx].cfg_type, value);
235 }
236
237 /* create the config map entry */
238 map[*nmaps].data.configs.group_or_pin = gname;
239 map[*nmaps].data.configs.configs = cfg;
240 map[*nmaps].data.configs.num_configs = cfg_cnt;
241 map[*nmaps].type = PIN_MAP_TYPE_CONFIGS_GROUP;
242 *nmaps += 1;
243
244skip_cfgs:
245 /* create the function map entry */
246 if (of_find_property(np, "samsung,exynos5440-pin-function", NULL)) {
247 fname = kasprintf(GFP_KERNEL,
248 "%s%s", np->name, FUNCTION_SUFFIX);
249 if (!fname)
250 goto free_cfg;
251
252 map[*nmaps].data.mux.group = gname;
253 map[*nmaps].data.mux.function = fname;
254 map[*nmaps].type = PIN_MAP_TYPE_MUX_GROUP;
255 *nmaps += 1;
256 }
257
258 *maps = map;
259 return 0;
260
261free_cfg:
262 kfree(cfg);
263free_gname:
264 kfree(gname);
265free_map:
266 kfree(map);
267 return -ENOMEM;
268}
269
270/* free the memory allocated to hold the pin-map table */
271static void exynos5440_dt_free_map(struct pinctrl_dev *pctldev,
272 struct pinctrl_map *map, unsigned num_maps)
273{
274 int idx;
275
276 for (idx = 0; idx < num_maps; idx++) {
277 if (map[idx].type == PIN_MAP_TYPE_MUX_GROUP) {
278 kfree(map[idx].data.mux.function);
279 if (!idx)
280 kfree(map[idx].data.mux.group);
281 } else if (map->type == PIN_MAP_TYPE_CONFIGS_GROUP) {
282 kfree(map[idx].data.configs.configs);
283 if (!idx)
284 kfree(map[idx].data.configs.group_or_pin);
285 }
286 }
287
288 kfree(map);
289}
290
291/* list of pinctrl callbacks for the pinctrl core */
292static const struct pinctrl_ops exynos5440_pctrl_ops = {
293 .get_groups_count = exynos5440_get_group_count,
294 .get_group_name = exynos5440_get_group_name,
295 .get_group_pins = exynos5440_get_group_pins,
296 .dt_node_to_map = exynos5440_dt_node_to_map,
297 .dt_free_map = exynos5440_dt_free_map,
298};
299
300/* check if the selector is a valid pin function selector */
301static int exynos5440_get_functions_count(struct pinctrl_dev *pctldev)
302{
303 struct exynos5440_pinctrl_priv_data *priv;
304
305 priv = pinctrl_dev_get_drvdata(pctldev);
306 return priv->nr_functions;
307}
308
309/* return the name of the pin function specified */
310static const char *exynos5440_pinmux_get_fname(struct pinctrl_dev *pctldev,
311 unsigned selector)
312{
313 struct exynos5440_pinctrl_priv_data *priv;
314
315 priv = pinctrl_dev_get_drvdata(pctldev);
316 return priv->pmx_functions[selector].name;
317}
318
319/* return the groups associated for the specified function selector */
320static int exynos5440_pinmux_get_groups(struct pinctrl_dev *pctldev,
321 unsigned selector, const char * const **groups,
322 unsigned * const num_groups)
323{
324 struct exynos5440_pinctrl_priv_data *priv;
325
326 priv = pinctrl_dev_get_drvdata(pctldev);
327 *groups = priv->pmx_functions[selector].groups;
328 *num_groups = priv->pmx_functions[selector].num_groups;
329 return 0;
330}
331
332/* enable or disable a pinmux function */
333static void exynos5440_pinmux_setup(struct pinctrl_dev *pctldev, unsigned selector,
334 unsigned group, bool enable)
335{
336 struct exynos5440_pinctrl_priv_data *priv;
337 void __iomem *base;
338 u32 function;
339 u32 data;
340
341 priv = pinctrl_dev_get_drvdata(pctldev);
342 base = priv->reg_base;
343 function = priv->pmx_functions[selector].function;
344
345 data = readl(base + GPIO_MUX);
346 if (enable)
347 data |= (1 << function);
348 else
349 data &= ~(1 << function);
350 writel(data, base + GPIO_MUX);
351}
352
353/* enable a specified pinmux by writing to registers */
354static int exynos5440_pinmux_set_mux(struct pinctrl_dev *pctldev,
355 unsigned selector,
356 unsigned group)
357{
358 exynos5440_pinmux_setup(pctldev, selector, group, true);
359 return 0;
360}
361
362/*
363 * The calls to gpio_direction_output() and gpio_direction_input()
364 * leads to this function call (via the pinctrl_gpio_direction_{input|output}()
365 * function called from the gpiolib interface).
366 */
367static int exynos5440_pinmux_gpio_set_direction(struct pinctrl_dev *pctldev,
368 struct pinctrl_gpio_range *range, unsigned offset, bool input)
369{
370 return 0;
371}
372
373/* list of pinmux callbacks for the pinmux vertical in pinctrl core */
374static const struct pinmux_ops exynos5440_pinmux_ops = {
375 .get_functions_count = exynos5440_get_functions_count,
376 .get_function_name = exynos5440_pinmux_get_fname,
377 .get_function_groups = exynos5440_pinmux_get_groups,
378 .set_mux = exynos5440_pinmux_set_mux,
379 .gpio_set_direction = exynos5440_pinmux_gpio_set_direction,
380};
381
382/* set the pin config settings for a specified pin */
383static int exynos5440_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
384 unsigned long *configs,
385 unsigned num_configs)
386{
387 struct exynos5440_pinctrl_priv_data *priv;
388 void __iomem *base;
389 enum pincfg_type cfg_type;
390 u32 cfg_value;
391 u32 data;
392 int i;
393
394 priv = pinctrl_dev_get_drvdata(pctldev);
395 base = priv->reg_base;
396
397 for (i = 0; i < num_configs; i++) {
398 cfg_type = PINCFG_UNPACK_TYPE(configs[i]);
399 cfg_value = PINCFG_UNPACK_VALUE(configs[i]);
400
401 switch (cfg_type) {
402 case PINCFG_TYPE_PUD:
403 /* first set pull enable/disable bit */
404 data = readl(base + GPIO_PE);
405 data &= ~(1 << pin);
406 if (cfg_value)
407 data |= (1 << pin);
408 writel(data, base + GPIO_PE);
409
410 /* then set pull up/down bit */
411 data = readl(base + GPIO_PS);
412 data &= ~(1 << pin);
413 if (cfg_value == 2)
414 data |= (1 << pin);
415 writel(data, base + GPIO_PS);
416 break;
417
418 case PINCFG_TYPE_DRV:
419 /* set the first bit of the drive strength */
420 data = readl(base + GPIO_DS0);
421 data &= ~(1 << pin);
422 data |= ((cfg_value & 1) << pin);
423 writel(data, base + GPIO_DS0);
424 cfg_value >>= 1;
425
426 /* set the second bit of the driver strength */
427 data = readl(base + GPIO_DS1);
428 data &= ~(1 << pin);
429 data |= ((cfg_value & 1) << pin);
430 writel(data, base + GPIO_DS1);
431 break;
432 case PINCFG_TYPE_SKEW_RATE:
433 data = readl(base + GPIO_SR);
434 data &= ~(1 << pin);
435 data |= ((cfg_value & 1) << pin);
436 writel(data, base + GPIO_SR);
437 break;
438 case PINCFG_TYPE_INPUT_TYPE:
439 data = readl(base + GPIO_TYPE);
440 data &= ~(1 << pin);
441 data |= ((cfg_value & 1) << pin);
442 writel(data, base + GPIO_TYPE);
443 break;
444 default:
445 WARN_ON(1);
446 return -EINVAL;
447 }
448 } /* for each config */
449
450 return 0;
451}
452
453/* get the pin config settings for a specified pin */
454static int exynos5440_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
455 unsigned long *config)
456{
457 struct exynos5440_pinctrl_priv_data *priv;
458 void __iomem *base;
459 enum pincfg_type cfg_type = PINCFG_UNPACK_TYPE(*config);
460 u32 data;
461
462 priv = pinctrl_dev_get_drvdata(pctldev);
463 base = priv->reg_base;
464
465 switch (cfg_type) {
466 case PINCFG_TYPE_PUD:
467 data = readl(base + GPIO_PE);
468 data = (data >> pin) & 1;
469 if (!data)
470 *config = 0;
471 else
472 *config = ((readl(base + GPIO_PS) >> pin) & 1) + 1;
473 break;
474 case PINCFG_TYPE_DRV:
475 data = readl(base + GPIO_DS0);
476 data = (data >> pin) & 1;
477 *config = data;
478 data = readl(base + GPIO_DS1);
479 data = (data >> pin) & 1;
480 *config |= (data << 1);
481 break;
482 case PINCFG_TYPE_SKEW_RATE:
483 data = readl(base + GPIO_SR);
484 *config = (data >> pin) & 1;
485 break;
486 case PINCFG_TYPE_INPUT_TYPE:
487 data = readl(base + GPIO_TYPE);
488 *config = (data >> pin) & 1;
489 break;
490 default:
491 WARN_ON(1);
492 return -EINVAL;
493 }
494
495 return 0;
496}
497
498/* set the pin config settings for a specified pin group */
499static int exynos5440_pinconf_group_set(struct pinctrl_dev *pctldev,
500 unsigned group, unsigned long *configs,
501 unsigned num_configs)
502{
503 struct exynos5440_pinctrl_priv_data *priv;
504 const unsigned int *pins;
505 unsigned int cnt;
506
507 priv = pinctrl_dev_get_drvdata(pctldev);
508 pins = priv->pin_groups[group].pins;
509
510 for (cnt = 0; cnt < priv->pin_groups[group].num_pins; cnt++)
511 exynos5440_pinconf_set(pctldev, pins[cnt], configs,
512 num_configs);
513
514 return 0;
515}
516
517/* get the pin config settings for a specified pin group */
518static int exynos5440_pinconf_group_get(struct pinctrl_dev *pctldev,
519 unsigned int group, unsigned long *config)
520{
521 struct exynos5440_pinctrl_priv_data *priv;
522 const unsigned int *pins;
523
524 priv = pinctrl_dev_get_drvdata(pctldev);
525 pins = priv->pin_groups[group].pins;
526 exynos5440_pinconf_get(pctldev, pins[0], config);
527 return 0;
528}
529
530/* list of pinconfig callbacks for pinconfig vertical in the pinctrl code */
531static const struct pinconf_ops exynos5440_pinconf_ops = {
532 .pin_config_get = exynos5440_pinconf_get,
533 .pin_config_set = exynos5440_pinconf_set,
534 .pin_config_group_get = exynos5440_pinconf_group_get,
535 .pin_config_group_set = exynos5440_pinconf_group_set,
536};
537
538/* gpiolib gpio_set callback function */
539static void exynos5440_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
540{
541 struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc);
542 void __iomem *base = priv->reg_base;
543 u32 data;
544
545 data = readl(base + GPIO_VAL);
546 data &= ~(1 << offset);
547 if (value)
548 data |= 1 << offset;
549 writel(data, base + GPIO_VAL);
550}
551
552/* gpiolib gpio_get callback function */
553static int exynos5440_gpio_get(struct gpio_chip *gc, unsigned offset)
554{
555 struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc);
556 void __iomem *base = priv->reg_base;
557 u32 data;
558
559 data = readl(base + GPIO_IN);
560 data >>= offset;
561 data &= 1;
562 return data;
563}
564
565/* gpiolib gpio_direction_input callback function */
566static int exynos5440_gpio_direction_input(struct gpio_chip *gc, unsigned offset)
567{
568 struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc);
569 void __iomem *base = priv->reg_base;
570 u32 data;
571
572 /* first disable the data output enable on this pin */
573 data = readl(base + GPIO_OE);
574 data &= ~(1 << offset);
575 writel(data, base + GPIO_OE);
576
577 /* now enable input on this pin */
578 data = readl(base + GPIO_IE);
579 data |= 1 << offset;
580 writel(data, base + GPIO_IE);
581 return 0;
582}
583
584/* gpiolib gpio_direction_output callback function */
585static int exynos5440_gpio_direction_output(struct gpio_chip *gc, unsigned offset,
586 int value)
587{
588 struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc);
589 void __iomem *base = priv->reg_base;
590 u32 data;
591
592 exynos5440_gpio_set(gc, offset, value);
593
594 /* first disable the data input enable on this pin */
595 data = readl(base + GPIO_IE);
596 data &= ~(1 << offset);
597 writel(data, base + GPIO_IE);
598
599 /* now enable output on this pin */
600 data = readl(base + GPIO_OE);
601 data |= 1 << offset;
602 writel(data, base + GPIO_OE);
603 return 0;
604}
605
606/* gpiolib gpio_to_irq callback function */
607static int exynos5440_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
608{
609 struct exynos5440_pinctrl_priv_data *priv = gpiochip_get_data(gc);
610 unsigned int virq;
611
612 if (offset < 16 || offset > 23)
613 return -ENXIO;
614
615 if (!priv->irq_domain)
616 return -ENXIO;
617
618 virq = irq_create_mapping(priv->irq_domain, offset - 16);
619 return virq ? : -ENXIO;
620}
621
622/* parse the pin numbers listed in the 'samsung,exynos5440-pins' property */
623static int exynos5440_pinctrl_parse_dt_pins(struct platform_device *pdev,
624 struct device_node *cfg_np, unsigned int **pin_list,
625 unsigned int *npins)
626{
627 struct device *dev = &pdev->dev;
628 struct property *prop;
629
630 prop = of_find_property(cfg_np, "samsung,exynos5440-pins", NULL);
631 if (!prop)
632 return -ENOENT;
633
634 *npins = prop->length / sizeof(unsigned long);
635 if (!*npins) {
636 dev_err(dev, "invalid pin list in %s node", cfg_np->name);
637 return -EINVAL;
638 }
639
640 *pin_list = devm_kzalloc(dev, *npins * sizeof(**pin_list), GFP_KERNEL);
641 if (!*pin_list)
642 return -ENOMEM;
643
644 return of_property_read_u32_array(cfg_np, "samsung,exynos5440-pins",
645 *pin_list, *npins);
646}
647
648/*
649 * Parse the information about all the available pin groups and pin functions
650 * from device node of the pin-controller.
651 */
652static int exynos5440_pinctrl_parse_dt(struct platform_device *pdev,
653 struct exynos5440_pinctrl_priv_data *priv)
654{
655 struct device *dev = &pdev->dev;
656 struct device_node *dev_np = dev->of_node;
657 struct device_node *cfg_np;
658 struct exynos5440_pin_group *groups, *grp;
659 struct exynos5440_pmx_func *functions, *func;
660 unsigned *pin_list;
661 unsigned int npins, grp_cnt, func_idx = 0;
662 char *gname, *fname;
663 int ret;
664
665 grp_cnt = of_get_child_count(dev_np);
666 if (!grp_cnt)
667 return -EINVAL;
668
669 groups = devm_kzalloc(dev, grp_cnt * sizeof(*groups), GFP_KERNEL);
670 if (!groups)
671 return -EINVAL;
672
673 grp = groups;
674
675 functions = devm_kzalloc(dev, grp_cnt * sizeof(*functions), GFP_KERNEL);
676 if (!functions)
677 return -EINVAL;
678
679 func = functions;
680
681 /*
682 * Iterate over all the child nodes of the pin controller node
683 * and create pin groups and pin function lists.
684 */
685 for_each_child_of_node(dev_np, cfg_np) {
686 u32 function;
687
688 ret = exynos5440_pinctrl_parse_dt_pins(pdev, cfg_np,
689 &pin_list, &npins);
690 if (ret) {
691 gname = NULL;
692 goto skip_to_pin_function;
693 }
694
695 /* derive pin group name from the node name */
696 gname = devm_kasprintf(dev, GFP_KERNEL,
697 "%s%s", cfg_np->name, GROUP_SUFFIX);
698 if (!gname)
699 return -ENOMEM;
700
701 grp->name = gname;
702 grp->pins = pin_list;
703 grp->num_pins = npins;
704 grp++;
705
706skip_to_pin_function:
707 ret = of_property_read_u32(cfg_np, "samsung,exynos5440-pin-function",
708 &function);
709 if (ret)
710 continue;
711
712 /* derive function name from the node name */
713 fname = devm_kasprintf(dev, GFP_KERNEL,
714 "%s%s", cfg_np->name, FUNCTION_SUFFIX);
715 if (!fname)
716 return -ENOMEM;
717
718 func->name = fname;
719 func->groups = devm_kzalloc(dev, sizeof(char *), GFP_KERNEL);
720 if (!func->groups)
721 return -ENOMEM;
722 func->groups[0] = gname;
723 func->num_groups = gname ? 1 : 0;
724 func->function = function;
725 func++;
726 func_idx++;
727 }
728
729 priv->pin_groups = groups;
730 priv->nr_groups = grp_cnt;
731 priv->pmx_functions = functions;
732 priv->nr_functions = func_idx;
733 return 0;
734}
735
736/* register the pinctrl interface with the pinctrl subsystem */
737static int exynos5440_pinctrl_register(struct platform_device *pdev,
738 struct exynos5440_pinctrl_priv_data *priv)
739{
740 struct device *dev = &pdev->dev;
741 struct pinctrl_desc *ctrldesc;
742 struct pinctrl_dev *pctl_dev;
743 struct pinctrl_pin_desc *pindesc, *pdesc;
744 char *pin_names;
745 int pin, ret;
746
747 ctrldesc = devm_kzalloc(dev, sizeof(*ctrldesc), GFP_KERNEL);
748 if (!ctrldesc)
749 return -ENOMEM;
750
751 ctrldesc->name = "exynos5440-pinctrl";
752 ctrldesc->owner = THIS_MODULE;
753 ctrldesc->pctlops = &exynos5440_pctrl_ops;
754 ctrldesc->pmxops = &exynos5440_pinmux_ops;
755 ctrldesc->confops = &exynos5440_pinconf_ops;
756
757 pindesc = devm_kzalloc(&pdev->dev, sizeof(*pindesc) *
758 EXYNOS5440_MAX_PINS, GFP_KERNEL);
759 if (!pindesc)
760 return -ENOMEM;
761 ctrldesc->pins = pindesc;
762 ctrldesc->npins = EXYNOS5440_MAX_PINS;
763
764 /* dynamically populate the pin number and pin name for pindesc */
765 for (pin = 0, pdesc = pindesc; pin < ctrldesc->npins; pin++, pdesc++)
766 pdesc->number = pin;
767
768 /*
769 * allocate space for storing the dynamically generated names for all
770 * the pins which belong to this pin-controller.
771 */
772 pin_names = devm_kzalloc(&pdev->dev, sizeof(char) * PIN_NAME_LENGTH *
773 ctrldesc->npins, GFP_KERNEL);
774 if (!pin_names)
775 return -ENOMEM;
776
777 /* for each pin, set the name of the pin */
778 for (pin = 0; pin < ctrldesc->npins; pin++) {
779 snprintf(pin_names, 6, "gpio%02d", pin);
780 pdesc = pindesc + pin;
781 pdesc->name = pin_names;
782 pin_names += PIN_NAME_LENGTH;
783 }
784
785 ret = exynos5440_pinctrl_parse_dt(pdev, priv);
786 if (ret)
787 return ret;
788
789 pctl_dev = devm_pinctrl_register(&pdev->dev, ctrldesc, priv);
790 if (IS_ERR(pctl_dev)) {
791 dev_err(&pdev->dev, "could not register pinctrl driver\n");
792 return PTR_ERR(pctl_dev);
793 }
794
795 priv->range.name = "exynos5440-pctrl-gpio-range";
796 priv->range.id = 0;
797 priv->range.base = 0;
798 priv->range.npins = EXYNOS5440_MAX_PINS;
799 priv->range.gc = priv->gc;
800 pinctrl_add_gpio_range(pctl_dev, &priv->range);
801 return 0;
802}
803
804/* register the gpiolib interface with the gpiolib subsystem */
805static int exynos5440_gpiolib_register(struct platform_device *pdev,
806 struct exynos5440_pinctrl_priv_data *priv)
807{
808 struct gpio_chip *gc;
809 int ret;
810
811 gc = devm_kzalloc(&pdev->dev, sizeof(*gc), GFP_KERNEL);
812 if (!gc)
813 return -ENOMEM;
814
815 priv->gc = gc;
816 gc->base = 0;
817 gc->ngpio = EXYNOS5440_MAX_PINS;
818 gc->parent = &pdev->dev;
819 gc->set = exynos5440_gpio_set;
820 gc->get = exynos5440_gpio_get;
821 gc->direction_input = exynos5440_gpio_direction_input;
822 gc->direction_output = exynos5440_gpio_direction_output;
823 gc->to_irq = exynos5440_gpio_to_irq;
824 gc->label = "gpiolib-exynos5440";
825 gc->owner = THIS_MODULE;
826 ret = gpiochip_add_data(gc, priv);
827 if (ret) {
828 dev_err(&pdev->dev, "failed to register gpio_chip %s, error "
829 "code: %d\n", gc->label, ret);
830 return ret;
831 }
832
833 return 0;
834}
835
836/* unregister the gpiolib interface with the gpiolib subsystem */
837static int exynos5440_gpiolib_unregister(struct platform_device *pdev,
838 struct exynos5440_pinctrl_priv_data *priv)
839{
840 gpiochip_remove(priv->gc);
841 return 0;
842}
843
844static void exynos5440_gpio_irq_unmask(struct irq_data *irqd)
845{
846 struct exynos5440_pinctrl_priv_data *d;
847 unsigned long gpio_int;
848
849 d = irq_data_get_irq_chip_data(irqd);
850 gpio_int = readl(d->reg_base + GPIO_INT);
851 gpio_int |= 1 << irqd->hwirq;
852 writel(gpio_int, d->reg_base + GPIO_INT);
853}
854
855static void exynos5440_gpio_irq_mask(struct irq_data *irqd)
856{
857 struct exynos5440_pinctrl_priv_data *d;
858 unsigned long gpio_int;
859
860 d = irq_data_get_irq_chip_data(irqd);
861 gpio_int = readl(d->reg_base + GPIO_INT);
862 gpio_int &= ~(1 << irqd->hwirq);
863 writel(gpio_int, d->reg_base + GPIO_INT);
864}
865
866/* irq_chip for gpio interrupts */
867static struct irq_chip exynos5440_gpio_irq_chip = {
868 .name = "exynos5440_gpio_irq_chip",
869 .irq_unmask = exynos5440_gpio_irq_unmask,
870 .irq_mask = exynos5440_gpio_irq_mask,
871};
872
873/* interrupt handler for GPIO interrupts 0..7 */
874static irqreturn_t exynos5440_gpio_irq(int irq, void *data)
875{
876 struct exynos5440_gpio_intr_data *intd = data;
877 struct exynos5440_pinctrl_priv_data *d = intd->priv;
878 int virq;
879
880 virq = irq_linear_revmap(d->irq_domain, intd->gpio_int);
881 if (!virq)
882 return IRQ_NONE;
883 generic_handle_irq(virq);
884 return IRQ_HANDLED;
885}
886
887static int exynos5440_gpio_irq_map(struct irq_domain *h, unsigned int virq,
888 irq_hw_number_t hw)
889{
890 struct exynos5440_pinctrl_priv_data *d = h->host_data;
891
892 irq_set_chip_data(virq, d);
893 irq_set_chip_and_handler(virq, &exynos5440_gpio_irq_chip,
894 handle_level_irq);
895 return 0;
896}
897
898/* irq domain callbacks for gpio interrupt controller */
899static const struct irq_domain_ops exynos5440_gpio_irqd_ops = {
900 .map = exynos5440_gpio_irq_map,
901 .xlate = irq_domain_xlate_twocell,
902};
903
904/* setup handling of gpio interrupts */
905static int exynos5440_gpio_irq_init(struct platform_device *pdev,
906 struct exynos5440_pinctrl_priv_data *priv)
907{
908 struct device *dev = &pdev->dev;
909 struct exynos5440_gpio_intr_data *intd;
910 int i, irq, ret;
911
912 intd = devm_kzalloc(dev, sizeof(*intd) * EXYNOS5440_MAX_GPIO_INT,
913 GFP_KERNEL);
914 if (!intd)
915 return -ENOMEM;
916
917 for (i = 0; i < EXYNOS5440_MAX_GPIO_INT; i++) {
918 irq = irq_of_parse_and_map(dev->of_node, i);
919 if (irq <= 0) {
920 dev_err(dev, "irq parsing failed\n");
921 return -EINVAL;
922 }
923
924 intd->gpio_int = i;
925 intd->priv = priv;
926 ret = devm_request_irq(dev, irq, exynos5440_gpio_irq,
927 0, dev_name(dev), intd++);
928 if (ret) {
929 dev_err(dev, "irq request failed\n");
930 return -ENXIO;
931 }
932 }
933
934 priv->irq_domain = irq_domain_add_linear(dev->of_node,
935 EXYNOS5440_MAX_GPIO_INT,
936 &exynos5440_gpio_irqd_ops, priv);
937 if (!priv->irq_domain) {
938 dev_err(dev, "failed to create irq domain\n");
939 return -ENXIO;
940 }
941
942 return 0;
943}
944
945static int exynos5440_pinctrl_probe(struct platform_device *pdev)
946{
947 struct device *dev = &pdev->dev;
948 struct exynos5440_pinctrl_priv_data *priv;
949 struct resource *res;
950 int ret;
951
952 if (!dev->of_node) {
953 dev_err(dev, "device tree node not found\n");
954 return -ENODEV;
955 }
956
957 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
958 if (!priv)
959 return -ENOMEM;
960
961 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
962 priv->reg_base = devm_ioremap_resource(&pdev->dev, res);
963 if (IS_ERR(priv->reg_base))
964 return PTR_ERR(priv->reg_base);
965
966 ret = exynos5440_gpiolib_register(pdev, priv);
967 if (ret)
968 return ret;
969
970 ret = exynos5440_pinctrl_register(pdev, priv);
971 if (ret) {
972 exynos5440_gpiolib_unregister(pdev, priv);
973 return ret;
974 }
975
976 ret = exynos5440_gpio_irq_init(pdev, priv);
977 if (ret) {
978 dev_err(dev, "failed to setup gpio interrupts\n");
979 return ret;
980 }
981
982 platform_set_drvdata(pdev, priv);
983 dev_info(dev, "EXYNOS5440 pinctrl driver registered\n");
984 return 0;
985}
986
987static const struct of_device_id exynos5440_pinctrl_dt_match[] = {
988 { .compatible = "samsung,exynos5440-pinctrl" },
989 {},
990};
991
992static struct platform_driver exynos5440_pinctrl_driver = {
993 .probe = exynos5440_pinctrl_probe,
994 .driver = {
995 .name = "exynos5440-pinctrl",
996 .of_match_table = exynos5440_pinctrl_dt_match,
997 .suppress_bind_attrs = true,
998 },
999};
1000
1001static int __init exynos5440_pinctrl_drv_register(void)
1002{
1003 return platform_driver_register(&exynos5440_pinctrl_driver);
1004}
1005postcore_initcall(exynos5440_pinctrl_drv_register);
diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c
index 336e88d7bdb9..618945a0fd38 100644
--- a/drivers/pinctrl/samsung/pinctrl-samsung.c
+++ b/drivers/pinctrl/samsung/pinctrl-samsung.c
@@ -279,6 +279,32 @@ static int samsung_dt_node_to_map(struct pinctrl_dev *pctldev,
279 return 0; 279 return 0;
280} 280}
281 281
282#ifdef CONFIG_DEBUG_FS
283/* Forward declaration which can be used by samsung_pin_dbg_show */
284static int samsung_pinconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
285 unsigned long *config);
286static const char * const reg_names[] = {"CON", "DAT", "PUD", "DRV", "CON_PDN",
287 "PUD_PDN"};
288
289static void samsung_pin_dbg_show(struct pinctrl_dev *pctldev,
290 struct seq_file *s, unsigned int pin)
291{
292 enum pincfg_type cfg_type;
293 unsigned long config;
294 int ret;
295
296 for (cfg_type = 0; cfg_type < PINCFG_TYPE_NUM; cfg_type++) {
297 config = PINCFG_PACK(cfg_type, 0);
298 ret = samsung_pinconf_get(pctldev, pin, &config);
299 if (ret < 0)
300 continue;
301
302 seq_printf(s, " %s(0x%lx)", reg_names[cfg_type],
303 PINCFG_UNPACK_VALUE(config));
304 }
305}
306#endif
307
282/* list of pinctrl callbacks for the pinctrl core */ 308/* list of pinctrl callbacks for the pinctrl core */
283static const struct pinctrl_ops samsung_pctrl_ops = { 309static const struct pinctrl_ops samsung_pctrl_ops = {
284 .get_groups_count = samsung_get_group_count, 310 .get_groups_count = samsung_get_group_count,
@@ -286,6 +312,9 @@ static const struct pinctrl_ops samsung_pctrl_ops = {
286 .get_group_pins = samsung_get_group_pins, 312 .get_group_pins = samsung_get_group_pins,
287 .dt_node_to_map = samsung_dt_node_to_map, 313 .dt_node_to_map = samsung_dt_node_to_map,
288 .dt_free_map = samsung_dt_free_map, 314 .dt_free_map = samsung_dt_free_map,
315#ifdef CONFIG_DEBUG_FS
316 .pin_dbg_show = samsung_pin_dbg_show,
317#endif
289}; 318};
290 319
291/* check if the selector is a valid pin function selector */ 320/* check if the selector is a valid pin function selector */
diff --git a/drivers/pinctrl/sh-pfc/Kconfig b/drivers/pinctrl/sh-pfc/Kconfig
index c11b789ec583..43d950c16528 100644
--- a/drivers/pinctrl/sh-pfc/Kconfig
+++ b/drivers/pinctrl/sh-pfc/Kconfig
@@ -44,6 +44,11 @@ config PINCTRL_PFC_R8A7745
44 depends on ARCH_R8A7745 44 depends on ARCH_R8A7745
45 select PINCTRL_SH_PFC 45 select PINCTRL_SH_PFC
46 46
47config PINCTRL_PFC_R8A77470
48 def_bool y
49 depends on ARCH_R8A77470
50 select PINCTRL_SH_PFC
51
47config PINCTRL_PFC_R8A7778 52config PINCTRL_PFC_R8A7778
48 def_bool y 53 def_bool y
49 depends on ARCH_R8A7778 54 depends on ARCH_R8A7778
@@ -104,6 +109,11 @@ config PINCTRL_PFC_R8A77980
104 depends on ARCH_R8A77980 109 depends on ARCH_R8A77980
105 select PINCTRL_SH_PFC 110 select PINCTRL_SH_PFC
106 111
112config PINCTRL_PFC_R8A77990
113 def_bool y
114 depends on ARCH_R8A77990
115 select PINCTRL_SH_PFC
116
107config PINCTRL_PFC_R8A77995 117config PINCTRL_PFC_R8A77995
108 def_bool y 118 def_bool y
109 depends on ARCH_R8A77995 119 depends on ARCH_R8A77995
diff --git a/drivers/pinctrl/sh-pfc/Makefile b/drivers/pinctrl/sh-pfc/Makefile
index 463775f28cf1..d0b29c51c159 100644
--- a/drivers/pinctrl/sh-pfc/Makefile
+++ b/drivers/pinctrl/sh-pfc/Makefile
@@ -6,6 +6,7 @@ obj-$(CONFIG_PINCTRL_PFC_R8A73A4) += pfc-r8a73a4.o
6obj-$(CONFIG_PINCTRL_PFC_R8A7740) += pfc-r8a7740.o 6obj-$(CONFIG_PINCTRL_PFC_R8A7740) += pfc-r8a7740.o
7obj-$(CONFIG_PINCTRL_PFC_R8A7743) += pfc-r8a7791.o 7obj-$(CONFIG_PINCTRL_PFC_R8A7743) += pfc-r8a7791.o
8obj-$(CONFIG_PINCTRL_PFC_R8A7745) += pfc-r8a7794.o 8obj-$(CONFIG_PINCTRL_PFC_R8A7745) += pfc-r8a7794.o
9obj-$(CONFIG_PINCTRL_PFC_R8A77470) += pfc-r8a77470.o
9obj-$(CONFIG_PINCTRL_PFC_R8A7778) += pfc-r8a7778.o 10obj-$(CONFIG_PINCTRL_PFC_R8A7778) += pfc-r8a7778.o
10obj-$(CONFIG_PINCTRL_PFC_R8A7779) += pfc-r8a7779.o 11obj-$(CONFIG_PINCTRL_PFC_R8A7779) += pfc-r8a7779.o
11obj-$(CONFIG_PINCTRL_PFC_R8A7790) += pfc-r8a7790.o 12obj-$(CONFIG_PINCTRL_PFC_R8A7790) += pfc-r8a7790.o
@@ -19,6 +20,7 @@ obj-$(CONFIG_PINCTRL_PFC_R8A7796) += pfc-r8a7796.o
19obj-$(CONFIG_PINCTRL_PFC_R8A77965) += pfc-r8a77965.o 20obj-$(CONFIG_PINCTRL_PFC_R8A77965) += pfc-r8a77965.o
20obj-$(CONFIG_PINCTRL_PFC_R8A77970) += pfc-r8a77970.o 21obj-$(CONFIG_PINCTRL_PFC_R8A77970) += pfc-r8a77970.o
21obj-$(CONFIG_PINCTRL_PFC_R8A77980) += pfc-r8a77980.o 22obj-$(CONFIG_PINCTRL_PFC_R8A77980) += pfc-r8a77980.o
23obj-$(CONFIG_PINCTRL_PFC_R8A77990) += pfc-r8a77990.o
22obj-$(CONFIG_PINCTRL_PFC_R8A77995) += pfc-r8a77995.o 24obj-$(CONFIG_PINCTRL_PFC_R8A77995) += pfc-r8a77995.o
23obj-$(CONFIG_PINCTRL_PFC_SH7203) += pfc-sh7203.o 25obj-$(CONFIG_PINCTRL_PFC_SH7203) += pfc-sh7203.o
24obj-$(CONFIG_PINCTRL_PFC_SH7264) += pfc-sh7264.o 26obj-$(CONFIG_PINCTRL_PFC_SH7264) += pfc-sh7264.o
diff --git a/drivers/pinctrl/sh-pfc/core.c b/drivers/pinctrl/sh-pfc/core.c
index 74861b7b5b0d..eb06981538b4 100644
--- a/drivers/pinctrl/sh-pfc/core.c
+++ b/drivers/pinctrl/sh-pfc/core.c
@@ -503,6 +503,12 @@ static const struct of_device_id sh_pfc_of_table[] = {
503 .data = &r8a7745_pinmux_info, 503 .data = &r8a7745_pinmux_info,
504 }, 504 },
505#endif 505#endif
506#ifdef CONFIG_PINCTRL_PFC_R8A77470
507 {
508 .compatible = "renesas,pfc-r8a77470",
509 .data = &r8a77470_pinmux_info,
510 },
511#endif
506#ifdef CONFIG_PINCTRL_PFC_R8A7778 512#ifdef CONFIG_PINCTRL_PFC_R8A7778
507 { 513 {
508 .compatible = "renesas,pfc-r8a7778", 514 .compatible = "renesas,pfc-r8a7778",
@@ -575,6 +581,12 @@ static const struct of_device_id sh_pfc_of_table[] = {
575 .data = &r8a77980_pinmux_info, 581 .data = &r8a77980_pinmux_info,
576 }, 582 },
577#endif 583#endif
584#ifdef CONFIG_PINCTRL_PFC_R8A77990
585 {
586 .compatible = "renesas,pfc-r8a77990",
587 .data = &r8a77990_pinmux_info,
588 },
589#endif
578#ifdef CONFIG_PINCTRL_PFC_R8A77995 590#ifdef CONFIG_PINCTRL_PFC_R8A77995
579 { 591 {
580 .compatible = "renesas,pfc-r8a77995", 592 .compatible = "renesas,pfc-r8a77995",
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77470.c b/drivers/pinctrl/sh-pfc/pfc-r8a77470.c
new file mode 100644
index 000000000000..9d3ed438ec7b
--- /dev/null
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77470.c
@@ -0,0 +1,2343 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * R8A77470 processor support - PFC hardware block.
4 *
5 * Copyright (C) 2018 Renesas Electronics Corp.
6 */
7
8#include <linux/kernel.h>
9
10#include "sh_pfc.h"
11
12#define CPU_ALL_PORT(fn, sfx) \
13 PORT_GP_23(0, fn, sfx), \
14 PORT_GP_23(1, fn, sfx), \
15 PORT_GP_32(2, fn, sfx), \
16 PORT_GP_17(3, fn, sfx), \
17 PORT_GP_1(3, 27, fn, sfx), \
18 PORT_GP_1(3, 28, fn, sfx), \
19 PORT_GP_1(3, 29, fn, sfx), \
20 PORT_GP_26(4, fn, sfx), \
21 PORT_GP_32(5, fn, sfx)
22
23enum {
24 PINMUX_RESERVED = 0,
25
26 PINMUX_DATA_BEGIN,
27 GP_ALL(DATA),
28 PINMUX_DATA_END,
29
30 PINMUX_FUNCTION_BEGIN,
31 GP_ALL(FN),
32
33 /* GPSR0 */
34 FN_USB0_PWEN, FN_USB0_OVC, FN_USB1_PWEN, FN_USB1_OVC, FN_CLKOUT,
35 FN_IP0_3_0, FN_IP0_7_4, FN_IP0_11_8, FN_IP0_15_12, FN_IP0_19_16,
36 FN_IP0_23_20, FN_IP0_27_24, FN_IP0_31_28, FN_MMC0_CLK_SDHI1_CLK,
37 FN_MMC0_CMD_SDHI1_CMD, FN_MMC0_D0_SDHI1_D0, FN_MMC0_D1_SDHI1_D1,
38 FN_MMC0_D2_SDHI1_D2, FN_MMC0_D3_SDHI1_D3, FN_IP1_3_0,
39 FN_IP1_7_4, FN_MMC0_D6, FN_MMC0_D7,
40
41 /* GPSR1 */
42 FN_IP1_11_8, FN_IP1_15_12, FN_IP1_19_16, FN_IP1_23_20, FN_IP1_27_24,
43 FN_IP1_31_28, FN_IP2_3_0, FN_IP2_7_4, FN_IP2_11_8, FN_IP2_15_12,
44 FN_IP2_19_16, FN_IP2_23_20, FN_IP2_27_24, FN_IP2_31_28, FN_IP3_3_0,
45 FN_IP3_7_4, FN_IP3_11_8, FN_IP3_15_12, FN_IP3_19_16, FN_IP3_23_20,
46 FN_IP3_27_24, FN_IP3_31_28, FN_IP4_3_0,
47
48 /* GPSR2 */
49 FN_IP4_7_4, FN_IP4_11_8, FN_IP4_15_12, FN_IP4_19_16, FN_IP4_23_20,
50 FN_IP4_27_24, FN_IP4_31_28, FN_IP5_3_0, FN_IP5_7_4, FN_IP5_11_8,
51 FN_IP5_15_12, FN_IP5_19_16, FN_IP5_23_20, FN_IP5_27_24, FN_IP5_31_28,
52 FN_IP6_3_0, FN_IP6_7_4, FN_IP6_11_8, FN_IP6_15_12, FN_IP6_19_16,
53 FN_IP6_23_20, FN_IP6_27_24, FN_IP6_31_28, FN_IP7_3_0, FN_IP7_7_4,
54 FN_IP7_11_8, FN_IP7_15_12, FN_IP7_19_16, FN_IP7_23_20, FN_IP7_27_24,
55 FN_IP7_31_28, FN_IP8_3_0,
56
57 /* GPSR3 */
58 FN_IP8_7_4, FN_IP8_11_8, FN_IP8_15_12, FN_IP8_19_16, FN_IP8_23_20,
59 FN_IP8_27_24, FN_IP8_31_28, FN_IP9_3_0, FN_IP9_7_4, FN_IP9_11_8,
60 FN_IP9_15_12, FN_IP9_19_16, FN_IP9_23_20, FN_IP9_27_24, FN_IP9_31_28,
61 FN_IP10_3_0, FN_IP10_7_4, FN_IP10_11_8, FN_IP10_15_12, FN_IP10_19_16,
62
63 /* GPSR4 */
64 FN_IP10_23_20, FN_IP10_27_24, FN_IP10_31_28, FN_IP11_3_0, FN_IP11_7_4,
65 FN_IP11_11_8, FN_IP11_15_12, FN_IP11_19_16, FN_IP11_23_20,
66 FN_IP11_27_24, FN_IP11_31_28, FN_IP12_3_0, FN_IP12_7_4, FN_IP12_11_8,
67 FN_IP12_15_12, FN_IP12_19_16, FN_IP12_23_20, FN_IP12_27_24,
68 FN_IP12_31_28, FN_IP13_3_0, FN_IP13_7_4, FN_IP13_11_8, FN_IP13_15_12,
69 FN_IP13_19_16, FN_IP13_23_20, FN_IP13_27_24,
70
71 /* GPSR5 */
72 FN_IP13_31_28, FN_IP14_3_0, FN_IP14_7_4, FN_IP14_11_8, FN_IP14_15_12,
73 FN_IP14_19_16, FN_IP14_23_20, FN_IP14_27_24, FN_IP14_31_28,
74 FN_IP15_3_0, FN_IP15_7_4, FN_IP15_11_8, FN_IP15_15_12, FN_IP15_19_16,
75 FN_IP15_23_20, FN_IP15_27_24, FN_IP15_31_28, FN_IP16_3_0, FN_IP16_7_4,
76 FN_IP16_11_8, FN_IP16_15_12, FN_IP16_19_16, FN_IP16_23_20,
77 FN_IP16_27_24, FN_IP16_31_28, FN_IP17_3_0, FN_IP17_7_4, FN_IP17_11_8,
78 FN_IP17_15_12, FN_IP17_19_16, FN_IP17_23_20, FN_IP17_27_24,
79
80 /* IPSR0 */
81 FN_SD0_CLK, FN_SSI_SCK1_C, FN_RX3_C,
82 FN_SD0_CMD, FN_SSI_WS1_C, FN_TX3_C,
83 FN_SD0_DAT0, FN_SSI_SDATA1_C, FN_RX4_E,
84 FN_SD0_DAT1, FN_SSI_SCK0129_B, FN_TX4_E,
85 FN_SD0_DAT2, FN_SSI_WS0129_B, FN_RX5_E,
86 FN_SD0_DAT3, FN_SSI_SDATA0_B, FN_TX5_E,
87 FN_SD0_CD, FN_CAN0_RX_A,
88 FN_SD0_WP, FN_IRQ7, FN_CAN0_TX_A,
89
90 /* IPSR1 */
91 FN_MMC0_D4, FN_SD1_CD,
92 FN_MMC0_D5, FN_SD1_WP,
93 FN_D0, FN_SCL3_B, FN_RX5_B, FN_IRQ4, FN_MSIOF2_RXD_C, FN_SSI_SDATA5_B,
94 FN_D1, FN_SDA3_B, FN_TX5_B, FN_MSIOF2_TXD_C, FN_SSI_WS5_B,
95 FN_D2, FN_RX4_B, FN_SCL0_D, FN_PWM1_C, FN_MSIOF2_SCK_C, FN_SSI_SCK5_B,
96 FN_D3, FN_TX4_B, FN_SDA0_D, FN_PWM0_A, FN_MSIOF2_SYNC_C,
97 FN_D4, FN_IRQ3, FN_TCLK1_A, FN_PWM6_C,
98 FN_D5, FN_HRX2, FN_SCL1_B, FN_PWM2_C, FN_TCLK2_B,
99
100 /* IPSR2 */
101 FN_D6, FN_HTX2, FN_SDA1_B, FN_PWM4_C,
102 FN_D7, FN_HSCK2, FN_SCIF1_SCK_C, FN_IRQ6, FN_PWM5_C,
103 FN_D8, FN_HCTS2_N, FN_RX1_C, FN_SCL1_D, FN_PWM3_C,
104 FN_D9, FN_HRTS2_N, FN_TX1_C, FN_SDA1_D,
105 FN_D10, FN_MSIOF2_RXD_A, FN_HRX0_B,
106 FN_D11, FN_MSIOF2_TXD_A, FN_HTX0_B,
107 FN_D12, FN_MSIOF2_SCK_A, FN_HSCK0, FN_CAN_CLK_C,
108 FN_D13, FN_MSIOF2_SYNC_A, FN_RX4_C,
109
110 /* IPSR3 */
111 FN_D14, FN_MSIOF2_SS1, FN_TX4_C, FN_CAN1_RX_B, FN_AVB_AVTP_CAPTURE_A,
112 FN_D15, FN_MSIOF2_SS2, FN_PWM4_A, FN_CAN1_TX_B, FN_IRQ2, FN_AVB_AVTP_MATCH_A,
113 FN_QSPI0_SPCLK, FN_WE0_N,
114 FN_QSPI0_MOSI_QSPI0_IO0, FN_BS_N,
115 FN_QSPI0_MISO_QSPI0_IO1, FN_RD_WR_N,
116 FN_QSPI0_IO2, FN_CS0_N,
117 FN_QSPI0_IO3, FN_RD_N,
118 FN_QSPI0_SSL, FN_WE1_N,
119
120 /* IPSR4 */
121 FN_EX_WAIT0, FN_CAN_CLK_B, FN_SCIF_CLK_A,
122 FN_DU0_DR0, FN_RX5_C, FN_SCL2_D, FN_A0,
123 FN_DU0_DR1, FN_TX5_C, FN_SDA2_D, FN_A1,
124 FN_DU0_DR2, FN_RX0_D, FN_SCL0_E, FN_A2,
125 FN_DU0_DR3, FN_TX0_D, FN_SDA0_E, FN_PWM0_B, FN_A3,
126 FN_DU0_DR4, FN_RX1_D, FN_A4,
127 FN_DU0_DR5, FN_TX1_D, FN_PWM1_B, FN_A5,
128 FN_DU0_DR6, FN_RX2_C, FN_A6,
129
130 /* IPSR5 */
131 FN_DU0_DR7, FN_TX2_C, FN_PWM2_B, FN_A7,
132 FN_DU0_DG0, FN_RX3_B, FN_SCL3_D, FN_A8,
133 FN_DU0_DG1, FN_TX3_B, FN_SDA3_D, FN_PWM3_B, FN_A9,
134 FN_DU0_DG2, FN_RX4_D, FN_A10,
135 FN_DU0_DG3, FN_TX4_D, FN_PWM4_B, FN_A11,
136 FN_DU0_DG4, FN_HRX0_A, FN_A12,
137 FN_DU0_DG5, FN_HTX0_A, FN_PWM5_B, FN_A13,
138 FN_DU0_DG6, FN_HRX1_C, FN_A14,
139
140 /* IPSR6 */
141 FN_DU0_DG7, FN_HTX1_C, FN_PWM6_B, FN_A15,
142 FN_DU0_DB0, FN_SCL4_D, FN_CAN0_RX_C, FN_A16,
143 FN_DU0_DB1, FN_SDA4_D, FN_CAN0_TX_C, FN_A17,
144 FN_DU0_DB2, FN_HCTS0_N, FN_A18,
145 FN_DU0_DB3, FN_HRTS0_N, FN_A19,
146 FN_DU0_DB4, FN_HCTS1_N_C, FN_A20,
147 FN_DU0_DB5, FN_HRTS1_N_C, FN_A21,
148 FN_DU0_DB6, FN_A22,
149
150 /* IPSR7 */
151 FN_DU0_DB7, FN_A23,
152 FN_DU0_DOTCLKIN, FN_A24,
153 FN_DU0_DOTCLKOUT0, FN_A25,
154 FN_DU0_DOTCLKOUT1, FN_MSIOF2_RXD_B, FN_CS1_N_A26,
155 FN_DU0_EXHSYNC_DU0_HSYNC, FN_MSIOF2_TXD_B, FN_DREQ0_N,
156 FN_DU0_EXVSYNC_DU0_VSYNC, FN_MSIOF2_SYNC_B, FN_DACK0,
157 FN_DU0_EXODDF_DU0_ODDF_DISP_CDE, FN_MSIOF2_SCK_B, FN_DRACK0,
158 FN_DU0_DISP, FN_CAN1_RX_C,
159
160 /* IPSR8 */
161 FN_DU0_CDE, FN_CAN1_TX_C,
162 FN_VI1_CLK, FN_AVB_RX_CLK, FN_ETH_REF_CLK,
163 FN_VI1_DATA0, FN_AVB_RX_DV, FN_ETH_CRS_DV,
164 FN_VI1_DATA1, FN_AVB_RXD0, FN_ETH_RXD0,
165 FN_VI1_DATA2, FN_AVB_RXD1, FN_ETH_RXD1,
166 FN_VI1_DATA3, FN_AVB_RXD2, FN_ETH_MDIO,
167 FN_VI1_DATA4, FN_AVB_RXD3, FN_ETH_RX_ER,
168 FN_VI1_DATA5, FN_AVB_RXD4, FN_ETH_LINK,
169
170 /* IPSR9 */
171 FN_VI1_DATA6, FN_AVB_RXD5, FN_ETH_TXD1,
172 FN_VI1_DATA7, FN_AVB_RXD6, FN_ETH_TX_EN,
173 FN_VI1_CLKENB, FN_SCL3_A, FN_AVB_RXD7, FN_ETH_MAGIC,
174 FN_VI1_FIELD, FN_SDA3_A, FN_AVB_RX_ER, FN_ETH_TXD0,
175 FN_VI1_HSYNC_N, FN_RX0_B, FN_SCL0_C, FN_AVB_GTXREFCLK, FN_ETH_MDC,
176 FN_VI1_VSYNC_N, FN_TX0_B, FN_SDA0_C, FN_AUDIO_CLKOUT_B, FN_AVB_TX_CLK,
177 FN_VI1_DATA8, FN_SCL2_B, FN_AVB_TX_EN,
178 FN_VI1_DATA9, FN_SDA2_B, FN_AVB_TXD0,
179
180 /* IPSR10 */
181 FN_VI1_DATA10, FN_CAN0_RX_B, FN_AVB_TXD1,
182 FN_VI1_DATA11, FN_CAN0_TX_B, FN_AVB_TXD2,
183 FN_AVB_TXD3, FN_AUDIO_CLKA_B, FN_SSI_SCK1_D, FN_RX5_F, FN_MSIOF0_RXD_B,
184 FN_AVB_TXD4, FN_AUDIO_CLKB_B, FN_SSI_WS1_D, FN_TX5_F, FN_MSIOF0_TXD_B,
185 FN_AVB_TXD5, FN_SCIF_CLK_B, FN_AUDIO_CLKC_B, FN_SSI_SDATA1_D, FN_MSIOF0_SCK_B,
186 FN_SCL0_A, FN_RX0_C, FN_PWM5_A, FN_TCLK1_B, FN_AVB_TXD6, FN_CAN1_RX_D, FN_MSIOF0_SYNC_B,
187 FN_SDA0_A, FN_TX0_C, FN_IRQ5, FN_CAN_CLK_A, FN_AVB_GTX_CLK, FN_CAN1_TX_D, FN_DVC_MUTE,
188 FN_SCL1_A, FN_RX4_A, FN_PWM5_D, FN_DU1_DR0, FN_SSI_SCK6_B, FN_VI0_G0,
189
190 /* IPSR11 */
191 FN_SDA1_A, FN_TX4_A, FN_DU1_DR1, FN_SSI_WS6_B, FN_VI0_G1,
192 FN_MSIOF0_RXD_A, FN_RX5_A, FN_SCL2_C, FN_DU1_DR2, FN_QSPI1_MOSI_QSPI1_IO0, FN_SSI_SDATA6_B, FN_VI0_G2,
193 FN_MSIOF0_TXD_A, FN_TX5_A, FN_SDA2_C, FN_DU1_DR3, FN_QSPI1_MISO_QSPI1_IO1, FN_SSI_WS78_B, FN_VI0_G3,
194 FN_MSIOF0_SCK_A, FN_IRQ0, FN_DU1_DR4, FN_QSPI1_SPCLK, FN_SSI_SCK78_B, FN_VI0_G4,
195 FN_MSIOF0_SYNC_A, FN_PWM1_A, FN_DU1_DR5, FN_QSPI1_IO2, FN_SSI_SDATA7_B,
196 FN_MSIOF0_SS1_A, FN_DU1_DR6, FN_QSPI1_IO3, FN_SSI_SDATA8_B,
197 FN_MSIOF0_SS2_A, FN_DU1_DR7, FN_QSPI1_SSL,
198 FN_HRX1_A, FN_SCL4_A, FN_PWM6_A, FN_DU1_DG0, FN_RX0_A,
199
200 /* IPSR12 */
201 FN_HTX1_A, FN_SDA4_A, FN_DU1_DG1, FN_TX0_A,
202 FN_HCTS1_N_A, FN_PWM2_A, FN_DU1_DG2, FN_REMOCON_B,
203 FN_HRTS1_N_A, FN_DU1_DG3, FN_SSI_WS1_B, FN_IRQ1,
204 FN_SD2_CLK, FN_HSCK1, FN_DU1_DG4, FN_SSI_SCK1_B,
205 FN_SD2_CMD, FN_SCIF1_SCK_A, FN_TCLK2_A, FN_DU1_DG5, FN_SSI_SCK2_B, FN_PWM3_A,
206 FN_SD2_DAT0, FN_RX1_A, FN_SCL1_E, FN_DU1_DG6, FN_SSI_SDATA1_B,
207 FN_SD2_DAT1, FN_TX1_A, FN_SDA1_E, FN_DU1_DG7, FN_SSI_WS2_B,
208 FN_SD2_DAT2, FN_RX2_A, FN_DU1_DB0, FN_SSI_SDATA2_B,
209
210 /* IPSR13 */
211 FN_SD2_DAT3, FN_TX2_A, FN_DU1_DB1, FN_SSI_WS9_B,
212 FN_SD2_CD, FN_SCIF2_SCK_A, FN_DU1_DB2, FN_SSI_SCK9_B,
213 FN_SD2_WP, FN_SCIF3_SCK, FN_DU1_DB3, FN_SSI_SDATA9_B,
214 FN_RX3_A, FN_SCL1_C, FN_MSIOF1_RXD_B, FN_DU1_DB4, FN_AUDIO_CLKA_C, FN_SSI_SDATA4_B,
215 FN_TX3_A, FN_SDA1_C, FN_MSIOF1_TXD_B, FN_DU1_DB5, FN_AUDIO_CLKB_C, FN_SSI_WS4_B,
216 FN_SCL2_A, FN_MSIOF1_SCK_B, FN_DU1_DB6, FN_AUDIO_CLKC_C, FN_SSI_SCK4_B,
217 FN_SDA2_A, FN_MSIOF1_SYNC_B, FN_DU1_DB7, FN_AUDIO_CLKOUT_C,
218 FN_SSI_SCK5_A, FN_DU1_DOTCLKOUT1,
219
220 /* IPSR14 */
221 FN_SSI_WS5_A, FN_SCL3_C, FN_DU1_DOTCLKIN,
222 FN_SSI_SDATA5_A, FN_SDA3_C, FN_DU1_DOTCLKOUT0,
223 FN_SSI_SCK6_A, FN_DU1_EXODDF_DU1_ODDF_DISP_CDE,
224 FN_SSI_WS6_A, FN_SCL4_C, FN_DU1_EXHSYNC_DU1_HSYNC,
225 FN_SSI_SDATA6_A, FN_SDA4_C, FN_DU1_EXVSYNC_DU1_VSYNC,
226 FN_SSI_SCK78_A, FN_SDA4_E, FN_DU1_DISP,
227 FN_SSI_WS78_A, FN_SCL4_E, FN_DU1_CDE,
228 FN_SSI_SDATA7_A, FN_IRQ8, FN_AUDIO_CLKA_D, FN_CAN_CLK_D, FN_VI0_G5,
229
230 /* IPSR15 */
231 FN_SSI_SCK0129_A, FN_MSIOF1_RXD_A, FN_RX5_D, FN_VI0_G6,
232 FN_SSI_WS0129_A, FN_MSIOF1_TXD_A, FN_TX5_D, FN_VI0_G7,
233 FN_SSI_SDATA0_A, FN_MSIOF1_SYNC_A, FN_PWM0_C, FN_VI0_R0,
234 FN_SSI_SCK34, FN_MSIOF1_SCK_A, FN_AVB_MDC, FN_DACK1, FN_VI0_R1,
235 FN_SSI_WS34, FN_MSIOF1_SS1_A, FN_AVB_MDIO, FN_CAN1_RX_A, FN_DREQ1_N, FN_VI0_R2,
236 FN_SSI_SDATA3, FN_MSIOF1_SS2_A, FN_AVB_LINK, FN_CAN1_TX_A, FN_DREQ2_N, FN_VI0_R3,
237 FN_SSI_SCK4_A, FN_AVB_MAGIC, FN_VI0_R4,
238 FN_SSI_WS4_A, FN_AVB_PHY_INT, FN_VI0_R5,
239
240 /* IPSR16 */
241 FN_SSI_SDATA4_A, FN_AVB_CRS, FN_VI0_R6,
242 FN_SSI_SCK1_A, FN_SCIF1_SCK_B, FN_PWM1_D, FN_IRQ9, FN_REMOCON_A, FN_DACK2, FN_VI0_CLK, FN_AVB_COL,
243 FN_SSI_SDATA8_A, FN_RX1_B, FN_CAN0_RX_D, FN_AVB_AVTP_CAPTURE_B, FN_VI0_R7,
244 FN_SSI_WS1_A, FN_TX1_B, FN_CAN0_TX_D, FN_AVB_AVTP_MATCH_B, FN_VI0_DATA0_VI0_B0,
245 FN_SSI_SDATA1_A, FN_HRX1_B, FN_VI0_DATA1_VI0_B1,
246 FN_SSI_SCK2_A, FN_HTX1_B, FN_AVB_TXD7, FN_VI0_DATA2_VI0_B2,
247 FN_SSI_WS2_A, FN_HCTS1_N_B, FN_AVB_TX_ER, FN_VI0_DATA3_VI0_B3,
248 FN_SSI_SDATA2_A, FN_HRTS1_N_B, FN_VI0_DATA4_VI0_B4,
249
250 /* IPSR17 */
251 FN_SSI_SCK9_A, FN_RX2_B, FN_SCL3_E, FN_EX_WAIT1, FN_VI0_DATA5_VI0_B5,
252 FN_SSI_WS9_A, FN_TX2_B, FN_SDA3_E, FN_VI0_DATA6_VI0_B6,
253 FN_SSI_SDATA9_A, FN_SCIF2_SCK_B, FN_PWM2_D, FN_VI0_DATA7_VI0_B7,
254 FN_AUDIO_CLKA_A, FN_SCL0_B, FN_VI0_CLKENB,
255 FN_AUDIO_CLKB_A, FN_SDA0_B, FN_VI0_FIELD,
256 FN_AUDIO_CLKC_A, FN_SCL4_B, FN_VI0_HSYNC_N,
257 FN_AUDIO_CLKOUT_A, FN_SDA4_B, FN_VI0_VSYNC_N,
258
259 /* MOD_SEL0 */
260 FN_SEL_ADGA_0, FN_SEL_ADGA_1, FN_SEL_ADGA_2, FN_SEL_ADGA_3,
261 FN_SEL_CANCLK_0, FN_SEL_CANCLK_1, FN_SEL_CANCLK_2, FN_SEL_CANCLK_3,
262 FN_SEL_CAN1_0, FN_SEL_CAN1_1, FN_SEL_CAN1_2, FN_SEL_CAN1_3,
263 FN_SEL_CAN0_0, FN_SEL_CAN0_1, FN_SEL_CAN0_2, FN_SEL_CAN0_3,
264 FN_SEL_I2C04_0, FN_SEL_I2C04_1, FN_SEL_I2C04_2, FN_SEL_I2C04_3, FN_SEL_I2C04_4,
265 FN_SEL_I2C03_0, FN_SEL_I2C03_1, FN_SEL_I2C03_2, FN_SEL_I2C03_3, FN_SEL_I2C03_4,
266 FN_SEL_I2C02_0, FN_SEL_I2C02_1, FN_SEL_I2C02_2, FN_SEL_I2C02_3,
267 FN_SEL_I2C01_0, FN_SEL_I2C01_1, FN_SEL_I2C01_2, FN_SEL_I2C01_3, FN_SEL_I2C01_4,
268 FN_SEL_I2C00_0, FN_SEL_I2C00_1, FN_SEL_I2C00_2, FN_SEL_I2C00_3, FN_SEL_I2C00_4,
269 FN_SEL_AVB_0, FN_SEL_AVB_1,
270
271 /* MOD_SEL1 */
272 FN_SEL_SCIFCLK_0, FN_SEL_SCIFCLK_1,
273 FN_SEL_SCIF5_0, FN_SEL_SCIF5_1, FN_SEL_SCIF5_2, FN_SEL_SCIF5_3, FN_SEL_SCIF5_4, FN_SEL_SCIF5_5,
274 FN_SEL_SCIF4_0, FN_SEL_SCIF4_1, FN_SEL_SCIF4_2, FN_SEL_SCIF4_3, FN_SEL_SCIF4_4,
275 FN_SEL_SCIF3_0, FN_SEL_SCIF3_1, FN_SEL_SCIF3_2,
276 FN_SEL_SCIF2_0, FN_SEL_SCIF2_1, FN_SEL_SCIF2_2,
277 FN_SEL_SCIF2_CLK_0, FN_SEL_SCIF2_CLK_1,
278 FN_SEL_SCIF1_0, FN_SEL_SCIF1_1, FN_SEL_SCIF1_2, FN_SEL_SCIF1_3,
279 FN_SEL_SCIF0_0, FN_SEL_SCIF0_1, FN_SEL_SCIF0_2, FN_SEL_SCIF0_3,
280 FN_SEL_MSIOF2_0, FN_SEL_MSIOF2_1, FN_SEL_MSIOF2_2,
281 FN_SEL_MSIOF1_0, FN_SEL_MSIOF1_1,
282 FN_SEL_MSIOF0_0, FN_SEL_MSIOF0_1,
283 FN_SEL_RCN_0, FN_SEL_RCN_1,
284 FN_SEL_TMU2_0, FN_SEL_TMU2_1,
285 FN_SEL_TMU1_0, FN_SEL_TMU1_1,
286 FN_SEL_HSCIF1_0, FN_SEL_HSCIF1_1, FN_SEL_HSCIF1_2,
287 FN_SEL_HSCIF0_0, FN_SEL_HSCIF0_1,
288
289 /* MOD_SEL2 */
290 FN_SEL_ADGB_0, FN_SEL_ADGB_1, FN_SEL_ADGB_2,
291 FN_SEL_ADGC_0, FN_SEL_ADGC_1, FN_SEL_ADGC_2,
292 FN_SEL_SSI9_0, FN_SEL_SSI9_1,
293 FN_SEL_SSI8_0, FN_SEL_SSI8_1,
294 FN_SEL_SSI7_0, FN_SEL_SSI7_1,
295 FN_SEL_SSI6_0, FN_SEL_SSI6_1,
296 FN_SEL_SSI5_0, FN_SEL_SSI5_1,
297 FN_SEL_SSI4_0, FN_SEL_SSI4_1,
298 FN_SEL_SSI2_0, FN_SEL_SSI2_1,
299 FN_SEL_SSI1_0, FN_SEL_SSI1_1, FN_SEL_SSI1_2, FN_SEL_SSI1_3,
300 FN_SEL_SSI0_0, FN_SEL_SSI0_1,
301 PINMUX_FUNCTION_END,
302
303 PINMUX_MARK_BEGIN,
304
305 USB0_PWEN_MARK, USB0_OVC_MARK, USB1_PWEN_MARK, USB1_OVC_MARK,
306 CLKOUT_MARK, MMC0_CLK_SDHI1_CLK_MARK, MMC0_CMD_SDHI1_CMD_MARK,
307 MMC0_D0_SDHI1_D0_MARK, MMC0_D1_SDHI1_D1_MARK,
308 MMC0_D2_SDHI1_D2_MARK, MMC0_D3_SDHI1_D3_MARK, MMC0_D6_MARK,
309 MMC0_D7_MARK,
310
311 /* IPSR0 */
312 SD0_CLK_MARK, SSI_SCK1_C_MARK, RX3_C_MARK,
313 SD0_CMD_MARK, SSI_WS1_C_MARK, TX3_C_MARK,
314 SD0_DAT0_MARK, SSI_SDATA1_C_MARK, RX4_E_MARK,
315 SD0_DAT1_MARK, SSI_SCK0129_B_MARK, TX4_E_MARK,
316 SD0_DAT2_MARK, SSI_WS0129_B_MARK, RX5_E_MARK,
317 SD0_DAT3_MARK, SSI_SDATA0_B_MARK, TX5_E_MARK,
318 SD0_CD_MARK, CAN0_RX_A_MARK,
319 SD0_WP_MARK, IRQ7_MARK, CAN0_TX_A_MARK,
320
321 /* IPSR1 */
322 MMC0_D4_MARK, SD1_CD_MARK,
323 MMC0_D5_MARK, SD1_WP_MARK,
324 D0_MARK, SCL3_B_MARK, RX5_B_MARK, IRQ4_MARK, MSIOF2_RXD_C_MARK, SSI_SDATA5_B_MARK,
325 D1_MARK, SDA3_B_MARK, TX5_B_MARK, MSIOF2_TXD_C_MARK, SSI_WS5_B_MARK,
326 D2_MARK, RX4_B_MARK, SCL0_D_MARK, PWM1_C_MARK, MSIOF2_SCK_C_MARK, SSI_SCK5_B_MARK,
327 D3_MARK, TX4_B_MARK, SDA0_D_MARK, PWM0_A_MARK, MSIOF2_SYNC_C_MARK,
328 D4_MARK, IRQ3_MARK, TCLK1_A_MARK, PWM6_C_MARK,
329 D5_MARK, HRX2_MARK, SCL1_B_MARK, PWM2_C_MARK, TCLK2_B_MARK,
330
331 /* IPSR2 */
332 D6_MARK, HTX2_MARK, SDA1_B_MARK, PWM4_C_MARK,
333 D7_MARK, HSCK2_MARK, SCIF1_SCK_C_MARK, IRQ6_MARK, PWM5_C_MARK,
334 D8_MARK, HCTS2_N_MARK, RX1_C_MARK, SCL1_D_MARK, PWM3_C_MARK,
335 D9_MARK, HRTS2_N_MARK, TX1_C_MARK, SDA1_D_MARK,
336 D10_MARK, MSIOF2_RXD_A_MARK, HRX0_B_MARK,
337 D11_MARK, MSIOF2_TXD_A_MARK, HTX0_B_MARK,
338 D12_MARK, MSIOF2_SCK_A_MARK, HSCK0_MARK, CAN_CLK_C_MARK,
339 D13_MARK, MSIOF2_SYNC_A_MARK, RX4_C_MARK,
340
341 /* IPSR3 */
342 D14_MARK, MSIOF2_SS1_MARK, TX4_C_MARK, CAN1_RX_B_MARK, AVB_AVTP_CAPTURE_A_MARK,
343 D15_MARK, MSIOF2_SS2_MARK, PWM4_A_MARK, CAN1_TX_B_MARK, IRQ2_MARK, AVB_AVTP_MATCH_A_MARK,
344 QSPI0_SPCLK_MARK, WE0_N_MARK,
345 QSPI0_MOSI_QSPI0_IO0_MARK, BS_N_MARK,
346 QSPI0_MISO_QSPI0_IO1_MARK, RD_WR_N_MARK,
347 QSPI0_IO2_MARK, CS0_N_MARK,
348 QSPI0_IO3_MARK, RD_N_MARK,
349 QSPI0_SSL_MARK, WE1_N_MARK,
350
351 /* IPSR4 */
352 EX_WAIT0_MARK, CAN_CLK_B_MARK, SCIF_CLK_A_MARK,
353 DU0_DR0_MARK, RX5_C_MARK, SCL2_D_MARK, A0_MARK,
354 DU0_DR1_MARK, TX5_C_MARK, SDA2_D_MARK, A1_MARK,
355 DU0_DR2_MARK, RX0_D_MARK, SCL0_E_MARK, A2_MARK,
356 DU0_DR3_MARK, TX0_D_MARK, SDA0_E_MARK, PWM0_B_MARK, A3_MARK,
357 DU0_DR4_MARK, RX1_D_MARK, A4_MARK,
358 DU0_DR5_MARK, TX1_D_MARK, PWM1_B_MARK, A5_MARK,
359 DU0_DR6_MARK, RX2_C_MARK, A6_MARK,
360
361 /* IPSR5 */
362 DU0_DR7_MARK, TX2_C_MARK, PWM2_B_MARK, A7_MARK,
363 DU0_DG0_MARK, RX3_B_MARK, SCL3_D_MARK, A8_MARK,
364 DU0_DG1_MARK, TX3_B_MARK, SDA3_D_MARK, PWM3_B_MARK, A9_MARK,
365 DU0_DG2_MARK, RX4_D_MARK, A10_MARK,
366 DU0_DG3_MARK, TX4_D_MARK, PWM4_B_MARK, A11_MARK,
367 DU0_DG4_MARK, HRX0_A_MARK, A12_MARK,
368 DU0_DG5_MARK, HTX0_A_MARK, PWM5_B_MARK, A13_MARK,
369 DU0_DG6_MARK, HRX1_C_MARK, A14_MARK,
370
371 /* IPSR6 */
372 DU0_DG7_MARK, HTX1_C_MARK, PWM6_B_MARK, A15_MARK,
373 DU0_DB0_MARK, SCL4_D_MARK, CAN0_RX_C_MARK, A16_MARK,
374 DU0_DB1_MARK, SDA4_D_MARK, CAN0_TX_C_MARK, A17_MARK,
375 DU0_DB2_MARK, HCTS0_N_MARK, A18_MARK,
376 DU0_DB3_MARK, HRTS0_N_MARK, A19_MARK,
377 DU0_DB4_MARK, HCTS1_N_C_MARK, A20_MARK,
378 DU0_DB5_MARK, HRTS1_N_C_MARK, A21_MARK,
379 DU0_DB6_MARK, A22_MARK,
380
381 /* IPSR7 */
382 DU0_DB7_MARK, A23_MARK,
383 DU0_DOTCLKIN_MARK, A24_MARK,
384 DU0_DOTCLKOUT0_MARK, A25_MARK,
385 DU0_DOTCLKOUT1_MARK, MSIOF2_RXD_B_MARK, CS1_N_A26_MARK,
386 DU0_EXHSYNC_DU0_HSYNC_MARK, MSIOF2_TXD_B_MARK, DREQ0_N_MARK,
387 DU0_EXVSYNC_DU0_VSYNC_MARK, MSIOF2_SYNC_B_MARK, DACK0_MARK,
388 DU0_EXODDF_DU0_ODDF_DISP_CDE_MARK, MSIOF2_SCK_B_MARK, DRACK0_MARK,
389 DU0_DISP_MARK, CAN1_RX_C_MARK,
390
391 /* IPSR8 */
392 DU0_CDE_MARK, CAN1_TX_C_MARK,
393 VI1_CLK_MARK, AVB_RX_CLK_MARK, ETH_REF_CLK_MARK,
394 VI1_DATA0_MARK, AVB_RX_DV_MARK, ETH_CRS_DV_MARK,
395 VI1_DATA1_MARK, AVB_RXD0_MARK, ETH_RXD0_MARK,
396 VI1_DATA2_MARK, AVB_RXD1_MARK, ETH_RXD1_MARK,
397 VI1_DATA3_MARK, AVB_RXD2_MARK, ETH_MDIO_MARK,
398 VI1_DATA4_MARK, AVB_RXD3_MARK, ETH_RX_ER_MARK,
399 VI1_DATA5_MARK, AVB_RXD4_MARK, ETH_LINK_MARK,
400
401 /* IPSR9 */
402 VI1_DATA6_MARK, AVB_RXD5_MARK, ETH_TXD1_MARK,
403 VI1_DATA7_MARK, AVB_RXD6_MARK, ETH_TX_EN_MARK,
404 VI1_CLKENB_MARK, SCL3_A_MARK, AVB_RXD7_MARK, ETH_MAGIC_MARK,
405 VI1_FIELD_MARK, SDA3_A_MARK, AVB_RX_ER_MARK, ETH_TXD0_MARK,
406 VI1_HSYNC_N_MARK, RX0_B_MARK, SCL0_C_MARK, AVB_GTXREFCLK_MARK, ETH_MDC_MARK,
407 VI1_VSYNC_N_MARK, TX0_B_MARK, SDA0_C_MARK, AUDIO_CLKOUT_B_MARK, AVB_TX_CLK_MARK,
408 VI1_DATA8_MARK, SCL2_B_MARK, AVB_TX_EN_MARK,
409 VI1_DATA9_MARK, SDA2_B_MARK, AVB_TXD0_MARK,
410
411 /* IPSR10 */
412 VI1_DATA10_MARK, CAN0_RX_B_MARK, AVB_TXD1_MARK,
413 VI1_DATA11_MARK, CAN0_TX_B_MARK, AVB_TXD2_MARK,
414 AVB_TXD3_MARK, AUDIO_CLKA_B_MARK, SSI_SCK1_D_MARK, RX5_F_MARK, MSIOF0_RXD_B_MARK,
415 AVB_TXD4_MARK, AUDIO_CLKB_B_MARK, SSI_WS1_D_MARK, TX5_F_MARK, MSIOF0_TXD_B_MARK,
416 AVB_TXD5_MARK, SCIF_CLK_B_MARK, AUDIO_CLKC_B_MARK, SSI_SDATA1_D_MARK, MSIOF0_SCK_B_MARK,
417 SCL0_A_MARK, RX0_C_MARK, PWM5_A_MARK, TCLK1_B_MARK, AVB_TXD6_MARK, CAN1_RX_D_MARK, MSIOF0_SYNC_B_MARK,
418 SDA0_A_MARK, TX0_C_MARK, IRQ5_MARK, CAN_CLK_A_MARK, AVB_GTX_CLK_MARK, CAN1_TX_D_MARK, DVC_MUTE_MARK,
419 SCL1_A_MARK, RX4_A_MARK, PWM5_D_MARK, DU1_DR0_MARK, SSI_SCK6_B_MARK, VI0_G0_MARK,
420
421 /* IPSR11 */
422 SDA1_A_MARK, TX4_A_MARK, DU1_DR1_MARK, SSI_WS6_B_MARK, VI0_G1_MARK,
423 MSIOF0_RXD_A_MARK, RX5_A_MARK, SCL2_C_MARK, DU1_DR2_MARK, QSPI1_MOSI_QSPI1_IO0_MARK, SSI_SDATA6_B_MARK, VI0_G2_MARK,
424 MSIOF0_TXD_A_MARK, TX5_A_MARK, SDA2_C_MARK, DU1_DR3_MARK, QSPI1_MISO_QSPI1_IO1_MARK, SSI_WS78_B_MARK, VI0_G3_MARK,
425 MSIOF0_SCK_A_MARK, IRQ0_MARK, DU1_DR4_MARK, QSPI1_SPCLK_MARK, SSI_SCK78_B_MARK, VI0_G4_MARK,
426 MSIOF0_SYNC_A_MARK, PWM1_A_MARK, DU1_DR5_MARK, QSPI1_IO2_MARK, SSI_SDATA7_B_MARK,
427 MSIOF0_SS1_A_MARK, DU1_DR6_MARK, QSPI1_IO3_MARK, SSI_SDATA8_B_MARK,
428 MSIOF0_SS2_A_MARK, DU1_DR7_MARK, QSPI1_SSL_MARK,
429 HRX1_A_MARK, SCL4_A_MARK, PWM6_A_MARK, DU1_DG0_MARK, RX0_A_MARK,
430
431 /* IPSR12 */
432 HTX1_A_MARK, SDA4_A_MARK, DU1_DG1_MARK, TX0_A_MARK,
433 HCTS1_N_A_MARK, PWM2_A_MARK, DU1_DG2_MARK, REMOCON_B_MARK,
434 HRTS1_N_A_MARK, DU1_DG3_MARK, SSI_WS1_B_MARK, IRQ1_MARK,
435 SD2_CLK_MARK, HSCK1_MARK, DU1_DG4_MARK, SSI_SCK1_B_MARK,
436 SD2_CMD_MARK, SCIF1_SCK_A_MARK, TCLK2_A_MARK, DU1_DG5_MARK, SSI_SCK2_B_MARK, PWM3_A_MARK,
437 SD2_DAT0_MARK, RX1_A_MARK, SCL1_E_MARK, DU1_DG6_MARK, SSI_SDATA1_B_MARK,
438 SD2_DAT1_MARK, TX1_A_MARK, SDA1_E_MARK, DU1_DG7_MARK, SSI_WS2_B_MARK,
439 SD2_DAT2_MARK, RX2_A_MARK, DU1_DB0_MARK, SSI_SDATA2_B_MARK,
440
441 /* IPSR13 */
442 SD2_DAT3_MARK, TX2_A_MARK, DU1_DB1_MARK, SSI_WS9_B_MARK,
443 SD2_CD_MARK, SCIF2_SCK_A_MARK, DU1_DB2_MARK, SSI_SCK9_B_MARK,
444 SD2_WP_MARK, SCIF3_SCK_MARK, DU1_DB3_MARK, SSI_SDATA9_B_MARK,
445 RX3_A_MARK, SCL1_C_MARK, MSIOF1_RXD_B_MARK, DU1_DB4_MARK, AUDIO_CLKA_C_MARK, SSI_SDATA4_B_MARK,
446 TX3_A_MARK, SDA1_C_MARK, MSIOF1_TXD_B_MARK, DU1_DB5_MARK, AUDIO_CLKB_C_MARK, SSI_WS4_B_MARK,
447 SCL2_A_MARK, MSIOF1_SCK_B_MARK, DU1_DB6_MARK, AUDIO_CLKC_C_MARK, SSI_SCK4_B_MARK,
448 SDA2_A_MARK, MSIOF1_SYNC_B_MARK, DU1_DB7_MARK, AUDIO_CLKOUT_C_MARK,
449 SSI_SCK5_A_MARK, DU1_DOTCLKOUT1_MARK,
450
451 /* IPSR14 */
452 SSI_WS5_A_MARK, SCL3_C_MARK, DU1_DOTCLKIN_MARK,
453 SSI_SDATA5_A_MARK, SDA3_C_MARK, DU1_DOTCLKOUT0_MARK,
454 SSI_SCK6_A_MARK, DU1_EXODDF_DU1_ODDF_DISP_CDE_MARK,
455 SSI_WS6_A_MARK, SCL4_C_MARK, DU1_EXHSYNC_DU1_HSYNC_MARK,
456 SSI_SDATA6_A_MARK, SDA4_C_MARK, DU1_EXVSYNC_DU1_VSYNC_MARK,
457 SSI_SCK78_A_MARK, SDA4_E_MARK, DU1_DISP_MARK,
458 SSI_WS78_A_MARK, SCL4_E_MARK, DU1_CDE_MARK,
459 SSI_SDATA7_A_MARK, IRQ8_MARK, AUDIO_CLKA_D_MARK, CAN_CLK_D_MARK, VI0_G5_MARK,
460
461 /* IPSR15 */
462 SSI_SCK0129_A_MARK, MSIOF1_RXD_A_MARK, RX5_D_MARK, VI0_G6_MARK,
463 SSI_WS0129_A_MARK, MSIOF1_TXD_A_MARK, TX5_D_MARK, VI0_G7_MARK,
464 SSI_SDATA0_A_MARK, MSIOF1_SYNC_A_MARK, PWM0_C_MARK, VI0_R0_MARK,
465 SSI_SCK34_MARK, MSIOF1_SCK_A_MARK, AVB_MDC_MARK, DACK1_MARK, VI0_R1_MARK,
466 SSI_WS34_MARK, MSIOF1_SS1_A_MARK, AVB_MDIO_MARK, CAN1_RX_A_MARK, DREQ1_N_MARK, VI0_R2_MARK,
467 SSI_SDATA3_MARK, MSIOF1_SS2_A_MARK, AVB_LINK_MARK, CAN1_TX_A_MARK, DREQ2_N_MARK, VI0_R3_MARK,
468 SSI_SCK4_A_MARK, AVB_MAGIC_MARK, VI0_R4_MARK,
469 SSI_WS4_A_MARK, AVB_PHY_INT_MARK, VI0_R5_MARK,
470
471 /* IPSR16 */
472 SSI_SDATA4_A_MARK, AVB_CRS_MARK, VI0_R6_MARK,
473 SSI_SCK1_A_MARK, SCIF1_SCK_B_MARK, PWM1_D_MARK, IRQ9_MARK, REMOCON_A_MARK, DACK2_MARK, VI0_CLK_MARK, AVB_COL_MARK,
474 SSI_SDATA8_A_MARK, RX1_B_MARK, CAN0_RX_D_MARK, AVB_AVTP_CAPTURE_B_MARK, VI0_R7_MARK,
475 SSI_WS1_A_MARK, TX1_B_MARK, CAN0_TX_D_MARK, AVB_AVTP_MATCH_B_MARK, VI0_DATA0_VI0_B0_MARK,
476 SSI_SDATA1_A_MARK, HRX1_B_MARK, VI0_DATA1_VI0_B1_MARK,
477 SSI_SCK2_A_MARK, HTX1_B_MARK, AVB_TXD7_MARK, VI0_DATA2_VI0_B2_MARK,
478 SSI_WS2_A_MARK, HCTS1_N_B_MARK, AVB_TX_ER_MARK, VI0_DATA3_VI0_B3_MARK,
479 SSI_SDATA2_A_MARK, HRTS1_N_B_MARK, VI0_DATA4_VI0_B4_MARK,
480
481 /* IPSR17 */
482 SSI_SCK9_A_MARK, RX2_B_MARK, SCL3_E_MARK, EX_WAIT1_MARK, VI0_DATA5_VI0_B5_MARK,
483 SSI_WS9_A_MARK, TX2_B_MARK, SDA3_E_MARK, VI0_DATA6_VI0_B6_MARK,
484 SSI_SDATA9_A_MARK, SCIF2_SCK_B_MARK, PWM2_D_MARK, VI0_DATA7_VI0_B7_MARK,
485 AUDIO_CLKA_A_MARK, SCL0_B_MARK, VI0_CLKENB_MARK,
486 AUDIO_CLKB_A_MARK, SDA0_B_MARK, VI0_FIELD_MARK,
487 AUDIO_CLKC_A_MARK, SCL4_B_MARK, VI0_HSYNC_N_MARK,
488 AUDIO_CLKOUT_A_MARK, SDA4_B_MARK, VI0_VSYNC_N_MARK,
489
490 PINMUX_MARK_END,
491};
492
493static const u16 pinmux_data[] = {
494 PINMUX_DATA_GP_ALL(), /* PINMUX_DATA(GP_M_N_DATA, GP_M_N_FN...), */
495
496 PINMUX_SINGLE(USB0_PWEN),
497 PINMUX_SINGLE(USB0_OVC),
498 PINMUX_SINGLE(USB1_PWEN),
499 PINMUX_SINGLE(USB1_OVC),
500 PINMUX_SINGLE(CLKOUT),
501 PINMUX_SINGLE(MMC0_CLK_SDHI1_CLK),
502 PINMUX_SINGLE(MMC0_CMD_SDHI1_CMD),
503 PINMUX_SINGLE(MMC0_D0_SDHI1_D0),
504 PINMUX_SINGLE(MMC0_D1_SDHI1_D1),
505 PINMUX_SINGLE(MMC0_D2_SDHI1_D2),
506 PINMUX_SINGLE(MMC0_D3_SDHI1_D3),
507 PINMUX_SINGLE(MMC0_D6),
508 PINMUX_SINGLE(MMC0_D7),
509
510 /* IPSR0 */
511 PINMUX_IPSR_GPSR(IP0_3_0, SD0_CLK),
512 PINMUX_IPSR_MSEL(IP0_3_0, SSI_SCK1_C, SEL_SSI1_2),
513 PINMUX_IPSR_MSEL(IP0_3_0, RX3_C, SEL_SCIF3_2),
514 PINMUX_IPSR_GPSR(IP0_7_4, SD0_CMD),
515 PINMUX_IPSR_MSEL(IP0_7_4, SSI_WS1_C, SEL_SSI1_2),
516 PINMUX_IPSR_MSEL(IP0_7_4, TX3_C, SEL_SCIF3_2),
517 PINMUX_IPSR_GPSR(IP0_11_8, SD0_DAT0),
518 PINMUX_IPSR_MSEL(IP0_11_8, SSI_SDATA1_C, SEL_SSI1_2),
519 PINMUX_IPSR_MSEL(IP0_11_8, RX4_E, SEL_SCIF4_4),
520 PINMUX_IPSR_GPSR(IP0_15_12, SD0_DAT1),
521 PINMUX_IPSR_MSEL(IP0_15_12, SSI_SCK0129_B, SEL_SSI0_1),
522 PINMUX_IPSR_MSEL(IP0_15_12, TX4_E, SEL_SCIF4_4),
523 PINMUX_IPSR_GPSR(IP0_19_16, SD0_DAT2),
524 PINMUX_IPSR_MSEL(IP0_19_16, SSI_WS0129_B, SEL_SSI0_1),
525 PINMUX_IPSR_MSEL(IP0_19_16, RX5_E, SEL_SCIF5_4),
526 PINMUX_IPSR_GPSR(IP0_23_20, SD0_DAT3),
527 PINMUX_IPSR_MSEL(IP0_23_20, SSI_SDATA0_B, SEL_SSI0_1),
528 PINMUX_IPSR_MSEL(IP0_23_20, TX5_E, SEL_SCIF5_4),
529 PINMUX_IPSR_GPSR(IP0_27_24, SD0_CD),
530 PINMUX_IPSR_MSEL(IP0_27_24, CAN0_RX_A, SEL_CAN0_0),
531 PINMUX_IPSR_GPSR(IP0_31_28, SD0_WP),
532 PINMUX_IPSR_GPSR(IP0_31_28, IRQ7),
533 PINMUX_IPSR_MSEL(IP0_31_28, CAN0_TX_A, SEL_CAN0_0),
534
535 /* IPSR1 */
536 PINMUX_IPSR_GPSR(IP1_3_0, MMC0_D4),
537 PINMUX_IPSR_GPSR(IP1_3_0, SD1_CD),
538 PINMUX_IPSR_GPSR(IP1_7_4, MMC0_D5),
539 PINMUX_IPSR_GPSR(IP1_7_4, SD1_WP),
540 PINMUX_IPSR_GPSR(IP1_11_8, D0),
541 PINMUX_IPSR_MSEL(IP1_11_8, SCL3_B, SEL_I2C03_1),
542 PINMUX_IPSR_MSEL(IP1_11_8, RX5_B, SEL_SCIF5_1),
543 PINMUX_IPSR_GPSR(IP1_11_8, IRQ4),
544 PINMUX_IPSR_MSEL(IP1_11_8, MSIOF2_RXD_C, SEL_MSIOF2_2),
545 PINMUX_IPSR_MSEL(IP1_11_8, SSI_SDATA5_B, SEL_SSI5_1),
546 PINMUX_IPSR_GPSR(IP1_15_12, D1),
547 PINMUX_IPSR_MSEL(IP1_15_12, SDA3_B, SEL_I2C03_1),
548 PINMUX_IPSR_MSEL(IP1_15_12, TX5_B, SEL_SCIF5_1),
549 PINMUX_IPSR_MSEL(IP1_15_12, MSIOF2_TXD_C, SEL_MSIOF2_2),
550 PINMUX_IPSR_MSEL(IP1_15_12, SSI_WS5_B, SEL_SSI5_1),
551 PINMUX_IPSR_GPSR(IP1_19_16, D2),
552 PINMUX_IPSR_MSEL(IP1_19_16, RX4_B, SEL_SCIF4_1),
553 PINMUX_IPSR_MSEL(IP1_19_16, SCL0_D, SEL_I2C00_3),
554 PINMUX_IPSR_GPSR(IP1_19_16, PWM1_C),
555 PINMUX_IPSR_MSEL(IP1_19_16, MSIOF2_SCK_C, SEL_MSIOF2_2),
556 PINMUX_IPSR_MSEL(IP1_19_16, SSI_SCK5_B, SEL_SSI5_1),
557 PINMUX_IPSR_GPSR(IP1_23_20, D3),
558 PINMUX_IPSR_MSEL(IP1_23_20, TX4_B, SEL_SCIF4_1),
559 PINMUX_IPSR_MSEL(IP1_23_20, SDA0_D, SEL_I2C00_3),
560 PINMUX_IPSR_GPSR(IP1_23_20, PWM0_A),
561 PINMUX_IPSR_MSEL(IP1_23_20, MSIOF2_SYNC_C, SEL_MSIOF2_2),
562 PINMUX_IPSR_GPSR(IP1_27_24, D4),
563 PINMUX_IPSR_GPSR(IP1_27_24, IRQ3),
564 PINMUX_IPSR_MSEL(IP1_27_24, TCLK1_A, SEL_TMU1_0),
565 PINMUX_IPSR_GPSR(IP1_27_24, PWM6_C),
566 PINMUX_IPSR_GPSR(IP1_31_28, D5),
567 PINMUX_IPSR_GPSR(IP1_31_28, HRX2),
568 PINMUX_IPSR_MSEL(IP1_31_28, SCL1_B, SEL_I2C01_1),
569 PINMUX_IPSR_GPSR(IP1_31_28, PWM2_C),
570 PINMUX_IPSR_MSEL(IP1_31_28, TCLK2_B, SEL_TMU2_1),
571
572 /* IPSR2 */
573 PINMUX_IPSR_GPSR(IP2_3_0, D6),
574 PINMUX_IPSR_GPSR(IP2_3_0, HTX2),
575 PINMUX_IPSR_MSEL(IP2_3_0, SDA1_B, SEL_I2C01_1),
576 PINMUX_IPSR_GPSR(IP2_3_0, PWM4_C),
577 PINMUX_IPSR_GPSR(IP2_7_4, D7),
578 PINMUX_IPSR_GPSR(IP2_7_4, HSCK2),
579 PINMUX_IPSR_MSEL(IP2_7_4, SCIF1_SCK_C, SEL_SCIF1_2),
580 PINMUX_IPSR_GPSR(IP2_7_4, IRQ6),
581 PINMUX_IPSR_GPSR(IP2_7_4, PWM5_C),
582 PINMUX_IPSR_GPSR(IP2_11_8, D8),
583 PINMUX_IPSR_GPSR(IP2_11_8, HCTS2_N),
584 PINMUX_IPSR_MSEL(IP2_11_8, RX1_C, SEL_SCIF1_2),
585 PINMUX_IPSR_MSEL(IP2_11_8, SCL1_D, SEL_I2C01_3),
586 PINMUX_IPSR_GPSR(IP2_11_8, PWM3_C),
587 PINMUX_IPSR_GPSR(IP2_15_12, D9),
588 PINMUX_IPSR_GPSR(IP2_15_12, HRTS2_N),
589 PINMUX_IPSR_MSEL(IP2_15_12, TX1_C, SEL_SCIF1_2),
590 PINMUX_IPSR_MSEL(IP2_15_12, SDA1_D, SEL_I2C01_3),
591 PINMUX_IPSR_GPSR(IP2_19_16, D10),
592 PINMUX_IPSR_MSEL(IP2_19_16, MSIOF2_RXD_A, SEL_MSIOF2_0),
593 PINMUX_IPSR_MSEL(IP2_19_16, HRX0_B, SEL_HSCIF0_1),
594 PINMUX_IPSR_GPSR(IP2_23_20, D11),
595 PINMUX_IPSR_MSEL(IP2_23_20, MSIOF2_TXD_A, SEL_MSIOF2_0),
596 PINMUX_IPSR_MSEL(IP2_23_20, HTX0_B, SEL_HSCIF0_1),
597 PINMUX_IPSR_GPSR(IP2_27_24, D12),
598 PINMUX_IPSR_MSEL(IP2_27_24, MSIOF2_SCK_A, SEL_MSIOF2_0),
599 PINMUX_IPSR_GPSR(IP2_27_24, HSCK0),
600 PINMUX_IPSR_MSEL(IP2_27_24, CAN_CLK_C, SEL_CANCLK_2),
601 PINMUX_IPSR_GPSR(IP2_31_28, D13),
602 PINMUX_IPSR_MSEL(IP2_31_28, MSIOF2_SYNC_A, SEL_MSIOF2_0),
603 PINMUX_IPSR_MSEL(IP2_31_28, RX4_C, SEL_SCIF4_2),
604
605 /* IPSR3 */
606 PINMUX_IPSR_GPSR(IP3_3_0, D14),
607 PINMUX_IPSR_GPSR(IP3_3_0, MSIOF2_SS1),
608 PINMUX_IPSR_MSEL(IP3_3_0, TX4_C, SEL_SCIF4_2),
609 PINMUX_IPSR_MSEL(IP3_3_0, CAN1_RX_B, SEL_CAN1_1),
610 PINMUX_IPSR_MSEL(IP3_3_0, AVB_AVTP_CAPTURE_A, SEL_AVB_0),
611 PINMUX_IPSR_GPSR(IP3_7_4, D15),
612 PINMUX_IPSR_GPSR(IP3_7_4, MSIOF2_SS2),
613 PINMUX_IPSR_GPSR(IP3_7_4, PWM4_A),
614 PINMUX_IPSR_MSEL(IP3_7_4, CAN1_TX_B, SEL_CAN1_1),
615 PINMUX_IPSR_GPSR(IP3_7_4, IRQ2),
616 PINMUX_IPSR_MSEL(IP3_7_4, AVB_AVTP_MATCH_A, SEL_AVB_0),
617 PINMUX_IPSR_GPSR(IP3_11_8, QSPI0_SPCLK),
618 PINMUX_IPSR_GPSR(IP3_11_8, WE0_N),
619 PINMUX_IPSR_GPSR(IP3_15_12, QSPI0_MOSI_QSPI0_IO0),
620 PINMUX_IPSR_GPSR(IP3_15_12, BS_N),
621 PINMUX_IPSR_GPSR(IP3_19_16, QSPI0_MISO_QSPI0_IO1),
622 PINMUX_IPSR_GPSR(IP3_19_16, RD_WR_N),
623 PINMUX_IPSR_GPSR(IP3_23_20, QSPI0_IO2),
624 PINMUX_IPSR_GPSR(IP3_23_20, CS0_N),
625 PINMUX_IPSR_GPSR(IP3_27_24, QSPI0_IO3),
626 PINMUX_IPSR_GPSR(IP3_27_24, RD_N),
627 PINMUX_IPSR_GPSR(IP3_31_28, QSPI0_SSL),
628 PINMUX_IPSR_GPSR(IP3_31_28, WE1_N),
629
630 /* IPSR4 */
631 PINMUX_IPSR_GPSR(IP4_3_0, EX_WAIT0),
632 PINMUX_IPSR_MSEL(IP4_3_0, CAN_CLK_B, SEL_CANCLK_1),
633 PINMUX_IPSR_MSEL(IP4_3_0, SCIF_CLK_A, SEL_SCIFCLK_0),
634 PINMUX_IPSR_GPSR(IP4_7_4, DU0_DR0),
635 PINMUX_IPSR_MSEL(IP4_7_4, RX5_C, SEL_SCIF5_2),
636 PINMUX_IPSR_MSEL(IP4_7_4, SCL2_D, SEL_I2C02_3),
637 PINMUX_IPSR_GPSR(IP4_7_4, A0),
638 PINMUX_IPSR_GPSR(IP4_11_8, DU0_DR1),
639 PINMUX_IPSR_MSEL(IP4_11_8, TX5_C, SEL_SCIF5_2),
640 PINMUX_IPSR_MSEL(IP4_11_8, SDA2_D, SEL_I2C02_3),
641 PINMUX_IPSR_GPSR(IP4_11_8, A1),
642 PINMUX_IPSR_GPSR(IP4_15_12, DU0_DR2),
643 PINMUX_IPSR_MSEL(IP4_15_12, RX0_D, SEL_SCIF0_3),
644 PINMUX_IPSR_MSEL(IP4_15_12, SCL0_E, SEL_I2C00_4),
645 PINMUX_IPSR_GPSR(IP4_15_12, A2),
646 PINMUX_IPSR_GPSR(IP4_19_16, DU0_DR3),
647 PINMUX_IPSR_MSEL(IP4_19_16, TX0_D, SEL_SCIF0_3),
648 PINMUX_IPSR_MSEL(IP4_19_16, SDA0_E, SEL_I2C00_4),
649 PINMUX_IPSR_GPSR(IP4_19_16, PWM0_B),
650 PINMUX_IPSR_GPSR(IP4_19_16, A3),
651 PINMUX_IPSR_GPSR(IP4_23_20, DU0_DR4),
652 PINMUX_IPSR_MSEL(IP4_23_20, RX1_D, SEL_SCIF1_3),
653 PINMUX_IPSR_GPSR(IP4_23_20, A4),
654 PINMUX_IPSR_GPSR(IP4_27_24, DU0_DR5),
655 PINMUX_IPSR_MSEL(IP4_27_24, TX1_D, SEL_SCIF1_3),
656 PINMUX_IPSR_GPSR(IP4_27_24, PWM1_B),
657 PINMUX_IPSR_GPSR(IP4_27_24, A5),
658 PINMUX_IPSR_GPSR(IP4_31_28, DU0_DR6),
659 PINMUX_IPSR_MSEL(IP4_31_28, RX2_C, SEL_SCIF2_2),
660 PINMUX_IPSR_GPSR(IP4_31_28, A6),
661
662 /* IPSR5 */
663 PINMUX_IPSR_GPSR(IP5_3_0, DU0_DR7),
664 PINMUX_IPSR_MSEL(IP5_3_0, TX2_C, SEL_SCIF2_2),
665 PINMUX_IPSR_GPSR(IP5_3_0, PWM2_B),
666 PINMUX_IPSR_GPSR(IP5_3_0, A7),
667 PINMUX_IPSR_GPSR(IP5_7_4, DU0_DG0),
668 PINMUX_IPSR_MSEL(IP5_7_4, RX3_B, SEL_SCIF3_1),
669 PINMUX_IPSR_MSEL(IP5_7_4, SCL3_D, SEL_I2C03_3),
670 PINMUX_IPSR_GPSR(IP5_7_4, A8),
671 PINMUX_IPSR_GPSR(IP5_11_8, DU0_DG1),
672 PINMUX_IPSR_MSEL(IP5_11_8, TX3_B, SEL_SCIF3_1),
673 PINMUX_IPSR_MSEL(IP5_11_8, SDA3_D, SEL_I2C03_3),
674 PINMUX_IPSR_GPSR(IP5_11_8, PWM3_B),
675 PINMUX_IPSR_GPSR(IP5_11_8, A9),
676 PINMUX_IPSR_GPSR(IP5_15_12, DU0_DG2),
677 PINMUX_IPSR_MSEL(IP5_15_12, RX4_D, SEL_SCIF4_3),
678 PINMUX_IPSR_GPSR(IP5_15_12, A10),
679 PINMUX_IPSR_GPSR(IP5_19_16, DU0_DG3),
680 PINMUX_IPSR_MSEL(IP5_19_16, TX4_D, SEL_SCIF4_3),
681 PINMUX_IPSR_GPSR(IP5_19_16, PWM4_B),
682 PINMUX_IPSR_GPSR(IP5_19_16, A11),
683 PINMUX_IPSR_GPSR(IP5_23_20, DU0_DG4),
684 PINMUX_IPSR_MSEL(IP5_23_20, HRX0_A, SEL_HSCIF0_0),
685 PINMUX_IPSR_GPSR(IP5_23_20, A12),
686 PINMUX_IPSR_GPSR(IP5_27_24, DU0_DG5),
687 PINMUX_IPSR_MSEL(IP5_27_24, HTX0_A, SEL_HSCIF0_0),
688 PINMUX_IPSR_GPSR(IP5_27_24, PWM5_B),
689 PINMUX_IPSR_GPSR(IP5_27_24, A13),
690 PINMUX_IPSR_GPSR(IP5_31_28, DU0_DG6),
691 PINMUX_IPSR_MSEL(IP5_31_28, HRX1_C, SEL_HSCIF1_2),
692 PINMUX_IPSR_GPSR(IP5_31_28, A14),
693
694 /* IPSR6 */
695 PINMUX_IPSR_GPSR(IP6_3_0, DU0_DG7),
696 PINMUX_IPSR_MSEL(IP6_3_0, HTX1_C, SEL_HSCIF1_2),
697 PINMUX_IPSR_GPSR(IP6_3_0, PWM6_B),
698 PINMUX_IPSR_GPSR(IP6_3_0, A15),
699 PINMUX_IPSR_GPSR(IP6_7_4, DU0_DB0),
700 PINMUX_IPSR_MSEL(IP6_7_4, SCL4_D, SEL_I2C04_3),
701 PINMUX_IPSR_MSEL(IP6_7_4, CAN0_RX_C, SEL_CAN0_2),
702 PINMUX_IPSR_GPSR(IP6_7_4, A16),
703 PINMUX_IPSR_GPSR(IP6_11_8, DU0_DB1),
704 PINMUX_IPSR_MSEL(IP6_11_8, SDA4_D, SEL_I2C04_3),
705 PINMUX_IPSR_MSEL(IP6_11_8, CAN0_TX_C, SEL_CAN0_2),
706 PINMUX_IPSR_GPSR(IP6_11_8, A17),
707 PINMUX_IPSR_GPSR(IP6_15_12, DU0_DB2),
708 PINMUX_IPSR_GPSR(IP6_15_12, HCTS0_N),
709 PINMUX_IPSR_GPSR(IP6_15_12, A18),
710 PINMUX_IPSR_GPSR(IP6_19_16, DU0_DB3),
711 PINMUX_IPSR_GPSR(IP6_19_16, HRTS0_N),
712 PINMUX_IPSR_GPSR(IP6_19_16, A19),
713 PINMUX_IPSR_GPSR(IP6_23_20, DU0_DB4),
714 PINMUX_IPSR_MSEL(IP6_23_20, HCTS1_N_C, SEL_HSCIF1_2),
715 PINMUX_IPSR_GPSR(IP6_23_20, A20),
716 PINMUX_IPSR_GPSR(IP6_27_24, DU0_DB5),
717 PINMUX_IPSR_MSEL(IP6_27_24, HRTS1_N_C, SEL_HSCIF1_2),
718 PINMUX_IPSR_GPSR(IP6_27_24, A21),
719 PINMUX_IPSR_GPSR(IP6_31_28, DU0_DB6),
720 PINMUX_IPSR_GPSR(IP6_31_28, A22),
721
722 /* IPSR7 */
723 PINMUX_IPSR_GPSR(IP7_3_0, DU0_DB7),
724 PINMUX_IPSR_GPSR(IP7_3_0, A23),
725 PINMUX_IPSR_GPSR(IP7_7_4, DU0_DOTCLKIN),
726 PINMUX_IPSR_GPSR(IP7_7_4, A24),
727 PINMUX_IPSR_GPSR(IP7_11_8, DU0_DOTCLKOUT0),
728 PINMUX_IPSR_GPSR(IP7_11_8, A25),
729 PINMUX_IPSR_GPSR(IP7_15_12, DU0_DOTCLKOUT1),
730 PINMUX_IPSR_MSEL(IP7_15_12, MSIOF2_RXD_B, SEL_MSIOF2_1),
731 PINMUX_IPSR_GPSR(IP7_15_12, CS1_N_A26),
732 PINMUX_IPSR_GPSR(IP7_19_16, DU0_EXHSYNC_DU0_HSYNC),
733 PINMUX_IPSR_MSEL(IP7_19_16, MSIOF2_TXD_B, SEL_MSIOF2_1),
734 PINMUX_IPSR_GPSR(IP7_19_16, DREQ0_N),
735 PINMUX_IPSR_GPSR(IP7_23_20, DU0_EXVSYNC_DU0_VSYNC),
736 PINMUX_IPSR_MSEL(IP7_23_20, MSIOF2_SYNC_B, SEL_MSIOF2_1),
737 PINMUX_IPSR_GPSR(IP7_23_20, DACK0),
738 PINMUX_IPSR_GPSR(IP7_27_24, DU0_EXODDF_DU0_ODDF_DISP_CDE),
739 PINMUX_IPSR_MSEL(IP7_27_24, MSIOF2_SCK_B, SEL_MSIOF2_1),
740 PINMUX_IPSR_GPSR(IP7_27_24, DRACK0),
741 PINMUX_IPSR_GPSR(IP7_31_28, DU0_DISP),
742 PINMUX_IPSR_MSEL(IP7_31_28, CAN1_RX_C, SEL_CAN1_2),
743
744 /* IPSR8 */
745 PINMUX_IPSR_GPSR(IP8_3_0, DU0_CDE),
746 PINMUX_IPSR_MSEL(IP8_3_0, CAN1_TX_C, SEL_CAN1_2),
747 PINMUX_IPSR_GPSR(IP8_7_4, VI1_CLK),
748 PINMUX_IPSR_GPSR(IP8_7_4, AVB_RX_CLK),
749 PINMUX_IPSR_GPSR(IP8_7_4, ETH_REF_CLK),
750 PINMUX_IPSR_GPSR(IP8_11_8, VI1_DATA0),
751 PINMUX_IPSR_GPSR(IP8_11_8, AVB_RX_DV),
752 PINMUX_IPSR_GPSR(IP8_11_8, ETH_CRS_DV),
753 PINMUX_IPSR_GPSR(IP8_15_12, VI1_DATA1),
754 PINMUX_IPSR_GPSR(IP8_15_12, AVB_RXD0),
755 PINMUX_IPSR_GPSR(IP8_15_12, ETH_RXD0),
756 PINMUX_IPSR_GPSR(IP8_19_16, VI1_DATA2),
757 PINMUX_IPSR_GPSR(IP8_19_16, AVB_RXD1),
758 PINMUX_IPSR_GPSR(IP8_19_16, ETH_RXD1),
759 PINMUX_IPSR_GPSR(IP8_23_20, VI1_DATA3),
760 PINMUX_IPSR_GPSR(IP8_23_20, AVB_RXD2),
761 PINMUX_IPSR_GPSR(IP8_23_20, ETH_MDIO),
762 PINMUX_IPSR_GPSR(IP8_27_24, VI1_DATA4),
763 PINMUX_IPSR_GPSR(IP8_27_24, AVB_RXD3),
764 PINMUX_IPSR_GPSR(IP8_27_24, ETH_RX_ER),
765 PINMUX_IPSR_GPSR(IP8_31_28, VI1_DATA5),
766 PINMUX_IPSR_GPSR(IP8_31_28, AVB_RXD4),
767 PINMUX_IPSR_GPSR(IP8_31_28, ETH_LINK),
768
769 /* IPSR9 */
770 PINMUX_IPSR_GPSR(IP9_3_0, VI1_DATA6),
771 PINMUX_IPSR_GPSR(IP9_3_0, AVB_RXD5),
772 PINMUX_IPSR_GPSR(IP9_3_0, ETH_TXD1),
773 PINMUX_IPSR_GPSR(IP9_7_4, VI1_DATA7),
774 PINMUX_IPSR_GPSR(IP9_7_4, AVB_RXD6),
775 PINMUX_IPSR_GPSR(IP9_7_4, ETH_TX_EN),
776 PINMUX_IPSR_GPSR(IP9_11_8, VI1_CLKENB),
777 PINMUX_IPSR_MSEL(IP9_11_8, SCL3_A, SEL_I2C03_0),
778 PINMUX_IPSR_GPSR(IP9_11_8, AVB_RXD7),
779 PINMUX_IPSR_GPSR(IP9_11_8, ETH_MAGIC),
780 PINMUX_IPSR_GPSR(IP9_15_12, VI1_FIELD),
781 PINMUX_IPSR_MSEL(IP9_15_12, SDA3_A, SEL_I2C03_0),
782 PINMUX_IPSR_GPSR(IP9_15_12, AVB_RX_ER),
783 PINMUX_IPSR_GPSR(IP9_15_12, ETH_TXD0),
784 PINMUX_IPSR_GPSR(IP9_19_16, VI1_HSYNC_N),
785 PINMUX_IPSR_MSEL(IP9_19_16, RX0_B, SEL_SCIF0_1),
786 PINMUX_IPSR_MSEL(IP9_19_16, SCL0_C, SEL_I2C00_2),
787 PINMUX_IPSR_GPSR(IP9_19_16, AVB_GTXREFCLK),
788 PINMUX_IPSR_GPSR(IP9_19_16, ETH_MDC),
789 PINMUX_IPSR_GPSR(IP9_23_20, VI1_VSYNC_N),
790 PINMUX_IPSR_MSEL(IP9_23_20, TX0_B, SEL_SCIF0_1),
791 PINMUX_IPSR_MSEL(IP9_23_20, SDA0_C, SEL_I2C00_2),
792 PINMUX_IPSR_GPSR(IP9_23_20, AUDIO_CLKOUT_B),
793 PINMUX_IPSR_GPSR(IP9_23_20, AVB_TX_CLK),
794 PINMUX_IPSR_GPSR(IP9_27_24, VI1_DATA8),
795 PINMUX_IPSR_MSEL(IP9_27_24, SCL2_B, SEL_I2C02_1),
796 PINMUX_IPSR_GPSR(IP9_27_24, AVB_TX_EN),
797 PINMUX_IPSR_GPSR(IP9_31_28, VI1_DATA9),
798 PINMUX_IPSR_MSEL(IP9_31_28, SDA2_B, SEL_I2C02_1),
799 PINMUX_IPSR_GPSR(IP9_31_28, AVB_TXD0),
800
801 /* IPSR10 */
802 PINMUX_IPSR_GPSR(IP10_3_0, VI1_DATA10),
803 PINMUX_IPSR_MSEL(IP10_3_0, CAN0_RX_B, SEL_CAN0_1),
804 PINMUX_IPSR_GPSR(IP10_3_0, AVB_TXD1),
805 PINMUX_IPSR_GPSR(IP10_7_4, VI1_DATA11),
806 PINMUX_IPSR_MSEL(IP10_7_4, CAN0_TX_B, SEL_CAN0_1),
807 PINMUX_IPSR_GPSR(IP10_7_4, AVB_TXD2),
808 PINMUX_IPSR_GPSR(IP10_11_8, AVB_TXD3),
809 PINMUX_IPSR_MSEL(IP10_11_8, AUDIO_CLKA_B, SEL_ADGA_1),
810 PINMUX_IPSR_MSEL(IP10_11_8, SSI_SCK1_D, SEL_SSI1_3),
811 PINMUX_IPSR_MSEL(IP10_11_8, RX5_F, SEL_SCIF5_5),
812 PINMUX_IPSR_MSEL(IP10_11_8, MSIOF0_RXD_B, SEL_MSIOF0_1),
813 PINMUX_IPSR_GPSR(IP10_15_12, AVB_TXD4),
814 PINMUX_IPSR_MSEL(IP10_15_12, AUDIO_CLKB_B, SEL_ADGB_1),
815 PINMUX_IPSR_MSEL(IP10_15_12, SSI_WS1_D, SEL_SSI1_3),
816 PINMUX_IPSR_MSEL(IP10_15_12, TX5_F, SEL_SCIF5_5),
817 PINMUX_IPSR_MSEL(IP10_15_12, MSIOF0_TXD_B, SEL_MSIOF0_1),
818 PINMUX_IPSR_GPSR(IP10_19_16, AVB_TXD5),
819 PINMUX_IPSR_MSEL(IP10_19_16, SCIF_CLK_B, SEL_SCIFCLK_1),
820 PINMUX_IPSR_MSEL(IP10_19_16, AUDIO_CLKC_B, SEL_ADGC_1),
821 PINMUX_IPSR_MSEL(IP10_19_16, SSI_SDATA1_D, SEL_SSI1_3),
822 PINMUX_IPSR_MSEL(IP10_19_16, MSIOF0_SCK_B, SEL_MSIOF0_1),
823 PINMUX_IPSR_MSEL(IP10_23_20, SCL0_A, SEL_I2C00_0),
824 PINMUX_IPSR_MSEL(IP10_23_20, RX0_C, SEL_SCIF0_2),
825 PINMUX_IPSR_GPSR(IP10_23_20, PWM5_A),
826 PINMUX_IPSR_MSEL(IP10_23_20, TCLK1_B, SEL_TMU1_1),
827 PINMUX_IPSR_GPSR(IP10_23_20, AVB_TXD6),
828 PINMUX_IPSR_MSEL(IP10_23_20, CAN1_RX_D, SEL_CAN1_3),
829 PINMUX_IPSR_MSEL(IP10_23_20, MSIOF0_SYNC_B, SEL_MSIOF0_1),
830 PINMUX_IPSR_MSEL(IP10_27_24, SDA0_A, SEL_I2C00_0),
831 PINMUX_IPSR_MSEL(IP10_27_24, TX0_C, SEL_SCIF0_2),
832 PINMUX_IPSR_GPSR(IP10_27_24, IRQ5),
833 PINMUX_IPSR_MSEL(IP10_27_24, CAN_CLK_A, SEL_CANCLK_0),
834 PINMUX_IPSR_GPSR(IP10_27_24, AVB_GTX_CLK),
835 PINMUX_IPSR_MSEL(IP10_27_24, CAN1_TX_D, SEL_CAN1_3),
836 PINMUX_IPSR_GPSR(IP10_27_24, DVC_MUTE),
837 PINMUX_IPSR_MSEL(IP10_31_28, SCL1_A, SEL_I2C01_0),
838 PINMUX_IPSR_MSEL(IP10_31_28, RX4_A, SEL_SCIF4_0),
839 PINMUX_IPSR_GPSR(IP10_31_28, PWM5_D),
840 PINMUX_IPSR_GPSR(IP10_31_28, DU1_DR0),
841 PINMUX_IPSR_MSEL(IP10_31_28, SSI_SCK6_B, SEL_SSI6_1),
842 PINMUX_IPSR_GPSR(IP10_31_28, VI0_G0),
843
844 /* IPSR11 */
845 PINMUX_IPSR_MSEL(IP11_3_0, SDA1_A, SEL_I2C01_0),
846 PINMUX_IPSR_MSEL(IP11_3_0, TX4_A, SEL_SCIF4_0),
847 PINMUX_IPSR_GPSR(IP11_3_0, DU1_DR1),
848 PINMUX_IPSR_MSEL(IP11_3_0, SSI_WS6_B, SEL_SSI6_1),
849 PINMUX_IPSR_GPSR(IP11_3_0, VI0_G1),
850 PINMUX_IPSR_MSEL(IP11_7_4, MSIOF0_RXD_A, SEL_MSIOF0_0),
851 PINMUX_IPSR_MSEL(IP11_7_4, RX5_A, SEL_SCIF5_0),
852 PINMUX_IPSR_MSEL(IP11_7_4, SCL2_C, SEL_I2C02_2),
853 PINMUX_IPSR_GPSR(IP11_7_4, DU1_DR2),
854 PINMUX_IPSR_GPSR(IP11_7_4, QSPI1_MOSI_QSPI1_IO0),
855 PINMUX_IPSR_MSEL(IP11_7_4, SSI_SDATA6_B, SEL_SSI6_1),
856 PINMUX_IPSR_GPSR(IP11_7_4, VI0_G2),
857 PINMUX_IPSR_MSEL(IP11_11_8, MSIOF0_TXD_A, SEL_MSIOF0_0),
858 PINMUX_IPSR_MSEL(IP11_11_8, TX5_A, SEL_SCIF5_0),
859 PINMUX_IPSR_MSEL(IP11_11_8, SDA2_C, SEL_I2C02_2),
860 PINMUX_IPSR_GPSR(IP11_11_8, DU1_DR3),
861 PINMUX_IPSR_GPSR(IP11_11_8, QSPI1_MISO_QSPI1_IO1),
862 PINMUX_IPSR_MSEL(IP11_11_8, SSI_WS78_B, SEL_SSI7_1),
863 PINMUX_IPSR_GPSR(IP11_11_8, VI0_G3),
864 PINMUX_IPSR_MSEL(IP11_15_12, MSIOF0_SCK_A, SEL_MSIOF0_0),
865 PINMUX_IPSR_GPSR(IP11_15_12, IRQ0),
866 PINMUX_IPSR_GPSR(IP11_15_12, DU1_DR4),
867 PINMUX_IPSR_GPSR(IP11_15_12, QSPI1_SPCLK),
868 PINMUX_IPSR_MSEL(IP11_15_12, SSI_SCK78_B, SEL_SSI7_1),
869 PINMUX_IPSR_GPSR(IP11_15_12, VI0_G4),
870 PINMUX_IPSR_MSEL(IP11_19_16, MSIOF0_SYNC_A, SEL_MSIOF0_0),
871 PINMUX_IPSR_GPSR(IP11_19_16, PWM1_A),
872 PINMUX_IPSR_GPSR(IP11_19_16, DU1_DR5),
873 PINMUX_IPSR_GPSR(IP11_19_16, QSPI1_IO2),
874 PINMUX_IPSR_MSEL(IP11_19_16, SSI_SDATA7_B, SEL_SSI7_1),
875 PINMUX_IPSR_MSEL(IP11_23_20, MSIOF0_SS1_A, SEL_MSIOF0_0),
876 PINMUX_IPSR_GPSR(IP11_23_20, DU1_DR6),
877 PINMUX_IPSR_GPSR(IP11_23_20, QSPI1_IO3),
878 PINMUX_IPSR_MSEL(IP11_23_20, SSI_SDATA8_B, SEL_SSI8_1),
879 PINMUX_IPSR_MSEL(IP11_27_24, MSIOF0_SS2_A, SEL_MSIOF0_0),
880 PINMUX_IPSR_GPSR(IP11_27_24, DU1_DR7),
881 PINMUX_IPSR_GPSR(IP11_27_24, QSPI1_SSL),
882 PINMUX_IPSR_MSEL(IP11_31_28, HRX1_A, SEL_HSCIF1_0),
883 PINMUX_IPSR_MSEL(IP11_31_28, SCL4_A, SEL_I2C04_0),
884 PINMUX_IPSR_GPSR(IP11_31_28, PWM6_A),
885 PINMUX_IPSR_GPSR(IP11_31_28, DU1_DG0),
886 PINMUX_IPSR_MSEL(IP11_31_28, RX0_A, SEL_SCIF0_0),
887
888 /* IPSR12 */
889 PINMUX_IPSR_MSEL(IP12_3_0, HTX1_A, SEL_HSCIF1_0),
890 PINMUX_IPSR_MSEL(IP12_3_0, SDA4_A, SEL_I2C04_0),
891 PINMUX_IPSR_GPSR(IP12_3_0, DU1_DG1),
892 PINMUX_IPSR_MSEL(IP12_3_0, TX0_A, SEL_SCIF0_0),
893 PINMUX_IPSR_MSEL(IP12_7_4, HCTS1_N_A, SEL_HSCIF1_0),
894 PINMUX_IPSR_GPSR(IP12_7_4, PWM2_A),
895 PINMUX_IPSR_GPSR(IP12_7_4, DU1_DG2),
896 PINMUX_IPSR_MSEL(IP12_7_4, REMOCON_B, SEL_RCN_1),
897 PINMUX_IPSR_MSEL(IP12_11_8, HRTS1_N_A, SEL_HSCIF1_0),
898 PINMUX_IPSR_GPSR(IP12_11_8, DU1_DG3),
899 PINMUX_IPSR_MSEL(IP12_11_8, SSI_WS1_B, SEL_SSI1_1),
900 PINMUX_IPSR_GPSR(IP12_11_8, IRQ1),
901 PINMUX_IPSR_GPSR(IP12_15_12, SD2_CLK),
902 PINMUX_IPSR_GPSR(IP12_15_12, HSCK1),
903 PINMUX_IPSR_GPSR(IP12_15_12, DU1_DG4),
904 PINMUX_IPSR_MSEL(IP12_15_12, SSI_SCK1_B, SEL_SSI1_1),
905 PINMUX_IPSR_GPSR(IP12_19_16, SD2_CMD),
906 PINMUX_IPSR_MSEL(IP12_19_16, SCIF1_SCK_A, SEL_SCIF1_0),
907 PINMUX_IPSR_MSEL(IP12_19_16, TCLK2_A, SEL_TMU2_0),
908 PINMUX_IPSR_GPSR(IP12_19_16, DU1_DG5),
909 PINMUX_IPSR_MSEL(IP12_19_16, SSI_SCK2_B, SEL_SSI2_1),
910 PINMUX_IPSR_GPSR(IP12_19_16, PWM3_A),
911 PINMUX_IPSR_GPSR(IP12_23_20, SD2_DAT0),
912 PINMUX_IPSR_MSEL(IP12_23_20, RX1_A, SEL_SCIF1_0),
913 PINMUX_IPSR_MSEL(IP12_23_20, SCL1_E, SEL_I2C01_4),
914 PINMUX_IPSR_GPSR(IP12_23_20, DU1_DG6),
915 PINMUX_IPSR_MSEL(IP12_23_20, SSI_SDATA1_B, SEL_SSI1_1),
916 PINMUX_IPSR_GPSR(IP12_27_24, SD2_DAT1),
917 PINMUX_IPSR_MSEL(IP12_27_24, TX1_A, SEL_SCIF1_0),
918 PINMUX_IPSR_MSEL(IP12_27_24, SDA1_E, SEL_I2C01_4),
919 PINMUX_IPSR_GPSR(IP12_27_24, DU1_DG7),
920 PINMUX_IPSR_MSEL(IP12_27_24, SSI_WS2_B, SEL_SSI2_1),
921 PINMUX_IPSR_GPSR(IP12_31_28, SD2_DAT2),
922 PINMUX_IPSR_MSEL(IP12_31_28, RX2_A, SEL_SCIF2_0),
923 PINMUX_IPSR_GPSR(IP12_31_28, DU1_DB0),
924 PINMUX_IPSR_MSEL(IP12_31_28, SSI_SDATA2_B, SEL_SSI2_1),
925
926 /* IPSR13 */
927 PINMUX_IPSR_GPSR(IP13_3_0, SD2_DAT3),
928 PINMUX_IPSR_MSEL(IP13_3_0, TX2_A, SEL_SCIF2_0),
929 PINMUX_IPSR_GPSR(IP13_3_0, DU1_DB1),
930 PINMUX_IPSR_MSEL(IP13_3_0, SSI_WS9_B, SEL_SSI9_1),
931 PINMUX_IPSR_GPSR(IP13_7_4, SD2_CD),
932 PINMUX_IPSR_MSEL(IP13_7_4, SCIF2_SCK_A, SEL_SCIF2_CLK_0),
933 PINMUX_IPSR_GPSR(IP13_7_4, DU1_DB2),
934 PINMUX_IPSR_MSEL(IP13_7_4, SSI_SCK9_B, SEL_SSI9_1),
935 PINMUX_IPSR_GPSR(IP13_11_8, SD2_WP),
936 PINMUX_IPSR_GPSR(IP13_11_8, SCIF3_SCK),
937 PINMUX_IPSR_GPSR(IP13_11_8, DU1_DB3),
938 PINMUX_IPSR_MSEL(IP13_11_8, SSI_SDATA9_B, SEL_SSI9_1),
939 PINMUX_IPSR_MSEL(IP13_15_12, RX3_A, SEL_SCIF3_0),
940 PINMUX_IPSR_MSEL(IP13_15_12, SCL1_C, SEL_I2C01_2),
941 PINMUX_IPSR_MSEL(IP13_15_12, MSIOF1_RXD_B, SEL_MSIOF1_1),
942 PINMUX_IPSR_GPSR(IP13_15_12, DU1_DB4),
943 PINMUX_IPSR_MSEL(IP13_15_12, AUDIO_CLKA_C, SEL_ADGA_2),
944 PINMUX_IPSR_MSEL(IP13_15_12, SSI_SDATA4_B, SEL_SSI4_1),
945 PINMUX_IPSR_MSEL(IP13_19_16, TX3_A, SEL_SCIF3_0),
946 PINMUX_IPSR_MSEL(IP13_19_16, SDA1_C, SEL_I2C01_2),
947 PINMUX_IPSR_MSEL(IP13_19_16, MSIOF1_TXD_B, SEL_MSIOF1_1),
948 PINMUX_IPSR_GPSR(IP13_19_16, DU1_DB5),
949 PINMUX_IPSR_MSEL(IP13_19_16, AUDIO_CLKB_C, SEL_ADGB_2),
950 PINMUX_IPSR_MSEL(IP13_19_16, SSI_WS4_B, SEL_SSI4_1),
951 PINMUX_IPSR_MSEL(IP13_23_20, SCL2_A, SEL_I2C02_0),
952 PINMUX_IPSR_MSEL(IP13_23_20, MSIOF1_SCK_B, SEL_MSIOF1_1),
953 PINMUX_IPSR_GPSR(IP13_23_20, DU1_DB6),
954 PINMUX_IPSR_MSEL(IP13_23_20, AUDIO_CLKC_C, SEL_ADGC_2),
955 PINMUX_IPSR_MSEL(IP13_23_20, SSI_SCK4_B, SEL_SSI4_1),
956 PINMUX_IPSR_MSEL(IP13_27_24, SDA2_A, SEL_I2C02_0),
957 PINMUX_IPSR_MSEL(IP13_27_24, MSIOF1_SYNC_B, SEL_MSIOF1_1),
958 PINMUX_IPSR_GPSR(IP13_27_24, DU1_DB7),
959 PINMUX_IPSR_GPSR(IP13_27_24, AUDIO_CLKOUT_C),
960 PINMUX_IPSR_MSEL(IP13_31_28, SSI_SCK5_A, SEL_SSI5_0),
961 PINMUX_IPSR_GPSR(IP13_31_28, DU1_DOTCLKOUT1),
962
963 /* IPSR14 */
964 PINMUX_IPSR_MSEL(IP14_3_0, SSI_WS5_A, SEL_SSI5_0),
965 PINMUX_IPSR_MSEL(IP14_3_0, SCL3_C, SEL_I2C03_2),
966 PINMUX_IPSR_GPSR(IP14_3_0, DU1_DOTCLKIN),
967 PINMUX_IPSR_MSEL(IP14_7_4, SSI_SDATA5_A, SEL_SSI5_0),
968 PINMUX_IPSR_MSEL(IP14_7_4, SDA3_C, SEL_I2C03_2),
969 PINMUX_IPSR_GPSR(IP14_7_4, DU1_DOTCLKOUT0),
970 PINMUX_IPSR_MSEL(IP14_11_8, SSI_SCK6_A, SEL_SSI6_0),
971 PINMUX_IPSR_GPSR(IP14_11_8, DU1_EXODDF_DU1_ODDF_DISP_CDE),
972 PINMUX_IPSR_MSEL(IP14_15_12, SSI_WS6_A, SEL_SSI6_0),
973 PINMUX_IPSR_MSEL(IP14_15_12, SCL4_C, SEL_I2C04_2),
974 PINMUX_IPSR_GPSR(IP14_15_12, DU1_EXHSYNC_DU1_HSYNC),
975 PINMUX_IPSR_MSEL(IP14_19_16, SSI_SDATA6_A, SEL_SSI6_0),
976 PINMUX_IPSR_MSEL(IP14_19_16, SDA4_C, SEL_I2C04_2),
977 PINMUX_IPSR_GPSR(IP14_19_16, DU1_EXVSYNC_DU1_VSYNC),
978 PINMUX_IPSR_MSEL(IP14_23_20, SSI_SCK78_A, SEL_SSI7_0),
979 PINMUX_IPSR_MSEL(IP14_23_20, SDA4_E, SEL_I2C04_4),
980 PINMUX_IPSR_GPSR(IP14_23_20, DU1_DISP),
981 PINMUX_IPSR_MSEL(IP14_27_24, SSI_WS78_A, SEL_SSI7_0),
982 PINMUX_IPSR_MSEL(IP14_27_24, SCL4_E, SEL_I2C04_4),
983 PINMUX_IPSR_GPSR(IP14_27_24, DU1_CDE),
984 PINMUX_IPSR_MSEL(IP14_31_28, SSI_SDATA7_A, SEL_SSI7_0),
985 PINMUX_IPSR_GPSR(IP14_31_28, IRQ8),
986 PINMUX_IPSR_MSEL(IP14_31_28, AUDIO_CLKA_D, SEL_ADGA_3),
987 PINMUX_IPSR_MSEL(IP14_31_28, CAN_CLK_D, SEL_CANCLK_3),
988 PINMUX_IPSR_GPSR(IP14_31_28, VI0_G5),
989
990 /* IPSR15 */
991 PINMUX_IPSR_MSEL(IP15_3_0, SSI_SCK0129_A, SEL_SSI0_0),
992 PINMUX_IPSR_MSEL(IP15_3_0, MSIOF1_RXD_A, SEL_MSIOF1_0),
993 PINMUX_IPSR_MSEL(IP15_3_0, RX5_D, SEL_SCIF5_3),
994 PINMUX_IPSR_GPSR(IP15_3_0, VI0_G6),
995 PINMUX_IPSR_MSEL(IP15_7_4, SSI_WS0129_A, SEL_SSI0_0),
996 PINMUX_IPSR_MSEL(IP15_7_4, MSIOF1_TXD_A, SEL_MSIOF1_0),
997 PINMUX_IPSR_MSEL(IP15_7_4, TX5_D, SEL_SCIF5_3),
998 PINMUX_IPSR_GPSR(IP15_7_4, VI0_G7),
999 PINMUX_IPSR_MSEL(IP15_11_8, SSI_SDATA0_A, SEL_SSI0_0),
1000 PINMUX_IPSR_MSEL(IP15_11_8, MSIOF1_SYNC_A, SEL_MSIOF1_0),
1001 PINMUX_IPSR_GPSR(IP15_11_8, PWM0_C),
1002 PINMUX_IPSR_GPSR(IP15_11_8, VI0_R0),
1003 PINMUX_IPSR_GPSR(IP15_15_12, SSI_SCK34),
1004 PINMUX_IPSR_MSEL(IP15_15_12, MSIOF1_SCK_A, SEL_MSIOF1_0),
1005 PINMUX_IPSR_GPSR(IP15_15_12, AVB_MDC),
1006 PINMUX_IPSR_GPSR(IP15_15_12, DACK1),
1007 PINMUX_IPSR_GPSR(IP15_15_12, VI0_R1),
1008 PINMUX_IPSR_GPSR(IP15_19_16, SSI_WS34),
1009 PINMUX_IPSR_MSEL(IP15_19_16, MSIOF1_SS1_A, SEL_MSIOF1_0),
1010 PINMUX_IPSR_GPSR(IP15_19_16, AVB_MDIO),
1011 PINMUX_IPSR_MSEL(IP15_19_16, CAN1_RX_A, SEL_CAN1_0),
1012 PINMUX_IPSR_GPSR(IP15_19_16, DREQ1_N),
1013 PINMUX_IPSR_GPSR(IP15_19_16, VI0_R2),
1014 PINMUX_IPSR_GPSR(IP15_23_20, SSI_SDATA3),
1015 PINMUX_IPSR_MSEL(IP15_23_20, MSIOF1_SS2_A, SEL_MSIOF1_0),
1016 PINMUX_IPSR_GPSR(IP15_23_20, AVB_LINK),
1017 PINMUX_IPSR_MSEL(IP15_23_20, CAN1_TX_A, SEL_CAN1_0),
1018 PINMUX_IPSR_GPSR(IP15_23_20, DREQ2_N),
1019 PINMUX_IPSR_GPSR(IP15_23_20, VI0_R3),
1020 PINMUX_IPSR_MSEL(IP15_27_24, SSI_SCK4_A, SEL_SSI4_0),
1021 PINMUX_IPSR_GPSR(IP15_27_24, AVB_MAGIC),
1022 PINMUX_IPSR_GPSR(IP15_27_24, VI0_R4),
1023 PINMUX_IPSR_MSEL(IP15_31_28, SSI_WS4_A, SEL_SSI4_0),
1024 PINMUX_IPSR_GPSR(IP15_31_28, AVB_PHY_INT),
1025 PINMUX_IPSR_GPSR(IP15_31_28, VI0_R5),
1026
1027 /* IPSR16 */
1028 PINMUX_IPSR_MSEL(IP16_3_0, SSI_SDATA4_A, SEL_SSI4_0),
1029 PINMUX_IPSR_GPSR(IP16_3_0, AVB_CRS),
1030 PINMUX_IPSR_GPSR(IP16_3_0, VI0_R6),
1031 PINMUX_IPSR_MSEL(IP16_7_4, SSI_SCK1_A, SEL_SSI1_0),
1032 PINMUX_IPSR_MSEL(IP16_7_4, SCIF1_SCK_B, SEL_SCIF1_1),
1033 PINMUX_IPSR_GPSR(IP16_7_4, PWM1_D),
1034 PINMUX_IPSR_GPSR(IP16_7_4, IRQ9),
1035 PINMUX_IPSR_MSEL(IP16_7_4, REMOCON_A, SEL_RCN_0),
1036 PINMUX_IPSR_GPSR(IP16_7_4, DACK2),
1037 PINMUX_IPSR_GPSR(IP16_7_4, VI0_CLK),
1038 PINMUX_IPSR_GPSR(IP16_7_4, AVB_COL),
1039 PINMUX_IPSR_MSEL(IP16_11_8, SSI_SDATA8_A, SEL_SSI8_0),
1040 PINMUX_IPSR_MSEL(IP16_11_8, RX1_B, SEL_SCIF1_1),
1041 PINMUX_IPSR_MSEL(IP16_11_8, CAN0_RX_D, SEL_CAN0_3),
1042 PINMUX_IPSR_MSEL(IP16_11_8, AVB_AVTP_CAPTURE_B, SEL_AVB_1),
1043 PINMUX_IPSR_GPSR(IP16_11_8, VI0_R7),
1044 PINMUX_IPSR_MSEL(IP16_15_12, SSI_WS1_A, SEL_SSI1_0),
1045 PINMUX_IPSR_MSEL(IP16_15_12, TX1_B, SEL_SCIF1_1),
1046 PINMUX_IPSR_MSEL(IP16_15_12, CAN0_TX_D, SEL_CAN0_3),
1047 PINMUX_IPSR_MSEL(IP16_15_12, AVB_AVTP_MATCH_B, SEL_AVB_1),
1048 PINMUX_IPSR_GPSR(IP16_15_12, VI0_DATA0_VI0_B0),
1049 PINMUX_IPSR_MSEL(IP16_19_16, SSI_SDATA1_A, SEL_SSI1_0),
1050 PINMUX_IPSR_MSEL(IP16_19_16, HRX1_B, SEL_HSCIF1_1),
1051 PINMUX_IPSR_GPSR(IP16_19_16, VI0_DATA1_VI0_B1),
1052 PINMUX_IPSR_MSEL(IP16_23_20, SSI_SCK2_A, SEL_SSI2_0),
1053 PINMUX_IPSR_MSEL(IP16_23_20, HTX1_B, SEL_HSCIF1_1),
1054 PINMUX_IPSR_GPSR(IP16_23_20, AVB_TXD7),
1055 PINMUX_IPSR_GPSR(IP16_23_20, VI0_DATA2_VI0_B2),
1056 PINMUX_IPSR_MSEL(IP16_27_24, SSI_WS2_A, SEL_SSI2_0),
1057 PINMUX_IPSR_MSEL(IP16_27_24, HCTS1_N_B, SEL_HSCIF1_1),
1058 PINMUX_IPSR_GPSR(IP16_27_24, AVB_TX_ER),
1059 PINMUX_IPSR_GPSR(IP16_27_24, VI0_DATA3_VI0_B3),
1060 PINMUX_IPSR_MSEL(IP16_31_28, SSI_SDATA2_A, SEL_SSI2_0),
1061 PINMUX_IPSR_MSEL(IP16_31_28, HRTS1_N_B, SEL_HSCIF1_1),
1062 PINMUX_IPSR_GPSR(IP16_31_28, VI0_DATA4_VI0_B4),
1063
1064 /* IPSR17 */
1065 PINMUX_IPSR_MSEL(IP17_3_0, SSI_SCK9_A, SEL_SSI9_0),
1066 PINMUX_IPSR_MSEL(IP17_3_0, RX2_B, SEL_SCIF2_1),
1067 PINMUX_IPSR_MSEL(IP17_3_0, SCL3_E, SEL_I2C03_4),
1068 PINMUX_IPSR_GPSR(IP17_3_0, EX_WAIT1),
1069 PINMUX_IPSR_GPSR(IP17_3_0, VI0_DATA5_VI0_B5),
1070 PINMUX_IPSR_MSEL(IP17_7_4, SSI_WS9_A, SEL_SSI9_0),
1071 PINMUX_IPSR_MSEL(IP17_7_4, TX2_B, SEL_SCIF2_1),
1072 PINMUX_IPSR_MSEL(IP17_7_4, SDA3_E, SEL_I2C03_4),
1073 PINMUX_IPSR_GPSR(IP17_7_4, VI0_DATA6_VI0_B6),
1074 PINMUX_IPSR_MSEL(IP17_11_8, SSI_SDATA9_A, SEL_SSI9_0),
1075 PINMUX_IPSR_GPSR(IP17_11_8, SCIF2_SCK_B),
1076 PINMUX_IPSR_GPSR(IP17_11_8, PWM2_D),
1077 PINMUX_IPSR_GPSR(IP17_11_8, VI0_DATA7_VI0_B7),
1078 PINMUX_IPSR_MSEL(IP17_15_12, AUDIO_CLKA_A, SEL_ADGA_0),
1079 PINMUX_IPSR_MSEL(IP17_15_12, SCL0_B, SEL_I2C00_1),
1080 PINMUX_IPSR_GPSR(IP17_15_12, VI0_CLKENB),
1081 PINMUX_IPSR_MSEL(IP17_19_16, AUDIO_CLKB_A, SEL_ADGB_0),
1082 PINMUX_IPSR_MSEL(IP17_19_16, SDA0_B, SEL_I2C00_1),
1083 PINMUX_IPSR_GPSR(IP17_19_16, VI0_FIELD),
1084 PINMUX_IPSR_MSEL(IP17_23_20, AUDIO_CLKC_A, SEL_ADGC_0),
1085 PINMUX_IPSR_MSEL(IP17_23_20, SCL4_B, SEL_I2C04_1),
1086 PINMUX_IPSR_GPSR(IP17_23_20, VI0_HSYNC_N),
1087 PINMUX_IPSR_GPSR(IP17_27_24, AUDIO_CLKOUT_A),
1088 PINMUX_IPSR_MSEL(IP17_27_24, SDA4_B, SEL_I2C04_1),
1089 PINMUX_IPSR_GPSR(IP17_27_24, VI0_VSYNC_N),
1090};
1091
1092static const struct sh_pfc_pin pinmux_pins[] = {
1093 PINMUX_GPIO_GP_ALL(),
1094};
1095
1096/* - MMC -------------------------------------------------------------------- */
1097static const unsigned int mmc_data1_pins[] = {
1098 /* D0 */
1099 RCAR_GP_PIN(0, 15),
1100};
1101static const unsigned int mmc_data1_mux[] = {
1102 MMC0_D0_SDHI1_D0_MARK,
1103};
1104static const unsigned int mmc_data4_pins[] = {
1105 /* D[0:3] */
1106 RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 16),
1107 RCAR_GP_PIN(0, 17), RCAR_GP_PIN(0, 18),
1108};
1109static const unsigned int mmc_data4_mux[] = {
1110 MMC0_D0_SDHI1_D0_MARK, MMC0_D1_SDHI1_D1_MARK,
1111 MMC0_D2_SDHI1_D2_MARK, MMC0_D3_SDHI1_D3_MARK,
1112};
1113static const unsigned int mmc_data8_pins[] = {
1114 /* D[0:3] */
1115 RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 16),
1116 RCAR_GP_PIN(0, 17), RCAR_GP_PIN(0, 18),
1117 RCAR_GP_PIN(0, 19), RCAR_GP_PIN(0, 20),
1118 RCAR_GP_PIN(0, 21), RCAR_GP_PIN(0, 22),
1119};
1120static const unsigned int mmc_data8_mux[] = {
1121 MMC0_D0_SDHI1_D0_MARK, MMC0_D1_SDHI1_D1_MARK,
1122 MMC0_D2_SDHI1_D2_MARK, MMC0_D3_SDHI1_D3_MARK,
1123 MMC0_D4_MARK, MMC0_D5_MARK,
1124 MMC0_D6_MARK, MMC0_D7_MARK,
1125};
1126static const unsigned int mmc_ctrl_pins[] = {
1127 /* CLK, CMD */
1128 RCAR_GP_PIN(0, 13), RCAR_GP_PIN(0, 14),
1129};
1130static const unsigned int mmc_ctrl_mux[] = {
1131 MMC0_CLK_SDHI1_CLK_MARK, MMC0_CMD_SDHI1_CMD_MARK,
1132};
1133/* - SCIF0 ------------------------------------------------------------------ */
1134static const unsigned int scif0_data_a_pins[] = {
1135 /* RX, TX */
1136 RCAR_GP_PIN(4, 10), RCAR_GP_PIN(4, 11),
1137};
1138static const unsigned int scif0_data_a_mux[] = {
1139 RX0_A_MARK, TX0_A_MARK,
1140};
1141static const unsigned int scif0_data_b_pins[] = {
1142 /* RX, TX */
1143 RCAR_GP_PIN(3, 11), RCAR_GP_PIN(3, 12),
1144};
1145static const unsigned int scif0_data_b_mux[] = {
1146 RX0_B_MARK, TX0_B_MARK,
1147};
1148static const unsigned int scif0_data_c_pins[] = {
1149 /* RX, TX */
1150 RCAR_GP_PIN(4, 0), RCAR_GP_PIN(4, 1),
1151};
1152static const unsigned int scif0_data_c_mux[] = {
1153 RX0_C_MARK, TX0_C_MARK,
1154};
1155static const unsigned int scif0_data_d_pins[] = {
1156 /* RX, TX */
1157 RCAR_GP_PIN(2, 2), RCAR_GP_PIN(2, 3),
1158};
1159static const unsigned int scif0_data_d_mux[] = {
1160 RX0_D_MARK, TX0_D_MARK,
1161};
1162/* - SCIF1 ------------------------------------------------------------------ */
1163static const unsigned int scif1_data_a_pins[] = {
1164 /* RX, TX */
1165 RCAR_GP_PIN(4, 16), RCAR_GP_PIN(4, 17),
1166};
1167static const unsigned int scif1_data_a_mux[] = {
1168 RX1_A_MARK, TX1_A_MARK,
1169};
1170static const unsigned int scif1_clk_a_pins[] = {
1171 /* SCK */
1172 RCAR_GP_PIN(4, 15),
1173};
1174static const unsigned int scif1_clk_a_mux[] = {
1175 SCIF1_SCK_A_MARK,
1176};
1177static const unsigned int scif1_data_b_pins[] = {
1178 /* RX, TX */
1179 RCAR_GP_PIN(5, 19), RCAR_GP_PIN(5, 20),
1180};
1181static const unsigned int scif1_data_b_mux[] = {
1182 RX1_B_MARK, TX1_B_MARK,
1183};
1184static const unsigned int scif1_clk_b_pins[] = {
1185 /* SCK */
1186 RCAR_GP_PIN(5, 18),
1187};
1188static const unsigned int scif1_clk_b_mux[] = {
1189 SCIF1_SCK_B_MARK,
1190};
1191static const unsigned int scif1_data_c_pins[] = {
1192 /* RX, TX */
1193 RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 9),
1194};
1195static const unsigned int scif1_data_c_mux[] = {
1196 RX1_C_MARK, TX1_C_MARK,
1197};
1198static const unsigned int scif1_clk_c_pins[] = {
1199 /* SCK */
1200 RCAR_GP_PIN(1, 7),
1201};
1202static const unsigned int scif1_clk_c_mux[] = {
1203 SCIF1_SCK_C_MARK,
1204};
1205static const unsigned int scif1_data_d_pins[] = {
1206 /* RX, TX */
1207 RCAR_GP_PIN(2, 4), RCAR_GP_PIN(2, 5),
1208};
1209static const unsigned int scif1_data_d_mux[] = {
1210 RX1_D_MARK, TX1_D_MARK,
1211};
1212/* - SCIF2 ------------------------------------------------------------------ */
1213static const unsigned int scif2_data_a_pins[] = {
1214 /* RX, TX */
1215 RCAR_GP_PIN(4, 18), RCAR_GP_PIN(4, 19),
1216};
1217static const unsigned int scif2_data_a_mux[] = {
1218 RX2_A_MARK, TX2_A_MARK,
1219};
1220static const unsigned int scif2_clk_a_pins[] = {
1221 /* SCK */
1222 RCAR_GP_PIN(4, 20),
1223};
1224static const unsigned int scif2_clk_a_mux[] = {
1225 SCIF2_SCK_A_MARK,
1226};
1227static const unsigned int scif2_data_b_pins[] = {
1228 /* RX, TX */
1229 RCAR_GP_PIN(5, 25), RCAR_GP_PIN(5, 26),
1230};
1231static const unsigned int scif2_data_b_mux[] = {
1232 RX2_B_MARK, TX2_B_MARK,
1233};
1234static const unsigned int scif2_clk_b_pins[] = {
1235 /* SCK */
1236 RCAR_GP_PIN(5, 27),
1237};
1238static const unsigned int scif2_clk_b_mux[] = {
1239 SCIF2_SCK_B_MARK,
1240};
1241static const unsigned int scif2_data_c_pins[] = {
1242 /* RX, TX */
1243 RCAR_GP_PIN(2, 6), RCAR_GP_PIN(2, 7),
1244};
1245static const unsigned int scif2_data_c_mux[] = {
1246 RX2_C_MARK, TX2_C_MARK,
1247};
1248/* - SCIF3 ------------------------------------------------------------------ */
1249static const unsigned int scif3_data_a_pins[] = {
1250 /* RX, TX */
1251 RCAR_GP_PIN(4, 22), RCAR_GP_PIN(4, 23),
1252};
1253static const unsigned int scif3_data_a_mux[] = {
1254 RX3_A_MARK, TX3_A_MARK,
1255};
1256static const unsigned int scif3_clk_pins[] = {
1257 /* SCK */
1258 RCAR_GP_PIN(4, 21),
1259};
1260static const unsigned int scif3_clk_mux[] = {
1261 SCIF3_SCK_MARK,
1262};
1263static const unsigned int scif3_data_b_pins[] = {
1264 /* RX, TX */
1265 RCAR_GP_PIN(2, 8), RCAR_GP_PIN(2, 9),
1266};
1267static const unsigned int scif3_data_b_mux[] = {
1268 RX3_B_MARK, TX3_B_MARK,
1269};
1270static const unsigned int scif3_data_c_pins[] = {
1271 /* RX, TX */
1272 RCAR_GP_PIN(0, 5), RCAR_GP_PIN(0, 6),
1273};
1274static const unsigned int scif3_data_c_mux[] = {
1275 RX3_C_MARK, TX3_C_MARK,
1276};
1277/* - SCIF4 ------------------------------------------------------------------ */
1278static const unsigned int scif4_data_a_pins[] = {
1279 /* RX, TX */
1280 RCAR_GP_PIN(4, 2), RCAR_GP_PIN(4, 3),
1281};
1282static const unsigned int scif4_data_a_mux[] = {
1283 RX4_A_MARK, TX4_A_MARK,
1284};
1285static const unsigned int scif4_data_b_pins[] = {
1286 /* RX, TX */
1287 RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 3),
1288};
1289static const unsigned int scif4_data_b_mux[] = {
1290 RX4_B_MARK, TX4_B_MARK,
1291};
1292static const unsigned int scif4_data_c_pins[] = {
1293 /* RX, TX */
1294 RCAR_GP_PIN(1, 13), RCAR_GP_PIN(1, 14),
1295};
1296static const unsigned int scif4_data_c_mux[] = {
1297 RX4_C_MARK, TX4_C_MARK,
1298};
1299static const unsigned int scif4_data_d_pins[] = {
1300 /* RX, TX */
1301 RCAR_GP_PIN(2, 10), RCAR_GP_PIN(2, 11),
1302};
1303static const unsigned int scif4_data_d_mux[] = {
1304 RX4_D_MARK, TX4_D_MARK,
1305};
1306static const unsigned int scif4_data_e_pins[] = {
1307 /* RX, TX */
1308 RCAR_GP_PIN(0, 7), RCAR_GP_PIN(0, 8),
1309};
1310static const unsigned int scif4_data_e_mux[] = {
1311 RX4_E_MARK, TX4_E_MARK,
1312};
1313/* - SCIF5 ------------------------------------------------------------------ */
1314static const unsigned int scif5_data_a_pins[] = {
1315 /* RX, TX */
1316 RCAR_GP_PIN(4, 4), RCAR_GP_PIN(4, 5),
1317};
1318static const unsigned int scif5_data_a_mux[] = {
1319 RX5_A_MARK, TX5_A_MARK,
1320};
1321static const unsigned int scif5_data_b_pins[] = {
1322 /* RX, TX */
1323 RCAR_GP_PIN(1, 0), RCAR_GP_PIN(1, 1),
1324};
1325static const unsigned int scif5_data_b_mux[] = {
1326 RX5_B_MARK, TX5_B_MARK,
1327};
1328static const unsigned int scif5_data_c_pins[] = {
1329 /* RX, TX */
1330 RCAR_GP_PIN(2, 0), RCAR_GP_PIN(2, 1),
1331};
1332static const unsigned int scif5_data_c_mux[] = {
1333 RX5_C_MARK, TX5_C_MARK,
1334};
1335static const unsigned int scif5_data_d_pins[] = {
1336 /* RX, TX */
1337 RCAR_GP_PIN(5, 9), RCAR_GP_PIN(5, 10),
1338};
1339static const unsigned int scif5_data_d_mux[] = {
1340 RX5_D_MARK, TX5_D_MARK,
1341};
1342static const unsigned int scif5_data_e_pins[] = {
1343 /* RX, TX */
1344 RCAR_GP_PIN(0, 9), RCAR_GP_PIN(0, 10),
1345};
1346static const unsigned int scif5_data_e_mux[] = {
1347 RX5_E_MARK, TX5_E_MARK,
1348};
1349static const unsigned int scif5_data_f_pins[] = {
1350 /* RX, TX */
1351 RCAR_GP_PIN(3, 27), RCAR_GP_PIN(3, 28),
1352};
1353static const unsigned int scif5_data_f_mux[] = {
1354 RX5_F_MARK, TX5_F_MARK,
1355};
1356/* - SCIF Clock ------------------------------------------------------------- */
1357static const unsigned int scif_clk_a_pins[] = {
1358 /* SCIF_CLK */
1359 RCAR_GP_PIN(1, 22),
1360};
1361static const unsigned int scif_clk_a_mux[] = {
1362 SCIF_CLK_A_MARK,
1363};
1364static const unsigned int scif_clk_b_pins[] = {
1365 /* SCIF_CLK */
1366 RCAR_GP_PIN(3, 29),
1367};
1368static const unsigned int scif_clk_b_mux[] = {
1369 SCIF_CLK_B_MARK,
1370};
1371
1372static const struct sh_pfc_pin_group pinmux_groups[] = {
1373 SH_PFC_PIN_GROUP(mmc_data1),
1374 SH_PFC_PIN_GROUP(mmc_data4),
1375 SH_PFC_PIN_GROUP(mmc_data8),
1376 SH_PFC_PIN_GROUP(mmc_ctrl),
1377 SH_PFC_PIN_GROUP(scif0_data_a),
1378 SH_PFC_PIN_GROUP(scif0_data_b),
1379 SH_PFC_PIN_GROUP(scif0_data_c),
1380 SH_PFC_PIN_GROUP(scif0_data_d),
1381 SH_PFC_PIN_GROUP(scif1_data_a),
1382 SH_PFC_PIN_GROUP(scif1_clk_a),
1383 SH_PFC_PIN_GROUP(scif1_data_b),
1384 SH_PFC_PIN_GROUP(scif1_clk_b),
1385 SH_PFC_PIN_GROUP(scif1_data_c),
1386 SH_PFC_PIN_GROUP(scif1_clk_c),
1387 SH_PFC_PIN_GROUP(scif1_data_d),
1388 SH_PFC_PIN_GROUP(scif2_data_a),
1389 SH_PFC_PIN_GROUP(scif2_clk_a),
1390 SH_PFC_PIN_GROUP(scif2_data_b),
1391 SH_PFC_PIN_GROUP(scif2_clk_b),
1392 SH_PFC_PIN_GROUP(scif2_data_c),
1393 SH_PFC_PIN_GROUP(scif3_data_a),
1394 SH_PFC_PIN_GROUP(scif3_clk),
1395 SH_PFC_PIN_GROUP(scif3_data_b),
1396 SH_PFC_PIN_GROUP(scif3_data_c),
1397 SH_PFC_PIN_GROUP(scif4_data_a),
1398 SH_PFC_PIN_GROUP(scif4_data_b),
1399 SH_PFC_PIN_GROUP(scif4_data_c),
1400 SH_PFC_PIN_GROUP(scif4_data_d),
1401 SH_PFC_PIN_GROUP(scif4_data_e),
1402 SH_PFC_PIN_GROUP(scif5_data_a),
1403 SH_PFC_PIN_GROUP(scif5_data_b),
1404 SH_PFC_PIN_GROUP(scif5_data_c),
1405 SH_PFC_PIN_GROUP(scif5_data_d),
1406 SH_PFC_PIN_GROUP(scif5_data_e),
1407 SH_PFC_PIN_GROUP(scif5_data_f),
1408 SH_PFC_PIN_GROUP(scif_clk_a),
1409 SH_PFC_PIN_GROUP(scif_clk_b),
1410};
1411
1412static const char * const mmc_groups[] = {
1413 "mmc_data1",
1414 "mmc_data4",
1415 "mmc_data8",
1416 "mmc_ctrl",
1417};
1418
1419static const char * const scif0_groups[] = {
1420 "scif0_data_a",
1421 "scif0_data_b",
1422 "scif0_data_c",
1423 "scif0_data_d",
1424};
1425
1426static const char * const scif1_groups[] = {
1427 "scif1_data_a",
1428 "scif1_clk_a",
1429 "scif1_data_b",
1430 "scif1_clk_b",
1431 "scif1_data_c",
1432 "scif1_clk_c",
1433 "scif1_data_d",
1434};
1435
1436static const char * const scif2_groups[] = {
1437 "scif2_data_a",
1438 "scif2_clk_a",
1439 "scif2_data_b",
1440 "scif2_clk_b",
1441 "scif2_data_c",
1442};
1443
1444static const char * const scif3_groups[] = {
1445 "scif3_data_a",
1446 "scif3_clk",
1447 "scif3_data_b",
1448 "scif3_data_c",
1449};
1450
1451static const char * const scif4_groups[] = {
1452 "scif4_data_a",
1453 "scif4_data_b",
1454 "scif4_data_c",
1455 "scif4_data_d",
1456 "scif4_data_e",
1457};
1458
1459static const char * const scif5_groups[] = {
1460 "scif5_data_a",
1461 "scif5_data_b",
1462 "scif5_data_c",
1463 "scif5_data_d",
1464 "scif5_data_e",
1465 "scif5_data_f",
1466};
1467
1468static const char * const scif_clk_groups[] = {
1469 "scif_clk_a",
1470 "scif_clk_b",
1471};
1472
1473static const struct sh_pfc_function pinmux_functions[] = {
1474 SH_PFC_FUNCTION(mmc),
1475 SH_PFC_FUNCTION(scif0),
1476 SH_PFC_FUNCTION(scif1),
1477 SH_PFC_FUNCTION(scif2),
1478 SH_PFC_FUNCTION(scif3),
1479 SH_PFC_FUNCTION(scif4),
1480 SH_PFC_FUNCTION(scif5),
1481 SH_PFC_FUNCTION(scif_clk),
1482};
1483
1484static const struct pinmux_cfg_reg pinmux_config_regs[] = {
1485 { PINMUX_CFG_REG("GPSR0", 0xE6060004, 32, 1) {
1486 0, 0,
1487 0, 0,
1488 0, 0,
1489 0, 0,
1490 0, 0,
1491 0, 0,
1492 0, 0,
1493 0, 0,
1494 0, 0,
1495 GP_0_22_FN, FN_MMC0_D7,
1496 GP_0_21_FN, FN_MMC0_D6,
1497 GP_0_20_FN, FN_IP1_7_4,
1498 GP_0_19_FN, FN_IP1_3_0,
1499 GP_0_18_FN, FN_MMC0_D3_SDHI1_D3,
1500 GP_0_17_FN, FN_MMC0_D2_SDHI1_D2,
1501 GP_0_16_FN, FN_MMC0_D1_SDHI1_D1,
1502 GP_0_15_FN, FN_MMC0_D0_SDHI1_D0,
1503 GP_0_14_FN, FN_MMC0_CMD_SDHI1_CMD,
1504 GP_0_13_FN, FN_MMC0_CLK_SDHI1_CLK,
1505 GP_0_12_FN, FN_IP0_31_28,
1506 GP_0_11_FN, FN_IP0_27_24,
1507 GP_0_10_FN, FN_IP0_23_20,
1508 GP_0_9_FN, FN_IP0_19_16,
1509 GP_0_8_FN, FN_IP0_15_12,
1510 GP_0_7_FN, FN_IP0_11_8,
1511 GP_0_6_FN, FN_IP0_7_4,
1512 GP_0_5_FN, FN_IP0_3_0,
1513 GP_0_4_FN, FN_CLKOUT,
1514 GP_0_3_FN, FN_USB1_OVC,
1515 GP_0_2_FN, FN_USB1_PWEN,
1516 GP_0_1_FN, FN_USB0_OVC,
1517 GP_0_0_FN, FN_USB0_PWEN, }
1518 },
1519 { PINMUX_CFG_REG("GPSR1", 0xE6060008, 32, 1) {
1520 0, 0,
1521 0, 0,
1522 0, 0,
1523 0, 0,
1524 0, 0,
1525 0, 0,
1526 0, 0,
1527 0, 0,
1528 0, 0,
1529 GP_1_22_FN, FN_IP4_3_0,
1530 GP_1_21_FN, FN_IP3_31_28,
1531 GP_1_20_FN, FN_IP3_27_24,
1532 GP_1_19_FN, FN_IP3_23_20,
1533 GP_1_18_FN, FN_IP3_19_16,
1534 GP_1_17_FN, FN_IP3_15_12,
1535 GP_1_16_FN, FN_IP3_11_8,
1536 GP_1_15_FN, FN_IP3_7_4,
1537 GP_1_14_FN, FN_IP3_3_0,
1538 GP_1_13_FN, FN_IP2_31_28,
1539 GP_1_12_FN, FN_IP2_27_24,
1540 GP_1_11_FN, FN_IP2_23_20,
1541 GP_1_10_FN, FN_IP2_19_16,
1542 GP_1_9_FN, FN_IP2_15_12,
1543 GP_1_8_FN, FN_IP2_11_8,
1544 GP_1_7_FN, FN_IP2_7_4,
1545 GP_1_6_FN, FN_IP2_3_0,
1546 GP_1_5_FN, FN_IP1_31_28,
1547 GP_1_4_FN, FN_IP1_27_24,
1548 GP_1_3_FN, FN_IP1_23_20,
1549 GP_1_2_FN, FN_IP1_19_16,
1550 GP_1_1_FN, FN_IP1_15_12,
1551 GP_1_0_FN, FN_IP1_11_8, }
1552 },
1553 { PINMUX_CFG_REG("GPSR2", 0xE606000C, 32, 1) {
1554 GP_2_31_FN, FN_IP8_3_0,
1555 GP_2_30_FN, FN_IP7_31_28,
1556 GP_2_29_FN, FN_IP7_27_24,
1557 GP_2_28_FN, FN_IP7_23_20,
1558 GP_2_27_FN, FN_IP7_19_16,
1559 GP_2_26_FN, FN_IP7_15_12,
1560 GP_2_25_FN, FN_IP7_11_8,
1561 GP_2_24_FN, FN_IP7_7_4,
1562 GP_2_23_FN, FN_IP7_3_0,
1563 GP_2_22_FN, FN_IP6_31_28,
1564 GP_2_21_FN, FN_IP6_27_24,
1565 GP_2_20_FN, FN_IP6_23_20,
1566 GP_2_19_FN, FN_IP6_19_16,
1567 GP_2_18_FN, FN_IP6_15_12,
1568 GP_2_17_FN, FN_IP6_11_8,
1569 GP_2_16_FN, FN_IP6_7_4,
1570 GP_2_15_FN, FN_IP6_3_0,
1571 GP_2_14_FN, FN_IP5_31_28,
1572 GP_2_13_FN, FN_IP5_27_24,
1573 GP_2_12_FN, FN_IP5_23_20,
1574 GP_2_11_FN, FN_IP5_19_16,
1575 GP_2_10_FN, FN_IP5_15_12,
1576 GP_2_9_FN, FN_IP5_11_8,
1577 GP_2_8_FN, FN_IP5_7_4,
1578 GP_2_7_FN, FN_IP5_3_0,
1579 GP_2_6_FN, FN_IP4_31_28,
1580 GP_2_5_FN, FN_IP4_27_24,
1581 GP_2_4_FN, FN_IP4_23_20,
1582 GP_2_3_FN, FN_IP4_19_16,
1583 GP_2_2_FN, FN_IP4_15_12,
1584 GP_2_1_FN, FN_IP4_11_8,
1585 GP_2_0_FN, FN_IP4_7_4, }
1586 },
1587 { PINMUX_CFG_REG("GPSR3", 0xE6060010, 32, 1) {
1588 0, 0,
1589 0, 0,
1590 GP_3_29_FN, FN_IP10_19_16,
1591 GP_3_28_FN, FN_IP10_15_12,
1592 GP_3_27_FN, FN_IP10_11_8,
1593 0, 0,
1594 0, 0,
1595 0, 0,
1596 0, 0,
1597 0, 0,
1598 0, 0,
1599 0, 0,
1600 0, 0,
1601 0, 0,
1602 0, 0,
1603 GP_3_16_FN, FN_IP10_7_4,
1604 GP_3_15_FN, FN_IP10_3_0,
1605 GP_3_14_FN, FN_IP9_31_28,
1606 GP_3_13_FN, FN_IP9_27_24,
1607 GP_3_12_FN, FN_IP9_23_20,
1608 GP_3_11_FN, FN_IP9_19_16,
1609 GP_3_10_FN, FN_IP9_15_12,
1610 GP_3_9_FN, FN_IP9_11_8,
1611 GP_3_8_FN, FN_IP9_7_4,
1612 GP_3_7_FN, FN_IP9_3_0,
1613 GP_3_6_FN, FN_IP8_31_28,
1614 GP_3_5_FN, FN_IP8_27_24,
1615 GP_3_4_FN, FN_IP8_23_20,
1616 GP_3_3_FN, FN_IP8_19_16,
1617 GP_3_2_FN, FN_IP8_15_12,
1618 GP_3_1_FN, FN_IP8_11_8,
1619 GP_3_0_FN, FN_IP8_7_4, }
1620 },
1621 { PINMUX_CFG_REG("GPSR4", 0xE6060014, 32, 1) {
1622 0, 0,
1623 0, 0,
1624 0, 0,
1625 0, 0,
1626 0, 0,
1627 0, 0,
1628 GP_4_25_FN, FN_IP13_27_24,
1629 GP_4_24_FN, FN_IP13_23_20,
1630 GP_4_23_FN, FN_IP13_19_16,
1631 GP_4_22_FN, FN_IP13_15_12,
1632 GP_4_21_FN, FN_IP13_11_8,
1633 GP_4_20_FN, FN_IP13_7_4,
1634 GP_4_19_FN, FN_IP13_3_0,
1635 GP_4_18_FN, FN_IP12_31_28,
1636 GP_4_17_FN, FN_IP12_27_24,
1637 GP_4_16_FN, FN_IP12_23_20,
1638 GP_4_15_FN, FN_IP12_19_16,
1639 GP_4_14_FN, FN_IP12_15_12,
1640 GP_4_13_FN, FN_IP12_11_8,
1641 GP_4_12_FN, FN_IP12_7_4,
1642 GP_4_11_FN, FN_IP12_3_0,
1643 GP_4_10_FN, FN_IP11_31_28,
1644 GP_4_9_FN, FN_IP11_27_24,
1645 GP_4_8_FN, FN_IP11_23_20,
1646 GP_4_7_FN, FN_IP11_19_16,
1647 GP_4_6_FN, FN_IP11_15_12,
1648 GP_4_5_FN, FN_IP11_11_8,
1649 GP_4_4_FN, FN_IP11_7_4,
1650 GP_4_3_FN, FN_IP11_3_0,
1651 GP_4_2_FN, FN_IP10_31_28,
1652 GP_4_1_FN, FN_IP10_27_24,
1653 GP_4_0_FN, FN_IP10_23_20, }
1654 },
1655 { PINMUX_CFG_REG("GPSR5", 0xE6060018, 32, 1) {
1656 GP_5_31_FN, FN_IP17_27_24,
1657 GP_5_30_FN, FN_IP17_23_20,
1658 GP_5_29_FN, FN_IP17_19_16,
1659 GP_5_28_FN, FN_IP17_15_12,
1660 GP_5_27_FN, FN_IP17_11_8,
1661 GP_5_26_FN, FN_IP17_7_4,
1662 GP_5_25_FN, FN_IP17_3_0,
1663 GP_5_24_FN, FN_IP16_31_28,
1664 GP_5_23_FN, FN_IP16_27_24,
1665 GP_5_22_FN, FN_IP16_23_20,
1666 GP_5_21_FN, FN_IP16_19_16,
1667 GP_5_20_FN, FN_IP16_15_12,
1668 GP_5_19_FN, FN_IP16_11_8,
1669 GP_5_18_FN, FN_IP16_7_4,
1670 GP_5_17_FN, FN_IP16_3_0,
1671 GP_5_16_FN, FN_IP15_31_28,
1672 GP_5_15_FN, FN_IP15_27_24,
1673 GP_5_14_FN, FN_IP15_23_20,
1674 GP_5_13_FN, FN_IP15_19_16,
1675 GP_5_12_FN, FN_IP15_15_12,
1676 GP_5_11_FN, FN_IP15_11_8,
1677 GP_5_10_FN, FN_IP15_7_4,
1678 GP_5_9_FN, FN_IP15_3_0,
1679 GP_5_8_FN, FN_IP14_31_28,
1680 GP_5_7_FN, FN_IP14_27_24,
1681 GP_5_6_FN, FN_IP14_23_20,
1682 GP_5_5_FN, FN_IP14_19_16,
1683 GP_5_4_FN, FN_IP14_15_12,
1684 GP_5_3_FN, FN_IP14_11_8,
1685 GP_5_2_FN, FN_IP14_7_4,
1686 GP_5_1_FN, FN_IP14_3_0,
1687 GP_5_0_FN, FN_IP13_31_28, }
1688 },
1689 { PINMUX_CFG_REG_VAR("IPSR0", 0xE6060040, 32,
1690 4, 4, 4, 4, 4, 4, 4, 4) {
1691 /* IP0_31_28 [4] */
1692 FN_SD0_WP, FN_IRQ7, FN_CAN0_TX_A, 0, 0, 0, 0, 0,
1693 0, 0, 0, 0, 0, 0, 0, 0,
1694 /* IP0_27_24 [4] */
1695 FN_SD0_CD, 0, FN_CAN0_RX_A, 0, 0, 0, 0, 0,
1696 0, 0, 0, 0, 0, 0, 0, 0,
1697 /* IP0_23_20 [4] */
1698 FN_SD0_DAT3, 0, 0, FN_SSI_SDATA0_B, FN_TX5_E, 0, 0, 0,
1699 0, 0, 0, 0, 0, 0, 0, 0,
1700 /* IP0_19_16 [4] */
1701 FN_SD0_DAT2, 0, 0, FN_SSI_WS0129_B, FN_RX5_E, 0, 0, 0,
1702 0, 0, 0, 0, 0, 0, 0, 0,
1703 /* IP0_15_12 [4] */
1704 FN_SD0_DAT1, 0, 0, FN_SSI_SCK0129_B, FN_TX4_E, 0, 0, 0,
1705 0, 0, 0, 0, 0, 0, 0, 0,
1706 /* IP0_11_8 [4] */
1707 FN_SD0_DAT0, 0, 0, FN_SSI_SDATA1_C, FN_RX4_E, 0, 0, 0,
1708 0, 0, 0, 0, 0, 0, 0, 0,
1709 /* IP0_7_4 [4] */
1710 FN_SD0_CMD, 0, 0, FN_SSI_WS1_C, FN_TX3_C, 0, 0, 0,
1711 0, 0, 0, 0, 0, 0, 0, 0,
1712 /* IP0_3_0 [4] */
1713 FN_SD0_CLK, 0, 0, FN_SSI_SCK1_C, FN_RX3_C, 0, 0, 0,
1714 0, 0, 0, 0, 0, 0, 0, 0, }
1715 },
1716 { PINMUX_CFG_REG_VAR("IPSR1", 0xE6060044, 32,
1717 4, 4, 4, 4, 4, 4, 4, 4) {
1718 /* IP1_31_28 [4] */
1719 FN_D5, FN_HRX2, FN_SCL1_B, FN_PWM2_C, FN_TCLK2_B, 0, 0, 0,
1720 0, 0, 0, 0, 0, 0, 0, 0,
1721 /* IP1_27_24 [4] */
1722 FN_D4, 0, FN_IRQ3, FN_TCLK1_A, FN_PWM6_C, 0, 0, 0,
1723 0, 0, 0, 0, 0, 0, 0, 0,
1724 /* IP1_23_20 [4] */
1725 FN_D3, 0, FN_TX4_B, FN_SDA0_D, FN_PWM0_A,
1726 FN_MSIOF2_SYNC_C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1727 /* IP1_19_16 [4] */
1728 FN_D2, 0, FN_RX4_B, FN_SCL0_D, FN_PWM1_C,
1729 FN_MSIOF2_SCK_C, FN_SSI_SCK5_B, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1730 /* IP1_15_12 [4] */
1731 FN_D1, 0, FN_SDA3_B, FN_TX5_B, 0, FN_MSIOF2_TXD_C,
1732 FN_SSI_WS5_B, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1733 /* IP1_11_8 [4] */
1734 FN_D0, 0, FN_SCL3_B, FN_RX5_B, FN_IRQ4,
1735 FN_MSIOF2_RXD_C, FN_SSI_SDATA5_B, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1736 /* IP1_7_4 [4] */
1737 FN_MMC0_D5, FN_SD1_WP, 0, 0, 0, 0, 0, 0,
1738 0, 0, 0, 0, 0, 0, 0, 0,
1739 /* IP1_3_0 [4] */
1740 FN_MMC0_D4, FN_SD1_CD, 0, 0, 0, 0, 0, 0,
1741 0, 0, 0, 0, 0, 0, 0, 0, }
1742 },
1743 { PINMUX_CFG_REG_VAR("IPSR2", 0xE6060048, 32,
1744 4, 4, 4, 4, 4, 4, 4, 4) {
1745 /* IP2_31_28 [4] */
1746 FN_D13, FN_MSIOF2_SYNC_A, 0, FN_RX4_C, 0, 0, 0, 0, 0,
1747 0, 0, 0, 0, 0, 0, 0,
1748 /* IP2_27_24 [4] */
1749 FN_D12, FN_MSIOF2_SCK_A, FN_HSCK0, 0, FN_CAN_CLK_C,
1750 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1751 /* IP2_23_20 [4] */
1752 FN_D11, FN_MSIOF2_TXD_A, FN_HTX0_B, 0, 0, 0, 0, 0, 0,
1753 0, 0, 0, 0, 0, 0, 0,
1754 /* IP2_19_16 [4] */
1755 FN_D10, FN_MSIOF2_RXD_A, FN_HRX0_B, 0, 0, 0, 0, 0, 0,
1756 0, 0, 0, 0, 0, 0, 0,
1757 /* IP2_15_12 [4] */
1758 FN_D9, FN_HRTS2_N, FN_TX1_C, FN_SDA1_D, 0, 0, 0,
1759 0, 0, 0, 0, 0, 0, 0, 0, 0,
1760 /* IP2_11_8 [4] */
1761 FN_D8, FN_HCTS2_N, FN_RX1_C, FN_SCL1_D, FN_PWM3_C, 0,
1762 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1763 /* IP2_7_4 [4] */
1764 FN_D7, FN_HSCK2, FN_SCIF1_SCK_C, FN_IRQ6, FN_PWM5_C,
1765 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1766 /* IP2_3_0 [4] */
1767 FN_D6, FN_HTX2, FN_SDA1_B, FN_PWM4_C, 0, 0, 0, 0,
1768 0, 0, 0, 0, 0, 0, 0, 0, }
1769 },
1770 { PINMUX_CFG_REG_VAR("IPSR3", 0xE606004C, 32,
1771 4, 4, 4, 4, 4, 4, 4, 4) {
1772 /* IP3_31_28 [4] */
1773 FN_QSPI0_SSL, FN_WE1_N, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1774 0, 0,
1775 /* IP3_27_24 [4] */
1776 FN_QSPI0_IO3, FN_RD_N, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1777 0, 0,
1778 /* IP3_23_20 [4] */
1779 FN_QSPI0_IO2, FN_CS0_N, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1780 0, 0,
1781 /* IP3_19_16 [4] */
1782 FN_QSPI0_MISO_QSPI0_IO1, FN_RD_WR_N, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1783 0, 0, 0, 0,
1784 /* IP3_15_12 [4] */
1785 FN_QSPI0_MOSI_QSPI0_IO0, FN_BS_N, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1786 0, 0, 0,
1787 /* IP3_11_8 [4] */
1788 FN_QSPI0_SPCLK, FN_WE0_N, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1789 0, 0,
1790 /* IP3_7_4 [4] */
1791 FN_D15, FN_MSIOF2_SS2, FN_PWM4_A, 0, FN_CAN1_TX_B, FN_IRQ2,
1792 FN_AVB_AVTP_MATCH_A, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1793 /* IP3_3_0 [4] */
1794 FN_D14, FN_MSIOF2_SS1, 0, FN_TX4_C, FN_CAN1_RX_B,
1795 0, FN_AVB_AVTP_CAPTURE_A,
1796 0, 0, 0, 0, 0, 0, 0, 0, 0, }
1797 },
1798 { PINMUX_CFG_REG_VAR("IPSR4", 0xE6060050, 32,
1799 4, 4, 4, 4, 4, 4, 4, 4) {
1800 /* IP4_31_28 [4] */
1801 FN_DU0_DR6, 0, FN_RX2_C, 0, 0, 0, FN_A6, 0,
1802 0, 0, 0, 0, 0, 0, 0, 0,
1803 /* IP4_27_24 [4] */
1804 FN_DU0_DR5, 0, FN_TX1_D, 0, FN_PWM1_B, 0, FN_A5, 0,
1805 0, 0, 0, 0, 0, 0, 0, 0,
1806 /* IP4_23_20 [4] */
1807 FN_DU0_DR4, 0, FN_RX1_D, 0, 0, 0, FN_A4, 0, 0, 0, 0,
1808 0, 0, 0, 0, 0,
1809 /* IP4_19_16 [4] */
1810 FN_DU0_DR3, 0, FN_TX0_D, FN_SDA0_E, FN_PWM0_B, 0,
1811 FN_A3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1812 /* IP4_15_12 [4] */
1813 FN_DU0_DR2, 0, FN_RX0_D, FN_SCL0_E, 0, 0, FN_A2, 0,
1814 0, 0, 0, 0, 0, 0, 0, 0,
1815 /* IP4_11_8 [4] */
1816 FN_DU0_DR1, 0, FN_TX5_C, FN_SDA2_D, 0, 0, FN_A1, 0,
1817 0, 0, 0, 0, 0, 0, 0, 0,
1818 /* IP4_7_4 [4] */
1819 FN_DU0_DR0, 0, FN_RX5_C, FN_SCL2_D, 0, 0, FN_A0, 0,
1820 0, 0, 0, 0, 0, 0, 0, 0,
1821 /* IP4_3_0 [4] */
1822 FN_EX_WAIT0, FN_CAN_CLK_B, FN_SCIF_CLK_A, 0, 0, 0, 0,
1823 0, 0, 0, 0, 0, 0, 0, 0, 0, }
1824 },
1825 { PINMUX_CFG_REG_VAR("IPSR5", 0xE6060054, 32,
1826 4, 4, 4, 4, 4, 4, 4, 4) {
1827 /* IP5_31_28 [4] */
1828 FN_DU0_DG6, 0, FN_HRX1_C, 0, 0, 0, FN_A14, 0, 0, 0,
1829 0, 0, 0, 0, 0, 0,
1830 /* IP5_27_24 [4] */
1831 FN_DU0_DG5, 0, FN_HTX0_A, 0, FN_PWM5_B, 0, FN_A13,
1832 0, 0, 0, 0, 0, 0, 0, 0, 0,
1833 /* IP5_23_20 [4] */
1834 FN_DU0_DG4, 0, FN_HRX0_A, 0, 0, 0, FN_A12, 0, 0, 0,
1835 0, 0, 0, 0, 0, 0,
1836 /* IP5_19_16 [4] */
1837 FN_DU0_DG3, 0, FN_TX4_D, 0, FN_PWM4_B, 0, FN_A11, 0,
1838 0, 0, 0, 0, 0, 0, 0, 0,
1839 /* IP5_15_12 [4] */
1840 FN_DU0_DG2, 0, FN_RX4_D, 0, 0, 0, FN_A10, 0, 0, 0,
1841 0, 0, 0, 0, 0, 0,
1842 /* IP5_11_8 [4] */
1843 FN_DU0_DG1, 0, FN_TX3_B, FN_SDA3_D, FN_PWM3_B, 0,
1844 FN_A9, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1845 /* IP5_7_4 [4] */
1846 FN_DU0_DG0, 0, FN_RX3_B, FN_SCL3_D, 0, 0, FN_A8, 0,
1847 0, 0, 0, 0, 0, 0, 0, 0,
1848 /* IP5_3_0 [4] */
1849 FN_DU0_DR7, 0, FN_TX2_C, 0, FN_PWM2_B, 0, FN_A7, 0,
1850 0, 0, 0, 0, 0, 0, 0, 0, }
1851 },
1852 { PINMUX_CFG_REG_VAR("IPSR6", 0xE6060058, 32,
1853 4, 4, 4, 4, 4, 4, 4, 4) {
1854 /* IP6_31_28 [4] */
1855 FN_DU0_DB6, 0, 0, 0, 0, 0, FN_A22, 0, 0,
1856 0, 0, 0, 0, 0, 0, 0,
1857 /* IP6_27_24 [4] */
1858 FN_DU0_DB5, 0, FN_HRTS1_N_C, 0, 0, 0,
1859 FN_A21, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1860 /* IP6_23_20 [4] */
1861 FN_DU0_DB4, 0, FN_HCTS1_N_C, 0, 0, 0,
1862 FN_A20, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1863 /* IP6_19_16 [4] */
1864 FN_DU0_DB3, 0, FN_HRTS0_N, 0, 0, 0, FN_A19, 0, 0, 0,
1865 0, 0, 0, 0, 0, 0,
1866 /* IP6_15_12 [4] */
1867 FN_DU0_DB2, 0, FN_HCTS0_N, 0, 0, 0, FN_A18, 0, 0, 0,
1868 0, 0, 0, 0, 0, 0,
1869 /* IP6_11_8 [4] */
1870 FN_DU0_DB1, 0, 0, FN_SDA4_D, FN_CAN0_TX_C, 0, FN_A17,
1871 0, 0, 0, 0, 0, 0, 0, 0, 0,
1872 /* IP6_7_4 [4] */
1873 FN_DU0_DB0, 0, 0, FN_SCL4_D, FN_CAN0_RX_C, 0, FN_A16,
1874 0, 0, 0, 0, 0, 0, 0, 0, 0,
1875 /* IP6_3_0 [4] */
1876 FN_DU0_DG7, 0, FN_HTX1_C, 0, FN_PWM6_B, 0, FN_A15,
1877 0, 0, 0, 0, 0, 0, 0, 0, 0, }
1878 },
1879 { PINMUX_CFG_REG_VAR("IPSR7", 0xE606005C, 32,
1880 4, 4, 4, 4, 4, 4, 4, 4) {
1881 /* IP7_31_28 [4] */
1882 FN_DU0_DISP, 0, 0, 0, FN_CAN1_RX_C, 0, 0, 0, 0, 0, 0,
1883 0, 0, 0, 0, 0,
1884 /* IP7_27_24 [4] */
1885 FN_DU0_EXODDF_DU0_ODDF_DISP_CDE, 0, FN_MSIOF2_SCK_B,
1886 0, 0, 0, FN_DRACK0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1887 /* IP7_23_20 [4] */
1888 FN_DU0_EXVSYNC_DU0_VSYNC, 0, FN_MSIOF2_SYNC_B, 0,
1889 0, 0, FN_DACK0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1890 /* IP7_19_16 [4] */
1891 FN_DU0_EXHSYNC_DU0_HSYNC, 0, FN_MSIOF2_TXD_B, 0,
1892 0, 0, FN_DREQ0_N, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1893 /* IP7_15_12 [4] */
1894 FN_DU0_DOTCLKOUT1, 0, FN_MSIOF2_RXD_B, 0, 0, 0,
1895 FN_CS1_N_A26, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1896 /* IP7_11_8 [4] */
1897 FN_DU0_DOTCLKOUT0, 0, 0, 0, 0, 0, FN_A25, 0, 0, 0, 0,
1898 0, 0, 0, 0, 0,
1899 /* IP7_7_4 [4] */
1900 FN_DU0_DOTCLKIN, 0, 0, 0, 0, 0, FN_A24, 0, 0, 0,
1901 0, 0, 0, 0, 0, 0,
1902 /* IP7_3_0 [4] */
1903 FN_DU0_DB7, 0, 0, 0, 0, 0, FN_A23, 0, 0,
1904 0, 0, 0, 0, 0, 0, 0, }
1905 },
1906 { PINMUX_CFG_REG_VAR("IPSR8", 0xE6060060, 32,
1907 4, 4, 4, 4, 4, 4, 4, 4) {
1908 /* IP8_31_28 [4] */
1909 FN_VI1_DATA5, 0, 0, 0, FN_AVB_RXD4, FN_ETH_LINK, 0, 0, 0, 0,
1910 0, 0, 0, 0, 0, 0,
1911 /* IP8_27_24 [4] */
1912 FN_VI1_DATA4, 0, 0, 0, FN_AVB_RXD3, FN_ETH_RX_ER, 0, 0, 0, 0,
1913 0, 0, 0, 0, 0, 0,
1914 /* IP8_23_20 [4] */
1915 FN_VI1_DATA3, 0, 0, 0, FN_AVB_RXD2, FN_ETH_MDIO, 0, 0, 0, 0,
1916 0, 0, 0, 0, 0, 0,
1917 /* IP8_19_16 [4] */
1918 FN_VI1_DATA2, 0, 0, 0, FN_AVB_RXD1, FN_ETH_RXD1, 0, 0, 0, 0,
1919 0, 0, 0, 0, 0, 0,
1920 /* IP8_15_12 [4] */
1921 FN_VI1_DATA1, 0, 0, 0, FN_AVB_RXD0, FN_ETH_RXD0, 0, 0, 0, 0,
1922 0, 0, 0, 0, 0, 0,
1923 /* IP8_11_8 [4] */
1924 FN_VI1_DATA0, 0, 0, 0, FN_AVB_RX_DV, FN_ETH_CRS_DV, 0, 0, 0,
1925 0, 0, 0, 0, 0, 0, 0,
1926 /* IP8_7_4 [4] */
1927 FN_VI1_CLK, 0, 0, 0, FN_AVB_RX_CLK, FN_ETH_REF_CLK, 0, 0, 0,
1928 0, 0, 0, 0, 0, 0, 0,
1929 /* IP8_3_0 [4] */
1930 FN_DU0_CDE, 0, 0, 0, FN_CAN1_TX_C, 0, 0, 0, 0, 0, 0, 0,
1931 0, 0, 0, 0, }
1932 },
1933 { PINMUX_CFG_REG_VAR("IPSR9", 0xE6060064, 32,
1934 4, 4, 4, 4, 4, 4, 4, 4) {
1935 /* IP9_31_28 [4] */
1936 FN_VI1_DATA9, 0, 0, FN_SDA2_B, FN_AVB_TXD0, 0, 0, 0, 0, 0, 0,
1937 0, 0, 0, 0, 0,
1938 /* IP9_27_24 [4] */
1939 FN_VI1_DATA8, 0, 0, FN_SCL2_B, FN_AVB_TX_EN, 0, 0, 0, 0, 0, 0,
1940 0, 0, 0, 0, 0,
1941 /* IP9_23_20 [4] */
1942 FN_VI1_VSYNC_N, FN_TX0_B, FN_SDA0_C, FN_AUDIO_CLKOUT_B,
1943 FN_AVB_TX_CLK, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1944 /* IP9_19_16 [4] */
1945 FN_VI1_HSYNC_N, FN_RX0_B, FN_SCL0_C, 0, FN_AVB_GTXREFCLK,
1946 FN_ETH_MDC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1947 /* IP9_15_12 [4] */
1948 FN_VI1_FIELD, FN_SDA3_A, 0, 0, FN_AVB_RX_ER, FN_ETH_TXD0, 0,
1949 0, 0, 0, 0, 0, 0, 0, 0, 0,
1950 /* IP9_11_8 [4] */
1951 FN_VI1_CLKENB, FN_SCL3_A, 0, 0, FN_AVB_RXD7, FN_ETH_MAGIC, 0,
1952 0, 0, 0, 0, 0, 0, 0, 0, 0,
1953 /* IP9_7_4 [4] */
1954 FN_VI1_DATA7, 0, 0, 0, FN_AVB_RXD6, FN_ETH_TX_EN, 0, 0, 0, 0,
1955 0, 0, 0, 0, 0, 0,
1956 /* IP9_3_0 [4] */
1957 FN_VI1_DATA6, 0, 0, 0, FN_AVB_RXD5, FN_ETH_TXD1, 0, 0, 0, 0,
1958 0, 0, 0, 0, 0, 0, }
1959 },
1960 { PINMUX_CFG_REG_VAR("IPSR10", 0xE6060068, 32,
1961 4, 4, 4, 4, 4, 4, 4, 4) {
1962 /* IP10_31_28 [4] */
1963 FN_SCL1_A, FN_RX4_A, FN_PWM5_D, FN_DU1_DR0, 0, 0,
1964 FN_SSI_SCK6_B, FN_VI0_G0, 0, 0, 0, 0, 0, 0, 0, 0,
1965 /* IP10_27_24 [4] */
1966 FN_SDA0_A, FN_TX0_C, FN_IRQ5, FN_CAN_CLK_A, FN_AVB_GTX_CLK,
1967 FN_CAN1_TX_D, FN_DVC_MUTE, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1968 /* IP10_23_20 [4] */
1969 FN_SCL0_A, FN_RX0_C, FN_PWM5_A, FN_TCLK1_B, FN_AVB_TXD6,
1970 FN_CAN1_RX_D, FN_MSIOF0_SYNC_B, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1971 /* IP10_19_16 [4] */
1972 FN_AVB_TXD5, FN_SCIF_CLK_B, FN_AUDIO_CLKC_B, 0,
1973 FN_SSI_SDATA1_D, 0, FN_MSIOF0_SCK_B, 0, 0, 0, 0, 0, 0, 0,
1974 0, 0,
1975 /* IP10_15_12 [4] */
1976 FN_AVB_TXD4, 0, FN_AUDIO_CLKB_B, 0, FN_SSI_WS1_D, FN_TX5_F,
1977 FN_MSIOF0_TXD_B, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1978 /* IP10_11_8 [4] */
1979 FN_AVB_TXD3, 0, FN_AUDIO_CLKA_B, 0, FN_SSI_SCK1_D, FN_RX5_F,
1980 FN_MSIOF0_RXD_B, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1981 /* IP10_7_4 [4] */
1982 FN_VI1_DATA11, 0, 0, FN_CAN0_TX_B, FN_AVB_TXD2, 0, 0, 0, 0,
1983 0, 0, 0, 0, 0, 0, 0,
1984 /* IP10_3_0 [4] */
1985 FN_VI1_DATA10, 0, 0, FN_CAN0_RX_B, FN_AVB_TXD1, 0, 0, 0, 0,
1986 0, 0, 0, 0, 0, 0, 0, }
1987 },
1988 { PINMUX_CFG_REG_VAR("IPSR11", 0xE606006C, 32,
1989 4, 4, 4, 4, 4, 4, 4, 4) {
1990 /* IP11_31_28 [4] */
1991 FN_HRX1_A, FN_SCL4_A, FN_PWM6_A, FN_DU1_DG0, FN_RX0_A, 0, 0,
1992 0, 0, 0, 0, 0, 0, 0, 0, 0,
1993 /* IP11_27_24 [4] */
1994 FN_MSIOF0_SS2_A, 0, 0, FN_DU1_DR7, 0,
1995 FN_QSPI1_SSL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1996 /* IP11_23_20 [4] */
1997 FN_MSIOF0_SS1_A, 0, 0, FN_DU1_DR6, 0,
1998 FN_QSPI1_IO3, FN_SSI_SDATA8_B, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1999 /* IP11_19_16 [4] */
2000 FN_MSIOF0_SYNC_A, FN_PWM1_A, 0, FN_DU1_DR5,
2001 0, FN_QSPI1_IO2, FN_SSI_SDATA7_B, 0, 0, 0, 0, 0,
2002 0, 0, 0, 0,
2003 /* IP11_15_12 [4] */
2004 FN_MSIOF0_SCK_A, FN_IRQ0, 0, FN_DU1_DR4,
2005 0, FN_QSPI1_SPCLK, FN_SSI_SCK78_B, FN_VI0_G4,
2006 0, 0, 0, 0, 0, 0, 0, 0,
2007 /* IP11_11_8 [4] */
2008 FN_MSIOF0_TXD_A, FN_TX5_A, FN_SDA2_C, FN_DU1_DR3, 0,
2009 FN_QSPI1_MISO_QSPI1_IO1, FN_SSI_WS78_B, FN_VI0_G3,
2010 0, 0, 0, 0, 0, 0, 0, 0,
2011 /* IP11_7_4 [4] */
2012 FN_MSIOF0_RXD_A, FN_RX5_A, FN_SCL2_C, FN_DU1_DR2, 0,
2013 FN_QSPI1_MOSI_QSPI1_IO0, FN_SSI_SDATA6_B, FN_VI0_G2,
2014 0, 0, 0, 0, 0, 0, 0, 0,
2015 /* IP11_3_0 [4] */
2016 FN_SDA1_A, FN_TX4_A, 0, FN_DU1_DR1, 0, 0, FN_SSI_WS6_B,
2017 FN_VI0_G1, 0, 0, 0, 0, 0, 0, 0, 0, }
2018 },
2019 { PINMUX_CFG_REG_VAR("IPSR12", 0xE6060070, 32,
2020 4, 4, 4, 4, 4, 4, 4, 4) {
2021 /* IP12_31_28 [4] */
2022 FN_SD2_DAT2, FN_RX2_A, 0, FN_DU1_DB0, FN_SSI_SDATA2_B, 0, 0,
2023 0, 0, 0, 0, 0, 0, 0, 0, 0,
2024 /* IP12_27_24 [4] */
2025 FN_SD2_DAT1, FN_TX1_A, FN_SDA1_E, FN_DU1_DG7, FN_SSI_WS2_B,
2026 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2027 /* IP12_23_20 [4] */
2028 FN_SD2_DAT0, FN_RX1_A, FN_SCL1_E, FN_DU1_DG6,
2029 FN_SSI_SDATA1_B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2030 /* IP12_19_16 [4] */
2031 FN_SD2_CMD, FN_SCIF1_SCK_A, FN_TCLK2_A, FN_DU1_DG5,
2032 FN_SSI_SCK2_B, FN_PWM3_A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2033 /* IP12_15_12 [4] */
2034 FN_SD2_CLK, FN_HSCK1, 0, FN_DU1_DG4, FN_SSI_SCK1_B, 0, 0, 0,
2035 0, 0, 0, 0, 0, 0, 0, 0,
2036 /* IP12_11_8 [4] */
2037 FN_HRTS1_N_A, 0, 0, FN_DU1_DG3, FN_SSI_WS1_B, FN_IRQ1, 0, 0,
2038 0, 0, 0, 0, 0, 0, 0, 0,
2039 /* IP12_7_4 [4] */
2040 FN_HCTS1_N_A, FN_PWM2_A, 0, FN_DU1_DG2, FN_REMOCON_B,
2041 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2042 /* IP12_3_0 [4] */
2043 FN_HTX1_A, FN_SDA4_A, 0, FN_DU1_DG1, FN_TX0_A, 0, 0, 0, 0, 0,
2044 0, 0, 0, 0, 0, 0, }
2045 },
2046 { PINMUX_CFG_REG_VAR("IPSR13", 0xE6060074, 32,
2047 4, 4, 4, 4, 4, 4, 4, 4) {
2048 /* IP13_31_28 [4] */
2049 FN_SSI_SCK5_A, 0, 0, FN_DU1_DOTCLKOUT1, 0, 0, 0, 0, 0, 0, 0,
2050 0, 0, 0, 0, 0,
2051 /* IP13_27_24 [4] */
2052 FN_SDA2_A, 0, FN_MSIOF1_SYNC_B, FN_DU1_DB7, FN_AUDIO_CLKOUT_C,
2053 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2054 /* IP13_23_20 [4] */
2055 FN_SCL2_A, 0, FN_MSIOF1_SCK_B, FN_DU1_DB6, FN_AUDIO_CLKC_C,
2056 FN_SSI_SCK4_B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2057 /* IP13_19_16 [4] */
2058 FN_TX3_A, FN_SDA1_C, FN_MSIOF1_TXD_B, FN_DU1_DB5,
2059 FN_AUDIO_CLKB_C, FN_SSI_WS4_B, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2060 /* IP13_15_12 [4] */
2061 FN_RX3_A, FN_SCL1_C, FN_MSIOF1_RXD_B, FN_DU1_DB4,
2062 FN_AUDIO_CLKA_C, FN_SSI_SDATA4_B, 0, 0, 0, 0, 0, 0, 0, 0,
2063 0, 0,
2064 /* IP13_11_8 [4] */
2065 FN_SD2_WP, FN_SCIF3_SCK, 0, FN_DU1_DB3, FN_SSI_SDATA9_B, 0,
2066 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2067 /* IP13_7_4 [4] */
2068 FN_SD2_CD, FN_SCIF2_SCK_A, 0, FN_DU1_DB2, FN_SSI_SCK9_B, 0, 0,
2069 0, 0, 0, 0, 0, 0, 0, 0, 0,
2070 /* IP13_3_0 [4] */
2071 FN_SD2_DAT3, FN_TX2_A, 0, FN_DU1_DB1, FN_SSI_WS9_B, 0, 0, 0,
2072 0, 0, 0, 0, 0, 0, 0, 0, }
2073 },
2074 { PINMUX_CFG_REG_VAR("IPSR14", 0xE6060078, 32,
2075 4, 4, 4, 4, 4, 4, 4, 4) {
2076 /* IP14_31_28 [4] */
2077 FN_SSI_SDATA7_A, 0, 0, FN_IRQ8, FN_AUDIO_CLKA_D, FN_CAN_CLK_D,
2078 FN_VI0_G5, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2079 /* IP14_27_24 [4] */
2080 FN_SSI_WS78_A, 0, FN_SCL4_E, FN_DU1_CDE, 0, 0, 0, 0, 0, 0, 0,
2081 0, 0, 0, 0, 0,
2082 /* IP14_23_20 [4] */
2083 FN_SSI_SCK78_A, 0, FN_SDA4_E, FN_DU1_DISP, 0, 0, 0, 0, 0, 0,
2084 0, 0, 0, 0, 0, 0,
2085 /* IP14_19_16 [4] */
2086 FN_SSI_SDATA6_A, 0, FN_SDA4_C, FN_DU1_EXVSYNC_DU1_VSYNC, 0, 0,
2087 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2088 /* IP14_15_12 [4] */
2089 FN_SSI_WS6_A, 0, FN_SCL4_C, FN_DU1_EXHSYNC_DU1_HSYNC, 0, 0, 0,
2090 0, 0, 0, 0, 0, 0, 0, 0, 0,
2091 /* IP14_11_8 [4] */
2092 FN_SSI_SCK6_A, 0, 0, FN_DU1_EXODDF_DU1_ODDF_DISP_CDE, 0, 0,
2093 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2094 /* IP14_7_4 [4] */
2095 FN_SSI_SDATA5_A, 0, FN_SDA3_C, FN_DU1_DOTCLKOUT0, 0, 0, 0,
2096 0, 0, 0, 0, 0, 0, 0, 0, 0,
2097 /* IP14_3_0 [4] */
2098 FN_SSI_WS5_A, 0, FN_SCL3_C, FN_DU1_DOTCLKIN, 0, 0, 0, 0, 0, 0,
2099 0, 0, 0, 0, 0, 0, }
2100 },
2101 { PINMUX_CFG_REG_VAR("IPSR15", 0xE606007C, 32,
2102 4, 4, 4, 4, 4, 4, 4, 4) {
2103 /* IP15_31_28 [4] */
2104 FN_SSI_WS4_A, 0, FN_AVB_PHY_INT, 0, 0, 0, FN_VI0_R5, 0, 0, 0,
2105 0, 0, 0, 0, 0, 0,
2106 /* IP15_27_24 [4] */
2107 FN_SSI_SCK4_A, 0, FN_AVB_MAGIC, 0, 0, 0, FN_VI0_R4, 0, 0, 0,
2108 0, 0, 0, 0, 0, 0,
2109 /* IP15_23_20 [4] */
2110 FN_SSI_SDATA3, FN_MSIOF1_SS2_A, FN_AVB_LINK, 0, FN_CAN1_TX_A,
2111 FN_DREQ2_N, FN_VI0_R3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2112 /* IP15_19_16 [4] */
2113 FN_SSI_WS34, FN_MSIOF1_SS1_A, FN_AVB_MDIO, 0, FN_CAN1_RX_A,
2114 FN_DREQ1_N, FN_VI0_R2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2115 /* IP15_15_12 [4] */
2116 FN_SSI_SCK34, FN_MSIOF1_SCK_A, FN_AVB_MDC, 0, 0, FN_DACK1,
2117 FN_VI0_R1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2118 /* IP15_11_8 [4] */
2119 FN_SSI_SDATA0_A, FN_MSIOF1_SYNC_A, FN_PWM0_C, 0, 0, 0,
2120 FN_VI0_R0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2121 /* IP15_7_4 [4] */
2122 FN_SSI_WS0129_A, FN_MSIOF1_TXD_A, FN_TX5_D, 0, 0, 0,
2123 FN_VI0_G7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2124 /* IP15_3_0 [4] */
2125 FN_SSI_SCK0129_A, FN_MSIOF1_RXD_A, FN_RX5_D, 0, 0, 0,
2126 FN_VI0_G6, 0, 0, 0, 0, 0, 0, 0, 0, 0, }
2127 },
2128 { PINMUX_CFG_REG_VAR("IPSR16", 0xE6060080, 32,
2129 4, 4, 4, 4, 4, 4, 4, 4) {
2130 /* IP16_31_28 [4] */
2131 FN_SSI_SDATA2_A, FN_HRTS1_N_B, 0, 0, 0, 0,
2132 FN_VI0_DATA4_VI0_B4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2133 /* IP16_27_24 [4] */
2134 FN_SSI_WS2_A, FN_HCTS1_N_B, 0, 0, 0, FN_AVB_TX_ER,
2135 FN_VI0_DATA3_VI0_B3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2136 /* IP16_23_20 [4] */
2137 FN_SSI_SCK2_A, FN_HTX1_B, 0, 0, 0, FN_AVB_TXD7,
2138 FN_VI0_DATA2_VI0_B2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2139 /* IP16_19_16 [4] */
2140 FN_SSI_SDATA1_A, FN_HRX1_B, 0, 0, 0, 0, FN_VI0_DATA1_VI0_B1,
2141 0, 0, 0, 0, 0, 0, 0, 0, 0,
2142 /* IP16_15_12 [4] */
2143 FN_SSI_WS1_A, FN_TX1_B, 0, 0, FN_CAN0_TX_D,
2144 FN_AVB_AVTP_MATCH_B, FN_VI0_DATA0_VI0_B0, 0, 0, 0, 0, 0, 0,
2145 0, 0, 0,
2146 /* IP16_11_8 [4] */
2147 FN_SSI_SDATA8_A, FN_RX1_B, 0, 0, FN_CAN0_RX_D,
2148 FN_AVB_AVTP_CAPTURE_B, FN_VI0_R7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2149 /* IP16_7_4 [4] */
2150 FN_SSI_SCK1_A, FN_SCIF1_SCK_B, FN_PWM1_D, FN_IRQ9, FN_REMOCON_A,
2151 FN_DACK2, FN_VI0_CLK, FN_AVB_COL, 0, 0, 0, 0, 0, 0, 0, 0,
2152 /* IP16_3_0 [4] */
2153 FN_SSI_SDATA4_A, 0, FN_AVB_CRS, 0, 0, 0, FN_VI0_R6, 0, 0, 0,
2154 0, 0, 0, 0, 0, 0, }
2155 },
2156 { PINMUX_CFG_REG_VAR("IPSR17", 0xE6060084, 32,
2157 4, 4, 4, 4, 4, 4, 4, 4) {
2158 /* IP17_31_28 [4] */
2159 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2160 /* IP17_27_24 [4] */
2161 FN_AUDIO_CLKOUT_A, FN_SDA4_B, 0, 0, 0, 0,
2162 FN_VI0_VSYNC_N, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2163 /* IP17_23_20 [4] */
2164 FN_AUDIO_CLKC_A, FN_SCL4_B, 0, 0, 0, 0,
2165 FN_VI0_HSYNC_N, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2166 /* IP17_19_16 [4] */
2167 FN_AUDIO_CLKB_A, FN_SDA0_B, 0, 0, 0, 0,
2168 FN_VI0_FIELD, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2169 /* IP17_15_12 [4] */
2170 FN_AUDIO_CLKA_A, FN_SCL0_B, 0, 0, 0, 0,
2171 FN_VI0_CLKENB, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2172 /* IP17_11_8 [4] */
2173 FN_SSI_SDATA9_A, FN_SCIF2_SCK_B, FN_PWM2_D, 0, 0, 0,
2174 FN_VI0_DATA7_VI0_B7, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2175 /* IP17_7_4 [4] */
2176 FN_SSI_WS9_A, FN_TX2_B, FN_SDA3_E, 0, 0, 0,
2177 FN_VI0_DATA6_VI0_B6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2178 /* IP17_3_0 [4] */
2179 FN_SSI_SCK9_A, FN_RX2_B, FN_SCL3_E, 0, 0, FN_EX_WAIT1,
2180 FN_VI0_DATA5_VI0_B5, 0, 0, 0, 0, 0, 0, 0, 0, 0, }
2181 },
2182 { PINMUX_CFG_REG_VAR("MOD_SEL0", 0xE60600C0, 32,
2183 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 1, 3, 3,
2184 1, 2, 3, 3, 1) {
2185 /* RESERVED [1] */
2186 0, 0,
2187 /* RESERVED [1] */
2188 0, 0,
2189 /* RESERVED [1] */
2190 0, 0,
2191 /* RESERVED [1] */
2192 0, 0,
2193 /* RESERVED [1] */
2194 0, 0,
2195 /* SEL_ADGA [2] */
2196 FN_SEL_ADGA_0, FN_SEL_ADGA_1, FN_SEL_ADGA_2, FN_SEL_ADGA_3,
2197 /* RESERVED [1] */
2198 0, 0,
2199 /* RESERVED [1] */
2200 0, 0,
2201 /* SEL_CANCLK [2] */
2202 FN_SEL_CANCLK_0, FN_SEL_CANCLK_1, FN_SEL_CANCLK_2,
2203 FN_SEL_CANCLK_3,
2204 /* SEL_CAN1 [2] */
2205 FN_SEL_CAN1_0, FN_SEL_CAN1_1, FN_SEL_CAN1_2, FN_SEL_CAN1_3,
2206 /* SEL_CAN0 [2] */
2207 FN_SEL_CAN0_0, FN_SEL_CAN0_1, FN_SEL_CAN0_2, FN_SEL_CAN0_3,
2208 /* RESERVED [1] */
2209 0, 0,
2210 /* SEL_I2C04 [3] */
2211 FN_SEL_I2C04_0, FN_SEL_I2C04_1, FN_SEL_I2C04_2, FN_SEL_I2C04_3,
2212 FN_SEL_I2C04_4, 0, 0, 0,
2213 /* SEL_I2C03 [3] */
2214 FN_SEL_I2C03_0, FN_SEL_I2C03_1, FN_SEL_I2C03_2, FN_SEL_I2C03_3,
2215 FN_SEL_I2C03_4, 0, 0, 0,
2216 /* RESERVED [1] */
2217 0, 0,
2218 /* SEL_I2C02 [2] */
2219 FN_SEL_I2C02_0, FN_SEL_I2C02_1, FN_SEL_I2C02_2, FN_SEL_I2C02_3,
2220 /* SEL_I2C01 [3] */
2221 FN_SEL_I2C01_0, FN_SEL_I2C01_1, FN_SEL_I2C01_2, FN_SEL_I2C01_3,
2222 FN_SEL_I2C01_4, 0, 0, 0,
2223 /* SEL_I2C00 [3] */
2224 FN_SEL_I2C00_0, FN_SEL_I2C00_1, FN_SEL_I2C00_2, FN_SEL_I2C00_3,
2225 FN_SEL_I2C00_4, 0, 0, 0,
2226 /* SEL_AVB [1] */
2227 FN_SEL_AVB_0, FN_SEL_AVB_1, }
2228 },
2229 { PINMUX_CFG_REG_VAR("MOD_SEL1", 0xE60600C4, 32,
2230 1, 3, 3, 2, 2, 1, 2, 2,
2231 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1) {
2232 /* SEL_SCIFCLK [1] */
2233 FN_SEL_SCIFCLK_0, FN_SEL_SCIFCLK_1,
2234 /* SEL_SCIF5 [3] */
2235 FN_SEL_SCIF5_0, FN_SEL_SCIF5_1, FN_SEL_SCIF5_2, FN_SEL_SCIF5_3,
2236 FN_SEL_SCIF5_4, FN_SEL_SCIF5_5, 0, 0,
2237 /* SEL_SCIF4 [3] */
2238 FN_SEL_SCIF4_0, FN_SEL_SCIF4_1, FN_SEL_SCIF4_2, FN_SEL_SCIF4_3,
2239 FN_SEL_SCIF4_4, 0, 0, 0,
2240 /* SEL_SCIF3 [2] */
2241 FN_SEL_SCIF3_0, FN_SEL_SCIF3_1, FN_SEL_SCIF3_2, 0,
2242 /* SEL_SCIF2 [2] */
2243 FN_SEL_SCIF2_0, FN_SEL_SCIF2_1, FN_SEL_SCIF2_2, 0,
2244 /* SEL_SCIF2_CLK [1] */
2245 FN_SEL_SCIF2_CLK_0, FN_SEL_SCIF2_CLK_1,
2246 /* SEL_SCIF1 [2] */
2247 FN_SEL_SCIF1_0, FN_SEL_SCIF1_1, FN_SEL_SCIF1_2, FN_SEL_SCIF1_3,
2248 /* SEL_SCIF0 [2] */
2249 FN_SEL_SCIF0_0, FN_SEL_SCIF0_1, FN_SEL_SCIF0_2, FN_SEL_SCIF0_3,
2250 /* SEL_MSIOF2 [2] */
2251 FN_SEL_MSIOF2_0, FN_SEL_MSIOF2_1, FN_SEL_MSIOF2_2, 0,
2252 /* RESERVED [1] */
2253 0, 0,
2254 /* SEL_MSIOF1 [1] */
2255 FN_SEL_MSIOF1_0, FN_SEL_MSIOF1_1,
2256 /* RESERVED [1] */
2257 0, 0,
2258 /* SEL_MSIOF0 [1] */
2259 FN_SEL_MSIOF0_0, FN_SEL_MSIOF0_1,
2260 /* SEL_RCN [1] */
2261 FN_SEL_RCN_0, FN_SEL_RCN_1,
2262 /* RESERVED [2] */
2263 0, 0, 0, 0,
2264 /* SEL_TMU2 [1] */
2265 FN_SEL_TMU2_0, FN_SEL_TMU2_1,
2266 /* SEL_TMU1 [1] */
2267 FN_SEL_TMU1_0, FN_SEL_TMU1_1,
2268 /* RESERVED [2] */
2269 0, 0, 0, 0,
2270 /* SEL_HSCIF1 [2] */
2271 FN_SEL_HSCIF1_0, FN_SEL_HSCIF1_1, FN_SEL_HSCIF1_2, 0,
2272 /* SEL_HSCIF0 [1] */
2273 FN_SEL_HSCIF0_0, FN_SEL_HSCIF0_1,}
2274 },
2275 { PINMUX_CFG_REG_VAR("MOD_SEL2", 0xE60600C8, 32,
2276 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
2277 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2) {
2278 /* RESERVED [1] */
2279 0, 0,
2280 /* RESERVED [1] */
2281 0, 0,
2282 /* RESERVED [1] */
2283 0, 0,
2284 /* RESERVED [1] */
2285 0, 0,
2286 /* RESERVED [1] */
2287 0, 0,
2288 /* RESERVED [1] */
2289 0, 0,
2290 /* RESERVED [1] */
2291 0, 0,
2292 /* RESERVED [1] */
2293 0, 0,
2294 /* RESERVED [1] */
2295 0, 0,
2296 /* RESERVED [1] */
2297 0, 0,
2298 /* SEL_ADGB [2] */
2299 FN_SEL_ADGB_0, FN_SEL_ADGB_1, FN_SEL_ADGB_2, 0,
2300 /* SEL_ADGC [2] */
2301 FN_SEL_ADGC_0, FN_SEL_ADGC_1, FN_SEL_ADGC_2, 0,
2302 /* SEL_SSI9 [2] */
2303 FN_SEL_SSI9_0, FN_SEL_SSI9_1, 0, 0,
2304 /* SEL_SSI8 [2] */
2305 FN_SEL_SSI8_0, FN_SEL_SSI8_1, 0, 0,
2306 /* SEL_SSI7 [2] */
2307 FN_SEL_SSI7_0, FN_SEL_SSI7_1, 0, 0,
2308 /* SEL_SSI6 [2] */
2309 FN_SEL_SSI6_0, FN_SEL_SSI6_1, 0, 0,
2310 /* SEL_SSI5 [2] */
2311 FN_SEL_SSI5_0, FN_SEL_SSI5_1, 0, 0,
2312 /* SEL_SSI4 [2] */
2313 FN_SEL_SSI4_0, FN_SEL_SSI4_1, 0, 0,
2314 /* SEL_SSI2 [2] */
2315 FN_SEL_SSI2_0, FN_SEL_SSI2_1, 0, 0,
2316 /* SEL_SSI1 [2] */
2317 FN_SEL_SSI1_0, FN_SEL_SSI1_1, FN_SEL_SSI1_2, FN_SEL_SSI1_3,
2318 /* SEL_SSI0 [2] */
2319 FN_SEL_SSI0_0, FN_SEL_SSI0_1, 0, 0, }
2320 },
2321 { },
2322};
2323
2324#ifdef CONFIG_PINCTRL_PFC_R8A77470
2325const struct sh_pfc_soc_info r8a77470_pinmux_info = {
2326 .name = "r8a77470_pfc",
2327 .unlock_reg = 0xe6060000, /* PMMR */
2328
2329 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2330
2331 .pins = pinmux_pins,
2332 .nr_pins = ARRAY_SIZE(pinmux_pins),
2333 .groups = pinmux_groups,
2334 .nr_groups = ARRAY_SIZE(pinmux_groups),
2335 .functions = pinmux_functions,
2336 .nr_functions = ARRAY_SIZE(pinmux_functions),
2337
2338 .cfg_regs = pinmux_config_regs,
2339
2340 .pinmux_data = pinmux_data,
2341 .pinmux_data_size = ARRAY_SIZE(pinmux_data),
2342};
2343#endif
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7795-es1.c b/drivers/pinctrl/sh-pfc/pfc-r8a7795-es1.c
index 82a1c411c952..a6c5d50557e6 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7795-es1.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7795-es1.c
@@ -1432,10 +1432,10 @@ static const u16 pinmux_data[] = {
1432 1432
1433/* 1433/*
1434 * Static pins can not be muxed between different functions but 1434 * Static pins can not be muxed between different functions but
1435 * still needs a mark entry in the pinmux list. Add each static 1435 * still need mark entries in the pinmux list. Add each static
1436 * pin to the list without an associated function. The sh-pfc 1436 * pin to the list without an associated function. The sh-pfc
1437 * core will do the right thing and skip trying to mux then pin 1437 * core will do the right thing and skip trying to mux the pin
1438 * while still applying configuration to it 1438 * while still applying configuration to it.
1439 */ 1439 */
1440#define FM(x) PINMUX_DATA(x##_MARK, 0), 1440#define FM(x) PINMUX_DATA(x##_MARK, 0),
1441 PINMUX_STATIC 1441 PINMUX_STATIC
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
index 7100a2dd65f8..4f55b1562ad4 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7795.c
@@ -1493,10 +1493,10 @@ static const u16 pinmux_data[] = {
1493 1493
1494/* 1494/*
1495 * Static pins can not be muxed between different functions but 1495 * Static pins can not be muxed between different functions but
1496 * still needs a mark entry in the pinmux list. Add each static 1496 * still need mark entries in the pinmux list. Add each static
1497 * pin to the list without an associated function. The sh-pfc 1497 * pin to the list without an associated function. The sh-pfc
1498 * core will do the right thing and skip trying to mux then pin 1498 * core will do the right thing and skip trying to mux the pin
1499 * while still applying configuration to it 1499 * while still applying configuration to it.
1500 */ 1500 */
1501#define FM(x) PINMUX_DATA(x##_MARK, 0), 1501#define FM(x) PINMUX_DATA(x##_MARK, 0),
1502 PINMUX_STATIC 1502 PINMUX_STATIC
@@ -3122,7 +3122,7 @@ static const unsigned int msiof3_ss1_e_mux[] = {
3122 MSIOF3_SS1_E_MARK, 3122 MSIOF3_SS1_E_MARK,
3123}; 3123};
3124static const unsigned int msiof3_ss2_e_pins[] = { 3124static const unsigned int msiof3_ss2_e_pins[] = {
3125 /* SS1 */ 3125 /* SS2 */
3126 RCAR_GP_PIN(2, 0), 3126 RCAR_GP_PIN(2, 0),
3127}; 3127};
3128static const unsigned int msiof3_ss2_e_mux[] = { 3128static const unsigned int msiof3_ss2_e_mux[] = {
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7796.c b/drivers/pinctrl/sh-pfc/pfc-r8a7796.c
index 4bc5b1f820c1..3ea133cfb241 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a7796.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a7796.c
@@ -1499,10 +1499,10 @@ static const u16 pinmux_data[] = {
1499 1499
1500/* 1500/*
1501 * Static pins can not be muxed between different functions but 1501 * Static pins can not be muxed between different functions but
1502 * still needs a mark entry in the pinmux list. Add each static 1502 * still need mark entries in the pinmux list. Add each static
1503 * pin to the list without an associated function. The sh-pfc 1503 * pin to the list without an associated function. The sh-pfc
1504 * core will do the right thing and skip trying to mux then pin 1504 * core will do the right thing and skip trying to mux the pin
1505 * while still applying configuration to it 1505 * while still applying configuration to it.
1506 */ 1506 */
1507#define FM(x) PINMUX_DATA(x##_MARK, 0), 1507#define FM(x) PINMUX_DATA(x##_MARK, 0),
1508 PINMUX_STATIC 1508 PINMUX_STATIC
@@ -3122,7 +3122,7 @@ static const unsigned int msiof3_ss1_e_mux[] = {
3122 MSIOF3_SS1_E_MARK, 3122 MSIOF3_SS1_E_MARK,
3123}; 3123};
3124static const unsigned int msiof3_ss2_e_pins[] = { 3124static const unsigned int msiof3_ss2_e_pins[] = {
3125 /* SS1 */ 3125 /* SS2 */
3126 RCAR_GP_PIN(2, 0), 3126 RCAR_GP_PIN(2, 0),
3127}; 3127};
3128static const unsigned int msiof3_ss2_e_mux[] = { 3128static const unsigned int msiof3_ss2_e_mux[] = {
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77965.c b/drivers/pinctrl/sh-pfc/pfc-r8a77965.c
index cea9d0599c12..d2bbee656381 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a77965.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77965.c
@@ -1,4 +1,4 @@
1// SPDX-License-Identifier: GPL-2. 1// SPDX-License-Identifier: GPL-2.0
2/* 2/*
3 * R8A77965 processor support - PFC hardware block. 3 * R8A77965 processor support - PFC hardware block.
4 * 4 *
@@ -1501,10 +1501,10 @@ static const u16 pinmux_data[] = {
1501 1501
1502/* 1502/*
1503 * Static pins can not be muxed between different functions but 1503 * Static pins can not be muxed between different functions but
1504 * still needs a mark entry in the pinmux list. Add each static 1504 * still need mark entries in the pinmux list. Add each static
1505 * pin to the list without an associated function. The sh-pfc 1505 * pin to the list without an associated function. The sh-pfc
1506 * core will do the right thing and skip trying to mux then pin 1506 * core will do the right thing and skip trying to mux the pin
1507 * while still applying configuration to it 1507 * while still applying configuration to it.
1508 */ 1508 */
1509#define FM(x) PINMUX_DATA(x##_MARK, 0), 1509#define FM(x) PINMUX_DATA(x##_MARK, 0),
1510 PINMUX_STATIC 1510 PINMUX_STATIC
@@ -1662,6 +1662,153 @@ static const unsigned int avb_avtp_capture_b_mux[] = {
1662 AVB_AVTP_CAPTURE_B_MARK, 1662 AVB_AVTP_CAPTURE_B_MARK,
1663}; 1663};
1664 1664
1665/* - DU --------------------------------------------------------------------- */
1666static const unsigned int du_rgb666_pins[] = {
1667 /* R[7:2], G[7:2], B[7:2] */
1668 RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 13),
1669 RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 11), RCAR_GP_PIN(0, 10),
1670 RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 13),
1671 RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 18),
1672 RCAR_GP_PIN(1, 7), RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 5),
1673 RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 3), RCAR_GP_PIN(1, 2),
1674};
1675
1676static const unsigned int du_rgb666_mux[] = {
1677 DU_DR7_MARK, DU_DR6_MARK, DU_DR5_MARK, DU_DR4_MARK,
1678 DU_DR3_MARK, DU_DR2_MARK,
1679 DU_DG7_MARK, DU_DG6_MARK, DU_DG5_MARK, DU_DG4_MARK,
1680 DU_DG3_MARK, DU_DG2_MARK,
1681 DU_DB7_MARK, DU_DB6_MARK, DU_DB5_MARK, DU_DB4_MARK,
1682 DU_DB3_MARK, DU_DB2_MARK,
1683};
1684
1685static const unsigned int du_rgb888_pins[] = {
1686 /* R[7:0], G[7:0], B[7:0] */
1687 RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 14), RCAR_GP_PIN(0, 13),
1688 RCAR_GP_PIN(0, 12), RCAR_GP_PIN(0, 11), RCAR_GP_PIN(0, 10),
1689 RCAR_GP_PIN(0, 9), RCAR_GP_PIN(0, 8),
1690 RCAR_GP_PIN(1, 15), RCAR_GP_PIN(1, 14), RCAR_GP_PIN(1, 13),
1691 RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 19), RCAR_GP_PIN(1, 18),
1692 RCAR_GP_PIN(1, 17), RCAR_GP_PIN(1, 16),
1693 RCAR_GP_PIN(1, 7), RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 5),
1694 RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 3), RCAR_GP_PIN(1, 2),
1695 RCAR_GP_PIN(1, 1), RCAR_GP_PIN(1, 0),
1696};
1697
1698static const unsigned int du_rgb888_mux[] = {
1699 DU_DR7_MARK, DU_DR6_MARK, DU_DR5_MARK, DU_DR4_MARK,
1700 DU_DR3_MARK, DU_DR2_MARK, DU_DR1_MARK, DU_DR0_MARK,
1701 DU_DG7_MARK, DU_DG6_MARK, DU_DG5_MARK, DU_DG4_MARK,
1702 DU_DG3_MARK, DU_DG2_MARK, DU_DG1_MARK, DU_DG0_MARK,
1703 DU_DB7_MARK, DU_DB6_MARK, DU_DB5_MARK, DU_DB4_MARK,
1704 DU_DB3_MARK, DU_DB2_MARK, DU_DB1_MARK, DU_DB0_MARK,
1705};
1706
1707static const unsigned int du_clk_out_0_pins[] = {
1708 /* CLKOUT */
1709 RCAR_GP_PIN(1, 27),
1710};
1711
1712static const unsigned int du_clk_out_0_mux[] = {
1713 DU_DOTCLKOUT0_MARK
1714};
1715
1716static const unsigned int du_clk_out_1_pins[] = {
1717 /* CLKOUT */
1718 RCAR_GP_PIN(2, 3),
1719};
1720
1721static const unsigned int du_clk_out_1_mux[] = {
1722 DU_DOTCLKOUT1_MARK
1723};
1724
1725static const unsigned int du_sync_pins[] = {
1726 /* EXVSYNC/VSYNC, EXHSYNC/HSYNC */
1727 RCAR_GP_PIN(2, 5), RCAR_GP_PIN(2, 4),
1728};
1729
1730static const unsigned int du_sync_mux[] = {
1731 DU_EXVSYNC_DU_VSYNC_MARK, DU_EXHSYNC_DU_HSYNC_MARK
1732};
1733
1734static const unsigned int du_oddf_pins[] = {
1735 /* EXDISP/EXODDF/EXCDE */
1736 RCAR_GP_PIN(2, 2),
1737};
1738
1739static const unsigned int du_oddf_mux[] = {
1740 DU_EXODDF_DU_ODDF_DISP_CDE_MARK,
1741};
1742
1743static const unsigned int du_cde_pins[] = {
1744 /* CDE */
1745 RCAR_GP_PIN(2, 0),
1746};
1747
1748static const unsigned int du_cde_mux[] = {
1749 DU_CDE_MARK,
1750};
1751
1752static const unsigned int du_disp_pins[] = {
1753 /* DISP */
1754 RCAR_GP_PIN(2, 1),
1755};
1756
1757static const unsigned int du_disp_mux[] = {
1758 DU_DISP_MARK,
1759};
1760
1761/* - I2C -------------------------------------------------------------------- */
1762static const unsigned int i2c1_a_pins[] = {
1763 /* SDA, SCL */
1764 RCAR_GP_PIN(5, 11), RCAR_GP_PIN(5, 10),
1765};
1766static const unsigned int i2c1_a_mux[] = {
1767 SDA1_A_MARK, SCL1_A_MARK,
1768};
1769static const unsigned int i2c1_b_pins[] = {
1770 /* SDA, SCL */
1771 RCAR_GP_PIN(5, 24), RCAR_GP_PIN(5, 23),
1772};
1773static const unsigned int i2c1_b_mux[] = {
1774 SDA1_B_MARK, SCL1_B_MARK,
1775};
1776static const unsigned int i2c2_a_pins[] = {
1777 /* SDA, SCL */
1778 RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 4),
1779};
1780static const unsigned int i2c2_a_mux[] = {
1781 SDA2_A_MARK, SCL2_A_MARK,
1782};
1783static const unsigned int i2c2_b_pins[] = {
1784 /* SDA, SCL */
1785 RCAR_GP_PIN(3, 13), RCAR_GP_PIN(3, 12),
1786};
1787static const unsigned int i2c2_b_mux[] = {
1788 SDA2_B_MARK, SCL2_B_MARK,
1789};
1790static const unsigned int i2c6_a_pins[] = {
1791 /* SDA, SCL */
1792 RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11),
1793};
1794static const unsigned int i2c6_a_mux[] = {
1795 SDA6_A_MARK, SCL6_A_MARK,
1796};
1797static const unsigned int i2c6_b_pins[] = {
1798 /* SDA, SCL */
1799 RCAR_GP_PIN(1, 26), RCAR_GP_PIN(1, 25),
1800};
1801static const unsigned int i2c6_b_mux[] = {
1802 SDA6_B_MARK, SCL6_B_MARK,
1803};
1804static const unsigned int i2c6_c_pins[] = {
1805 /* SDA, SCL */
1806 RCAR_GP_PIN(0, 15), RCAR_GP_PIN(0, 14),
1807};
1808static const unsigned int i2c6_c_mux[] = {
1809 SDA6_C_MARK, SCL6_C_MARK,
1810};
1811
1665/* - INTC-EX ---------------------------------------------------------------- */ 1812/* - INTC-EX ---------------------------------------------------------------- */
1666static const unsigned int intc_ex_irq0_pins[] = { 1813static const unsigned int intc_ex_irq0_pins[] = {
1667 /* IRQ0 */ 1814 /* IRQ0 */
@@ -1706,6 +1853,803 @@ static const unsigned int intc_ex_irq5_mux[] = {
1706 IRQ5_MARK, 1853 IRQ5_MARK,
1707}; 1854};
1708 1855
1856/* - MSIOF0 ----------------------------------------------------------------- */
1857static const unsigned int msiof0_clk_pins[] = {
1858 /* SCK */
1859 RCAR_GP_PIN(5, 17),
1860};
1861static const unsigned int msiof0_clk_mux[] = {
1862 MSIOF0_SCK_MARK,
1863};
1864static const unsigned int msiof0_sync_pins[] = {
1865 /* SYNC */
1866 RCAR_GP_PIN(5, 18),
1867};
1868static const unsigned int msiof0_sync_mux[] = {
1869 MSIOF0_SYNC_MARK,
1870};
1871static const unsigned int msiof0_ss1_pins[] = {
1872 /* SS1 */
1873 RCAR_GP_PIN(5, 19),
1874};
1875static const unsigned int msiof0_ss1_mux[] = {
1876 MSIOF0_SS1_MARK,
1877};
1878static const unsigned int msiof0_ss2_pins[] = {
1879 /* SS2 */
1880 RCAR_GP_PIN(5, 21),
1881};
1882static const unsigned int msiof0_ss2_mux[] = {
1883 MSIOF0_SS2_MARK,
1884};
1885static const unsigned int msiof0_txd_pins[] = {
1886 /* TXD */
1887 RCAR_GP_PIN(5, 20),
1888};
1889static const unsigned int msiof0_txd_mux[] = {
1890 MSIOF0_TXD_MARK,
1891};
1892static const unsigned int msiof0_rxd_pins[] = {
1893 /* RXD */
1894 RCAR_GP_PIN(5, 22),
1895};
1896static const unsigned int msiof0_rxd_mux[] = {
1897 MSIOF0_RXD_MARK,
1898};
1899/* - MSIOF1 ----------------------------------------------------------------- */
1900static const unsigned int msiof1_clk_a_pins[] = {
1901 /* SCK */
1902 RCAR_GP_PIN(6, 8),
1903};
1904static const unsigned int msiof1_clk_a_mux[] = {
1905 MSIOF1_SCK_A_MARK,
1906};
1907static const unsigned int msiof1_sync_a_pins[] = {
1908 /* SYNC */
1909 RCAR_GP_PIN(6, 9),
1910};
1911static const unsigned int msiof1_sync_a_mux[] = {
1912 MSIOF1_SYNC_A_MARK,
1913};
1914static const unsigned int msiof1_ss1_a_pins[] = {
1915 /* SS1 */
1916 RCAR_GP_PIN(6, 5),
1917};
1918static const unsigned int msiof1_ss1_a_mux[] = {
1919 MSIOF1_SS1_A_MARK,
1920};
1921static const unsigned int msiof1_ss2_a_pins[] = {
1922 /* SS2 */
1923 RCAR_GP_PIN(6, 6),
1924};
1925static const unsigned int msiof1_ss2_a_mux[] = {
1926 MSIOF1_SS2_A_MARK,
1927};
1928static const unsigned int msiof1_txd_a_pins[] = {
1929 /* TXD */
1930 RCAR_GP_PIN(6, 7),
1931};
1932static const unsigned int msiof1_txd_a_mux[] = {
1933 MSIOF1_TXD_A_MARK,
1934};
1935static const unsigned int msiof1_rxd_a_pins[] = {
1936 /* RXD */
1937 RCAR_GP_PIN(6, 10),
1938};
1939static const unsigned int msiof1_rxd_a_mux[] = {
1940 MSIOF1_RXD_A_MARK,
1941};
1942static const unsigned int msiof1_clk_b_pins[] = {
1943 /* SCK */
1944 RCAR_GP_PIN(5, 9),
1945};
1946static const unsigned int msiof1_clk_b_mux[] = {
1947 MSIOF1_SCK_B_MARK,
1948};
1949static const unsigned int msiof1_sync_b_pins[] = {
1950 /* SYNC */
1951 RCAR_GP_PIN(5, 3),
1952};
1953static const unsigned int msiof1_sync_b_mux[] = {
1954 MSIOF1_SYNC_B_MARK,
1955};
1956static const unsigned int msiof1_ss1_b_pins[] = {
1957 /* SS1 */
1958 RCAR_GP_PIN(5, 4),
1959};
1960static const unsigned int msiof1_ss1_b_mux[] = {
1961 MSIOF1_SS1_B_MARK,
1962};
1963static const unsigned int msiof1_ss2_b_pins[] = {
1964 /* SS2 */
1965 RCAR_GP_PIN(5, 0),
1966};
1967static const unsigned int msiof1_ss2_b_mux[] = {
1968 MSIOF1_SS2_B_MARK,
1969};
1970static const unsigned int msiof1_txd_b_pins[] = {
1971 /* TXD */
1972 RCAR_GP_PIN(5, 8),
1973};
1974static const unsigned int msiof1_txd_b_mux[] = {
1975 MSIOF1_TXD_B_MARK,
1976};
1977static const unsigned int msiof1_rxd_b_pins[] = {
1978 /* RXD */
1979 RCAR_GP_PIN(5, 7),
1980};
1981static const unsigned int msiof1_rxd_b_mux[] = {
1982 MSIOF1_RXD_B_MARK,
1983};
1984static const unsigned int msiof1_clk_c_pins[] = {
1985 /* SCK */
1986 RCAR_GP_PIN(6, 17),
1987};
1988static const unsigned int msiof1_clk_c_mux[] = {
1989 MSIOF1_SCK_C_MARK,
1990};
1991static const unsigned int msiof1_sync_c_pins[] = {
1992 /* SYNC */
1993 RCAR_GP_PIN(6, 18),
1994};
1995static const unsigned int msiof1_sync_c_mux[] = {
1996 MSIOF1_SYNC_C_MARK,
1997};
1998static const unsigned int msiof1_ss1_c_pins[] = {
1999 /* SS1 */
2000 RCAR_GP_PIN(6, 21),
2001};
2002static const unsigned int msiof1_ss1_c_mux[] = {
2003 MSIOF1_SS1_C_MARK,
2004};
2005static const unsigned int msiof1_ss2_c_pins[] = {
2006 /* SS2 */
2007 RCAR_GP_PIN(6, 27),
2008};
2009static const unsigned int msiof1_ss2_c_mux[] = {
2010 MSIOF1_SS2_C_MARK,
2011};
2012static const unsigned int msiof1_txd_c_pins[] = {
2013 /* TXD */
2014 RCAR_GP_PIN(6, 20),
2015};
2016static const unsigned int msiof1_txd_c_mux[] = {
2017 MSIOF1_TXD_C_MARK,
2018};
2019static const unsigned int msiof1_rxd_c_pins[] = {
2020 /* RXD */
2021 RCAR_GP_PIN(6, 19),
2022};
2023static const unsigned int msiof1_rxd_c_mux[] = {
2024 MSIOF1_RXD_C_MARK,
2025};
2026static const unsigned int msiof1_clk_d_pins[] = {
2027 /* SCK */
2028 RCAR_GP_PIN(5, 12),
2029};
2030static const unsigned int msiof1_clk_d_mux[] = {
2031 MSIOF1_SCK_D_MARK,
2032};
2033static const unsigned int msiof1_sync_d_pins[] = {
2034 /* SYNC */
2035 RCAR_GP_PIN(5, 15),
2036};
2037static const unsigned int msiof1_sync_d_mux[] = {
2038 MSIOF1_SYNC_D_MARK,
2039};
2040static const unsigned int msiof1_ss1_d_pins[] = {
2041 /* SS1 */
2042 RCAR_GP_PIN(5, 16),
2043};
2044static const unsigned int msiof1_ss1_d_mux[] = {
2045 MSIOF1_SS1_D_MARK,
2046};
2047static const unsigned int msiof1_ss2_d_pins[] = {
2048 /* SS2 */
2049 RCAR_GP_PIN(5, 21),
2050};
2051static const unsigned int msiof1_ss2_d_mux[] = {
2052 MSIOF1_SS2_D_MARK,
2053};
2054static const unsigned int msiof1_txd_d_pins[] = {
2055 /* TXD */
2056 RCAR_GP_PIN(5, 14),
2057};
2058static const unsigned int msiof1_txd_d_mux[] = {
2059 MSIOF1_TXD_D_MARK,
2060};
2061static const unsigned int msiof1_rxd_d_pins[] = {
2062 /* RXD */
2063 RCAR_GP_PIN(5, 13),
2064};
2065static const unsigned int msiof1_rxd_d_mux[] = {
2066 MSIOF1_RXD_D_MARK,
2067};
2068static const unsigned int msiof1_clk_e_pins[] = {
2069 /* SCK */
2070 RCAR_GP_PIN(3, 0),
2071};
2072static const unsigned int msiof1_clk_e_mux[] = {
2073 MSIOF1_SCK_E_MARK,
2074};
2075static const unsigned int msiof1_sync_e_pins[] = {
2076 /* SYNC */
2077 RCAR_GP_PIN(3, 1),
2078};
2079static const unsigned int msiof1_sync_e_mux[] = {
2080 MSIOF1_SYNC_E_MARK,
2081};
2082static const unsigned int msiof1_ss1_e_pins[] = {
2083 /* SS1 */
2084 RCAR_GP_PIN(3, 4),
2085};
2086static const unsigned int msiof1_ss1_e_mux[] = {
2087 MSIOF1_SS1_E_MARK,
2088};
2089static const unsigned int msiof1_ss2_e_pins[] = {
2090 /* SS2 */
2091 RCAR_GP_PIN(3, 5),
2092};
2093static const unsigned int msiof1_ss2_e_mux[] = {
2094 MSIOF1_SS2_E_MARK,
2095};
2096static const unsigned int msiof1_txd_e_pins[] = {
2097 /* TXD */
2098 RCAR_GP_PIN(3, 3),
2099};
2100static const unsigned int msiof1_txd_e_mux[] = {
2101 MSIOF1_TXD_E_MARK,
2102};
2103static const unsigned int msiof1_rxd_e_pins[] = {
2104 /* RXD */
2105 RCAR_GP_PIN(3, 2),
2106};
2107static const unsigned int msiof1_rxd_e_mux[] = {
2108 MSIOF1_RXD_E_MARK,
2109};
2110static const unsigned int msiof1_clk_f_pins[] = {
2111 /* SCK */
2112 RCAR_GP_PIN(5, 23),
2113};
2114static const unsigned int msiof1_clk_f_mux[] = {
2115 MSIOF1_SCK_F_MARK,
2116};
2117static const unsigned int msiof1_sync_f_pins[] = {
2118 /* SYNC */
2119 RCAR_GP_PIN(5, 24),
2120};
2121static const unsigned int msiof1_sync_f_mux[] = {
2122 MSIOF1_SYNC_F_MARK,
2123};
2124static const unsigned int msiof1_ss1_f_pins[] = {
2125 /* SS1 */
2126 RCAR_GP_PIN(6, 1),
2127};
2128static const unsigned int msiof1_ss1_f_mux[] = {
2129 MSIOF1_SS1_F_MARK,
2130};
2131static const unsigned int msiof1_ss2_f_pins[] = {
2132 /* SS2 */
2133 RCAR_GP_PIN(6, 2),
2134};
2135static const unsigned int msiof1_ss2_f_mux[] = {
2136 MSIOF1_SS2_F_MARK,
2137};
2138static const unsigned int msiof1_txd_f_pins[] = {
2139 /* TXD */
2140 RCAR_GP_PIN(6, 0),
2141};
2142static const unsigned int msiof1_txd_f_mux[] = {
2143 MSIOF1_TXD_F_MARK,
2144};
2145static const unsigned int msiof1_rxd_f_pins[] = {
2146 /* RXD */
2147 RCAR_GP_PIN(5, 25),
2148};
2149static const unsigned int msiof1_rxd_f_mux[] = {
2150 MSIOF1_RXD_F_MARK,
2151};
2152static const unsigned int msiof1_clk_g_pins[] = {
2153 /* SCK */
2154 RCAR_GP_PIN(3, 6),
2155};
2156static const unsigned int msiof1_clk_g_mux[] = {
2157 MSIOF1_SCK_G_MARK,
2158};
2159static const unsigned int msiof1_sync_g_pins[] = {
2160 /* SYNC */
2161 RCAR_GP_PIN(3, 7),
2162};
2163static const unsigned int msiof1_sync_g_mux[] = {
2164 MSIOF1_SYNC_G_MARK,
2165};
2166static const unsigned int msiof1_ss1_g_pins[] = {
2167 /* SS1 */
2168 RCAR_GP_PIN(3, 10),
2169};
2170static const unsigned int msiof1_ss1_g_mux[] = {
2171 MSIOF1_SS1_G_MARK,
2172};
2173static const unsigned int msiof1_ss2_g_pins[] = {
2174 /* SS2 */
2175 RCAR_GP_PIN(3, 11),
2176};
2177static const unsigned int msiof1_ss2_g_mux[] = {
2178 MSIOF1_SS2_G_MARK,
2179};
2180static const unsigned int msiof1_txd_g_pins[] = {
2181 /* TXD */
2182 RCAR_GP_PIN(3, 9),
2183};
2184static const unsigned int msiof1_txd_g_mux[] = {
2185 MSIOF1_TXD_G_MARK,
2186};
2187static const unsigned int msiof1_rxd_g_pins[] = {
2188 /* RXD */
2189 RCAR_GP_PIN(3, 8),
2190};
2191static const unsigned int msiof1_rxd_g_mux[] = {
2192 MSIOF1_RXD_G_MARK,
2193};
2194/* - MSIOF2 ----------------------------------------------------------------- */
2195static const unsigned int msiof2_clk_a_pins[] = {
2196 /* SCK */
2197 RCAR_GP_PIN(1, 9),
2198};
2199static const unsigned int msiof2_clk_a_mux[] = {
2200 MSIOF2_SCK_A_MARK,
2201};
2202static const unsigned int msiof2_sync_a_pins[] = {
2203 /* SYNC */
2204 RCAR_GP_PIN(1, 8),
2205};
2206static const unsigned int msiof2_sync_a_mux[] = {
2207 MSIOF2_SYNC_A_MARK,
2208};
2209static const unsigned int msiof2_ss1_a_pins[] = {
2210 /* SS1 */
2211 RCAR_GP_PIN(1, 6),
2212};
2213static const unsigned int msiof2_ss1_a_mux[] = {
2214 MSIOF2_SS1_A_MARK,
2215};
2216static const unsigned int msiof2_ss2_a_pins[] = {
2217 /* SS2 */
2218 RCAR_GP_PIN(1, 7),
2219};
2220static const unsigned int msiof2_ss2_a_mux[] = {
2221 MSIOF2_SS2_A_MARK,
2222};
2223static const unsigned int msiof2_txd_a_pins[] = {
2224 /* TXD */
2225 RCAR_GP_PIN(1, 11),
2226};
2227static const unsigned int msiof2_txd_a_mux[] = {
2228 MSIOF2_TXD_A_MARK,
2229};
2230static const unsigned int msiof2_rxd_a_pins[] = {
2231 /* RXD */
2232 RCAR_GP_PIN(1, 10),
2233};
2234static const unsigned int msiof2_rxd_a_mux[] = {
2235 MSIOF2_RXD_A_MARK,
2236};
2237static const unsigned int msiof2_clk_b_pins[] = {
2238 /* SCK */
2239 RCAR_GP_PIN(0, 4),
2240};
2241static const unsigned int msiof2_clk_b_mux[] = {
2242 MSIOF2_SCK_B_MARK,
2243};
2244static const unsigned int msiof2_sync_b_pins[] = {
2245 /* SYNC */
2246 RCAR_GP_PIN(0, 5),
2247};
2248static const unsigned int msiof2_sync_b_mux[] = {
2249 MSIOF2_SYNC_B_MARK,
2250};
2251static const unsigned int msiof2_ss1_b_pins[] = {
2252 /* SS1 */
2253 RCAR_GP_PIN(0, 0),
2254};
2255static const unsigned int msiof2_ss1_b_mux[] = {
2256 MSIOF2_SS1_B_MARK,
2257};
2258static const unsigned int msiof2_ss2_b_pins[] = {
2259 /* SS2 */
2260 RCAR_GP_PIN(0, 1),
2261};
2262static const unsigned int msiof2_ss2_b_mux[] = {
2263 MSIOF2_SS2_B_MARK,
2264};
2265static const unsigned int msiof2_txd_b_pins[] = {
2266 /* TXD */
2267 RCAR_GP_PIN(0, 7),
2268};
2269static const unsigned int msiof2_txd_b_mux[] = {
2270 MSIOF2_TXD_B_MARK,
2271};
2272static const unsigned int msiof2_rxd_b_pins[] = {
2273 /* RXD */
2274 RCAR_GP_PIN(0, 6),
2275};
2276static const unsigned int msiof2_rxd_b_mux[] = {
2277 MSIOF2_RXD_B_MARK,
2278};
2279static const unsigned int msiof2_clk_c_pins[] = {
2280 /* SCK */
2281 RCAR_GP_PIN(2, 12),
2282};
2283static const unsigned int msiof2_clk_c_mux[] = {
2284 MSIOF2_SCK_C_MARK,
2285};
2286static const unsigned int msiof2_sync_c_pins[] = {
2287 /* SYNC */
2288 RCAR_GP_PIN(2, 11),
2289};
2290static const unsigned int msiof2_sync_c_mux[] = {
2291 MSIOF2_SYNC_C_MARK,
2292};
2293static const unsigned int msiof2_ss1_c_pins[] = {
2294 /* SS1 */
2295 RCAR_GP_PIN(2, 10),
2296};
2297static const unsigned int msiof2_ss1_c_mux[] = {
2298 MSIOF2_SS1_C_MARK,
2299};
2300static const unsigned int msiof2_ss2_c_pins[] = {
2301 /* SS2 */
2302 RCAR_GP_PIN(2, 9),
2303};
2304static const unsigned int msiof2_ss2_c_mux[] = {
2305 MSIOF2_SS2_C_MARK,
2306};
2307static const unsigned int msiof2_txd_c_pins[] = {
2308 /* TXD */
2309 RCAR_GP_PIN(2, 14),
2310};
2311static const unsigned int msiof2_txd_c_mux[] = {
2312 MSIOF2_TXD_C_MARK,
2313};
2314static const unsigned int msiof2_rxd_c_pins[] = {
2315 /* RXD */
2316 RCAR_GP_PIN(2, 13),
2317};
2318static const unsigned int msiof2_rxd_c_mux[] = {
2319 MSIOF2_RXD_C_MARK,
2320};
2321static const unsigned int msiof2_clk_d_pins[] = {
2322 /* SCK */
2323 RCAR_GP_PIN(0, 8),
2324};
2325static const unsigned int msiof2_clk_d_mux[] = {
2326 MSIOF2_SCK_D_MARK,
2327};
2328static const unsigned int msiof2_sync_d_pins[] = {
2329 /* SYNC */
2330 RCAR_GP_PIN(0, 9),
2331};
2332static const unsigned int msiof2_sync_d_mux[] = {
2333 MSIOF2_SYNC_D_MARK,
2334};
2335static const unsigned int msiof2_ss1_d_pins[] = {
2336 /* SS1 */
2337 RCAR_GP_PIN(0, 12),
2338};
2339static const unsigned int msiof2_ss1_d_mux[] = {
2340 MSIOF2_SS1_D_MARK,
2341};
2342static const unsigned int msiof2_ss2_d_pins[] = {
2343 /* SS2 */
2344 RCAR_GP_PIN(0, 13),
2345};
2346static const unsigned int msiof2_ss2_d_mux[] = {
2347 MSIOF2_SS2_D_MARK,
2348};
2349static const unsigned int msiof2_txd_d_pins[] = {
2350 /* TXD */
2351 RCAR_GP_PIN(0, 11),
2352};
2353static const unsigned int msiof2_txd_d_mux[] = {
2354 MSIOF2_TXD_D_MARK,
2355};
2356static const unsigned int msiof2_rxd_d_pins[] = {
2357 /* RXD */
2358 RCAR_GP_PIN(0, 10),
2359};
2360static const unsigned int msiof2_rxd_d_mux[] = {
2361 MSIOF2_RXD_D_MARK,
2362};
2363/* - MSIOF3 ----------------------------------------------------------------- */
2364static const unsigned int msiof3_clk_a_pins[] = {
2365 /* SCK */
2366 RCAR_GP_PIN(0, 0),
2367};
2368static const unsigned int msiof3_clk_a_mux[] = {
2369 MSIOF3_SCK_A_MARK,
2370};
2371static const unsigned int msiof3_sync_a_pins[] = {
2372 /* SYNC */
2373 RCAR_GP_PIN(0, 1),
2374};
2375static const unsigned int msiof3_sync_a_mux[] = {
2376 MSIOF3_SYNC_A_MARK,
2377};
2378static const unsigned int msiof3_ss1_a_pins[] = {
2379 /* SS1 */
2380 RCAR_GP_PIN(0, 14),
2381};
2382static const unsigned int msiof3_ss1_a_mux[] = {
2383 MSIOF3_SS1_A_MARK,
2384};
2385static const unsigned int msiof3_ss2_a_pins[] = {
2386 /* SS2 */
2387 RCAR_GP_PIN(0, 15),
2388};
2389static const unsigned int msiof3_ss2_a_mux[] = {
2390 MSIOF3_SS2_A_MARK,
2391};
2392static const unsigned int msiof3_txd_a_pins[] = {
2393 /* TXD */
2394 RCAR_GP_PIN(0, 3),
2395};
2396static const unsigned int msiof3_txd_a_mux[] = {
2397 MSIOF3_TXD_A_MARK,
2398};
2399static const unsigned int msiof3_rxd_a_pins[] = {
2400 /* RXD */
2401 RCAR_GP_PIN(0, 2),
2402};
2403static const unsigned int msiof3_rxd_a_mux[] = {
2404 MSIOF3_RXD_A_MARK,
2405};
2406static const unsigned int msiof3_clk_b_pins[] = {
2407 /* SCK */
2408 RCAR_GP_PIN(1, 2),
2409};
2410static const unsigned int msiof3_clk_b_mux[] = {
2411 MSIOF3_SCK_B_MARK,
2412};
2413static const unsigned int msiof3_sync_b_pins[] = {
2414 /* SYNC */
2415 RCAR_GP_PIN(1, 0),
2416};
2417static const unsigned int msiof3_sync_b_mux[] = {
2418 MSIOF3_SYNC_B_MARK,
2419};
2420static const unsigned int msiof3_ss1_b_pins[] = {
2421 /* SS1 */
2422 RCAR_GP_PIN(1, 4),
2423};
2424static const unsigned int msiof3_ss1_b_mux[] = {
2425 MSIOF3_SS1_B_MARK,
2426};
2427static const unsigned int msiof3_ss2_b_pins[] = {
2428 /* SS2 */
2429 RCAR_GP_PIN(1, 5),
2430};
2431static const unsigned int msiof3_ss2_b_mux[] = {
2432 MSIOF3_SS2_B_MARK,
2433};
2434static const unsigned int msiof3_txd_b_pins[] = {
2435 /* TXD */
2436 RCAR_GP_PIN(1, 1),
2437};
2438static const unsigned int msiof3_txd_b_mux[] = {
2439 MSIOF3_TXD_B_MARK,
2440};
2441static const unsigned int msiof3_rxd_b_pins[] = {
2442 /* RXD */
2443 RCAR_GP_PIN(1, 3),
2444};
2445static const unsigned int msiof3_rxd_b_mux[] = {
2446 MSIOF3_RXD_B_MARK,
2447};
2448static const unsigned int msiof3_clk_c_pins[] = {
2449 /* SCK */
2450 RCAR_GP_PIN(1, 12),
2451};
2452static const unsigned int msiof3_clk_c_mux[] = {
2453 MSIOF3_SCK_C_MARK,
2454};
2455static const unsigned int msiof3_sync_c_pins[] = {
2456 /* SYNC */
2457 RCAR_GP_PIN(1, 13),
2458};
2459static const unsigned int msiof3_sync_c_mux[] = {
2460 MSIOF3_SYNC_C_MARK,
2461};
2462static const unsigned int msiof3_txd_c_pins[] = {
2463 /* TXD */
2464 RCAR_GP_PIN(1, 15),
2465};
2466static const unsigned int msiof3_txd_c_mux[] = {
2467 MSIOF3_TXD_C_MARK,
2468};
2469static const unsigned int msiof3_rxd_c_pins[] = {
2470 /* RXD */
2471 RCAR_GP_PIN(1, 14),
2472};
2473static const unsigned int msiof3_rxd_c_mux[] = {
2474 MSIOF3_RXD_C_MARK,
2475};
2476static const unsigned int msiof3_clk_d_pins[] = {
2477 /* SCK */
2478 RCAR_GP_PIN(1, 22),
2479};
2480static const unsigned int msiof3_clk_d_mux[] = {
2481 MSIOF3_SCK_D_MARK,
2482};
2483static const unsigned int msiof3_sync_d_pins[] = {
2484 /* SYNC */
2485 RCAR_GP_PIN(1, 23),
2486};
2487static const unsigned int msiof3_sync_d_mux[] = {
2488 MSIOF3_SYNC_D_MARK,
2489};
2490static const unsigned int msiof3_ss1_d_pins[] = {
2491 /* SS1 */
2492 RCAR_GP_PIN(1, 26),
2493};
2494static const unsigned int msiof3_ss1_d_mux[] = {
2495 MSIOF3_SS1_D_MARK,
2496};
2497static const unsigned int msiof3_txd_d_pins[] = {
2498 /* TXD */
2499 RCAR_GP_PIN(1, 25),
2500};
2501static const unsigned int msiof3_txd_d_mux[] = {
2502 MSIOF3_TXD_D_MARK,
2503};
2504static const unsigned int msiof3_rxd_d_pins[] = {
2505 /* RXD */
2506 RCAR_GP_PIN(1, 24),
2507};
2508static const unsigned int msiof3_rxd_d_mux[] = {
2509 MSIOF3_RXD_D_MARK,
2510};
2511static const unsigned int msiof3_clk_e_pins[] = {
2512 /* SCK */
2513 RCAR_GP_PIN(2, 3),
2514};
2515static const unsigned int msiof3_clk_e_mux[] = {
2516 MSIOF3_SCK_E_MARK,
2517};
2518static const unsigned int msiof3_sync_e_pins[] = {
2519 /* SYNC */
2520 RCAR_GP_PIN(2, 2),
2521};
2522static const unsigned int msiof3_sync_e_mux[] = {
2523 MSIOF3_SYNC_E_MARK,
2524};
2525static const unsigned int msiof3_ss1_e_pins[] = {
2526 /* SS1 */
2527 RCAR_GP_PIN(2, 1),
2528};
2529static const unsigned int msiof3_ss1_e_mux[] = {
2530 MSIOF3_SS1_E_MARK,
2531};
2532static const unsigned int msiof3_ss2_e_pins[] = {
2533 /* SS2 */
2534 RCAR_GP_PIN(2, 0),
2535};
2536static const unsigned int msiof3_ss2_e_mux[] = {
2537 MSIOF3_SS2_E_MARK,
2538};
2539static const unsigned int msiof3_txd_e_pins[] = {
2540 /* TXD */
2541 RCAR_GP_PIN(2, 5),
2542};
2543static const unsigned int msiof3_txd_e_mux[] = {
2544 MSIOF3_TXD_E_MARK,
2545};
2546static const unsigned int msiof3_rxd_e_pins[] = {
2547 /* RXD */
2548 RCAR_GP_PIN(2, 4),
2549};
2550static const unsigned int msiof3_rxd_e_mux[] = {
2551 MSIOF3_RXD_E_MARK,
2552};
2553
2554/* - PWM0 --------------------------------------------------------------------*/
2555static const unsigned int pwm0_pins[] = {
2556 /* PWM */
2557 RCAR_GP_PIN(2, 6),
2558};
2559static const unsigned int pwm0_mux[] = {
2560 PWM0_MARK,
2561};
2562/* - PWM1 --------------------------------------------------------------------*/
2563static const unsigned int pwm1_a_pins[] = {
2564 /* PWM */
2565 RCAR_GP_PIN(2, 7),
2566};
2567static const unsigned int pwm1_a_mux[] = {
2568 PWM1_A_MARK,
2569};
2570static const unsigned int pwm1_b_pins[] = {
2571 /* PWM */
2572 RCAR_GP_PIN(1, 8),
2573};
2574static const unsigned int pwm1_b_mux[] = {
2575 PWM1_B_MARK,
2576};
2577/* - PWM2 --------------------------------------------------------------------*/
2578static const unsigned int pwm2_a_pins[] = {
2579 /* PWM */
2580 RCAR_GP_PIN(2, 8),
2581};
2582static const unsigned int pwm2_a_mux[] = {
2583 PWM2_A_MARK,
2584};
2585static const unsigned int pwm2_b_pins[] = {
2586 /* PWM */
2587 RCAR_GP_PIN(1, 11),
2588};
2589static const unsigned int pwm2_b_mux[] = {
2590 PWM2_B_MARK,
2591};
2592/* - PWM3 --------------------------------------------------------------------*/
2593static const unsigned int pwm3_a_pins[] = {
2594 /* PWM */
2595 RCAR_GP_PIN(1, 0),
2596};
2597static const unsigned int pwm3_a_mux[] = {
2598 PWM3_A_MARK,
2599};
2600static const unsigned int pwm3_b_pins[] = {
2601 /* PWM */
2602 RCAR_GP_PIN(2, 2),
2603};
2604static const unsigned int pwm3_b_mux[] = {
2605 PWM3_B_MARK,
2606};
2607/* - PWM4 --------------------------------------------------------------------*/
2608static const unsigned int pwm4_a_pins[] = {
2609 /* PWM */
2610 RCAR_GP_PIN(1, 1),
2611};
2612static const unsigned int pwm4_a_mux[] = {
2613 PWM4_A_MARK,
2614};
2615static const unsigned int pwm4_b_pins[] = {
2616 /* PWM */
2617 RCAR_GP_PIN(2, 3),
2618};
2619static const unsigned int pwm4_b_mux[] = {
2620 PWM4_B_MARK,
2621};
2622/* - PWM5 --------------------------------------------------------------------*/
2623static const unsigned int pwm5_a_pins[] = {
2624 /* PWM */
2625 RCAR_GP_PIN(1, 2),
2626};
2627static const unsigned int pwm5_a_mux[] = {
2628 PWM5_A_MARK,
2629};
2630static const unsigned int pwm5_b_pins[] = {
2631 /* PWM */
2632 RCAR_GP_PIN(2, 4),
2633};
2634static const unsigned int pwm5_b_mux[] = {
2635 PWM5_B_MARK,
2636};
2637/* - PWM6 --------------------------------------------------------------------*/
2638static const unsigned int pwm6_a_pins[] = {
2639 /* PWM */
2640 RCAR_GP_PIN(1, 3),
2641};
2642static const unsigned int pwm6_a_mux[] = {
2643 PWM6_A_MARK,
2644};
2645static const unsigned int pwm6_b_pins[] = {
2646 /* PWM */
2647 RCAR_GP_PIN(2, 5),
2648};
2649static const unsigned int pwm6_b_mux[] = {
2650 PWM6_B_MARK,
2651};
2652
1709/* - SCIF0 ------------------------------------------------------------------ */ 2653/* - SCIF0 ------------------------------------------------------------------ */
1710static const unsigned int scif0_data_pins[] = { 2654static const unsigned int scif0_data_pins[] = {
1711 /* RX, TX */ 2655 /* RX, TX */
@@ -1917,6 +2861,264 @@ static const unsigned int scif_clk_b_mux[] = {
1917 SCIF_CLK_B_MARK, 2861 SCIF_CLK_B_MARK,
1918}; 2862};
1919 2863
2864/* - SDHI0 ------------------------------------------------------------------ */
2865static const unsigned int sdhi0_data1_pins[] = {
2866 /* D0 */
2867 RCAR_GP_PIN(3, 2),
2868};
2869
2870static const unsigned int sdhi0_data1_mux[] = {
2871 SD0_DAT0_MARK,
2872};
2873
2874static const unsigned int sdhi0_data4_pins[] = {
2875 /* D[0:3] */
2876 RCAR_GP_PIN(3, 2), RCAR_GP_PIN(3, 3),
2877 RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 5),
2878};
2879
2880static const unsigned int sdhi0_data4_mux[] = {
2881 SD0_DAT0_MARK, SD0_DAT1_MARK,
2882 SD0_DAT2_MARK, SD0_DAT3_MARK,
2883};
2884
2885static const unsigned int sdhi0_ctrl_pins[] = {
2886 /* CLK, CMD */
2887 RCAR_GP_PIN(3, 0), RCAR_GP_PIN(3, 1),
2888};
2889
2890static const unsigned int sdhi0_ctrl_mux[] = {
2891 SD0_CLK_MARK, SD0_CMD_MARK,
2892};
2893
2894static const unsigned int sdhi0_cd_pins[] = {
2895 /* CD */
2896 RCAR_GP_PIN(3, 12),
2897};
2898
2899static const unsigned int sdhi0_cd_mux[] = {
2900 SD0_CD_MARK,
2901};
2902
2903static const unsigned int sdhi0_wp_pins[] = {
2904 /* WP */
2905 RCAR_GP_PIN(3, 13),
2906};
2907
2908static const unsigned int sdhi0_wp_mux[] = {
2909 SD0_WP_MARK,
2910};
2911
2912/* - SDHI1 ------------------------------------------------------------------ */
2913static const unsigned int sdhi1_data1_pins[] = {
2914 /* D0 */
2915 RCAR_GP_PIN(3, 8),
2916};
2917
2918static const unsigned int sdhi1_data1_mux[] = {
2919 SD1_DAT0_MARK,
2920};
2921
2922static const unsigned int sdhi1_data4_pins[] = {
2923 /* D[0:3] */
2924 RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
2925 RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
2926};
2927
2928static const unsigned int sdhi1_data4_mux[] = {
2929 SD1_DAT0_MARK, SD1_DAT1_MARK,
2930 SD1_DAT2_MARK, SD1_DAT3_MARK,
2931};
2932
2933static const unsigned int sdhi1_ctrl_pins[] = {
2934 /* CLK, CMD */
2935 RCAR_GP_PIN(3, 6), RCAR_GP_PIN(3, 7),
2936};
2937
2938static const unsigned int sdhi1_ctrl_mux[] = {
2939 SD1_CLK_MARK, SD1_CMD_MARK,
2940};
2941
2942static const unsigned int sdhi1_cd_pins[] = {
2943 /* CD */
2944 RCAR_GP_PIN(3, 14),
2945};
2946
2947static const unsigned int sdhi1_cd_mux[] = {
2948 SD1_CD_MARK,
2949};
2950
2951static const unsigned int sdhi1_wp_pins[] = {
2952 /* WP */
2953 RCAR_GP_PIN(3, 15),
2954};
2955
2956static const unsigned int sdhi1_wp_mux[] = {
2957 SD1_WP_MARK,
2958};
2959
2960/* - SDHI2 ------------------------------------------------------------------ */
2961static const unsigned int sdhi2_data1_pins[] = {
2962 /* D0 */
2963 RCAR_GP_PIN(4, 2),
2964};
2965
2966static const unsigned int sdhi2_data1_mux[] = {
2967 SD2_DAT0_MARK,
2968};
2969
2970static const unsigned int sdhi2_data4_pins[] = {
2971 /* D[0:3] */
2972 RCAR_GP_PIN(4, 2), RCAR_GP_PIN(4, 3),
2973 RCAR_GP_PIN(4, 4), RCAR_GP_PIN(4, 5),
2974};
2975
2976static const unsigned int sdhi2_data4_mux[] = {
2977 SD2_DAT0_MARK, SD2_DAT1_MARK,
2978 SD2_DAT2_MARK, SD2_DAT3_MARK,
2979};
2980
2981static const unsigned int sdhi2_data8_pins[] = {
2982 /* D[0:7] */
2983 RCAR_GP_PIN(4, 2), RCAR_GP_PIN(4, 3),
2984 RCAR_GP_PIN(4, 4), RCAR_GP_PIN(4, 5),
2985 RCAR_GP_PIN(3, 8), RCAR_GP_PIN(3, 9),
2986 RCAR_GP_PIN(3, 10), RCAR_GP_PIN(3, 11),
2987};
2988
2989static const unsigned int sdhi2_data8_mux[] = {
2990 SD2_DAT0_MARK, SD2_DAT1_MARK,
2991 SD2_DAT2_MARK, SD2_DAT3_MARK,
2992 SD2_DAT4_MARK, SD2_DAT5_MARK,
2993 SD2_DAT6_MARK, SD2_DAT7_MARK,
2994};
2995
2996static const unsigned int sdhi2_ctrl_pins[] = {
2997 /* CLK, CMD */
2998 RCAR_GP_PIN(4, 0), RCAR_GP_PIN(4, 1),
2999};
3000
3001static const unsigned int sdhi2_ctrl_mux[] = {
3002 SD2_CLK_MARK, SD2_CMD_MARK,
3003};
3004
3005static const unsigned int sdhi2_cd_a_pins[] = {
3006 /* CD */
3007 RCAR_GP_PIN(4, 13),
3008};
3009
3010static const unsigned int sdhi2_cd_a_mux[] = {
3011 SD2_CD_A_MARK,
3012};
3013
3014static const unsigned int sdhi2_cd_b_pins[] = {
3015 /* CD */
3016 RCAR_GP_PIN(5, 10),
3017};
3018
3019static const unsigned int sdhi2_cd_b_mux[] = {
3020 SD2_CD_B_MARK,
3021};
3022
3023static const unsigned int sdhi2_wp_a_pins[] = {
3024 /* WP */
3025 RCAR_GP_PIN(4, 14),
3026};
3027
3028static const unsigned int sdhi2_wp_a_mux[] = {
3029 SD2_WP_A_MARK,
3030};
3031
3032static const unsigned int sdhi2_wp_b_pins[] = {
3033 /* WP */
3034 RCAR_GP_PIN(5, 11),
3035};
3036
3037static const unsigned int sdhi2_wp_b_mux[] = {
3038 SD2_WP_B_MARK,
3039};
3040
3041static const unsigned int sdhi2_ds_pins[] = {
3042 /* DS */
3043 RCAR_GP_PIN(4, 6),
3044};
3045
3046static const unsigned int sdhi2_ds_mux[] = {
3047 SD2_DS_MARK,
3048};
3049
3050/* - SDHI3 ------------------------------------------------------------------ */
3051static const unsigned int sdhi3_data1_pins[] = {
3052 /* D0 */
3053 RCAR_GP_PIN(4, 9),
3054};
3055
3056static const unsigned int sdhi3_data1_mux[] = {
3057 SD3_DAT0_MARK,
3058};
3059
3060static const unsigned int sdhi3_data4_pins[] = {
3061 /* D[0:3] */
3062 RCAR_GP_PIN(4, 9), RCAR_GP_PIN(4, 10),
3063 RCAR_GP_PIN(4, 11), RCAR_GP_PIN(4, 12),
3064};
3065
3066static const unsigned int sdhi3_data4_mux[] = {
3067 SD3_DAT0_MARK, SD3_DAT1_MARK,
3068 SD3_DAT2_MARK, SD3_DAT3_MARK,
3069};
3070
3071static const unsigned int sdhi3_data8_pins[] = {
3072 /* D[0:7] */
3073 RCAR_GP_PIN(4, 9), RCAR_GP_PIN(4, 10),
3074 RCAR_GP_PIN(4, 11), RCAR_GP_PIN(4, 12),
3075 RCAR_GP_PIN(4, 13), RCAR_GP_PIN(4, 14),
3076 RCAR_GP_PIN(4, 15), RCAR_GP_PIN(4, 16),
3077};
3078
3079static const unsigned int sdhi3_data8_mux[] = {
3080 SD3_DAT0_MARK, SD3_DAT1_MARK,
3081 SD3_DAT2_MARK, SD3_DAT3_MARK,
3082 SD3_DAT4_MARK, SD3_DAT5_MARK,
3083 SD3_DAT6_MARK, SD3_DAT7_MARK,
3084};
3085
3086static const unsigned int sdhi3_ctrl_pins[] = {
3087 /* CLK, CMD */
3088 RCAR_GP_PIN(4, 7), RCAR_GP_PIN(4, 8),
3089};
3090
3091static const unsigned int sdhi3_ctrl_mux[] = {
3092 SD3_CLK_MARK, SD3_CMD_MARK,
3093};
3094
3095static const unsigned int sdhi3_cd_pins[] = {
3096 /* CD */
3097 RCAR_GP_PIN(4, 15),
3098};
3099
3100static const unsigned int sdhi3_cd_mux[] = {
3101 SD3_CD_MARK,
3102};
3103
3104static const unsigned int sdhi3_wp_pins[] = {
3105 /* WP */
3106 RCAR_GP_PIN(4, 16),
3107};
3108
3109static const unsigned int sdhi3_wp_mux[] = {
3110 SD3_WP_MARK,
3111};
3112
3113static const unsigned int sdhi3_ds_pins[] = {
3114 /* DS */
3115 RCAR_GP_PIN(4, 17),
3116};
3117
3118static const unsigned int sdhi3_ds_mux[] = {
3119 SD3_DS_MARK,
3120};
3121
1920/* - USB0 ------------------------------------------------------------------- */ 3122/* - USB0 ------------------------------------------------------------------- */
1921static const unsigned int usb0_pins[] = { 3123static const unsigned int usb0_pins[] = {
1922 /* PWEN, OVC */ 3124 /* PWEN, OVC */
@@ -1959,12 +3161,139 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
1959 SH_PFC_PIN_GROUP(avb_avtp_capture_a), 3161 SH_PFC_PIN_GROUP(avb_avtp_capture_a),
1960 SH_PFC_PIN_GROUP(avb_avtp_match_b), 3162 SH_PFC_PIN_GROUP(avb_avtp_match_b),
1961 SH_PFC_PIN_GROUP(avb_avtp_capture_b), 3163 SH_PFC_PIN_GROUP(avb_avtp_capture_b),
3164 SH_PFC_PIN_GROUP(du_rgb666),
3165 SH_PFC_PIN_GROUP(du_rgb888),
3166 SH_PFC_PIN_GROUP(du_clk_out_0),
3167 SH_PFC_PIN_GROUP(du_clk_out_1),
3168 SH_PFC_PIN_GROUP(du_sync),
3169 SH_PFC_PIN_GROUP(du_oddf),
3170 SH_PFC_PIN_GROUP(du_cde),
3171 SH_PFC_PIN_GROUP(du_disp),
3172 SH_PFC_PIN_GROUP(i2c1_a),
3173 SH_PFC_PIN_GROUP(i2c1_b),
3174 SH_PFC_PIN_GROUP(i2c2_a),
3175 SH_PFC_PIN_GROUP(i2c2_b),
3176 SH_PFC_PIN_GROUP(i2c6_a),
3177 SH_PFC_PIN_GROUP(i2c6_b),
3178 SH_PFC_PIN_GROUP(i2c6_c),
1962 SH_PFC_PIN_GROUP(intc_ex_irq0), 3179 SH_PFC_PIN_GROUP(intc_ex_irq0),
1963 SH_PFC_PIN_GROUP(intc_ex_irq1), 3180 SH_PFC_PIN_GROUP(intc_ex_irq1),
1964 SH_PFC_PIN_GROUP(intc_ex_irq2), 3181 SH_PFC_PIN_GROUP(intc_ex_irq2),
1965 SH_PFC_PIN_GROUP(intc_ex_irq3), 3182 SH_PFC_PIN_GROUP(intc_ex_irq3),
1966 SH_PFC_PIN_GROUP(intc_ex_irq4), 3183 SH_PFC_PIN_GROUP(intc_ex_irq4),
1967 SH_PFC_PIN_GROUP(intc_ex_irq5), 3184 SH_PFC_PIN_GROUP(intc_ex_irq5),
3185 SH_PFC_PIN_GROUP(msiof0_clk),
3186 SH_PFC_PIN_GROUP(msiof0_sync),
3187 SH_PFC_PIN_GROUP(msiof0_ss1),
3188 SH_PFC_PIN_GROUP(msiof0_ss2),
3189 SH_PFC_PIN_GROUP(msiof0_txd),
3190 SH_PFC_PIN_GROUP(msiof0_rxd),
3191 SH_PFC_PIN_GROUP(msiof1_clk_a),
3192 SH_PFC_PIN_GROUP(msiof1_sync_a),
3193 SH_PFC_PIN_GROUP(msiof1_ss1_a),
3194 SH_PFC_PIN_GROUP(msiof1_ss2_a),
3195 SH_PFC_PIN_GROUP(msiof1_txd_a),
3196 SH_PFC_PIN_GROUP(msiof1_rxd_a),
3197 SH_PFC_PIN_GROUP(msiof1_clk_b),
3198 SH_PFC_PIN_GROUP(msiof1_sync_b),
3199 SH_PFC_PIN_GROUP(msiof1_ss1_b),
3200 SH_PFC_PIN_GROUP(msiof1_ss2_b),
3201 SH_PFC_PIN_GROUP(msiof1_txd_b),
3202 SH_PFC_PIN_GROUP(msiof1_rxd_b),
3203 SH_PFC_PIN_GROUP(msiof1_clk_c),
3204 SH_PFC_PIN_GROUP(msiof1_sync_c),
3205 SH_PFC_PIN_GROUP(msiof1_ss1_c),
3206 SH_PFC_PIN_GROUP(msiof1_ss2_c),
3207 SH_PFC_PIN_GROUP(msiof1_txd_c),
3208 SH_PFC_PIN_GROUP(msiof1_rxd_c),
3209 SH_PFC_PIN_GROUP(msiof1_clk_d),
3210 SH_PFC_PIN_GROUP(msiof1_sync_d),
3211 SH_PFC_PIN_GROUP(msiof1_ss1_d),
3212 SH_PFC_PIN_GROUP(msiof1_ss2_d),
3213 SH_PFC_PIN_GROUP(msiof1_txd_d),
3214 SH_PFC_PIN_GROUP(msiof1_rxd_d),
3215 SH_PFC_PIN_GROUP(msiof1_clk_e),
3216 SH_PFC_PIN_GROUP(msiof1_sync_e),
3217 SH_PFC_PIN_GROUP(msiof1_ss1_e),
3218 SH_PFC_PIN_GROUP(msiof1_ss2_e),
3219 SH_PFC_PIN_GROUP(msiof1_txd_e),
3220 SH_PFC_PIN_GROUP(msiof1_rxd_e),
3221 SH_PFC_PIN_GROUP(msiof1_clk_f),
3222 SH_PFC_PIN_GROUP(msiof1_sync_f),
3223 SH_PFC_PIN_GROUP(msiof1_ss1_f),
3224 SH_PFC_PIN_GROUP(msiof1_ss2_f),
3225 SH_PFC_PIN_GROUP(msiof1_txd_f),
3226 SH_PFC_PIN_GROUP(msiof1_rxd_f),
3227 SH_PFC_PIN_GROUP(msiof1_clk_g),
3228 SH_PFC_PIN_GROUP(msiof1_sync_g),
3229 SH_PFC_PIN_GROUP(msiof1_ss1_g),
3230 SH_PFC_PIN_GROUP(msiof1_ss2_g),
3231 SH_PFC_PIN_GROUP(msiof1_txd_g),
3232 SH_PFC_PIN_GROUP(msiof1_rxd_g),
3233 SH_PFC_PIN_GROUP(msiof2_clk_a),
3234 SH_PFC_PIN_GROUP(msiof2_sync_a),
3235 SH_PFC_PIN_GROUP(msiof2_ss1_a),
3236 SH_PFC_PIN_GROUP(msiof2_ss2_a),
3237 SH_PFC_PIN_GROUP(msiof2_txd_a),
3238 SH_PFC_PIN_GROUP(msiof2_rxd_a),
3239 SH_PFC_PIN_GROUP(msiof2_clk_b),
3240 SH_PFC_PIN_GROUP(msiof2_sync_b),
3241 SH_PFC_PIN_GROUP(msiof2_ss1_b),
3242 SH_PFC_PIN_GROUP(msiof2_ss2_b),
3243 SH_PFC_PIN_GROUP(msiof2_txd_b),
3244 SH_PFC_PIN_GROUP(msiof2_rxd_b),
3245 SH_PFC_PIN_GROUP(msiof2_clk_c),
3246 SH_PFC_PIN_GROUP(msiof2_sync_c),
3247 SH_PFC_PIN_GROUP(msiof2_ss1_c),
3248 SH_PFC_PIN_GROUP(msiof2_ss2_c),
3249 SH_PFC_PIN_GROUP(msiof2_txd_c),
3250 SH_PFC_PIN_GROUP(msiof2_rxd_c),
3251 SH_PFC_PIN_GROUP(msiof2_clk_d),
3252 SH_PFC_PIN_GROUP(msiof2_sync_d),
3253 SH_PFC_PIN_GROUP(msiof2_ss1_d),
3254 SH_PFC_PIN_GROUP(msiof2_ss2_d),
3255 SH_PFC_PIN_GROUP(msiof2_txd_d),
3256 SH_PFC_PIN_GROUP(msiof2_rxd_d),
3257 SH_PFC_PIN_GROUP(msiof3_clk_a),
3258 SH_PFC_PIN_GROUP(msiof3_sync_a),
3259 SH_PFC_PIN_GROUP(msiof3_ss1_a),
3260 SH_PFC_PIN_GROUP(msiof3_ss2_a),
3261 SH_PFC_PIN_GROUP(msiof3_txd_a),
3262 SH_PFC_PIN_GROUP(msiof3_rxd_a),
3263 SH_PFC_PIN_GROUP(msiof3_clk_b),
3264 SH_PFC_PIN_GROUP(msiof3_sync_b),
3265 SH_PFC_PIN_GROUP(msiof3_ss1_b),
3266 SH_PFC_PIN_GROUP(msiof3_ss2_b),
3267 SH_PFC_PIN_GROUP(msiof3_txd_b),
3268 SH_PFC_PIN_GROUP(msiof3_rxd_b),
3269 SH_PFC_PIN_GROUP(msiof3_clk_c),
3270 SH_PFC_PIN_GROUP(msiof3_sync_c),
3271 SH_PFC_PIN_GROUP(msiof3_txd_c),
3272 SH_PFC_PIN_GROUP(msiof3_rxd_c),
3273 SH_PFC_PIN_GROUP(msiof3_clk_d),
3274 SH_PFC_PIN_GROUP(msiof3_sync_d),
3275 SH_PFC_PIN_GROUP(msiof3_ss1_d),
3276 SH_PFC_PIN_GROUP(msiof3_txd_d),
3277 SH_PFC_PIN_GROUP(msiof3_rxd_d),
3278 SH_PFC_PIN_GROUP(msiof3_clk_e),
3279 SH_PFC_PIN_GROUP(msiof3_sync_e),
3280 SH_PFC_PIN_GROUP(msiof3_ss1_e),
3281 SH_PFC_PIN_GROUP(msiof3_ss2_e),
3282 SH_PFC_PIN_GROUP(msiof3_txd_e),
3283 SH_PFC_PIN_GROUP(msiof3_rxd_e),
3284 SH_PFC_PIN_GROUP(pwm0),
3285 SH_PFC_PIN_GROUP(pwm1_a),
3286 SH_PFC_PIN_GROUP(pwm1_b),
3287 SH_PFC_PIN_GROUP(pwm2_a),
3288 SH_PFC_PIN_GROUP(pwm2_b),
3289 SH_PFC_PIN_GROUP(pwm3_a),
3290 SH_PFC_PIN_GROUP(pwm3_b),
3291 SH_PFC_PIN_GROUP(pwm4_a),
3292 SH_PFC_PIN_GROUP(pwm4_b),
3293 SH_PFC_PIN_GROUP(pwm5_a),
3294 SH_PFC_PIN_GROUP(pwm5_b),
3295 SH_PFC_PIN_GROUP(pwm6_a),
3296 SH_PFC_PIN_GROUP(pwm6_b),
1968 SH_PFC_PIN_GROUP(scif0_data), 3297 SH_PFC_PIN_GROUP(scif0_data),
1969 SH_PFC_PIN_GROUP(scif0_clk), 3298 SH_PFC_PIN_GROUP(scif0_clk),
1970 SH_PFC_PIN_GROUP(scif0_ctrl), 3299 SH_PFC_PIN_GROUP(scif0_ctrl),
@@ -1994,6 +3323,32 @@ static const struct sh_pfc_pin_group pinmux_groups[] = {
1994 SH_PFC_PIN_GROUP(scif5_clk_b), 3323 SH_PFC_PIN_GROUP(scif5_clk_b),
1995 SH_PFC_PIN_GROUP(scif_clk_a), 3324 SH_PFC_PIN_GROUP(scif_clk_a),
1996 SH_PFC_PIN_GROUP(scif_clk_b), 3325 SH_PFC_PIN_GROUP(scif_clk_b),
3326 SH_PFC_PIN_GROUP(sdhi0_data1),
3327 SH_PFC_PIN_GROUP(sdhi0_data4),
3328 SH_PFC_PIN_GROUP(sdhi0_ctrl),
3329 SH_PFC_PIN_GROUP(sdhi0_cd),
3330 SH_PFC_PIN_GROUP(sdhi0_wp),
3331 SH_PFC_PIN_GROUP(sdhi1_data1),
3332 SH_PFC_PIN_GROUP(sdhi1_data4),
3333 SH_PFC_PIN_GROUP(sdhi1_ctrl),
3334 SH_PFC_PIN_GROUP(sdhi1_cd),
3335 SH_PFC_PIN_GROUP(sdhi1_wp),
3336 SH_PFC_PIN_GROUP(sdhi2_data1),
3337 SH_PFC_PIN_GROUP(sdhi2_data4),
3338 SH_PFC_PIN_GROUP(sdhi2_data8),
3339 SH_PFC_PIN_GROUP(sdhi2_ctrl),
3340 SH_PFC_PIN_GROUP(sdhi2_cd_a),
3341 SH_PFC_PIN_GROUP(sdhi2_wp_a),
3342 SH_PFC_PIN_GROUP(sdhi2_cd_b),
3343 SH_PFC_PIN_GROUP(sdhi2_wp_b),
3344 SH_PFC_PIN_GROUP(sdhi2_ds),
3345 SH_PFC_PIN_GROUP(sdhi3_data1),
3346 SH_PFC_PIN_GROUP(sdhi3_data4),
3347 SH_PFC_PIN_GROUP(sdhi3_data8),
3348 SH_PFC_PIN_GROUP(sdhi3_ctrl),
3349 SH_PFC_PIN_GROUP(sdhi3_cd),
3350 SH_PFC_PIN_GROUP(sdhi3_wp),
3351 SH_PFC_PIN_GROUP(sdhi3_ds),
1997 SH_PFC_PIN_GROUP(usb0), 3352 SH_PFC_PIN_GROUP(usb0),
1998 SH_PFC_PIN_GROUP(usb1), 3353 SH_PFC_PIN_GROUP(usb1),
1999 SH_PFC_PIN_GROUP(usb30), 3354 SH_PFC_PIN_GROUP(usb30),
@@ -2013,6 +3368,33 @@ static const char * const avb_groups[] = {
2013 "avb_avtp_capture_b", 3368 "avb_avtp_capture_b",
2014}; 3369};
2015 3370
3371static const char * const du_groups[] = {
3372 "du_rgb666",
3373 "du_rgb888",
3374 "du_clk_out_0",
3375 "du_clk_out_1",
3376 "du_sync",
3377 "du_oddf",
3378 "du_cde",
3379 "du_disp",
3380};
3381
3382static const char * const i2c1_groups[] = {
3383 "i2c1_a",
3384 "i2c1_b",
3385};
3386
3387static const char * const i2c2_groups[] = {
3388 "i2c2_a",
3389 "i2c2_b",
3390};
3391
3392static const char * const i2c6_groups[] = {
3393 "i2c6_a",
3394 "i2c6_b",
3395 "i2c6_c",
3396};
3397
2016static const char * const intc_ex_groups[] = { 3398static const char * const intc_ex_groups[] = {
2017 "intc_ex_irq0", 3399 "intc_ex_irq0",
2018 "intc_ex_irq1", 3400 "intc_ex_irq1",
@@ -2022,6 +3404,151 @@ static const char * const intc_ex_groups[] = {
2022 "intc_ex_irq5", 3404 "intc_ex_irq5",
2023}; 3405};
2024 3406
3407static const char * const msiof0_groups[] = {
3408 "msiof0_clk",
3409 "msiof0_sync",
3410 "msiof0_ss1",
3411 "msiof0_ss2",
3412 "msiof0_txd",
3413 "msiof0_rxd",
3414};
3415
3416static const char * const msiof1_groups[] = {
3417 "msiof1_clk_a",
3418 "msiof1_sync_a",
3419 "msiof1_ss1_a",
3420 "msiof1_ss2_a",
3421 "msiof1_txd_a",
3422 "msiof1_rxd_a",
3423 "msiof1_clk_b",
3424 "msiof1_sync_b",
3425 "msiof1_ss1_b",
3426 "msiof1_ss2_b",
3427 "msiof1_txd_b",
3428 "msiof1_rxd_b",
3429 "msiof1_clk_c",
3430 "msiof1_sync_c",
3431 "msiof1_ss1_c",
3432 "msiof1_ss2_c",
3433 "msiof1_txd_c",
3434 "msiof1_rxd_c",
3435 "msiof1_clk_d",
3436 "msiof1_sync_d",
3437 "msiof1_ss1_d",
3438 "msiof1_ss2_d",
3439 "msiof1_txd_d",
3440 "msiof1_rxd_d",
3441 "msiof1_clk_e",
3442 "msiof1_sync_e",
3443 "msiof1_ss1_e",
3444 "msiof1_ss2_e",
3445 "msiof1_txd_e",
3446 "msiof1_rxd_e",
3447 "msiof1_clk_f",
3448 "msiof1_sync_f",
3449 "msiof1_ss1_f",
3450 "msiof1_ss2_f",
3451 "msiof1_txd_f",
3452 "msiof1_rxd_f",
3453 "msiof1_clk_g",
3454 "msiof1_sync_g",
3455 "msiof1_ss1_g",
3456 "msiof1_ss2_g",
3457 "msiof1_txd_g",
3458 "msiof1_rxd_g",
3459};
3460
3461static const char * const msiof2_groups[] = {
3462 "msiof2_clk_a",
3463 "msiof2_sync_a",
3464 "msiof2_ss1_a",
3465 "msiof2_ss2_a",
3466 "msiof2_txd_a",
3467 "msiof2_rxd_a",
3468 "msiof2_clk_b",
3469 "msiof2_sync_b",
3470 "msiof2_ss1_b",
3471 "msiof2_ss2_b",
3472 "msiof2_txd_b",
3473 "msiof2_rxd_b",
3474 "msiof2_clk_c",
3475 "msiof2_sync_c",
3476 "msiof2_ss1_c",
3477 "msiof2_ss2_c",
3478 "msiof2_txd_c",
3479 "msiof2_rxd_c",
3480 "msiof2_clk_d",
3481 "msiof2_sync_d",
3482 "msiof2_ss1_d",
3483 "msiof2_ss2_d",
3484 "msiof2_txd_d",
3485 "msiof2_rxd_d",
3486};
3487
3488static const char * const msiof3_groups[] = {
3489 "msiof3_clk_a",
3490 "msiof3_sync_a",
3491 "msiof3_ss1_a",
3492 "msiof3_ss2_a",
3493 "msiof3_txd_a",
3494 "msiof3_rxd_a",
3495 "msiof3_clk_b",
3496 "msiof3_sync_b",
3497 "msiof3_ss1_b",
3498 "msiof3_ss2_b",
3499 "msiof3_txd_b",
3500 "msiof3_rxd_b",
3501 "msiof3_clk_c",
3502 "msiof3_sync_c",
3503 "msiof3_txd_c",
3504 "msiof3_rxd_c",
3505 "msiof3_clk_d",
3506 "msiof3_sync_d",
3507 "msiof3_ss1_d",
3508 "msiof3_txd_d",
3509 "msiof3_rxd_d",
3510 "msiof3_clk_e",
3511 "msiof3_sync_e",
3512 "msiof3_ss1_e",
3513 "msiof3_ss2_e",
3514 "msiof3_txd_e",
3515 "msiof3_rxd_e",
3516};
3517
3518static const char * const pwm0_groups[] = {
3519 "pwm0",
3520};
3521
3522static const char * const pwm1_groups[] = {
3523 "pwm1_a",
3524 "pwm1_b",
3525};
3526
3527static const char * const pwm2_groups[] = {
3528 "pwm2_a",
3529 "pwm2_b",
3530};
3531
3532static const char * const pwm3_groups[] = {
3533 "pwm3_a",
3534 "pwm3_b",
3535};
3536
3537static const char * const pwm4_groups[] = {
3538 "pwm4_a",
3539 "pwm4_b",
3540};
3541
3542static const char * const pwm5_groups[] = {
3543 "pwm5_a",
3544 "pwm5_b",
3545};
3546
3547static const char * const pwm6_groups[] = {
3548 "pwm6_a",
3549 "pwm6_b",
3550};
3551
2025static const char * const scif0_groups[] = { 3552static const char * const scif0_groups[] = {
2026 "scif0_data", 3553 "scif0_data",
2027 "scif0_clk", 3554 "scif0_clk",
@@ -2071,6 +3598,44 @@ static const char * const scif_clk_groups[] = {
2071 "scif_clk_b", 3598 "scif_clk_b",
2072}; 3599};
2073 3600
3601static const char * const sdhi0_groups[] = {
3602 "sdhi0_data1",
3603 "sdhi0_data4",
3604 "sdhi0_ctrl",
3605 "sdhi0_cd",
3606 "sdhi0_wp",
3607};
3608
3609static const char * const sdhi1_groups[] = {
3610 "sdhi1_data1",
3611 "sdhi1_data4",
3612 "sdhi1_ctrl",
3613 "sdhi1_cd",
3614 "sdhi1_wp",
3615};
3616
3617static const char * const sdhi2_groups[] = {
3618 "sdhi2_data1",
3619 "sdhi2_data4",
3620 "sdhi2_data8",
3621 "sdhi2_ctrl",
3622 "sdhi2_cd_a",
3623 "sdhi2_wp_a",
3624 "sdhi2_cd_b",
3625 "sdhi2_wp_b",
3626 "sdhi2_ds",
3627};
3628
3629static const char * const sdhi3_groups[] = {
3630 "sdhi3_data1",
3631 "sdhi3_data4",
3632 "sdhi3_data8",
3633 "sdhi3_ctrl",
3634 "sdhi3_cd",
3635 "sdhi3_wp",
3636 "sdhi3_ds",
3637};
3638
2074static const char * const usb0_groups[] = { 3639static const char * const usb0_groups[] = {
2075 "usb0", 3640 "usb0",
2076}; 3641};
@@ -2085,7 +3650,22 @@ static const char * const usb30_groups[] = {
2085 3650
2086static const struct sh_pfc_function pinmux_functions[] = { 3651static const struct sh_pfc_function pinmux_functions[] = {
2087 SH_PFC_FUNCTION(avb), 3652 SH_PFC_FUNCTION(avb),
3653 SH_PFC_FUNCTION(du),
3654 SH_PFC_FUNCTION(i2c1),
3655 SH_PFC_FUNCTION(i2c2),
3656 SH_PFC_FUNCTION(i2c6),
2088 SH_PFC_FUNCTION(intc_ex), 3657 SH_PFC_FUNCTION(intc_ex),
3658 SH_PFC_FUNCTION(msiof0),
3659 SH_PFC_FUNCTION(msiof1),
3660 SH_PFC_FUNCTION(msiof2),
3661 SH_PFC_FUNCTION(msiof3),
3662 SH_PFC_FUNCTION(pwm0),
3663 SH_PFC_FUNCTION(pwm1),
3664 SH_PFC_FUNCTION(pwm2),
3665 SH_PFC_FUNCTION(pwm3),
3666 SH_PFC_FUNCTION(pwm4),
3667 SH_PFC_FUNCTION(pwm5),
3668 SH_PFC_FUNCTION(pwm6),
2089 SH_PFC_FUNCTION(scif0), 3669 SH_PFC_FUNCTION(scif0),
2090 SH_PFC_FUNCTION(scif1), 3670 SH_PFC_FUNCTION(scif1),
2091 SH_PFC_FUNCTION(scif2), 3671 SH_PFC_FUNCTION(scif2),
@@ -2093,6 +3673,10 @@ static const struct sh_pfc_function pinmux_functions[] = {
2093 SH_PFC_FUNCTION(scif4), 3673 SH_PFC_FUNCTION(scif4),
2094 SH_PFC_FUNCTION(scif5), 3674 SH_PFC_FUNCTION(scif5),
2095 SH_PFC_FUNCTION(scif_clk), 3675 SH_PFC_FUNCTION(scif_clk),
3676 SH_PFC_FUNCTION(sdhi0),
3677 SH_PFC_FUNCTION(sdhi1),
3678 SH_PFC_FUNCTION(sdhi2),
3679 SH_PFC_FUNCTION(sdhi3),
2096 SH_PFC_FUNCTION(usb0), 3680 SH_PFC_FUNCTION(usb0),
2097 SH_PFC_FUNCTION(usb1), 3681 SH_PFC_FUNCTION(usb1),
2098 SH_PFC_FUNCTION(usb30), 3682 SH_PFC_FUNCTION(usb30),
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77970.c b/drivers/pinctrl/sh-pfc/pfc-r8a77970.c
index b1bb7263532b..b02caf316711 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a77970.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77970.c
@@ -21,13 +21,15 @@
21#include "core.h" 21#include "core.h"
22#include "sh_pfc.h" 22#include "sh_pfc.h"
23 23
24#define CFG_FLAGS SH_PFC_PIN_CFG_DRIVE_STRENGTH
25
24#define CPU_ALL_PORT(fn, sfx) \ 26#define CPU_ALL_PORT(fn, sfx) \
25 PORT_GP_CFG_22(0, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ 27 PORT_GP_CFG_22(0, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE), \
26 PORT_GP_CFG_28(1, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ 28 PORT_GP_CFG_28(1, fn, sfx, CFG_FLAGS), \
27 PORT_GP_CFG_17(2, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ 29 PORT_GP_CFG_17(2, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE), \
28 PORT_GP_CFG_17(3, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ 30 PORT_GP_CFG_17(3, fn, sfx, CFG_FLAGS | SH_PFC_PIN_CFG_IO_VOLTAGE), \
29 PORT_GP_CFG_6(4, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH), \ 31 PORT_GP_CFG_6(4, fn, sfx, CFG_FLAGS), \
30 PORT_GP_CFG_15(5, fn, sfx, SH_PFC_PIN_CFG_DRIVE_STRENGTH) 32 PORT_GP_CFG_15(5, fn, sfx, CFG_FLAGS)
31/* 33/*
32 * F_() : just information 34 * F_() : just information
33 * FM() : macro for FN_xxx / xxx_MARK 35 * FM() : macro for FN_xxx / xxx_MARK
@@ -2382,18 +2384,31 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
2382 { }, 2384 { },
2383}; 2385};
2384 2386
2387enum ioctrl_regs {
2388 IOCTRL30,
2389 IOCTRL31,
2390 IOCTRL32,
2391};
2392
2393static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = {
2394 [IOCTRL30] = { 0xe6060380 },
2395 [IOCTRL31] = { 0xe6060384 },
2396 [IOCTRL32] = { 0xe6060388 },
2397 { /* sentinel */ },
2398};
2399
2385static int r8a77970_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin, 2400static int r8a77970_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin,
2386 u32 *pocctrl) 2401 u32 *pocctrl)
2387{ 2402{
2388 int bit = pin & 0x1f; 2403 int bit = pin & 0x1f;
2389 2404
2390 *pocctrl = 0xe6060380; 2405 *pocctrl = pinmux_ioctrl_regs[IOCTRL30].reg;
2391 if (pin >= RCAR_GP_PIN(0, 0) && pin <= RCAR_GP_PIN(0, 21)) 2406 if (pin >= RCAR_GP_PIN(0, 0) && pin <= RCAR_GP_PIN(0, 21))
2392 return bit; 2407 return bit;
2393 if (pin >= RCAR_GP_PIN(2, 0) && pin <= RCAR_GP_PIN(2, 9)) 2408 if (pin >= RCAR_GP_PIN(2, 0) && pin <= RCAR_GP_PIN(2, 9))
2394 return bit + 22; 2409 return bit + 22;
2395 2410
2396 *pocctrl += 4; 2411 *pocctrl = pinmux_ioctrl_regs[IOCTRL31].reg;
2397 if (pin >= RCAR_GP_PIN(2, 10) && pin <= RCAR_GP_PIN(2, 16)) 2412 if (pin >= RCAR_GP_PIN(2, 10) && pin <= RCAR_GP_PIN(2, 16))
2398 return bit - 10; 2413 return bit - 10;
2399 if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 16)) 2414 if (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 16))
@@ -2421,6 +2436,7 @@ const struct sh_pfc_soc_info r8a77970_pinmux_info = {
2421 .nr_functions = ARRAY_SIZE(pinmux_functions), 2436 .nr_functions = ARRAY_SIZE(pinmux_functions),
2422 2437
2423 .cfg_regs = pinmux_config_regs, 2438 .cfg_regs = pinmux_config_regs,
2439 .ioctrl_regs = pinmux_ioctrl_regs,
2424 2440
2425 .pinmux_data = pinmux_data, 2441 .pinmux_data = pinmux_data,
2426 .pinmux_data_size = ARRAY_SIZE(pinmux_data), 2442 .pinmux_data_size = ARRAY_SIZE(pinmux_data),
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77980.c b/drivers/pinctrl/sh-pfc/pfc-r8a77980.c
index 84c8f1c2f1d1..3f6967331f64 100644
--- a/drivers/pinctrl/sh-pfc/pfc-r8a77980.c
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77980.c
@@ -19,10 +19,10 @@
19#include "sh_pfc.h" 19#include "sh_pfc.h"
20 20
21#define CPU_ALL_PORT(fn, sfx) \ 21#define CPU_ALL_PORT(fn, sfx) \
22 PORT_GP_22(0, fn, sfx), \ 22 PORT_GP_CFG_22(0, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE), \
23 PORT_GP_28(1, fn, sfx), \ 23 PORT_GP_28(1, fn, sfx), \
24 PORT_GP_30(2, fn, sfx), \ 24 PORT_GP_CFG_30(2, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE), \
25 PORT_GP_17(3, fn, sfx), \ 25 PORT_GP_CFG_17(3, fn, sfx, SH_PFC_PIN_CFG_IO_VOLTAGE), \
26 PORT_GP_25(4, fn, sfx), \ 26 PORT_GP_25(4, fn, sfx), \
27 PORT_GP_15(5, fn, sfx) 27 PORT_GP_15(5, fn, sfx)
28 28
@@ -2779,8 +2779,53 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {
2779 { }, 2779 { },
2780}; 2780};
2781 2781
2782enum ioctrl_regs {
2783 IOCTRL30,
2784 IOCTRL31,
2785 IOCTRL32,
2786 IOCTRL33,
2787};
2788
2789static const struct pinmux_ioctrl_reg pinmux_ioctrl_regs[] = {
2790 [IOCTRL30] = { 0xe6060380, },
2791 [IOCTRL31] = { 0xe6060384, },
2792 [IOCTRL32] = { 0xe6060388, },
2793 [IOCTRL33] = { 0xe606038c, },
2794 { /* sentinel */ },
2795};
2796
2797static int r8a77980_pin_to_pocctrl(struct sh_pfc *pfc, unsigned int pin,
2798 u32 *pocctrl)
2799{
2800 int bit = pin & 0x1f;
2801
2802 *pocctrl = pinmux_ioctrl_regs[IOCTRL30].reg;
2803 if (pin >= RCAR_GP_PIN(0, 0) && pin <= RCAR_GP_PIN(0, 21))
2804 return bit;
2805 else if (pin >= RCAR_GP_PIN(2, 0) && pin <= RCAR_GP_PIN(2, 9))
2806 return bit + 22;
2807
2808 *pocctrl = pinmux_ioctrl_regs[IOCTRL31].reg;
2809 if (pin >= RCAR_GP_PIN(2, 10) && pin <= RCAR_GP_PIN(2, 16))
2810 return bit - 10;
2811 if ((pin >= RCAR_GP_PIN(2, 17) && pin <= RCAR_GP_PIN(2, 24)) ||
2812 (pin >= RCAR_GP_PIN(3, 0) && pin <= RCAR_GP_PIN(3, 16)))
2813 return bit + 7;
2814
2815 *pocctrl = pinmux_ioctrl_regs[IOCTRL32].reg;
2816 if (pin >= RCAR_GP_PIN(2, 25) && pin <= RCAR_GP_PIN(2, 29))
2817 return pin - 25;
2818
2819 return -EINVAL;
2820}
2821
2822static const struct sh_pfc_soc_operations pinmux_ops = {
2823 .pin_to_pocctrl = r8a77980_pin_to_pocctrl,
2824};
2825
2782const struct sh_pfc_soc_info r8a77980_pinmux_info = { 2826const struct sh_pfc_soc_info r8a77980_pinmux_info = {
2783 .name = "r8a77980_pfc", 2827 .name = "r8a77980_pfc",
2828 .ops = &pinmux_ops,
2784 .unlock_reg = 0xe6060000, /* PMMR */ 2829 .unlock_reg = 0xe6060000, /* PMMR */
2785 2830
2786 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END }, 2831 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
@@ -2793,6 +2838,7 @@ const struct sh_pfc_soc_info r8a77980_pinmux_info = {
2793 .nr_functions = ARRAY_SIZE(pinmux_functions), 2838 .nr_functions = ARRAY_SIZE(pinmux_functions),
2794 2839
2795 .cfg_regs = pinmux_config_regs, 2840 .cfg_regs = pinmux_config_regs,
2841 .ioctrl_regs = pinmux_ioctrl_regs,
2796 2842
2797 .pinmux_data = pinmux_data, 2843 .pinmux_data = pinmux_data,
2798 .pinmux_data_size = ARRAY_SIZE(pinmux_data), 2844 .pinmux_data_size = ARRAY_SIZE(pinmux_data),
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a77990.c b/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
new file mode 100644
index 000000000000..a68fd658aada
--- /dev/null
+++ b/drivers/pinctrl/sh-pfc/pfc-r8a77990.c
@@ -0,0 +1,2695 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * R8A77990 processor support - PFC hardware block.
4 *
5 * Copyright (C) 2018 Renesas Electronics Corp.
6 *
7 * This file is based on the drivers/pinctrl/sh-pfc/pfc-r8a7796.c
8 *
9 * R8A7796 processor support - PFC hardware block.
10 *
11 * Copyright (C) 2016-2017 Renesas Electronics Corp.
12 */
13
14#include <linux/kernel.h>
15
16#include "core.h"
17#include "sh_pfc.h"
18
19#define CFG_FLAGS (SH_PFC_PIN_CFG_PULL_UP | \
20 SH_PFC_PIN_CFG_PULL_DOWN)
21
22#define CPU_ALL_PORT(fn, sfx) \
23 PORT_GP_CFG_18(0, fn, sfx, CFG_FLAGS), \
24 PORT_GP_CFG_23(1, fn, sfx, CFG_FLAGS), \
25 PORT_GP_CFG_26(2, fn, sfx, CFG_FLAGS), \
26 PORT_GP_CFG_16(3, fn, sfx, CFG_FLAGS), \
27 PORT_GP_CFG_11(4, fn, sfx, CFG_FLAGS), \
28 PORT_GP_CFG_20(5, fn, sfx, CFG_FLAGS), \
29 PORT_GP_CFG_18(6, fn, sfx, CFG_FLAGS)
30/*
31 * F_() : just information
32 * FM() : macro for FN_xxx / xxx_MARK
33 */
34
35/* GPSR0 */
36#define GPSR0_17 F_(SDA4, IP7_27_24)
37#define GPSR0_16 F_(SCL4, IP7_23_20)
38#define GPSR0_15 F_(D15, IP7_19_16)
39#define GPSR0_14 F_(D14, IP7_15_12)
40#define GPSR0_13 F_(D13, IP7_11_8)
41#define GPSR0_12 F_(D12, IP7_7_4)
42#define GPSR0_11 F_(D11, IP7_3_0)
43#define GPSR0_10 F_(D10, IP6_31_28)
44#define GPSR0_9 F_(D9, IP6_27_24)
45#define GPSR0_8 F_(D8, IP6_23_20)
46#define GPSR0_7 F_(D7, IP6_19_16)
47#define GPSR0_6 F_(D6, IP6_15_12)
48#define GPSR0_5 F_(D5, IP6_11_8)
49#define GPSR0_4 F_(D4, IP6_7_4)
50#define GPSR0_3 F_(D3, IP6_3_0)
51#define GPSR0_2 F_(D2, IP5_31_28)
52#define GPSR0_1 F_(D1, IP5_27_24)
53#define GPSR0_0 F_(D0, IP5_23_20)
54
55/* GPSR1 */
56#define GPSR1_22 F_(WE0_N, IP5_19_16)
57#define GPSR1_21 F_(CS0_N, IP5_15_12)
58#define GPSR1_20 FM(CLKOUT)
59#define GPSR1_19 F_(A19, IP5_11_8)
60#define GPSR1_18 F_(A18, IP5_7_4)
61#define GPSR1_17 F_(A17, IP5_3_0)
62#define GPSR1_16 F_(A16, IP4_31_28)
63#define GPSR1_15 F_(A15, IP4_27_24)
64#define GPSR1_14 F_(A14, IP4_23_20)
65#define GPSR1_13 F_(A13, IP4_19_16)
66#define GPSR1_12 F_(A12, IP4_15_12)
67#define GPSR1_11 F_(A11, IP4_11_8)
68#define GPSR1_10 F_(A10, IP4_7_4)
69#define GPSR1_9 F_(A9, IP4_3_0)
70#define GPSR1_8 F_(A8, IP3_31_28)
71#define GPSR1_7 F_(A7, IP3_27_24)
72#define GPSR1_6 F_(A6, IP3_23_20)
73#define GPSR1_5 F_(A5, IP3_19_16)
74#define GPSR1_4 F_(A4, IP3_15_12)
75#define GPSR1_3 F_(A3, IP3_11_8)
76#define GPSR1_2 F_(A2, IP3_7_4)
77#define GPSR1_1 F_(A1, IP3_3_0)
78#define GPSR1_0 F_(A0, IP2_31_28)
79
80/* GPSR2 */
81#define GPSR2_25 F_(EX_WAIT0, IP2_27_24)
82#define GPSR2_24 F_(RD_WR_N, IP2_23_20)
83#define GPSR2_23 F_(RD_N, IP2_19_16)
84#define GPSR2_22 F_(BS_N, IP2_15_12)
85#define GPSR2_21 FM(AVB_PHY_INT)
86#define GPSR2_20 F_(AVB_TXCREFCLK, IP2_3_0)
87#define GPSR2_19 FM(AVB_RD3)
88#define GPSR2_18 F_(AVB_RD2, IP1_31_28)
89#define GPSR2_17 F_(AVB_RD1, IP1_27_24)
90#define GPSR2_16 F_(AVB_RD0, IP1_23_20)
91#define GPSR2_15 FM(AVB_RXC)
92#define GPSR2_14 FM(AVB_RX_CTL)
93#define GPSR2_13 F_(RPC_RESET_N, IP1_19_16)
94#define GPSR2_12 F_(RPC_INT_N, IP1_15_12)
95#define GPSR2_11 F_(QSPI1_SSL, IP1_11_8)
96#define GPSR2_10 F_(QSPI1_IO3, IP1_7_4)
97#define GPSR2_9 F_(QSPI1_IO2, IP1_3_0)
98#define GPSR2_8 F_(QSPI1_MISO_IO1, IP0_31_28)
99#define GPSR2_7 F_(QSPI1_MOSI_IO0, IP0_27_24)
100#define GPSR2_6 F_(QSPI1_SPCLK, IP0_23_20)
101#define GPSR2_5 FM(QSPI0_SSL)
102#define GPSR2_4 F_(QSPI0_IO3, IP0_19_16)
103#define GPSR2_3 F_(QSPI0_IO2, IP0_15_12)
104#define GPSR2_2 F_(QSPI0_MISO_IO1, IP0_11_8)
105#define GPSR2_1 F_(QSPI0_MOSI_IO0, IP0_7_4)
106#define GPSR2_0 F_(QSPI0_SPCLK, IP0_3_0)
107
108/* GPSR3 */
109#define GPSR3_15 F_(SD1_WP, IP11_7_4)
110#define GPSR3_14 F_(SD1_CD, IP11_3_0)
111#define GPSR3_13 F_(SD0_WP, IP10_31_28)
112#define GPSR3_12 F_(SD0_CD, IP10_27_24)
113#define GPSR3_11 F_(SD1_DAT3, IP9_11_8)
114#define GPSR3_10 F_(SD1_DAT2, IP9_7_4)
115#define GPSR3_9 F_(SD1_DAT1, IP9_3_0)
116#define GPSR3_8 F_(SD1_DAT0, IP8_31_28)
117#define GPSR3_7 F_(SD1_CMD, IP8_27_24)
118#define GPSR3_6 F_(SD1_CLK, IP8_23_20)
119#define GPSR3_5 F_(SD0_DAT3, IP8_19_16)
120#define GPSR3_4 F_(SD0_DAT2, IP8_15_12)
121#define GPSR3_3 F_(SD0_DAT1, IP8_11_8)
122#define GPSR3_2 F_(SD0_DAT0, IP8_7_4)
123#define GPSR3_1 F_(SD0_CMD, IP8_3_0)
124#define GPSR3_0 F_(SD0_CLK, IP7_31_28)
125
126/* GPSR4 */
127#define GPSR4_10 F_(SD3_DS, IP10_23_20)
128#define GPSR4_9 F_(SD3_DAT7, IP10_19_16)
129#define GPSR4_8 F_(SD3_DAT6, IP10_15_12)
130#define GPSR4_7 F_(SD3_DAT5, IP10_11_8)
131#define GPSR4_6 F_(SD3_DAT4, IP10_7_4)
132#define GPSR4_5 F_(SD3_DAT3, IP10_3_0)
133#define GPSR4_4 F_(SD3_DAT2, IP9_31_28)
134#define GPSR4_3 F_(SD3_DAT1, IP9_27_24)
135#define GPSR4_2 F_(SD3_DAT0, IP9_23_20)
136#define GPSR4_1 F_(SD3_CMD, IP9_19_16)
137#define GPSR4_0 F_(SD3_CLK, IP9_15_12)
138
139/* GPSR5 */
140#define GPSR5_19 F_(MLB_DAT, IP13_23_20)
141#define GPSR5_18 F_(MLB_SIG, IP13_19_16)
142#define GPSR5_17 F_(MLB_CLK, IP13_15_12)
143#define GPSR5_16 F_(SSI_SDATA9, IP13_11_8)
144#define GPSR5_15 F_(MSIOF0_SS2, IP13_7_4)
145#define GPSR5_14 F_(MSIOF0_SS1, IP13_3_0)
146#define GPSR5_13 F_(MSIOF0_SYNC, IP12_31_28)
147#define GPSR5_12 F_(MSIOF0_TXD, IP12_27_24)
148#define GPSR5_11 F_(MSIOF0_RXD, IP12_23_20)
149#define GPSR5_10 F_(MSIOF0_SCK, IP12_19_16)
150#define GPSR5_9 F_(RX2_A, IP12_15_12)
151#define GPSR5_8 F_(TX2_A, IP12_11_8)
152#define GPSR5_7 F_(SCK2_A, IP12_7_4)
153#define GPSR5_6 F_(TX1, IP12_3_0)
154#define GPSR5_5 F_(RX1, IP11_31_28)
155#define GPSR5_4 F_(RTS0_N_TANS_A, IP11_23_20)
156#define GPSR5_3 F_(CTS0_N_A, IP11_19_16)
157#define GPSR5_2 F_(TX0_A, IP11_15_12)
158#define GPSR5_1 F_(RX0_A, IP11_11_8)
159#define GPSR5_0 F_(SCK0_A, IP11_27_24)
160
161/* GPSR6 */
162#define GPSR6_17 F_(USB30_PWEN, IP15_27_24)
163#define GPSR6_16 F_(SSI_SDATA6, IP15_19_16)
164#define GPSR6_15 F_(SSI_WS6, IP15_15_12)
165#define GPSR6_14 F_(SSI_SCK6, IP15_11_8)
166#define GPSR6_13 F_(SSI_SDATA5, IP15_7_4)
167#define GPSR6_12 F_(SSI_WS5, IP15_3_0)
168#define GPSR6_11 F_(SSI_SCK5, IP14_31_28)
169#define GPSR6_10 F_(SSI_SDATA4, IP14_27_24)
170#define GPSR6_9 F_(USB30_OVC, IP15_31_28)
171#define GPSR6_8 F_(AUDIO_CLKA, IP15_23_20)
172#define GPSR6_7 F_(SSI_SDATA3, IP14_23_20)
173#define GPSR6_6 F_(SSI_WS349, IP14_19_16)
174#define GPSR6_5 F_(SSI_SCK349, IP14_15_12)
175#define GPSR6_4 F_(SSI_SDATA2, IP14_11_8)
176#define GPSR6_3 F_(SSI_SDATA1, IP14_7_4)
177#define GPSR6_2 F_(SSI_SDATA0, IP14_3_0)
178#define GPSR6_1 F_(SSI_WS01239, IP13_31_28)
179#define GPSR6_0 F_(SSI_SCK01239, IP13_27_24)
180
181/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 - F */
182#define IP0_3_0 FM(QSPI0_SPCLK) FM(HSCK4_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
183#define IP0_7_4 FM(QSPI0_MOSI_IO0) FM(HCTS4_N_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
184#define IP0_11_8 FM(QSPI0_MISO_IO1) FM(HRTS4_N_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
185#define IP0_15_12 FM(QSPI0_IO2) FM(HTX4_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
186#define IP0_19_16 FM(QSPI0_IO3) FM(HRX4_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
187#define IP0_23_20 FM(QSPI1_SPCLK) FM(RIF2_CLK_A) FM(HSCK4_B) FM(VI4_DATA0_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
188#define IP0_27_24 FM(QSPI1_MOSI_IO0) FM(RIF2_SYNC_A) FM(HTX4_B) FM(VI4_DATA1_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
189#define IP0_31_28 FM(QSPI1_MISO_IO1) FM(RIF2_D0_A) FM(HRX4_B) FM(VI4_DATA2_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
190#define IP1_3_0 FM(QSPI1_IO2) FM(RIF2_D1_A) FM(HTX3_C) FM(VI4_DATA3_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
191#define IP1_7_4 FM(QSPI1_IO3) FM(RIF3_CLK_A) FM(HRX3_C) FM(VI4_DATA4_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
192#define IP1_11_8 FM(QSPI1_SSL) FM(RIF3_SYNC_A) FM(HSCK3_C) FM(VI4_DATA5_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
193#define IP1_15_12 FM(RPC_INT_N) FM(RIF3_D0_A) FM(HCTS3_N_C) FM(VI4_DATA6_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
194#define IP1_19_16 FM(RPC_RESET_N) FM(RIF3_D1_A) FM(HRTS3_N_C) FM(VI4_DATA7_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
195#define IP1_23_20 FM(AVB_RD0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
196#define IP1_27_24 FM(AVB_RD1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
197#define IP1_31_28 FM(AVB_RD2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
198#define IP2_3_0 FM(AVB_TXCREFCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
199#define IP2_7_4 FM(AVB_MDIO) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
200#define IP2_11_8 FM(AVB_MDC) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
201#define IP2_15_12 FM(BS_N) FM(PWM0_A) FM(AVB_MAGIC) FM(VI4_CLK) F_(0, 0) FM(TX3_C) F_(0, 0) FM(VI5_CLK_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
202#define IP2_19_16 FM(RD_N) FM(PWM1_A) FM(AVB_LINK) FM(VI4_FIELD) F_(0, 0) FM(RX3_C) FM(FSCLKST2_N_A) FM(VI5_DATA0_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
203#define IP2_23_20 FM(RD_WR_N) FM(SCL7_A) FM(AVB_AVTP_MATCH_A) FM(VI4_VSYNC_N) FM(TX5_B) FM(SCK3_C) FM(PWM5_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
204#define IP2_27_24 FM(EX_WAIT0) FM(SDA7_A) FM(AVB_AVTP_CAPTURE_A) FM(VI4_HSYNC_N) FM(RX5_B) FM(PWM6_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
205#define IP2_31_28 FM(A0) FM(IRQ0) FM(PWM2_A) FM(MSIOF3_SS1_B) FM(VI5_CLK_A) FM(DU_CDE) FM(HRX3_D) FM(IERX) FM(QSTB_QHE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
206#define IP3_3_0 FM(A1) FM(IRQ1) FM(PWM3_A) FM(DU_DOTCLKIN1) FM(VI5_DATA0_A) FM(DU_DISP_CDE) FM(SDA6_B) FM(IETX) FM(QCPV_QDE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
207#define IP3_7_4 FM(A2) FM(IRQ2) FM(AVB_AVTP_PPS) FM(VI4_CLKENB) FM(VI5_DATA1_A) FM(DU_DISP) FM(SCL6_B) F_(0, 0) FM(QSTVB_QVE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
208#define IP3_11_8 FM(A3) FM(CTS4_N_A) FM(PWM4_A) FM(VI4_DATA12) F_(0, 0) FM(DU_DOTCLKOUT0) FM(HTX3_D) FM(IECLK) FM(LCDOUT12) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
209#define IP3_15_12 FM(A4) FM(RTS4_N_TANS_A) FM(MSIOF3_SYNC_B) FM(VI4_DATA8) FM(PWM2_B) FM(DU_DG4) FM(RIF2_CLK_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
210#define IP3_19_16 FM(A5) FM(SCK4_A) FM(MSIOF3_SCK_B) FM(VI4_DATA9) FM(PWM3_B) F_(0, 0) FM(RIF2_SYNC_B) F_(0, 0) FM(QPOLA) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
211#define IP3_23_20 FM(A6) FM(RX4_A) FM(MSIOF3_RXD_B) FM(VI4_DATA10) F_(0, 0) F_(0, 0) FM(RIF2_D0_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
212#define IP3_27_24 FM(A7) FM(TX4_A) FM(MSIOF3_TXD_B) FM(VI4_DATA11) F_(0, 0) F_(0, 0) FM(RIF2_D1_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
213#define IP3_31_28 FM(A8) FM(SDA6_A) FM(RX3_B) FM(HRX4_C) FM(VI5_HSYNC_N_A) FM(DU_HSYNC) FM(VI4_DATA0_B) F_(0, 0) FM(QSTH_QHS) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
214
215/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 - F */
216#define IP4_3_0 FM(A9) FM(TX5_A) FM(IRQ3) FM(VI4_DATA16) FM(VI5_VSYNC_N_A) FM(DU_DG7) F_(0, 0) F_(0, 0) FM(LCDOUT15) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
217#define IP4_7_4 FM(A10) FM(IRQ4) FM(MSIOF2_SYNC_B) FM(VI4_DATA13) FM(VI5_FIELD_A) FM(DU_DG5) FM(FSCLKST2_N_B) F_(0, 0) FM(LCDOUT13) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
218#define IP4_11_8 FM(A11) FM(SCL6_A) FM(TX3_B) FM(HTX4_C) F_(0, 0) FM(DU_VSYNC) FM(VI4_DATA1_B) F_(0, 0) FM(QSTVA_QVS) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
219#define IP4_15_12 FM(A12) FM(RX5_A) FM(MSIOF2_SS2_B) FM(VI4_DATA17) FM(VI5_DATA3_A) FM(DU_DG6) F_(0, 0) F_(0, 0) FM(LCDOUT14) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
220#define IP4_19_16 FM(A13) FM(SCK5_A) FM(MSIOF2_SCK_B) FM(VI4_DATA14) FM(HRX4_D) FM(DU_DB2) F_(0, 0) F_(0, 0) FM(LCDOUT2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
221#define IP4_23_20 FM(A14) FM(MSIOF1_SS1) FM(MSIOF2_RXD_B) FM(VI4_DATA15) FM(HTX4_D) FM(DU_DB3) F_(0, 0) F_(0, 0) FM(LCDOUT3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
222#define IP4_27_24 FM(A15) FM(MSIOF1_SS2) FM(MSIOF2_TXD_B) FM(VI4_DATA18) FM(VI5_DATA4_A) FM(DU_DB4) F_(0, 0) F_(0, 0) FM(LCDOUT4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
223#define IP4_31_28 FM(A16) FM(MSIOF1_SYNC) FM(MSIOF2_SS1_B) FM(VI4_DATA19) FM(VI5_DATA5_A) FM(DU_DB5) F_(0, 0) F_(0, 0) FM(LCDOUT5) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
224#define IP5_3_0 FM(A17) FM(MSIOF1_RXD) F_(0, 0) FM(VI4_DATA20) FM(VI5_DATA6_A) FM(DU_DB6) F_(0, 0) F_(0, 0) FM(LCDOUT6) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
225#define IP5_7_4 FM(A18) FM(MSIOF1_TXD) F_(0, 0) FM(VI4_DATA21) FM(VI5_DATA7_A) FM(DU_DB0) F_(0, 0) FM(HRX4_E) FM(LCDOUT0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
226#define IP5_11_8 FM(A19) FM(MSIOF1_SCK) F_(0, 0) FM(VI4_DATA22) FM(VI5_DATA2_A) FM(DU_DB1) F_(0, 0) FM(HTX4_E) FM(LCDOUT1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
227#define IP5_15_12 FM(CS0_N) FM(SCL5) F_(0, 0) F_(0, 0) F_(0, 0) FM(DU_DR0) FM(VI4_DATA2_B) F_(0, 0) FM(LCDOUT16) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
228#define IP5_19_16 FM(WE0_N) FM(SDA5) F_(0, 0) F_(0, 0) F_(0, 0) FM(DU_DR1) FM(VI4_DATA3_B) F_(0, 0) FM(LCDOUT17) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
229#define IP5_23_20 FM(D0) FM(MSIOF3_SCK_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(DU_DR2) FM(CTS4_N_C) F_(0, 0) FM(LCDOUT18) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
230#define IP5_27_24 FM(D1) FM(MSIOF3_SYNC_A) FM(SCK3_A) FM(VI4_DATA23) FM(VI5_CLKENB_A) FM(DU_DB7) FM(RTS4_N_TANS_C) F_(0, 0) FM(LCDOUT7) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
231#define IP5_31_28 FM(D2) FM(MSIOF3_RXD_A) FM(RX5_C) F_(0, 0) FM(VI5_DATA14_A) FM(DU_DR3) FM(RX4_C) F_(0, 0) FM(LCDOUT19) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
232#define IP6_3_0 FM(D3) FM(MSIOF3_TXD_A) FM(TX5_C) F_(0, 0) FM(VI5_DATA15_A) FM(DU_DR4) FM(TX4_C) F_(0, 0) FM(LCDOUT20) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
233#define IP6_7_4 FM(D4) FM(CANFD1_TX) FM(HSCK3_B) FM(CAN1_TX) FM(RTS3_N_TANS_A) FM(MSIOF3_SS2_A) F_(0, 0) FM(VI5_DATA1_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
234#define IP6_11_8 FM(D5) FM(RX3_A) FM(HRX3_B) F_(0, 0) F_(0, 0) FM(DU_DR5) FM(VI4_DATA4_B) F_(0, 0) FM(LCDOUT21) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
235#define IP6_15_12 FM(D6) FM(TX3_A) FM(HTX3_B) F_(0, 0) F_(0, 0) FM(DU_DR6) FM(VI4_DATA5_B) F_(0, 0) FM(LCDOUT22) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
236#define IP6_19_16 FM(D7) FM(CANFD1_RX) FM(IRQ5) FM(CAN1_RX) FM(CTS3_N_A) F_(0, 0) F_(0, 0) FM(VI5_DATA2_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
237#define IP6_23_20 FM(D8) FM(MSIOF2_SCK_A) FM(SCK4_B) F_(0, 0) FM(VI5_DATA12_A) FM(DU_DR7) FM(RIF3_CLK_B) FM(HCTS3_N_E) FM(LCDOUT23) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
238#define IP6_27_24 FM(D9) FM(MSIOF2_SYNC_A) F_(0, 0) F_(0, 0) FM(VI5_DATA10_A) FM(DU_DG0) FM(RIF3_SYNC_B) FM(HRX3_E) FM(LCDOUT8) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
239#define IP6_31_28 FM(D10) FM(MSIOF2_RXD_A) F_(0, 0) F_(0, 0) FM(VI5_DATA13_A) FM(DU_DG1) FM(RIF3_D0_B) FM(HTX3_E) FM(LCDOUT9) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
240#define IP7_3_0 FM(D11) FM(MSIOF2_TXD_A) F_(0, 0) F_(0, 0) FM(VI5_DATA11_A) FM(DU_DG2) FM(RIF3_D1_B) FM(HRTS3_N_E) FM(LCDOUT10) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
241#define IP7_7_4 FM(D12) FM(CANFD0_TX) FM(TX4_B) FM(CAN0_TX) FM(VI5_DATA8_A) F_(0, 0) F_(0, 0) FM(VI5_DATA3_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
242#define IP7_11_8 FM(D13) FM(CANFD0_RX) FM(RX4_B) FM(CAN0_RX) FM(VI5_DATA9_A) FM(SCL7_B) F_(0, 0) FM(VI5_DATA4_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
243#define IP7_15_12 FM(D14) FM(CAN_CLK) FM(HRX3_A) FM(MSIOF2_SS2_A) F_(0, 0) FM(SDA7_B) F_(0, 0) FM(VI5_DATA5_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
244#define IP7_19_16 FM(D15) FM(MSIOF2_SS1_A) FM(HTX3_A) FM(MSIOF3_SS1_A) F_(0, 0) FM(DU_DG3) F_(0, 0) F_(0, 0) FM(LCDOUT11) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
245#define IP7_23_20 FM(SCL4) FM(CS1_N_A26) F_(0, 0) F_(0, 0) F_(0, 0) FM(DU_DOTCLKIN0) FM(VI4_DATA6_B) FM(VI5_DATA6_B) FM(QCLK) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
246#define IP7_27_24 FM(SDA4) FM(WE1_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(VI4_DATA7_B) FM(VI5_DATA7_B) FM(QPOLB) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
247#define IP7_31_28 FM(SD0_CLK) FM(NFDATA8) FM(SCL1_C) FM(HSCK1_B) FM(SDA2_E) FM(FMCLK_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
248
249/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 - F */
250#define IP8_3_0 FM(SD0_CMD) FM(NFDATA9) F_(0, 0) FM(HRX1_B) F_(0, 0) FM(SPEEDIN_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
251#define IP8_7_4 FM(SD0_DAT0) FM(NFDATA10) F_(0, 0) FM(HTX1_B) F_(0, 0) FM(REMOCON_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
252#define IP8_11_8 FM(SD0_DAT1) FM(NFDATA11) FM(SDA2_C) FM(HCTS1_N_B) F_(0, 0) FM(FMIN_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
253#define IP8_15_12 FM(SD0_DAT2) FM(NFDATA12) FM(SCL2_C) FM(HRTS1_N_B) F_(0, 0) FM(BPFCLK_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
254#define IP8_19_16 FM(SD0_DAT3) FM(NFDATA13) FM(SDA1_C) FM(SCL2_E) FM(SPEEDIN_C) FM(REMOCON_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
255#define IP8_23_20 FM(SD1_CLK) FM(NFDATA14_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
256#define IP8_27_24 FM(SD1_CMD) FM(NFDATA15_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
257#define IP8_31_28 FM(SD1_DAT0) FM(NFWP_N_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
258#define IP9_3_0 FM(SD1_DAT1) FM(NFCE_N_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
259#define IP9_7_4 FM(SD1_DAT2) FM(NFALE_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
260#define IP9_11_8 FM(SD1_DAT3) FM(NFRB_N_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
261#define IP9_15_12 FM(SD3_CLK) FM(NFWE_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
262#define IP9_19_16 FM(SD3_CMD) FM(NFRE_N) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
263#define IP9_23_20 FM(SD3_DAT0) FM(NFDATA0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
264#define IP9_27_24 FM(SD3_DAT1) FM(NFDATA1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
265#define IP9_31_28 FM(SD3_DAT2) FM(NFDATA2) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
266#define IP10_3_0 FM(SD3_DAT3) FM(NFDATA3) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
267#define IP10_7_4 FM(SD3_DAT4) FM(NFDATA4) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
268#define IP10_11_8 FM(SD3_DAT5) FM(NFDATA5) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
269#define IP10_15_12 FM(SD3_DAT6) FM(NFDATA6) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
270#define IP10_19_16 FM(SD3_DAT7) FM(NFDATA7) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
271#define IP10_23_20 FM(SD3_DS) FM(NFCLE) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
272#define IP10_27_24 FM(SD0_CD) FM(NFALE_A) FM(SD3_CD) FM(RIF0_CLK_B) FM(SCL2_B) FM(TCLK1_A) FM(SSI_SCK2_B) FM(TS_SCK0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
273#define IP10_31_28 FM(SD0_WP) FM(NFRB_N_A) FM(SD3_WP) FM(RIF0_D0_B) FM(SDA2_B) FM(TCLK2_A) FM(SSI_WS2_B) FM(TS_SDAT0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
274#define IP11_3_0 FM(SD1_CD) FM(NFCE_N_A) FM(SSI_SCK1) FM(RIF0_D1_B) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SDEN0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
275#define IP11_7_4 FM(SD1_WP) FM(NFWP_N_A) FM(SSI_WS1) FM(RIF0_SYNC_B) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SPSYNC0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
276#define IP11_11_8 FM(RX0_A) FM(HRX1_A) FM(SSI_SCK2_A) FM(RIF1_SYNC) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SCK1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
277#define IP11_15_12 FM(TX0_A) FM(HTX1_A) FM(SSI_WS2_A) FM(RIF1_D0) F_(0, 0) F_(0, 0) F_(0, 0) FM(TS_SDAT1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
278#define IP11_19_16 FM(CTS0_N_A) FM(NFDATA14_A) FM(AUDIO_CLKOUT_A) FM(RIF1_D1) FM(SCIF_CLK_A) FM(FMCLK_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
279#define IP11_23_20 FM(RTS0_N_TANS_A) FM(NFDATA15_A) FM(AUDIO_CLKOUT1_A) FM(RIF1_CLK) FM(SCL2_A) FM(FMIN_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
280#define IP11_27_24 FM(SCK0_A) FM(HSCK1_A) FM(USB3HS0_ID) FM(RTS1_N_TANS) FM(SDA2_A) FM(FMCLK_C) F_(0, 0) F_(0, 0) FM(USB1_ID) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
281#define IP11_31_28 FM(RX1) FM(HRX2_B) FM(SSI_SCK9_B) FM(AUDIO_CLKOUT1_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
282
283/* IPSRx */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */ /* 8 */ /* 9 - F */
284#define IP12_3_0 FM(TX1) FM(HTX2_B) FM(SSI_WS9_B) FM(AUDIO_CLKOUT3_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
285#define IP12_7_4 FM(SCK2_A) FM(HSCK0_A) FM(AUDIO_CLKB_A) FM(CTS1_N) FM(RIF0_CLK_A) FM(REMOCON_A) FM(SCIF_CLK_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
286#define IP12_11_8 FM(TX2_A) FM(HRX0_A) FM(AUDIO_CLKOUT2_A) F_(0, 0) FM(SCL1_A) F_(0, 0) FM(FSO_CFE_0_N_A) FM(TS_SDEN1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
287#define IP12_15_12 FM(RX2_A) FM(HTX0_A) FM(AUDIO_CLKOUT3_A) F_(0, 0) FM(SDA1_A) F_(0, 0) FM(FSO_CFE_1_N_A) FM(TS_SPSYNC1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
288#define IP12_19_16 FM(MSIOF0_SCK) F_(0, 0) FM(SSI_SCK78) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
289#define IP12_23_20 FM(MSIOF0_RXD) F_(0, 0) FM(SSI_WS78) F_(0, 0) F_(0, 0) FM(TX2_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
290#define IP12_27_24 FM(MSIOF0_TXD) F_(0, 0) FM(SSI_SDATA7) F_(0, 0) F_(0, 0) FM(RX2_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
291#define IP12_31_28 FM(MSIOF0_SYNC) FM(AUDIO_CLKOUT_B) FM(SSI_SDATA8) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
292#define IP13_3_0 FM(MSIOF0_SS1) FM(HRX2_A) FM(SSI_SCK4) FM(HCTS0_N_A) FM(BPFCLK_C) FM(SPEEDIN_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
293#define IP13_7_4 FM(MSIOF0_SS2) FM(HTX2_A) FM(SSI_WS4) FM(HRTS0_N_A) FM(FMIN_C) FM(BPFCLK_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
294#define IP13_11_8 FM(SSI_SDATA9) F_(0, 0) FM(AUDIO_CLKC_A) FM(SCK1) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
295#define IP13_15_12 FM(MLB_CLK) FM(RX0_B) F_(0, 0) FM(RIF0_D0_A) FM(SCL1_B) FM(TCLK1_B) F_(0, 0) F_(0, 0) FM(SIM0_RST_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
296#define IP13_19_16 FM(MLB_SIG) FM(SCK0_B) F_(0, 0) FM(RIF0_D1_A) FM(SDA1_B) FM(TCLK2_B) F_(0, 0) F_(0, 0) FM(SIM0_D_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
297#define IP13_23_20 FM(MLB_DAT) FM(TX0_B) F_(0, 0) FM(RIF0_SYNC_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(SIM0_CLK_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
298#define IP13_27_24 FM(SSI_SCK01239) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
299#define IP13_31_28 FM(SSI_WS01239) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
300#define IP14_3_0 FM(SSI_SDATA0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
301#define IP14_7_4 FM(SSI_SDATA1) FM(AUDIO_CLKC_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(PWM0_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
302#define IP14_11_8 FM(SSI_SDATA2) FM(AUDIO_CLKOUT2_B) FM(SSI_SCK9_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(PWM1_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
303#define IP14_15_12 FM(SSI_SCK349) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(PWM2_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
304#define IP14_19_16 FM(SSI_WS349) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(PWM3_C) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
305#define IP14_23_20 FM(SSI_SDATA3) FM(AUDIO_CLKOUT1_C) FM(AUDIO_CLKB_B) F_(0, 0) F_(0, 0) F_(0, 0) FM(PWM4_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
306#define IP14_27_24 FM(SSI_SDATA4) F_(0, 0) FM(SSI_WS9_A) F_(0, 0) F_(0, 0) F_(0, 0) FM(PWM5_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
307#define IP14_31_28 FM(SSI_SCK5) FM(HRX0_B) F_(0, 0) FM(USB0_PWEN_B) FM(SCL2_D) F_(0, 0) FM(PWM6_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
308#define IP15_3_0 FM(SSI_WS5) FM(HTX0_B) F_(0, 0) FM(USB0_OVC_B) FM(SDA2_D) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
309#define IP15_7_4 FM(SSI_SDATA5) FM(HSCK0_B) FM(AUDIO_CLKB_C) FM(TPU0TO0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
310#define IP15_11_8 FM(SSI_SCK6) FM(HSCK2_A) FM(AUDIO_CLKC_C) FM(TPU0TO1) F_(0, 0) F_(0, 0) FM(FSO_CFE_0_N_B) F_(0, 0) FM(SIM0_RST_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
311#define IP15_15_12 FM(SSI_WS6) FM(HCTS2_N_A) FM(AUDIO_CLKOUT2_C) FM(TPU0TO2) FM(SDA1_D) F_(0, 0) FM(FSO_CFE_1_N_B) F_(0, 0) FM(SIM0_D_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
312#define IP15_19_16 FM(SSI_SDATA6) FM(HRTS2_N_A) FM(AUDIO_CLKOUT3_C) FM(TPU0TO3) FM(SCL1_D) F_(0, 0) FM(FSO_TOE_N_B) F_(0, 0) FM(SIM0_CLK_B) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
313#define IP15_23_20 FM(AUDIO_CLKA) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
314#define IP15_27_24 FM(USB30_PWEN) FM(USB0_PWEN_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
315#define IP15_31_28 FM(USB30_OVC) FM(USB0_OVC_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) FM(FSO_TOE_N_A) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0) F_(0, 0)
316
317#define PINMUX_GPSR \
318\
319 \
320 \
321 \
322 \
323 \
324 \
325 GPSR2_25 \
326 GPSR2_24 \
327 GPSR2_23 \
328 GPSR1_22 GPSR2_22 \
329 GPSR1_21 GPSR2_21 \
330 GPSR1_20 GPSR2_20 \
331 GPSR1_19 GPSR2_19 GPSR5_19 \
332 GPSR1_18 GPSR2_18 GPSR5_18 \
333GPSR0_17 GPSR1_17 GPSR2_17 GPSR5_17 GPSR6_17 \
334GPSR0_16 GPSR1_16 GPSR2_16 GPSR5_16 GPSR6_16 \
335GPSR0_15 GPSR1_15 GPSR2_15 GPSR3_15 GPSR5_15 GPSR6_15 \
336GPSR0_14 GPSR1_14 GPSR2_14 GPSR3_14 GPSR5_14 GPSR6_14 \
337GPSR0_13 GPSR1_13 GPSR2_13 GPSR3_13 GPSR5_13 GPSR6_13 \
338GPSR0_12 GPSR1_12 GPSR2_12 GPSR3_12 GPSR5_12 GPSR6_12 \
339GPSR0_11 GPSR1_11 GPSR2_11 GPSR3_11 GPSR5_11 GPSR6_11 \
340GPSR0_10 GPSR1_10 GPSR2_10 GPSR3_10 GPSR4_10 GPSR5_10 GPSR6_10 \
341GPSR0_9 GPSR1_9 GPSR2_9 GPSR3_9 GPSR4_9 GPSR5_9 GPSR6_9 \
342GPSR0_8 GPSR1_8 GPSR2_8 GPSR3_8 GPSR4_8 GPSR5_8 GPSR6_8 \
343GPSR0_7 GPSR1_7 GPSR2_7 GPSR3_7 GPSR4_7 GPSR5_7 GPSR6_7 \
344GPSR0_6 GPSR1_6 GPSR2_6 GPSR3_6 GPSR4_6 GPSR5_6 GPSR6_6 \
345GPSR0_5 GPSR1_5 GPSR2_5 GPSR3_5 GPSR4_5 GPSR5_5 GPSR6_5 \
346GPSR0_4 GPSR1_4 GPSR2_4 GPSR3_4 GPSR4_4 GPSR5_4 GPSR6_4 \
347GPSR0_3 GPSR1_3 GPSR2_3 GPSR3_3 GPSR4_3 GPSR5_3 GPSR6_3 \
348GPSR0_2 GPSR1_2 GPSR2_2 GPSR3_2 GPSR4_2 GPSR5_2 GPSR6_2 \
349GPSR0_1 GPSR1_1 GPSR2_1 GPSR3_1 GPSR4_1 GPSR5_1 GPSR6_1 \
350GPSR0_0 GPSR1_0 GPSR2_0 GPSR3_0 GPSR4_0 GPSR5_0 GPSR6_0
351
352#define PINMUX_IPSR \
353\
354FM(IP0_3_0) IP0_3_0 FM(IP1_3_0) IP1_3_0 FM(IP2_3_0) IP2_3_0 FM(IP3_3_0) IP3_3_0 \
355FM(IP0_7_4) IP0_7_4 FM(IP1_7_4) IP1_7_4 FM(IP2_7_4) IP2_7_4 FM(IP3_7_4) IP3_7_4 \
356FM(IP0_11_8) IP0_11_8 FM(IP1_11_8) IP1_11_8 FM(IP2_11_8) IP2_11_8 FM(IP3_11_8) IP3_11_8 \
357FM(IP0_15_12) IP0_15_12 FM(IP1_15_12) IP1_15_12 FM(IP2_15_12) IP2_15_12 FM(IP3_15_12) IP3_15_12 \
358FM(IP0_19_16) IP0_19_16 FM(IP1_19_16) IP1_19_16 FM(IP2_19_16) IP2_19_16 FM(IP3_19_16) IP3_19_16 \
359FM(IP0_23_20) IP0_23_20 FM(IP1_23_20) IP1_23_20 FM(IP2_23_20) IP2_23_20 FM(IP3_23_20) IP3_23_20 \
360FM(IP0_27_24) IP0_27_24 FM(IP1_27_24) IP1_27_24 FM(IP2_27_24) IP2_27_24 FM(IP3_27_24) IP3_27_24 \
361FM(IP0_31_28) IP0_31_28 FM(IP1_31_28) IP1_31_28 FM(IP2_31_28) IP2_31_28 FM(IP3_31_28) IP3_31_28 \
362\
363FM(IP4_3_0) IP4_3_0 FM(IP5_3_0) IP5_3_0 FM(IP6_3_0) IP6_3_0 FM(IP7_3_0) IP7_3_0 \
364FM(IP4_7_4) IP4_7_4 FM(IP5_7_4) IP5_7_4 FM(IP6_7_4) IP6_7_4 FM(IP7_7_4) IP7_7_4 \
365FM(IP4_11_8) IP4_11_8 FM(IP5_11_8) IP5_11_8 FM(IP6_11_8) IP6_11_8 FM(IP7_11_8) IP7_11_8 \
366FM(IP4_15_12) IP4_15_12 FM(IP5_15_12) IP5_15_12 FM(IP6_15_12) IP6_15_12 FM(IP7_15_12) IP7_15_12 \
367FM(IP4_19_16) IP4_19_16 FM(IP5_19_16) IP5_19_16 FM(IP6_19_16) IP6_19_16 FM(IP7_19_16) IP7_19_16 \
368FM(IP4_23_20) IP4_23_20 FM(IP5_23_20) IP5_23_20 FM(IP6_23_20) IP6_23_20 FM(IP7_23_20) IP7_23_20 \
369FM(IP4_27_24) IP4_27_24 FM(IP5_27_24) IP5_27_24 FM(IP6_27_24) IP6_27_24 FM(IP7_27_24) IP7_27_24 \
370FM(IP4_31_28) IP4_31_28 FM(IP5_31_28) IP5_31_28 FM(IP6_31_28) IP6_31_28 FM(IP7_31_28) IP7_31_28 \
371\
372FM(IP8_3_0) IP8_3_0 FM(IP9_3_0) IP9_3_0 FM(IP10_3_0) IP10_3_0 FM(IP11_3_0) IP11_3_0 \
373FM(IP8_7_4) IP8_7_4 FM(IP9_7_4) IP9_7_4 FM(IP10_7_4) IP10_7_4 FM(IP11_7_4) IP11_7_4 \
374FM(IP8_11_8) IP8_11_8 FM(IP9_11_8) IP9_11_8 FM(IP10_11_8) IP10_11_8 FM(IP11_11_8) IP11_11_8 \
375FM(IP8_15_12) IP8_15_12 FM(IP9_15_12) IP9_15_12 FM(IP10_15_12) IP10_15_12 FM(IP11_15_12) IP11_15_12 \
376FM(IP8_19_16) IP8_19_16 FM(IP9_19_16) IP9_19_16 FM(IP10_19_16) IP10_19_16 FM(IP11_19_16) IP11_19_16 \
377FM(IP8_23_20) IP8_23_20 FM(IP9_23_20) IP9_23_20 FM(IP10_23_20) IP10_23_20 FM(IP11_23_20) IP11_23_20 \
378FM(IP8_27_24) IP8_27_24 FM(IP9_27_24) IP9_27_24 FM(IP10_27_24) IP10_27_24 FM(IP11_27_24) IP11_27_24 \
379FM(IP8_31_28) IP8_31_28 FM(IP9_31_28) IP9_31_28 FM(IP10_31_28) IP10_31_28 FM(IP11_31_28) IP11_31_28 \
380\
381FM(IP12_3_0) IP12_3_0 FM(IP13_3_0) IP13_3_0 FM(IP14_3_0) IP14_3_0 FM(IP15_3_0) IP15_3_0 \
382FM(IP12_7_4) IP12_7_4 FM(IP13_7_4) IP13_7_4 FM(IP14_7_4) IP14_7_4 FM(IP15_7_4) IP15_7_4 \
383FM(IP12_11_8) IP12_11_8 FM(IP13_11_8) IP13_11_8 FM(IP14_11_8) IP14_11_8 FM(IP15_11_8) IP15_11_8 \
384FM(IP12_15_12) IP12_15_12 FM(IP13_15_12) IP13_15_12 FM(IP14_15_12) IP14_15_12 FM(IP15_15_12) IP15_15_12 \
385FM(IP12_19_16) IP12_19_16 FM(IP13_19_16) IP13_19_16 FM(IP14_19_16) IP14_19_16 FM(IP15_19_16) IP15_19_16 \
386FM(IP12_23_20) IP12_23_20 FM(IP13_23_20) IP13_23_20 FM(IP14_23_20) IP14_23_20 FM(IP15_23_20) IP15_23_20 \
387FM(IP12_27_24) IP12_27_24 FM(IP13_27_24) IP13_27_24 FM(IP14_27_24) IP14_27_24 FM(IP15_27_24) IP15_27_24 \
388FM(IP12_31_28) IP12_31_28 FM(IP13_31_28) IP13_31_28 FM(IP14_31_28) IP14_31_28 FM(IP15_31_28) IP15_31_28
389
390/* MOD_SEL0 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */
391#define MOD_SEL0_30_29 FM(SEL_ADGB_0) FM(SEL_ADGB_1) FM(SEL_ADGB_2) F_(0, 0)
392#define MOD_SEL0_28 FM(SEL_DRIF0_0) FM(SEL_DRIF0_1)
393#define MOD_SEL0_27_26 FM(SEL_FM_0) FM(SEL_FM_1) FM(SEL_FM_2) F_(0, 0)
394#define MOD_SEL0_25 FM(SEL_FSO_0) FM(SEL_FSO_1)
395#define MOD_SEL0_24 FM(SEL_HSCIF0_0) FM(SEL_HSCIF0_1)
396#define MOD_SEL0_23 FM(SEL_HSCIF1_0) FM(SEL_HSCIF1_1)
397#define MOD_SEL0_22 FM(SEL_HSCIF2_0) FM(SEL_HSCIF2_1)
398#define MOD_SEL0_21_20 FM(SEL_I2C1_0) FM(SEL_I2C1_1) FM(SEL_I2C1_2) FM(SEL_I2C1_3) FM(SEL_I2C1_4) F_(0, 0) F_(0, 0) F_(0, 0)
399#define MOD_SEL0_19_18_17 FM(SEL_I2C2_0) FM(SEL_I2C2_1) FM(SEL_I2C2_2) FM(SEL_I2C2_3) FM(SEL_I2C2_4) F_(0, 0) F_(0, 0) F_(0, 0)
400#define MOD_SEL0_16 FM(SEL_NDFC_0) FM(SEL_NDFC_1)
401#define MOD_SEL0_15 FM(SEL_PWM0_0) FM(SEL_PWM0_1)
402#define MOD_SEL0_14 FM(SEL_PWM1_0) FM(SEL_PWM1_1)
403#define MOD_SEL0_13_12 FM(SEL_PWM2_0) FM(SEL_PWM2_1) FM(SEL_PWM2_2) F_(0, 0)
404#define MOD_SEL0_11_10 FM(SEL_PWM3_0) FM(SEL_PWM3_1) FM(SEL_PWM3_2) F_(0, 0)
405#define MOD_SEL0_9 FM(SEL_PWM4_0) FM(SEL_PWM4_1)
406#define MOD_SEL0_8 FM(SEL_PWM5_0) FM(SEL_PWM5_1)
407#define MOD_SEL0_7 FM(SEL_PWM6_0) FM(SEL_PWM6_1)
408#define MOD_SEL0_6_5 FM(SEL_REMOCON_0) FM(SEL_REMOCON_1) FM(SEL_REMOCON_2) F_(0, 0)
409#define MOD_SEL0_4 FM(SEL_SCIF_0) FM(SEL_SCIF_1)
410#define MOD_SEL0_3 FM(SEL_SCIF0_0) FM(SEL_SCIF0_1)
411#define MOD_SEL0_2 FM(SEL_SCIF2_0) FM(SEL_SCIF2_1)
412#define MOD_SEL0_1_0 FM(SEL_SPEED_PULSE_IF_0) FM(SEL_SPEED_PULSE_IF_1) FM(SEL_SPEED_PULSE_IF_2) F_(0, 0)
413
414/* MOD_SEL1 */ /* 0 */ /* 1 */ /* 2 */ /* 3 */ /* 4 */ /* 5 */ /* 6 */ /* 7 */
415#define MOD_SEL1_31 FM(SEL_SIMCARD_0) FM(SEL_SIMCARD_1)
416#define MOD_SEL1_30 FM(SEL_SSI2_0) FM(SEL_SSI2_1)
417#define MOD_SEL1_29 FM(SEL_TIMER_TMU_0) FM(SEL_TIMER_TMU_1)
418#define MOD_SEL1_28 FM(SEL_USB_20_CH0_0) FM(SEL_USB_20_CH0_1)
419#define MOD_SEL1_26 FM(SEL_DRIF2_0) FM(SEL_DRIF2_1)
420#define MOD_SEL1_25 FM(SEL_DRIF3_0) FM(SEL_DRIF3_1)
421#define MOD_SEL1_24_23_22 FM(SEL_HSCIF3_0) FM(SEL_HSCIF3_1) FM(SEL_HSCIF3_2) FM(SEL_HSCIF3_3) FM(SEL_HSCIF3_4) F_(0, 0) F_(0, 0) F_(0, 0)
422#define MOD_SEL1_21_20_19 FM(SEL_HSCIF4_0) FM(SEL_HSCIF4_1) FM(SEL_HSCIF4_2) FM(SEL_HSCIF4_3) FM(SEL_HSCIF4_4) F_(0, 0) F_(0, 0) F_(0, 0)
423#define MOD_SEL1_18 FM(SEL_I2C6_0) FM(SEL_I2C6_1)
424#define MOD_SEL1_17 FM(SEL_I2C7_0) FM(SEL_I2C7_1)
425#define MOD_SEL1_16 FM(SEL_MSIOF2_0) FM(SEL_MSIOF2_1)
426#define MOD_SEL1_15 FM(SEL_MSIOF3_0) FM(SEL_MSIOF3_1)
427#define MOD_SEL1_14_13 FM(SEL_SCIF3_0) FM(SEL_SCIF3_1) FM(SEL_SCIF3_2) F_(0, 0)
428#define MOD_SEL1_12_11 FM(SEL_SCIF4_0) FM(SEL_SCIF4_1) FM(SEL_SCIF4_2) F_(0, 0)
429#define MOD_SEL1_10_9 FM(SEL_SCIF5_0) FM(SEL_SCIF5_1) FM(SEL_SCIF5_2) F_(0, 0)
430#define MOD_SEL1_8 FM(SEL_VIN4_0) FM(SEL_VIN4_1)
431#define MOD_SEL1_7 FM(SEL_VIN5_0) FM(SEL_VIN5_1)
432#define MOD_SEL1_6_5 FM(SEL_ADGC_0) FM(SEL_ADGC_1) FM(SEL_ADGC_2) F_(0, 0)
433#define MOD_SEL1_4 FM(SEL_SSI9_0) FM(SEL_SSI9_1)
434
435#define PINMUX_MOD_SELS \
436\
437 MOD_SEL1_31 \
438MOD_SEL0_30_29 MOD_SEL1_30 \
439 MOD_SEL1_29 \
440MOD_SEL0_28 MOD_SEL1_28 \
441MOD_SEL0_27_26 \
442 MOD_SEL1_26 \
443MOD_SEL0_25 MOD_SEL1_25 \
444MOD_SEL0_24 MOD_SEL1_24_23_22 \
445MOD_SEL0_23 \
446MOD_SEL0_22 \
447MOD_SEL0_21_20 MOD_SEL1_21_20_19 \
448MOD_SEL0_19_18_17 MOD_SEL1_18 \
449 MOD_SEL1_17 \
450MOD_SEL0_16 MOD_SEL1_16 \
451MOD_SEL0_15 MOD_SEL1_15 \
452MOD_SEL0_14 MOD_SEL1_14_13 \
453MOD_SEL0_13_12 \
454 MOD_SEL1_12_11 \
455MOD_SEL0_11_10 \
456 MOD_SEL1_10_9 \
457MOD_SEL0_9 \
458MOD_SEL0_8 MOD_SEL1_8 \
459MOD_SEL0_7 MOD_SEL1_7 \
460MOD_SEL0_6_5 MOD_SEL1_6_5 \
461MOD_SEL0_4 MOD_SEL1_4 \
462MOD_SEL0_3 \
463MOD_SEL0_2 \
464MOD_SEL0_1_0
465
466/*
467 * These pins are not able to be muxed but have other properties
468 * that can be set, such as pull-up/pull-down enable.
469 */
470#define PINMUX_STATIC \
471 FM(AVB_TX_CTL) FM(AVB_TXC) FM(AVB_TD0) FM(AVB_TD1) FM(AVB_TD2) \
472 FM(AVB_TD3) \
473 FM(PRESETOUT_N) FM(FSCLKST_N) FM(TRST_N) FM(TCK) FM(TMS) FM(TDI) \
474 FM(ASEBRK) \
475 FM(MLB_REF)
476
477enum {
478 PINMUX_RESERVED = 0,
479
480 PINMUX_DATA_BEGIN,
481 GP_ALL(DATA),
482 PINMUX_DATA_END,
483
484#define F_(x, y)
485#define FM(x) FN_##x,
486 PINMUX_FUNCTION_BEGIN,
487 GP_ALL(FN),
488 PINMUX_GPSR
489 PINMUX_IPSR
490 PINMUX_MOD_SELS
491 PINMUX_FUNCTION_END,
492#undef F_
493#undef FM
494
495#define F_(x, y)
496#define FM(x) x##_MARK,
497 PINMUX_MARK_BEGIN,
498 PINMUX_GPSR
499 PINMUX_IPSR
500 PINMUX_MOD_SELS
501 PINMUX_STATIC
502 PINMUX_MARK_END,
503#undef F_
504#undef FM
505};
506
507static const u16 pinmux_data[] = {
508 PINMUX_DATA_GP_ALL(),
509
510 PINMUX_SINGLE(CLKOUT),
511 PINMUX_SINGLE(AVB_PHY_INT),
512 PINMUX_SINGLE(AVB_RD3),
513 PINMUX_SINGLE(AVB_RXC),
514 PINMUX_SINGLE(AVB_RX_CTL),
515 PINMUX_SINGLE(QSPI0_SSL),
516
517 /* IPSR0 */
518 PINMUX_IPSR_GPSR(IP0_3_0, QSPI0_SPCLK),
519 PINMUX_IPSR_MSEL(IP0_3_0, HSCK4_A, SEL_HSCIF4_0),
520
521 PINMUX_IPSR_GPSR(IP0_7_4, QSPI0_MOSI_IO0),
522 PINMUX_IPSR_MSEL(IP0_7_4, HCTS4_N_A, SEL_HSCIF4_0),
523
524 PINMUX_IPSR_GPSR(IP0_11_8, QSPI0_MISO_IO1),
525 PINMUX_IPSR_MSEL(IP0_11_8, HRTS4_N_A, SEL_HSCIF4_0),
526
527 PINMUX_IPSR_GPSR(IP0_15_12, QSPI0_IO2),
528 PINMUX_IPSR_GPSR(IP0_15_12, HTX4_A),
529
530 PINMUX_IPSR_GPSR(IP0_19_16, QSPI0_IO3),
531 PINMUX_IPSR_MSEL(IP0_19_16, HRX4_A, SEL_HSCIF4_0),
532
533 PINMUX_IPSR_GPSR(IP0_23_20, QSPI1_SPCLK),
534 PINMUX_IPSR_MSEL(IP0_23_20, RIF2_CLK_A, SEL_DRIF2_0),
535 PINMUX_IPSR_MSEL(IP0_23_20, HSCK4_B, SEL_HSCIF4_1),
536 PINMUX_IPSR_MSEL(IP0_23_20, VI4_DATA0_A, SEL_VIN4_0),
537
538 PINMUX_IPSR_GPSR(IP0_27_24, QSPI1_MOSI_IO0),
539 PINMUX_IPSR_MSEL(IP0_27_24, RIF2_SYNC_A, SEL_DRIF2_0),
540 PINMUX_IPSR_GPSR(IP0_27_24, HTX4_B),
541 PINMUX_IPSR_MSEL(IP0_27_24, VI4_DATA1_A, SEL_VIN4_0),
542
543 PINMUX_IPSR_GPSR(IP0_31_28, QSPI1_MISO_IO1),
544 PINMUX_IPSR_MSEL(IP0_31_28, RIF2_D0_A, SEL_DRIF2_0),
545 PINMUX_IPSR_MSEL(IP0_31_28, HRX4_B, SEL_HSCIF4_1),
546 PINMUX_IPSR_MSEL(IP0_31_28, VI4_DATA2_A, SEL_VIN4_0),
547
548 /* IPSR1 */
549 PINMUX_IPSR_GPSR(IP1_3_0, QSPI1_IO2),
550 PINMUX_IPSR_MSEL(IP1_3_0, RIF2_D1_A, SEL_DRIF2_0),
551 PINMUX_IPSR_GPSR(IP1_3_0, HTX3_C),
552 PINMUX_IPSR_MSEL(IP1_3_0, VI4_DATA3_A, SEL_VIN4_0),
553
554 PINMUX_IPSR_GPSR(IP1_7_4, QSPI1_IO3),
555 PINMUX_IPSR_MSEL(IP1_7_4, RIF3_CLK_A, SEL_DRIF3_0),
556 PINMUX_IPSR_MSEL(IP1_7_4, HRX3_C, SEL_HSCIF3_2),
557 PINMUX_IPSR_MSEL(IP1_7_4, VI4_DATA4_A, SEL_VIN4_0),
558
559 PINMUX_IPSR_GPSR(IP1_11_8, QSPI1_SSL),
560 PINMUX_IPSR_MSEL(IP1_11_8, RIF3_SYNC_A, SEL_DRIF3_0),
561 PINMUX_IPSR_MSEL(IP1_11_8, HSCK3_C, SEL_HSCIF3_2),
562 PINMUX_IPSR_MSEL(IP1_11_8, VI4_DATA5_A, SEL_VIN4_0),
563
564 PINMUX_IPSR_GPSR(IP1_15_12, RPC_INT_N),
565 PINMUX_IPSR_MSEL(IP1_15_12, RIF3_D0_A, SEL_DRIF3_0),
566 PINMUX_IPSR_MSEL(IP1_15_12, HCTS3_N_C, SEL_HSCIF3_2),
567 PINMUX_IPSR_MSEL(IP1_15_12, VI4_DATA6_A, SEL_VIN4_0),
568
569 PINMUX_IPSR_GPSR(IP1_19_16, RPC_RESET_N),
570 PINMUX_IPSR_MSEL(IP1_19_16, RIF3_D1_A, SEL_DRIF3_0),
571 PINMUX_IPSR_MSEL(IP1_19_16, HRTS3_N_C, SEL_HSCIF3_2),
572 PINMUX_IPSR_MSEL(IP1_19_16, VI4_DATA7_A, SEL_VIN4_0),
573
574 PINMUX_IPSR_GPSR(IP1_23_20, AVB_RD0),
575
576 PINMUX_IPSR_GPSR(IP1_27_24, AVB_RD1),
577
578 PINMUX_IPSR_GPSR(IP1_31_28, AVB_RD2),
579
580 /* IPSR2 */
581 PINMUX_IPSR_GPSR(IP2_3_0, AVB_TXCREFCLK),
582
583 PINMUX_IPSR_GPSR(IP2_7_4, AVB_MDIO),
584
585 PINMUX_IPSR_GPSR(IP2_11_8, AVB_MDC),
586
587 PINMUX_IPSR_GPSR(IP2_15_12, BS_N),
588 PINMUX_IPSR_MSEL(IP2_15_12, PWM0_A, SEL_PWM0_0),
589 PINMUX_IPSR_GPSR(IP2_15_12, AVB_MAGIC),
590 PINMUX_IPSR_GPSR(IP2_15_12, VI4_CLK),
591 PINMUX_IPSR_GPSR(IP2_15_12, TX3_C),
592 PINMUX_IPSR_MSEL(IP2_15_12, VI5_CLK_B, SEL_VIN5_1),
593
594 PINMUX_IPSR_GPSR(IP2_19_16, RD_N),
595 PINMUX_IPSR_MSEL(IP2_19_16, PWM1_A, SEL_PWM1_0),
596 PINMUX_IPSR_GPSR(IP2_19_16, AVB_LINK),
597 PINMUX_IPSR_GPSR(IP2_19_16, VI4_FIELD),
598 PINMUX_IPSR_MSEL(IP2_19_16, RX3_C, SEL_SCIF3_2),
599 PINMUX_IPSR_GPSR(IP2_19_16, FSCLKST2_N_A),
600 PINMUX_IPSR_MSEL(IP2_19_16, VI5_DATA0_B, SEL_VIN5_1),
601
602 PINMUX_IPSR_GPSR(IP2_23_20, RD_WR_N),
603 PINMUX_IPSR_MSEL(IP2_23_20, SCL7_A, SEL_I2C7_0),
604 PINMUX_IPSR_GPSR(IP2_23_20, AVB_AVTP_MATCH_A),
605 PINMUX_IPSR_GPSR(IP2_23_20, VI4_VSYNC_N),
606 PINMUX_IPSR_GPSR(IP2_23_20, TX5_B),
607 PINMUX_IPSR_MSEL(IP2_23_20, SCK3_C, SEL_SCIF3_2),
608 PINMUX_IPSR_MSEL(IP2_23_20, PWM5_A, SEL_PWM5_0),
609
610 PINMUX_IPSR_GPSR(IP2_27_24, EX_WAIT0),
611 PINMUX_IPSR_MSEL(IP2_27_24, SDA7_A, SEL_I2C7_0),
612 PINMUX_IPSR_GPSR(IP2_27_24, AVB_AVTP_CAPTURE_A),
613 PINMUX_IPSR_GPSR(IP2_27_24, VI4_HSYNC_N),
614 PINMUX_IPSR_MSEL(IP2_27_24, RX5_B, SEL_SCIF5_1),
615 PINMUX_IPSR_MSEL(IP2_27_24, PWM6_A, SEL_PWM6_0),
616
617 PINMUX_IPSR_GPSR(IP2_31_28, A0),
618 PINMUX_IPSR_GPSR(IP2_31_28, IRQ0),
619 PINMUX_IPSR_MSEL(IP2_31_28, PWM2_A, SEL_PWM2_0),
620 PINMUX_IPSR_MSEL(IP2_31_28, MSIOF3_SS1_B, SEL_MSIOF3_1),
621 PINMUX_IPSR_MSEL(IP2_31_28, VI5_CLK_A, SEL_VIN5_0),
622 PINMUX_IPSR_GPSR(IP2_31_28, DU_CDE),
623 PINMUX_IPSR_MSEL(IP2_31_28, HRX3_D, SEL_HSCIF3_3),
624 PINMUX_IPSR_GPSR(IP2_31_28, IERX),
625 PINMUX_IPSR_GPSR(IP2_31_28, QSTB_QHE),
626
627 /* IPSR3 */
628 PINMUX_IPSR_GPSR(IP3_3_0, A1),
629 PINMUX_IPSR_GPSR(IP3_3_0, IRQ1),
630 PINMUX_IPSR_MSEL(IP3_3_0, PWM3_A, SEL_PWM3_0),
631 PINMUX_IPSR_GPSR(IP3_3_0, DU_DOTCLKIN1),
632 PINMUX_IPSR_MSEL(IP3_3_0, VI5_DATA0_A, SEL_VIN5_0),
633 PINMUX_IPSR_GPSR(IP3_3_0, DU_DISP_CDE),
634 PINMUX_IPSR_MSEL(IP3_3_0, SDA6_B, SEL_I2C6_1),
635 PINMUX_IPSR_GPSR(IP3_3_0, IETX),
636 PINMUX_IPSR_GPSR(IP3_3_0, QCPV_QDE),
637
638 PINMUX_IPSR_GPSR(IP3_7_4, A2),
639 PINMUX_IPSR_GPSR(IP3_7_4, IRQ2),
640 PINMUX_IPSR_GPSR(IP3_7_4, AVB_AVTP_PPS),
641 PINMUX_IPSR_GPSR(IP3_7_4, VI4_CLKENB),
642 PINMUX_IPSR_MSEL(IP3_7_4, VI5_DATA1_A, SEL_VIN5_0),
643 PINMUX_IPSR_GPSR(IP3_7_4, DU_DISP),
644 PINMUX_IPSR_MSEL(IP3_7_4, SCL6_B, SEL_I2C6_1),
645 PINMUX_IPSR_GPSR(IP3_7_4, QSTVB_QVE),
646
647 PINMUX_IPSR_GPSR(IP3_11_8, A3),
648 PINMUX_IPSR_MSEL(IP3_11_8, CTS4_N_A, SEL_SCIF4_0),
649 PINMUX_IPSR_MSEL(IP3_11_8, PWM4_A, SEL_PWM4_0),
650 PINMUX_IPSR_GPSR(IP3_11_8, VI4_DATA12),
651 PINMUX_IPSR_GPSR(IP3_11_8, DU_DOTCLKOUT0),
652 PINMUX_IPSR_GPSR(IP3_11_8, HTX3_D),
653 PINMUX_IPSR_GPSR(IP3_11_8, IECLK),
654 PINMUX_IPSR_GPSR(IP3_11_8, LCDOUT12),
655
656 PINMUX_IPSR_GPSR(IP3_15_12, A4),
657 PINMUX_IPSR_MSEL(IP3_15_12, RTS4_N_TANS_A, SEL_SCIF4_0),
658 PINMUX_IPSR_MSEL(IP3_15_12, MSIOF3_SYNC_B, SEL_MSIOF3_1),
659 PINMUX_IPSR_GPSR(IP3_15_12, VI4_DATA8),
660 PINMUX_IPSR_MSEL(IP3_15_12, PWM2_B, SEL_PWM2_1),
661 PINMUX_IPSR_GPSR(IP3_15_12, DU_DG4),
662 PINMUX_IPSR_MSEL(IP3_15_12, RIF2_CLK_B, SEL_DRIF2_1),
663
664 PINMUX_IPSR_GPSR(IP3_19_16, A5),
665 PINMUX_IPSR_MSEL(IP3_19_16, SCK4_A, SEL_SCIF4_0),
666 PINMUX_IPSR_MSEL(IP3_19_16, MSIOF3_SCK_B, SEL_MSIOF3_1),
667 PINMUX_IPSR_GPSR(IP3_19_16, VI4_DATA9),
668 PINMUX_IPSR_MSEL(IP3_19_16, PWM3_B, SEL_PWM3_1),
669 PINMUX_IPSR_MSEL(IP3_19_16, RIF2_SYNC_B, SEL_DRIF2_1),
670 PINMUX_IPSR_GPSR(IP3_19_16, QPOLA),
671
672 PINMUX_IPSR_GPSR(IP3_23_20, A6),
673 PINMUX_IPSR_MSEL(IP3_23_20, RX4_A, SEL_SCIF4_0),
674 PINMUX_IPSR_MSEL(IP3_23_20, MSIOF3_RXD_B, SEL_MSIOF3_1),
675 PINMUX_IPSR_GPSR(IP3_23_20, VI4_DATA10),
676 PINMUX_IPSR_MSEL(IP3_23_20, RIF2_D0_B, SEL_DRIF2_1),
677
678 PINMUX_IPSR_GPSR(IP3_27_24, A7),
679 PINMUX_IPSR_GPSR(IP3_27_24, TX4_A),
680 PINMUX_IPSR_GPSR(IP3_27_24, MSIOF3_TXD_B),
681 PINMUX_IPSR_GPSR(IP3_27_24, VI4_DATA11),
682 PINMUX_IPSR_MSEL(IP3_27_24, RIF2_D1_B, SEL_DRIF2_1),
683
684 PINMUX_IPSR_GPSR(IP3_31_28, A8),
685 PINMUX_IPSR_MSEL(IP3_31_28, SDA6_A, SEL_I2C6_0),
686 PINMUX_IPSR_MSEL(IP3_31_28, RX3_B, SEL_SCIF3_1),
687 PINMUX_IPSR_MSEL(IP3_31_28, HRX4_C, SEL_HSCIF4_2),
688 PINMUX_IPSR_MSEL(IP3_31_28, VI5_HSYNC_N_A, SEL_VIN5_0),
689 PINMUX_IPSR_GPSR(IP3_31_28, DU_HSYNC),
690 PINMUX_IPSR_MSEL(IP3_31_28, VI4_DATA0_B, SEL_VIN4_1),
691 PINMUX_IPSR_GPSR(IP3_31_28, QSTH_QHS),
692
693 /* IPSR4 */
694 PINMUX_IPSR_GPSR(IP4_3_0, A9),
695 PINMUX_IPSR_GPSR(IP4_3_0, TX5_A),
696 PINMUX_IPSR_GPSR(IP4_3_0, IRQ3),
697 PINMUX_IPSR_GPSR(IP4_3_0, VI4_DATA16),
698 PINMUX_IPSR_MSEL(IP4_3_0, VI5_VSYNC_N_A, SEL_VIN5_0),
699 PINMUX_IPSR_GPSR(IP4_3_0, DU_DG7),
700 PINMUX_IPSR_GPSR(IP4_3_0, LCDOUT15),
701
702 PINMUX_IPSR_GPSR(IP4_7_4, A10),
703 PINMUX_IPSR_GPSR(IP4_7_4, IRQ4),
704 PINMUX_IPSR_MSEL(IP4_7_4, MSIOF2_SYNC_B, SEL_MSIOF2_1),
705 PINMUX_IPSR_GPSR(IP4_7_4, VI4_DATA13),
706 PINMUX_IPSR_MSEL(IP4_7_4, VI5_FIELD_A, SEL_VIN5_0),
707 PINMUX_IPSR_GPSR(IP4_7_4, DU_DG5),
708 PINMUX_IPSR_GPSR(IP4_7_4, FSCLKST2_N_B),
709 PINMUX_IPSR_GPSR(IP4_7_4, LCDOUT13),
710
711 PINMUX_IPSR_GPSR(IP4_11_8, A11),
712 PINMUX_IPSR_MSEL(IP4_11_8, SCL6_A, SEL_I2C6_0),
713 PINMUX_IPSR_GPSR(IP4_11_8, TX3_B),
714 PINMUX_IPSR_GPSR(IP4_11_8, HTX4_C),
715 PINMUX_IPSR_GPSR(IP4_11_8, DU_VSYNC),
716 PINMUX_IPSR_MSEL(IP4_11_8, VI4_DATA1_B, SEL_VIN4_1),
717 PINMUX_IPSR_GPSR(IP4_11_8, QSTVA_QVS),
718
719 PINMUX_IPSR_GPSR(IP4_15_12, A12),
720 PINMUX_IPSR_MSEL(IP4_15_12, RX5_A, SEL_SCIF5_0),
721 PINMUX_IPSR_GPSR(IP4_15_12, MSIOF2_SS2_B),
722 PINMUX_IPSR_GPSR(IP4_15_12, VI4_DATA17),
723 PINMUX_IPSR_MSEL(IP4_15_12, VI5_DATA3_A, SEL_VIN5_0),
724 PINMUX_IPSR_GPSR(IP4_15_12, DU_DG6),
725 PINMUX_IPSR_GPSR(IP4_15_12, LCDOUT14),
726
727 PINMUX_IPSR_GPSR(IP4_19_16, A13),
728 PINMUX_IPSR_MSEL(IP4_19_16, SCK5_A, SEL_SCIF5_0),
729 PINMUX_IPSR_MSEL(IP4_19_16, MSIOF2_SCK_B, SEL_MSIOF2_1),
730 PINMUX_IPSR_GPSR(IP4_19_16, VI4_DATA14),
731 PINMUX_IPSR_MSEL(IP4_19_16, HRX4_D, SEL_HSCIF4_3),
732 PINMUX_IPSR_GPSR(IP4_19_16, DU_DB2),
733 PINMUX_IPSR_GPSR(IP4_19_16, LCDOUT2),
734
735 PINMUX_IPSR_GPSR(IP4_23_20, A14),
736 PINMUX_IPSR_GPSR(IP4_23_20, MSIOF1_SS1),
737 PINMUX_IPSR_MSEL(IP4_23_20, MSIOF2_RXD_B, SEL_MSIOF2_1),
738 PINMUX_IPSR_GPSR(IP4_23_20, VI4_DATA15),
739 PINMUX_IPSR_GPSR(IP4_23_20, HTX4_D),
740 PINMUX_IPSR_GPSR(IP4_23_20, DU_DB3),
741 PINMUX_IPSR_GPSR(IP4_23_20, LCDOUT3),
742
743 PINMUX_IPSR_GPSR(IP4_27_24, A15),
744 PINMUX_IPSR_GPSR(IP4_27_24, MSIOF1_SS2),
745 PINMUX_IPSR_GPSR(IP4_27_24, MSIOF2_TXD_B),
746 PINMUX_IPSR_GPSR(IP4_27_24, VI4_DATA18),
747 PINMUX_IPSR_MSEL(IP4_27_24, VI5_DATA4_A, SEL_VIN5_0),
748 PINMUX_IPSR_GPSR(IP4_27_24, DU_DB4),
749 PINMUX_IPSR_GPSR(IP4_27_24, LCDOUT4),
750
751 PINMUX_IPSR_GPSR(IP4_31_28, A16),
752 PINMUX_IPSR_GPSR(IP4_31_28, MSIOF1_SYNC),
753 PINMUX_IPSR_GPSR(IP4_31_28, MSIOF2_SS1_B),
754 PINMUX_IPSR_GPSR(IP4_31_28, VI4_DATA19),
755 PINMUX_IPSR_MSEL(IP4_31_28, VI5_DATA5_A, SEL_VIN5_0),
756 PINMUX_IPSR_GPSR(IP4_31_28, DU_DB5),
757 PINMUX_IPSR_GPSR(IP4_31_28, LCDOUT5),
758
759 /* IPSR5 */
760 PINMUX_IPSR_GPSR(IP5_3_0, A17),
761 PINMUX_IPSR_GPSR(IP5_3_0, MSIOF1_RXD),
762 PINMUX_IPSR_GPSR(IP5_3_0, VI4_DATA20),
763 PINMUX_IPSR_MSEL(IP5_3_0, VI5_DATA6_A, SEL_VIN5_0),
764 PINMUX_IPSR_GPSR(IP5_3_0, DU_DB6),
765 PINMUX_IPSR_GPSR(IP5_3_0, LCDOUT6),
766
767 PINMUX_IPSR_GPSR(IP5_7_4, A18),
768 PINMUX_IPSR_GPSR(IP5_7_4, MSIOF1_TXD),
769 PINMUX_IPSR_GPSR(IP5_7_4, VI4_DATA21),
770 PINMUX_IPSR_MSEL(IP5_7_4, VI5_DATA7_A, SEL_VIN5_0),
771 PINMUX_IPSR_GPSR(IP5_7_4, DU_DB0),
772 PINMUX_IPSR_MSEL(IP5_7_4, HRX4_E, SEL_HSCIF4_4),
773 PINMUX_IPSR_GPSR(IP5_7_4, LCDOUT0),
774
775 PINMUX_IPSR_GPSR(IP5_11_8, A19),
776 PINMUX_IPSR_GPSR(IP5_11_8, MSIOF1_SCK),
777 PINMUX_IPSR_GPSR(IP5_11_8, VI4_DATA22),
778 PINMUX_IPSR_MSEL(IP5_11_8, VI5_DATA2_A, SEL_VIN5_0),
779 PINMUX_IPSR_GPSR(IP5_11_8, DU_DB1),
780 PINMUX_IPSR_GPSR(IP5_11_8, HTX4_E),
781 PINMUX_IPSR_GPSR(IP5_11_8, LCDOUT1),
782
783 PINMUX_IPSR_GPSR(IP5_15_12, CS0_N),
784 PINMUX_IPSR_GPSR(IP5_15_12, SCL5),
785 PINMUX_IPSR_GPSR(IP5_15_12, DU_DR0),
786 PINMUX_IPSR_MSEL(IP5_15_12, VI4_DATA2_B, SEL_VIN4_1),
787 PINMUX_IPSR_GPSR(IP5_15_12, LCDOUT16),
788
789 PINMUX_IPSR_GPSR(IP5_19_16, WE0_N),
790 PINMUX_IPSR_GPSR(IP5_19_16, SDA5),
791 PINMUX_IPSR_GPSR(IP5_19_16, DU_DR1),
792 PINMUX_IPSR_MSEL(IP5_19_16, VI4_DATA3_B, SEL_VIN4_1),
793 PINMUX_IPSR_GPSR(IP5_19_16, LCDOUT17),
794
795 PINMUX_IPSR_GPSR(IP5_23_20, D0),
796 PINMUX_IPSR_MSEL(IP5_23_20, MSIOF3_SCK_A, SEL_MSIOF3_0),
797 PINMUX_IPSR_GPSR(IP5_23_20, DU_DR2),
798 PINMUX_IPSR_MSEL(IP5_23_20, CTS4_N_C, SEL_SCIF4_2),
799 PINMUX_IPSR_GPSR(IP5_23_20, LCDOUT18),
800
801 PINMUX_IPSR_GPSR(IP5_27_24, D1),
802 PINMUX_IPSR_MSEL(IP5_27_24, MSIOF3_SYNC_A, SEL_MSIOF3_0),
803 PINMUX_IPSR_MSEL(IP5_27_24, SCK3_A, SEL_SCIF3_0),
804 PINMUX_IPSR_GPSR(IP5_27_24, VI4_DATA23),
805 PINMUX_IPSR_MSEL(IP5_27_24, VI5_CLKENB_A, SEL_VIN5_0),
806 PINMUX_IPSR_GPSR(IP5_27_24, DU_DB7),
807 PINMUX_IPSR_MSEL(IP5_27_24, RTS4_N_TANS_C, SEL_SCIF4_2),
808 PINMUX_IPSR_GPSR(IP5_27_24, LCDOUT7),
809
810 PINMUX_IPSR_GPSR(IP5_31_28, D2),
811 PINMUX_IPSR_MSEL(IP5_31_28, MSIOF3_RXD_A, SEL_MSIOF3_0),
812 PINMUX_IPSR_MSEL(IP5_31_28, RX5_C, SEL_SCIF5_2),
813 PINMUX_IPSR_MSEL(IP5_31_28, VI5_DATA14_A, SEL_VIN5_0),
814 PINMUX_IPSR_GPSR(IP5_31_28, DU_DR3),
815 PINMUX_IPSR_MSEL(IP5_31_28, RX4_C, SEL_SCIF4_2),
816 PINMUX_IPSR_GPSR(IP5_31_28, LCDOUT19),
817
818 /* IPSR6 */
819 PINMUX_IPSR_GPSR(IP6_3_0, D3),
820 PINMUX_IPSR_GPSR(IP6_3_0, MSIOF3_TXD_A),
821 PINMUX_IPSR_GPSR(IP6_3_0, TX5_C),
822 PINMUX_IPSR_MSEL(IP6_3_0, VI5_DATA15_A, SEL_VIN5_0),
823 PINMUX_IPSR_GPSR(IP6_3_0, DU_DR4),
824 PINMUX_IPSR_GPSR(IP6_3_0, TX4_C),
825 PINMUX_IPSR_GPSR(IP6_3_0, LCDOUT20),
826
827 PINMUX_IPSR_GPSR(IP6_7_4, D4),
828 PINMUX_IPSR_GPSR(IP6_7_4, CANFD1_TX),
829 PINMUX_IPSR_MSEL(IP6_7_4, HSCK3_B, SEL_HSCIF3_1),
830 PINMUX_IPSR_GPSR(IP6_7_4, CAN1_TX),
831 PINMUX_IPSR_MSEL(IP6_7_4, RTS3_N_TANS_A, SEL_SCIF3_0),
832 PINMUX_IPSR_GPSR(IP6_7_4, MSIOF3_SS2_A),
833 PINMUX_IPSR_MSEL(IP6_7_4, VI5_DATA1_B, SEL_VIN5_1),
834
835 PINMUX_IPSR_GPSR(IP6_11_8, D5),
836 PINMUX_IPSR_MSEL(IP6_11_8, RX3_A, SEL_SCIF3_0),
837 PINMUX_IPSR_MSEL(IP6_11_8, HRX3_B, SEL_HSCIF3_1),
838 PINMUX_IPSR_GPSR(IP6_11_8, DU_DR5),
839 PINMUX_IPSR_MSEL(IP6_11_8, VI4_DATA4_B, SEL_VIN4_1),
840 PINMUX_IPSR_GPSR(IP6_11_8, LCDOUT21),
841
842 PINMUX_IPSR_GPSR(IP6_15_12, D6),
843 PINMUX_IPSR_GPSR(IP6_15_12, TX3_A),
844 PINMUX_IPSR_GPSR(IP6_15_12, HTX3_B),
845 PINMUX_IPSR_GPSR(IP6_15_12, DU_DR6),
846 PINMUX_IPSR_MSEL(IP6_15_12, VI4_DATA5_B, SEL_VIN4_1),
847 PINMUX_IPSR_GPSR(IP6_15_12, LCDOUT22),
848
849 PINMUX_IPSR_GPSR(IP6_19_16, D7),
850 PINMUX_IPSR_GPSR(IP6_19_16, CANFD1_RX),
851 PINMUX_IPSR_GPSR(IP6_19_16, IRQ5),
852 PINMUX_IPSR_GPSR(IP6_19_16, CAN1_RX),
853 PINMUX_IPSR_MSEL(IP6_19_16, CTS3_N_A, SEL_SCIF3_0),
854 PINMUX_IPSR_MSEL(IP6_19_16, VI5_DATA2_B, SEL_VIN5_1),
855
856 PINMUX_IPSR_GPSR(IP6_23_20, D8),
857 PINMUX_IPSR_MSEL(IP6_23_20, MSIOF2_SCK_A, SEL_MSIOF2_0),
858 PINMUX_IPSR_MSEL(IP6_23_20, SCK4_B, SEL_SCIF4_1),
859 PINMUX_IPSR_MSEL(IP6_23_20, VI5_DATA12_A, SEL_VIN5_0),
860 PINMUX_IPSR_GPSR(IP6_23_20, DU_DR7),
861 PINMUX_IPSR_MSEL(IP6_23_20, RIF3_CLK_B, SEL_DRIF3_1),
862 PINMUX_IPSR_MSEL(IP6_23_20, HCTS3_N_E, SEL_HSCIF3_4),
863 PINMUX_IPSR_GPSR(IP6_23_20, LCDOUT23),
864
865 PINMUX_IPSR_GPSR(IP6_27_24, D9),
866 PINMUX_IPSR_MSEL(IP6_27_24, MSIOF2_SYNC_A, SEL_MSIOF2_0),
867 PINMUX_IPSR_MSEL(IP6_27_24, VI5_DATA10_A, SEL_VIN5_0),
868 PINMUX_IPSR_GPSR(IP6_27_24, DU_DG0),
869 PINMUX_IPSR_MSEL(IP6_27_24, RIF3_SYNC_B, SEL_DRIF3_1),
870 PINMUX_IPSR_MSEL(IP6_27_24, HRX3_E, SEL_HSCIF3_4),
871 PINMUX_IPSR_GPSR(IP6_27_24, LCDOUT8),
872
873 PINMUX_IPSR_GPSR(IP6_31_28, D10),
874 PINMUX_IPSR_MSEL(IP6_31_28, MSIOF2_RXD_A, SEL_MSIOF2_0),
875 PINMUX_IPSR_MSEL(IP6_31_28, VI5_DATA13_A, SEL_VIN5_0),
876 PINMUX_IPSR_GPSR(IP6_31_28, DU_DG1),
877 PINMUX_IPSR_MSEL(IP6_31_28, RIF3_D0_B, SEL_DRIF3_1),
878 PINMUX_IPSR_GPSR(IP6_31_28, HTX3_E),
879 PINMUX_IPSR_GPSR(IP6_31_28, LCDOUT9),
880
881 /* IPSR7 */
882 PINMUX_IPSR_GPSR(IP7_3_0, D11),
883 PINMUX_IPSR_GPSR(IP7_3_0, MSIOF2_TXD_A),
884 PINMUX_IPSR_MSEL(IP7_3_0, VI5_DATA11_A, SEL_VIN5_0),
885 PINMUX_IPSR_GPSR(IP7_3_0, DU_DG2),
886 PINMUX_IPSR_MSEL(IP7_3_0, RIF3_D1_B, SEL_DRIF3_1),
887 PINMUX_IPSR_MSEL(IP7_3_0, HRTS3_N_E, SEL_HSCIF3_4),
888 PINMUX_IPSR_GPSR(IP7_3_0, LCDOUT10),
889
890 PINMUX_IPSR_GPSR(IP7_7_4, D12),
891 PINMUX_IPSR_GPSR(IP7_7_4, CANFD0_TX),
892 PINMUX_IPSR_GPSR(IP7_7_4, TX4_B),
893 PINMUX_IPSR_GPSR(IP7_7_4, CAN0_TX),
894 PINMUX_IPSR_MSEL(IP7_7_4, VI5_DATA8_A, SEL_VIN5_0),
895 PINMUX_IPSR_MSEL(IP7_7_4, VI5_DATA3_B, SEL_VIN5_1),
896
897 PINMUX_IPSR_GPSR(IP7_11_8, D13),
898 PINMUX_IPSR_GPSR(IP7_11_8, CANFD0_RX),
899 PINMUX_IPSR_MSEL(IP7_11_8, RX4_B, SEL_SCIF4_1),
900 PINMUX_IPSR_GPSR(IP7_11_8, CAN0_RX),
901 PINMUX_IPSR_MSEL(IP7_11_8, VI5_DATA9_A, SEL_VIN5_0),
902 PINMUX_IPSR_MSEL(IP7_11_8, SCL7_B, SEL_I2C7_1),
903 PINMUX_IPSR_MSEL(IP7_11_8, VI5_DATA4_B, SEL_VIN5_1),
904
905 PINMUX_IPSR_GPSR(IP7_15_12, D14),
906 PINMUX_IPSR_GPSR(IP7_15_12, CAN_CLK),
907 PINMUX_IPSR_MSEL(IP7_15_12, HRX3_A, SEL_HSCIF3_0),
908 PINMUX_IPSR_GPSR(IP7_15_12, MSIOF2_SS2_A),
909 PINMUX_IPSR_MSEL(IP7_15_12, SDA7_B, SEL_I2C7_1),
910 PINMUX_IPSR_MSEL(IP7_15_12, VI5_DATA5_B, SEL_VIN5_1),
911
912 PINMUX_IPSR_GPSR(IP7_19_16, D15),
913 PINMUX_IPSR_GPSR(IP7_19_16, MSIOF2_SS1_A),
914 PINMUX_IPSR_GPSR(IP7_19_16, HTX3_A),
915 PINMUX_IPSR_GPSR(IP7_19_16, MSIOF3_SS1_A),
916 PINMUX_IPSR_GPSR(IP7_19_16, DU_DG3),
917 PINMUX_IPSR_GPSR(IP7_19_16, LCDOUT11),
918
919 PINMUX_IPSR_GPSR(IP7_23_20, SCL4),
920 PINMUX_IPSR_GPSR(IP7_23_20, CS1_N_A26),
921 PINMUX_IPSR_GPSR(IP7_23_20, DU_DOTCLKIN0),
922 PINMUX_IPSR_MSEL(IP7_23_20, VI4_DATA6_B, SEL_VIN4_1),
923 PINMUX_IPSR_MSEL(IP7_23_20, VI5_DATA6_B, SEL_VIN5_1),
924 PINMUX_IPSR_GPSR(IP7_23_20, QCLK),
925
926 PINMUX_IPSR_GPSR(IP7_27_24, SDA4),
927 PINMUX_IPSR_GPSR(IP7_27_24, WE1_N),
928 PINMUX_IPSR_MSEL(IP7_27_24, VI4_DATA7_B, SEL_VIN4_1),
929 PINMUX_IPSR_MSEL(IP7_27_24, VI5_DATA7_B, SEL_VIN5_1),
930 PINMUX_IPSR_GPSR(IP7_27_24, QPOLB),
931
932 PINMUX_IPSR_GPSR(IP7_31_28, SD0_CLK),
933 PINMUX_IPSR_GPSR(IP7_31_28, NFDATA8),
934 PINMUX_IPSR_MSEL(IP7_31_28, SCL1_C, SEL_I2C1_2),
935 PINMUX_IPSR_MSEL(IP7_31_28, HSCK1_B, SEL_HSCIF1_1),
936 PINMUX_IPSR_MSEL(IP7_31_28, SDA2_E, SEL_I2C2_4),
937 PINMUX_IPSR_MSEL(IP7_31_28, FMCLK_B, SEL_FM_1),
938
939 /* IPSR8 */
940 PINMUX_IPSR_GPSR(IP8_3_0, SD0_CMD),
941 PINMUX_IPSR_GPSR(IP8_3_0, NFDATA9),
942 PINMUX_IPSR_MSEL(IP8_3_0, HRX1_B, SEL_HSCIF1_1),
943 PINMUX_IPSR_MSEL(IP8_3_0, SPEEDIN_B, SEL_SPEED_PULSE_IF_1),
944
945 PINMUX_IPSR_GPSR(IP8_7_4, SD0_DAT0),
946 PINMUX_IPSR_GPSR(IP8_7_4, NFDATA10),
947 PINMUX_IPSR_GPSR(IP8_7_4, HTX1_B),
948 PINMUX_IPSR_MSEL(IP8_7_4, REMOCON_B, SEL_REMOCON_1),
949
950 PINMUX_IPSR_GPSR(IP8_11_8, SD0_DAT1),
951 PINMUX_IPSR_GPSR(IP8_11_8, NFDATA11),
952 PINMUX_IPSR_MSEL(IP8_11_8, SDA2_C, SEL_I2C2_2),
953 PINMUX_IPSR_MSEL(IP8_11_8, HCTS1_N_B, SEL_HSCIF1_1),
954 PINMUX_IPSR_MSEL(IP8_11_8, FMIN_B, SEL_FM_1),
955
956 PINMUX_IPSR_GPSR(IP8_15_12, SD0_DAT2),
957 PINMUX_IPSR_GPSR(IP8_15_12, NFDATA12),
958 PINMUX_IPSR_MSEL(IP8_15_12, SCL2_C, SEL_I2C2_2),
959 PINMUX_IPSR_MSEL(IP8_15_12, HRTS1_N_B, SEL_HSCIF1_1),
960 PINMUX_IPSR_GPSR(IP8_15_12, BPFCLK_B),
961
962 PINMUX_IPSR_GPSR(IP8_19_16, SD0_DAT3),
963 PINMUX_IPSR_GPSR(IP8_19_16, NFDATA13),
964 PINMUX_IPSR_MSEL(IP8_19_16, SDA1_C, SEL_I2C1_2),
965 PINMUX_IPSR_MSEL(IP8_19_16, SCL2_E, SEL_I2C2_4),
966 PINMUX_IPSR_MSEL(IP8_19_16, SPEEDIN_C, SEL_SPEED_PULSE_IF_2),
967 PINMUX_IPSR_MSEL(IP8_19_16, REMOCON_C, SEL_REMOCON_2),
968
969 PINMUX_IPSR_GPSR(IP8_23_20, SD1_CLK),
970 PINMUX_IPSR_MSEL(IP8_23_20, NFDATA14_B, SEL_NDFC_1),
971
972 PINMUX_IPSR_GPSR(IP8_27_24, SD1_CMD),
973 PINMUX_IPSR_MSEL(IP8_27_24, NFDATA15_B, SEL_NDFC_1),
974
975 PINMUX_IPSR_GPSR(IP8_31_28, SD1_DAT0),
976 PINMUX_IPSR_MSEL(IP8_31_28, NFWP_N_B, SEL_NDFC_1),
977
978 /* IPSR9 */
979 PINMUX_IPSR_GPSR(IP9_3_0, SD1_DAT1),
980 PINMUX_IPSR_MSEL(IP9_3_0, NFCE_N_B, SEL_NDFC_1),
981
982 PINMUX_IPSR_GPSR(IP9_7_4, SD1_DAT2),
983 PINMUX_IPSR_MSEL(IP9_7_4, NFALE_B, SEL_NDFC_1),
984
985 PINMUX_IPSR_GPSR(IP9_11_8, SD1_DAT3),
986 PINMUX_IPSR_MSEL(IP9_11_8, NFRB_N_B, SEL_NDFC_1),
987
988 PINMUX_IPSR_GPSR(IP9_15_12, SD3_CLK),
989 PINMUX_IPSR_GPSR(IP9_15_12, NFWE_N),
990
991 PINMUX_IPSR_GPSR(IP9_19_16, SD3_CMD),
992 PINMUX_IPSR_GPSR(IP9_19_16, NFRE_N),
993
994 PINMUX_IPSR_GPSR(IP9_23_20, SD3_DAT0),
995 PINMUX_IPSR_GPSR(IP9_23_20, NFDATA0),
996
997 PINMUX_IPSR_GPSR(IP9_27_24, SD3_DAT1),
998 PINMUX_IPSR_GPSR(IP9_27_24, NFDATA1),
999
1000 PINMUX_IPSR_GPSR(IP9_31_28, SD3_DAT2),
1001 PINMUX_IPSR_GPSR(IP9_31_28, NFDATA2),
1002
1003 /* IPSR10 */
1004 PINMUX_IPSR_GPSR(IP10_3_0, SD3_DAT3),
1005 PINMUX_IPSR_GPSR(IP10_3_0, NFDATA3),
1006
1007 PINMUX_IPSR_GPSR(IP10_7_4, SD3_DAT4),
1008 PINMUX_IPSR_GPSR(IP10_7_4, NFDATA4),
1009
1010 PINMUX_IPSR_GPSR(IP10_11_8, SD3_DAT5),
1011 PINMUX_IPSR_GPSR(IP10_11_8, NFDATA5),
1012
1013 PINMUX_IPSR_GPSR(IP10_15_12, SD3_DAT6),
1014 PINMUX_IPSR_GPSR(IP10_15_12, NFDATA6),
1015
1016 PINMUX_IPSR_GPSR(IP10_19_16, SD3_DAT7),
1017 PINMUX_IPSR_GPSR(IP10_19_16, NFDATA7),
1018
1019 PINMUX_IPSR_GPSR(IP10_23_20, SD3_DS),
1020 PINMUX_IPSR_GPSR(IP10_23_20, NFCLE),
1021
1022 PINMUX_IPSR_GPSR(IP10_27_24, SD0_CD),
1023 PINMUX_IPSR_GPSR(IP10_27_24, NFALE_A),
1024 PINMUX_IPSR_GPSR(IP10_27_24, SD3_CD),
1025 PINMUX_IPSR_MSEL(IP10_27_24, RIF0_CLK_B, SEL_DRIF0_1),
1026 PINMUX_IPSR_MSEL(IP10_27_24, SCL2_B, SEL_I2C2_1),
1027 PINMUX_IPSR_MSEL(IP10_27_24, TCLK1_A, SEL_TIMER_TMU_0),
1028 PINMUX_IPSR_MSEL(IP10_27_24, SSI_SCK2_B, SEL_SSI2_1),
1029 PINMUX_IPSR_GPSR(IP10_27_24, TS_SCK0),
1030
1031 PINMUX_IPSR_GPSR(IP10_31_28, SD0_WP),
1032 PINMUX_IPSR_GPSR(IP10_31_28, NFRB_N_A),
1033 PINMUX_IPSR_GPSR(IP10_31_28, SD3_WP),
1034 PINMUX_IPSR_MSEL(IP10_31_28, RIF0_D0_B, SEL_DRIF0_1),
1035 PINMUX_IPSR_MSEL(IP10_31_28, SDA2_B, SEL_I2C2_1),
1036 PINMUX_IPSR_MSEL(IP10_31_28, TCLK2_A, SEL_TIMER_TMU_0),
1037 PINMUX_IPSR_MSEL(IP10_31_28, SSI_WS2_B, SEL_SSI2_1),
1038 PINMUX_IPSR_GPSR(IP10_31_28, TS_SDAT0),
1039
1040 /* IPSR11 */
1041 PINMUX_IPSR_GPSR(IP11_3_0, SD1_CD),
1042 PINMUX_IPSR_MSEL(IP11_3_0, NFCE_N_A, SEL_NDFC_0),
1043 PINMUX_IPSR_GPSR(IP11_3_0, SSI_SCK1),
1044 PINMUX_IPSR_MSEL(IP11_3_0, RIF0_D1_B, SEL_DRIF0_1),
1045 PINMUX_IPSR_GPSR(IP11_3_0, TS_SDEN0),
1046
1047 PINMUX_IPSR_GPSR(IP11_7_4, SD1_WP),
1048 PINMUX_IPSR_MSEL(IP11_7_4, NFWP_N_A, SEL_NDFC_0),
1049 PINMUX_IPSR_GPSR(IP11_7_4, SSI_WS1),
1050 PINMUX_IPSR_MSEL(IP11_7_4, RIF0_SYNC_B, SEL_DRIF0_1),
1051 PINMUX_IPSR_GPSR(IP11_7_4, TS_SPSYNC0),
1052
1053 PINMUX_IPSR_MSEL(IP11_11_8, RX0_A, SEL_SCIF0_0),
1054 PINMUX_IPSR_MSEL(IP11_11_8, HRX1_A, SEL_HSCIF1_0),
1055 PINMUX_IPSR_MSEL(IP11_11_8, SSI_SCK2_A, SEL_SSI2_0),
1056 PINMUX_IPSR_GPSR(IP11_11_8, RIF1_SYNC),
1057 PINMUX_IPSR_GPSR(IP11_11_8, TS_SCK1),
1058
1059 PINMUX_IPSR_GPSR(IP11_15_12, TX0_A),
1060 PINMUX_IPSR_GPSR(IP11_15_12, HTX1_A),
1061 PINMUX_IPSR_MSEL(IP11_15_12, SSI_WS2_A, SEL_SSI2_0),
1062 PINMUX_IPSR_GPSR(IP11_15_12, RIF1_D0),
1063 PINMUX_IPSR_GPSR(IP11_15_12, TS_SDAT1),
1064
1065 PINMUX_IPSR_MSEL(IP11_19_16, CTS0_N_A, SEL_SCIF0_0),
1066 PINMUX_IPSR_MSEL(IP11_19_16, NFDATA14_A, SEL_NDFC_0),
1067 PINMUX_IPSR_GPSR(IP11_19_16, AUDIO_CLKOUT_A),
1068 PINMUX_IPSR_GPSR(IP11_19_16, RIF1_D1),
1069 PINMUX_IPSR_MSEL(IP11_19_16, SCIF_CLK_A, SEL_SCIF_0),
1070 PINMUX_IPSR_MSEL(IP11_19_16, FMCLK_A, SEL_FM_0),
1071
1072 PINMUX_IPSR_MSEL(IP11_23_20, RTS0_N_TANS_A, SEL_SCIF0_0),
1073 PINMUX_IPSR_MSEL(IP11_23_20, NFDATA15_A, SEL_NDFC_0),
1074 PINMUX_IPSR_GPSR(IP11_23_20, AUDIO_CLKOUT1_A),
1075 PINMUX_IPSR_GPSR(IP11_23_20, RIF1_CLK),
1076 PINMUX_IPSR_MSEL(IP11_23_20, SCL2_A, SEL_I2C2_0),
1077 PINMUX_IPSR_MSEL(IP11_23_20, FMIN_A, SEL_FM_0),
1078
1079 PINMUX_IPSR_MSEL(IP11_27_24, SCK0_A, SEL_SCIF0_0),
1080 PINMUX_IPSR_MSEL(IP11_27_24, HSCK1_A, SEL_HSCIF1_0),
1081 PINMUX_IPSR_GPSR(IP11_27_24, USB3HS0_ID),
1082 PINMUX_IPSR_GPSR(IP11_27_24, RTS1_N_TANS),
1083 PINMUX_IPSR_MSEL(IP11_27_24, SDA2_A, SEL_I2C2_0),
1084 PINMUX_IPSR_MSEL(IP11_27_24, FMCLK_C, SEL_FM_2),
1085 PINMUX_IPSR_GPSR(IP11_27_24, USB1_ID),
1086
1087 PINMUX_IPSR_GPSR(IP11_31_28, RX1),
1088 PINMUX_IPSR_MSEL(IP11_31_28, HRX2_B, SEL_HSCIF2_1),
1089 PINMUX_IPSR_MSEL(IP11_31_28, SSI_SCK9_B, SEL_SSI9_1),
1090 PINMUX_IPSR_GPSR(IP11_31_28, AUDIO_CLKOUT1_B),
1091
1092 /* IPSR12 */
1093 PINMUX_IPSR_GPSR(IP12_3_0, TX1),
1094 PINMUX_IPSR_GPSR(IP12_3_0, HTX2_B),
1095 PINMUX_IPSR_MSEL(IP12_3_0, SSI_WS9_B, SEL_SSI9_1),
1096 PINMUX_IPSR_GPSR(IP12_3_0, AUDIO_CLKOUT3_B),
1097
1098 PINMUX_IPSR_GPSR(IP12_7_4, SCK2_A),
1099 PINMUX_IPSR_MSEL(IP12_7_4, HSCK0_A, SEL_HSCIF0_0),
1100 PINMUX_IPSR_MSEL(IP12_7_4, AUDIO_CLKB_A, SEL_ADGB_0),
1101 PINMUX_IPSR_GPSR(IP12_7_4, CTS1_N),
1102 PINMUX_IPSR_MSEL(IP12_7_4, RIF0_CLK_A, SEL_DRIF0_0),
1103 PINMUX_IPSR_MSEL(IP12_7_4, REMOCON_A, SEL_REMOCON_0),
1104 PINMUX_IPSR_MSEL(IP12_7_4, SCIF_CLK_B, SEL_SCIF_1),
1105
1106 PINMUX_IPSR_GPSR(IP12_11_8, TX2_A),
1107 PINMUX_IPSR_MSEL(IP12_11_8, HRX0_A, SEL_HSCIF0_0),
1108 PINMUX_IPSR_GPSR(IP12_11_8, AUDIO_CLKOUT2_A),
1109 PINMUX_IPSR_MSEL(IP12_11_8, SCL1_A, SEL_I2C1_0),
1110 PINMUX_IPSR_MSEL(IP12_11_8, FSO_CFE_0_N_A, SEL_FSO_0),
1111 PINMUX_IPSR_GPSR(IP12_11_8, TS_SDEN1),
1112
1113 PINMUX_IPSR_GPSR(IP12_15_12, RX2_A),
1114 PINMUX_IPSR_GPSR(IP12_15_12, HTX0_A),
1115 PINMUX_IPSR_GPSR(IP12_15_12, AUDIO_CLKOUT3_A),
1116 PINMUX_IPSR_MSEL(IP12_15_12, SDA1_A, SEL_I2C1_0),
1117 PINMUX_IPSR_MSEL(IP12_15_12, FSO_CFE_1_N_A, SEL_FSO_0),
1118 PINMUX_IPSR_GPSR(IP12_15_12, TS_SPSYNC1),
1119
1120 PINMUX_IPSR_GPSR(IP12_19_16, MSIOF0_SCK),
1121 PINMUX_IPSR_GPSR(IP12_19_16, SSI_SCK78),
1122
1123 PINMUX_IPSR_GPSR(IP12_23_20, MSIOF0_RXD),
1124 PINMUX_IPSR_GPSR(IP12_23_20, SSI_WS78),
1125 PINMUX_IPSR_GPSR(IP12_23_20, TX2_B),
1126
1127 PINMUX_IPSR_GPSR(IP12_27_24, MSIOF0_TXD),
1128 PINMUX_IPSR_GPSR(IP12_27_24, SSI_SDATA7),
1129 PINMUX_IPSR_GPSR(IP12_27_24, RX2_B),
1130
1131 PINMUX_IPSR_GPSR(IP12_31_28, MSIOF0_SYNC),
1132 PINMUX_IPSR_GPSR(IP12_31_28, AUDIO_CLKOUT_B),
1133 PINMUX_IPSR_GPSR(IP12_31_28, SSI_SDATA8),
1134
1135 /* IPSR13 */
1136 PINMUX_IPSR_GPSR(IP13_3_0, MSIOF0_SS1),
1137 PINMUX_IPSR_MSEL(IP13_3_0, HRX2_A, SEL_HSCIF2_0),
1138 PINMUX_IPSR_GPSR(IP13_3_0, SSI_SCK4),
1139 PINMUX_IPSR_MSEL(IP13_3_0, HCTS0_N_A, SEL_HSCIF0_0),
1140 PINMUX_IPSR_GPSR(IP13_3_0, BPFCLK_C),
1141 PINMUX_IPSR_MSEL(IP13_3_0, SPEEDIN_A, SEL_SPEED_PULSE_IF_0),
1142
1143 PINMUX_IPSR_GPSR(IP13_7_4, MSIOF0_SS2),
1144 PINMUX_IPSR_GPSR(IP13_7_4, HTX2_A),
1145 PINMUX_IPSR_GPSR(IP13_7_4, SSI_WS4),
1146 PINMUX_IPSR_MSEL(IP13_7_4, HRTS0_N_A, SEL_HSCIF0_0),
1147 PINMUX_IPSR_MSEL(IP13_7_4, FMIN_C, SEL_FM_2),
1148 PINMUX_IPSR_GPSR(IP13_7_4, BPFCLK_A),
1149
1150 PINMUX_IPSR_GPSR(IP13_11_8, SSI_SDATA9),
1151 PINMUX_IPSR_MSEL(IP13_11_8, AUDIO_CLKC_A, SEL_ADGC_0),
1152 PINMUX_IPSR_GPSR(IP13_11_8, SCK1),
1153
1154 PINMUX_IPSR_GPSR(IP13_15_12, MLB_CLK),
1155 PINMUX_IPSR_MSEL(IP13_15_12, RX0_B, SEL_SCIF0_1),
1156 PINMUX_IPSR_MSEL(IP13_15_12, RIF0_D0_A, SEL_DRIF0_0),
1157 PINMUX_IPSR_MSEL(IP13_15_12, SCL1_B, SEL_I2C1_1),
1158 PINMUX_IPSR_MSEL(IP13_15_12, TCLK1_B, SEL_TIMER_TMU_1),
1159 PINMUX_IPSR_GPSR(IP13_15_12, SIM0_RST_A),
1160
1161 PINMUX_IPSR_GPSR(IP13_19_16, MLB_SIG),
1162 PINMUX_IPSR_MSEL(IP13_19_16, SCK0_B, SEL_SCIF0_1),
1163 PINMUX_IPSR_MSEL(IP13_19_16, RIF0_D1_A, SEL_DRIF0_0),
1164 PINMUX_IPSR_MSEL(IP13_19_16, SDA1_B, SEL_I2C1_1),
1165 PINMUX_IPSR_MSEL(IP13_19_16, TCLK2_B, SEL_TIMER_TMU_1),
1166 PINMUX_IPSR_MSEL(IP13_19_16, SIM0_D_A, SEL_SIMCARD_0),
1167
1168 PINMUX_IPSR_GPSR(IP13_23_20, MLB_DAT),
1169 PINMUX_IPSR_GPSR(IP13_23_20, TX0_B),
1170 PINMUX_IPSR_MSEL(IP13_23_20, RIF0_SYNC_A, SEL_DRIF0_0),
1171 PINMUX_IPSR_GPSR(IP13_23_20, SIM0_CLK_A),
1172
1173 PINMUX_IPSR_GPSR(IP13_27_24, SSI_SCK01239),
1174
1175 PINMUX_IPSR_GPSR(IP13_31_28, SSI_WS01239),
1176
1177 /* IPSR14 */
1178 PINMUX_IPSR_GPSR(IP14_3_0, SSI_SDATA0),
1179
1180 PINMUX_IPSR_GPSR(IP14_7_4, SSI_SDATA1),
1181 PINMUX_IPSR_MSEL(IP14_7_4, AUDIO_CLKC_B, SEL_ADGC_1),
1182 PINMUX_IPSR_MSEL(IP14_7_4, PWM0_B, SEL_PWM0_1),
1183
1184 PINMUX_IPSR_GPSR(IP14_11_8, SSI_SDATA2),
1185 PINMUX_IPSR_GPSR(IP14_11_8, AUDIO_CLKOUT2_B),
1186 PINMUX_IPSR_MSEL(IP14_11_8, SSI_SCK9_A, SEL_SSI9_0),
1187 PINMUX_IPSR_MSEL(IP14_11_8, PWM1_B, SEL_PWM1_1),
1188
1189 PINMUX_IPSR_GPSR(IP14_15_12, SSI_SCK349),
1190 PINMUX_IPSR_MSEL(IP14_15_12, PWM2_C, SEL_PWM2_2),
1191
1192 PINMUX_IPSR_GPSR(IP14_19_16, SSI_WS349),
1193 PINMUX_IPSR_MSEL(IP14_19_16, PWM3_C, SEL_PWM3_2),
1194
1195 PINMUX_IPSR_GPSR(IP14_23_20, SSI_SDATA3),
1196 PINMUX_IPSR_GPSR(IP14_23_20, AUDIO_CLKOUT1_C),
1197 PINMUX_IPSR_MSEL(IP14_23_20, AUDIO_CLKB_B, SEL_ADGB_1),
1198 PINMUX_IPSR_MSEL(IP14_23_20, PWM4_B, SEL_PWM4_1),
1199
1200 PINMUX_IPSR_GPSR(IP14_27_24, SSI_SDATA4),
1201 PINMUX_IPSR_MSEL(IP14_27_24, SSI_WS9_A, SEL_SSI9_0),
1202 PINMUX_IPSR_MSEL(IP14_27_24, PWM5_B, SEL_PWM5_1),
1203
1204 PINMUX_IPSR_GPSR(IP14_31_28, SSI_SCK5),
1205 PINMUX_IPSR_MSEL(IP14_31_28, HRX0_B, SEL_HSCIF0_1),
1206 PINMUX_IPSR_GPSR(IP14_31_28, USB0_PWEN_B),
1207 PINMUX_IPSR_MSEL(IP14_31_28, SCL2_D, SEL_I2C2_3),
1208 PINMUX_IPSR_MSEL(IP14_31_28, PWM6_B, SEL_PWM6_1),
1209
1210 /* IPSR15 */
1211 PINMUX_IPSR_GPSR(IP15_3_0, SSI_WS5),
1212 PINMUX_IPSR_GPSR(IP15_3_0, HTX0_B),
1213 PINMUX_IPSR_MSEL(IP15_3_0, USB0_OVC_B, SEL_USB_20_CH0_1),
1214 PINMUX_IPSR_MSEL(IP15_3_0, SDA2_D, SEL_I2C2_3),
1215
1216 PINMUX_IPSR_GPSR(IP15_7_4, SSI_SDATA5),
1217 PINMUX_IPSR_MSEL(IP15_7_4, HSCK0_B, SEL_HSCIF0_1),
1218 PINMUX_IPSR_MSEL(IP15_7_4, AUDIO_CLKB_C, SEL_ADGB_2),
1219 PINMUX_IPSR_GPSR(IP15_7_4, TPU0TO0),
1220
1221 PINMUX_IPSR_GPSR(IP15_11_8, SSI_SCK6),
1222 PINMUX_IPSR_MSEL(IP15_11_8, HSCK2_A, SEL_HSCIF2_0),
1223 PINMUX_IPSR_MSEL(IP15_11_8, AUDIO_CLKC_C, SEL_ADGC_2),
1224 PINMUX_IPSR_GPSR(IP15_11_8, TPU0TO1),
1225 PINMUX_IPSR_MSEL(IP15_11_8, FSO_CFE_0_N_B, SEL_FSO_1),
1226 PINMUX_IPSR_GPSR(IP15_11_8, SIM0_RST_B),
1227
1228 PINMUX_IPSR_GPSR(IP15_15_12, SSI_WS6),
1229 PINMUX_IPSR_MSEL(IP15_15_12, HCTS2_N_A, SEL_HSCIF2_0),
1230 PINMUX_IPSR_GPSR(IP15_15_12, AUDIO_CLKOUT2_C),
1231 PINMUX_IPSR_GPSR(IP15_15_12, TPU0TO2),
1232 PINMUX_IPSR_MSEL(IP15_15_12, SDA1_D, SEL_I2C1_3),
1233 PINMUX_IPSR_MSEL(IP15_15_12, FSO_CFE_1_N_B, SEL_FSO_1),
1234 PINMUX_IPSR_MSEL(IP15_15_12, SIM0_D_B, SEL_SIMCARD_1),
1235
1236 PINMUX_IPSR_GPSR(IP15_19_16, SSI_SDATA6),
1237 PINMUX_IPSR_MSEL(IP15_19_16, HRTS2_N_A, SEL_HSCIF2_0),
1238 PINMUX_IPSR_GPSR(IP15_19_16, AUDIO_CLKOUT3_C),
1239 PINMUX_IPSR_GPSR(IP15_19_16, TPU0TO3),
1240 PINMUX_IPSR_MSEL(IP15_19_16, SCL1_D, SEL_I2C1_3),
1241 PINMUX_IPSR_MSEL(IP15_19_16, FSO_TOE_N_B, SEL_FSO_1),
1242 PINMUX_IPSR_GPSR(IP15_19_16, SIM0_CLK_B),
1243
1244 PINMUX_IPSR_GPSR(IP15_23_20, AUDIO_CLKA),
1245
1246 PINMUX_IPSR_GPSR(IP15_27_24, USB30_PWEN),
1247 PINMUX_IPSR_GPSR(IP15_27_24, USB0_PWEN_A),
1248
1249 PINMUX_IPSR_GPSR(IP15_31_28, USB30_OVC),
1250 PINMUX_IPSR_MSEL(IP15_31_28, USB0_OVC_A, SEL_USB_20_CH0_0),
1251
1252/*
1253 * Static pins can not be muxed between different functions but
1254 * still need mark entries in the pinmux list. Add each static
1255 * pin to the list without an associated function. The sh-pfc
1256 * core will do the right thing and skip trying to mux the pin
1257 * while still applying configuration to it.
1258 */
1259#define FM(x) PINMUX_DATA(x##_MARK, 0),
1260 PINMUX_STATIC
1261#undef FM
1262};
1263
1264/*
1265 * R8A77990 has 7 banks with 32 GPIOs in each => 224 GPIOs.
1266 * Physical layout rows: A - AE, cols: 1 - 25.
1267 */
1268#define ROW_GROUP_A(r) ('Z' - 'A' + 1 + (r))
1269#define PIN_NUMBER(r, c) (((r) - 'A') * 25 + (c) + 300)
1270#define PIN_A_NUMBER(r, c) PIN_NUMBER(ROW_GROUP_A(r), c)
1271#define PIN_NONE U16_MAX
1272
1273static const struct sh_pfc_pin pinmux_pins[] = {
1274 PINMUX_GPIO_GP_ALL(),
1275
1276 /*
1277 * Pins not associated with a GPIO port.
1278 *
1279 * The pin positions are different between different R8A77990
1280 * packages, all that is needed for the pfc driver is a unique
1281 * number for each pin. To this end use the pin layout from
1282 * R8A77990 to calculate a unique number for each pin.
1283 */
1284 SH_PFC_PIN_NAMED_CFG('F', 1, TRST_N, CFG_FLAGS),
1285 SH_PFC_PIN_NAMED_CFG('F', 3, TMS, CFG_FLAGS),
1286 SH_PFC_PIN_NAMED_CFG('F', 4, TCK, CFG_FLAGS),
1287 SH_PFC_PIN_NAMED_CFG('G', 2, TDI, CFG_FLAGS),
1288 SH_PFC_PIN_NAMED_CFG('G', 3, FSCLKST_N, CFG_FLAGS),
1289 SH_PFC_PIN_NAMED_CFG('H', 1, ASEBRK, CFG_FLAGS),
1290 SH_PFC_PIN_NAMED_CFG('N', 1, AVB_TXC, CFG_FLAGS),
1291 SH_PFC_PIN_NAMED_CFG('N', 2, AVB_TD0, CFG_FLAGS),
1292 SH_PFC_PIN_NAMED_CFG('N', 3, AVB_TD1, CFG_FLAGS),
1293 SH_PFC_PIN_NAMED_CFG('N', 5, AVB_TD2, CFG_FLAGS),
1294 SH_PFC_PIN_NAMED_CFG('N', 6, AVB_TD3, CFG_FLAGS),
1295 SH_PFC_PIN_NAMED_CFG('P', 3, AVB_TX_CTL, CFG_FLAGS),
1296 SH_PFC_PIN_NAMED_CFG('P', 4, AVB_MDIO, CFG_FLAGS),
1297 SH_PFC_PIN_NAMED_CFG('P', 5, AVB_MDC, CFG_FLAGS),
1298 SH_PFC_PIN_NAMED_CFG('T', 21, MLB_REF, CFG_FLAGS),
1299 SH_PFC_PIN_NAMED_CFG(ROW_GROUP_A('D'), 3, PRESETOUT_N, CFG_FLAGS),
1300};
1301
1302/* - EtherAVB --------------------------------------------------------------- */
1303static const unsigned int avb_link_pins[] = {
1304 /* AVB_LINK */
1305 RCAR_GP_PIN(2, 23),
1306};
1307
1308static const unsigned int avb_link_mux[] = {
1309 AVB_LINK_MARK,
1310};
1311
1312static const unsigned int avb_magic_pins[] = {
1313 /* AVB_MAGIC */
1314 RCAR_GP_PIN(2, 22),
1315};
1316
1317static const unsigned int avb_magic_mux[] = {
1318 AVB_MAGIC_MARK,
1319};
1320
1321static const unsigned int avb_phy_int_pins[] = {
1322 /* AVB_PHY_INT */
1323 RCAR_GP_PIN(2, 21),
1324};
1325
1326static const unsigned int avb_phy_int_mux[] = {
1327 AVB_PHY_INT_MARK,
1328};
1329
1330static const unsigned int avb_mii_pins[] = {
1331 /*
1332 * AVB_RX_CTL, AVB_RXC, AVB_RD0,
1333 * AVB_RD1, AVB_RD2, AVB_RD3,
1334 * AVB_TXCREFCLK
1335 */
1336 RCAR_GP_PIN(2, 14), RCAR_GP_PIN(2, 15), RCAR_GP_PIN(2, 16),
1337 RCAR_GP_PIN(2, 17), RCAR_GP_PIN(2, 18), RCAR_GP_PIN(2, 19),
1338 RCAR_GP_PIN(2, 20),
1339};
1340
1341static const unsigned int avb_mii_mux[] = {
1342 AVB_RX_CTL_MARK, AVB_RXC_MARK, AVB_RD0_MARK,
1343 AVB_RD1_MARK, AVB_RD2_MARK, AVB_RD3_MARK,
1344 AVB_TXCREFCLK_MARK,
1345};
1346
1347static const unsigned int avb_avtp_pps_pins[] = {
1348 /* AVB_AVTP_PPS */
1349 RCAR_GP_PIN(1, 2),
1350};
1351
1352static const unsigned int avb_avtp_pps_mux[] = {
1353 AVB_AVTP_PPS_MARK,
1354};
1355
1356static const unsigned int avb_avtp_match_a_pins[] = {
1357 /* AVB_AVTP_MATCH_A */
1358 RCAR_GP_PIN(2, 24),
1359};
1360
1361static const unsigned int avb_avtp_match_a_mux[] = {
1362 AVB_AVTP_MATCH_A_MARK,
1363};
1364
1365static const unsigned int avb_avtp_capture_a_pins[] = {
1366 /* AVB_AVTP_CAPTURE_A */
1367 RCAR_GP_PIN(2, 25),
1368};
1369
1370static const unsigned int avb_avtp_capture_a_mux[] = {
1371 AVB_AVTP_CAPTURE_A_MARK,
1372};
1373
1374/* - I2C -------------------------------------------------------------------- */
1375static const unsigned int i2c1_a_pins[] = {
1376 /* SCL, SDA */
1377 RCAR_GP_PIN(5, 8), RCAR_GP_PIN(5, 9),
1378};
1379
1380static const unsigned int i2c1_a_mux[] = {
1381 SCL1_A_MARK, SDA1_A_MARK,
1382};
1383
1384static const unsigned int i2c1_b_pins[] = {
1385 /* SCL, SDA */
1386 RCAR_GP_PIN(5, 17), RCAR_GP_PIN(5, 18),
1387};
1388
1389static const unsigned int i2c1_b_mux[] = {
1390 SCL1_B_MARK, SDA1_B_MARK,
1391};
1392
1393static const unsigned int i2c1_c_pins[] = {
1394 /* SCL, SDA */
1395 RCAR_GP_PIN(3, 0), RCAR_GP_PIN(3, 5),
1396};
1397
1398static const unsigned int i2c1_c_mux[] = {
1399 SCL1_C_MARK, SDA1_C_MARK,
1400};
1401
1402static const unsigned int i2c1_d_pins[] = {
1403 /* SCL, SDA */
1404 RCAR_GP_PIN(6, 16), RCAR_GP_PIN(6, 15),
1405};
1406
1407static const unsigned int i2c1_d_mux[] = {
1408 SCL1_D_MARK, SDA1_D_MARK,
1409};
1410
1411static const unsigned int i2c2_a_pins[] = {
1412 /* SCL, SDA */
1413 RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 0),
1414};
1415
1416static const unsigned int i2c2_a_mux[] = {
1417 SCL2_A_MARK, SDA2_A_MARK,
1418};
1419
1420static const unsigned int i2c2_b_pins[] = {
1421 /* SCL, SDA */
1422 RCAR_GP_PIN(3, 12), RCAR_GP_PIN(3, 13),
1423};
1424
1425static const unsigned int i2c2_b_mux[] = {
1426 SCL2_B_MARK, SDA2_B_MARK,
1427};
1428
1429static const unsigned int i2c2_c_pins[] = {
1430 /* SCL, SDA */
1431 RCAR_GP_PIN(3, 4), RCAR_GP_PIN(3, 3),
1432};
1433
1434static const unsigned int i2c2_c_mux[] = {
1435 SCL2_C_MARK, SDA2_C_MARK,
1436};
1437
1438static const unsigned int i2c2_d_pins[] = {
1439 /* SCL, SDA */
1440 RCAR_GP_PIN(6, 11), RCAR_GP_PIN(6, 12),
1441};
1442
1443static const unsigned int i2c2_d_mux[] = {
1444 SCL2_D_MARK, SDA2_D_MARK,
1445};
1446
1447static const unsigned int i2c2_e_pins[] = {
1448 /* SCL, SDA */
1449 RCAR_GP_PIN(3, 5), RCAR_GP_PIN(3, 0),
1450};
1451
1452static const unsigned int i2c2_e_mux[] = {
1453 SCL2_E_MARK, SDA2_E_MARK,
1454};
1455
1456static const unsigned int i2c4_pins[] = {
1457 /* SCL, SDA */
1458 RCAR_GP_PIN(0, 16), RCAR_GP_PIN(0, 17),
1459};
1460
1461static const unsigned int i2c4_mux[] = {
1462 SCL4_MARK, SDA4_MARK,
1463};
1464
1465static const unsigned int i2c5_pins[] = {
1466 /* SCL, SDA */
1467 RCAR_GP_PIN(1, 21), RCAR_GP_PIN(1, 22),
1468};
1469
1470static const unsigned int i2c5_mux[] = {
1471 SCL5_MARK, SDA5_MARK,
1472};
1473
1474static const unsigned int i2c6_a_pins[] = {
1475 /* SCL, SDA */
1476 RCAR_GP_PIN(1, 11), RCAR_GP_PIN(1, 8),
1477};
1478
1479static const unsigned int i2c6_a_mux[] = {
1480 SCL6_A_MARK, SDA6_A_MARK,
1481};
1482
1483static const unsigned int i2c6_b_pins[] = {
1484 /* SCL, SDA */
1485 RCAR_GP_PIN(1, 2), RCAR_GP_PIN(1, 1),
1486};
1487
1488static const unsigned int i2c6_b_mux[] = {
1489 SCL6_B_MARK, SDA6_B_MARK,
1490};
1491
1492static const unsigned int i2c7_a_pins[] = {
1493 /* SCL, SDA */
1494 RCAR_GP_PIN(2, 24), RCAR_GP_PIN(2, 25),
1495};
1496
1497static const unsigned int i2c7_a_mux[] = {
1498 SCL7_A_MARK, SDA7_A_MARK,
1499};
1500
1501static const unsigned int i2c7_b_pins[] = {
1502 /* SCL, SDA */
1503 RCAR_GP_PIN(0, 13), RCAR_GP_PIN(0, 14),
1504};
1505
1506static const unsigned int i2c7_b_mux[] = {
1507 SCL7_B_MARK, SDA7_B_MARK,
1508};
1509
1510/* - SCIF0 ------------------------------------------------------------------ */
1511static const unsigned int scif0_data_a_pins[] = {
1512 /* RX, TX */
1513 RCAR_GP_PIN(5, 1), RCAR_GP_PIN(5, 2),
1514};
1515
1516static const unsigned int scif0_data_a_mux[] = {
1517 RX0_A_MARK, TX0_A_MARK,
1518};
1519
1520static const unsigned int scif0_clk_a_pins[] = {
1521 /* SCK */
1522 RCAR_GP_PIN(5, 0),
1523};
1524
1525static const unsigned int scif0_clk_a_mux[] = {
1526 SCK0_A_MARK,
1527};
1528
1529static const unsigned int scif0_ctrl_a_pins[] = {
1530 /* RTS, CTS */
1531 RCAR_GP_PIN(5, 4), RCAR_GP_PIN(5, 3),
1532};
1533
1534static const unsigned int scif0_ctrl_a_mux[] = {
1535 RTS0_N_TANS_A_MARK, CTS0_N_A_MARK,
1536};
1537
1538static const unsigned int scif0_data_b_pins[] = {
1539 /* RX, TX */
1540 RCAR_GP_PIN(5, 17), RCAR_GP_PIN(5, 19),
1541};
1542
1543static const unsigned int scif0_data_b_mux[] = {
1544 RX0_B_MARK, TX0_B_MARK,
1545};
1546
1547static const unsigned int scif0_clk_b_pins[] = {
1548 /* SCK */
1549 RCAR_GP_PIN(5, 18),
1550};
1551
1552static const unsigned int scif0_clk_b_mux[] = {
1553 SCK0_B_MARK,
1554};
1555
1556/* - SCIF1 ------------------------------------------------------------------ */
1557static const unsigned int scif1_data_pins[] = {
1558 /* RX, TX */
1559 RCAR_GP_PIN(5, 5), RCAR_GP_PIN(5, 6),
1560};
1561
1562static const unsigned int scif1_data_mux[] = {
1563 RX1_MARK, TX1_MARK,
1564};
1565
1566static const unsigned int scif1_clk_pins[] = {
1567 /* SCK */
1568 RCAR_GP_PIN(5, 16),
1569};
1570
1571static const unsigned int scif1_clk_mux[] = {
1572 SCK1_MARK,
1573};
1574
1575static const unsigned int scif1_ctrl_pins[] = {
1576 /* RTS, CTS */
1577 RCAR_GP_PIN(5, 0), RCAR_GP_PIN(5, 7),
1578};
1579
1580static const unsigned int scif1_ctrl_mux[] = {
1581 RTS1_N_TANS_MARK, CTS1_N_MARK,
1582};
1583
1584/* - SCIF2 ------------------------------------------------------------------ */
1585static const unsigned int scif2_data_a_pins[] = {
1586 /* RX, TX */
1587 RCAR_GP_PIN(5, 9), RCAR_GP_PIN(5, 8),
1588};
1589
1590static const unsigned int scif2_data_a_mux[] = {
1591 RX2_A_MARK, TX2_A_MARK,
1592};
1593
1594static const unsigned int scif2_clk_a_pins[] = {
1595 /* SCK */
1596 RCAR_GP_PIN(5, 7),
1597};
1598
1599static const unsigned int scif2_clk_a_mux[] = {
1600 SCK2_A_MARK,
1601};
1602
1603static const unsigned int scif2_data_b_pins[] = {
1604 /* RX, TX */
1605 RCAR_GP_PIN(5, 12), RCAR_GP_PIN(5, 11),
1606};
1607
1608static const unsigned int scif2_data_b_mux[] = {
1609 RX2_B_MARK, TX2_B_MARK,
1610};
1611
1612/* - SCIF3 ------------------------------------------------------------------ */
1613static const unsigned int scif3_data_a_pins[] = {
1614 /* RX, TX */
1615 RCAR_GP_PIN(0, 5), RCAR_GP_PIN(0, 6),
1616};
1617
1618static const unsigned int scif3_data_a_mux[] = {
1619 RX3_A_MARK, TX3_A_MARK,
1620};
1621
1622static const unsigned int scif3_clk_a_pins[] = {
1623 /* SCK */
1624 RCAR_GP_PIN(0, 1),
1625};
1626
1627static const unsigned int scif3_clk_a_mux[] = {
1628 SCK3_A_MARK,
1629};
1630
1631static const unsigned int scif3_ctrl_a_pins[] = {
1632 /* RTS, CTS */
1633 RCAR_GP_PIN(0, 4), RCAR_GP_PIN(0, 7),
1634};
1635
1636static const unsigned int scif3_ctrl_a_mux[] = {
1637 RTS3_N_TANS_A_MARK, CTS3_N_A_MARK,
1638};
1639
1640static const unsigned int scif3_data_b_pins[] = {
1641 /* RX, TX */
1642 RCAR_GP_PIN(1, 8), RCAR_GP_PIN(1, 11),
1643};
1644
1645static const unsigned int scif3_data_b_mux[] = {
1646 RX3_B_MARK, TX3_B_MARK,
1647};
1648
1649static const unsigned int scif3_data_c_pins[] = {
1650 /* RX, TX */
1651 RCAR_GP_PIN(2, 23), RCAR_GP_PIN(2, 22),
1652};
1653
1654static const unsigned int scif3_data_c_mux[] = {
1655 RX3_C_MARK, TX3_C_MARK,
1656};
1657
1658static const unsigned int scif3_clk_c_pins[] = {
1659 /* SCK */
1660 RCAR_GP_PIN(2, 24),
1661};
1662
1663static const unsigned int scif3_clk_c_mux[] = {
1664 SCK3_C_MARK,
1665};
1666
1667/* - SCIF4 ------------------------------------------------------------------ */
1668static const unsigned int scif4_data_a_pins[] = {
1669 /* RX, TX */
1670 RCAR_GP_PIN(1, 6), RCAR_GP_PIN(1, 7),
1671};
1672
1673static const unsigned int scif4_data_a_mux[] = {
1674 RX4_A_MARK, TX4_A_MARK,
1675};
1676
1677static const unsigned int scif4_clk_a_pins[] = {
1678 /* SCK */
1679 RCAR_GP_PIN(1, 5),
1680};
1681
1682static const unsigned int scif4_clk_a_mux[] = {
1683 SCK4_A_MARK,
1684};
1685
1686static const unsigned int scif4_ctrl_a_pins[] = {
1687 /* RTS, CTS */
1688 RCAR_GP_PIN(1, 4), RCAR_GP_PIN(1, 3),
1689};
1690
1691static const unsigned int scif4_ctrl_a_mux[] = {
1692 RTS4_N_TANS_A_MARK, CTS4_N_A_MARK,
1693};
1694
1695static const unsigned int scif4_data_b_pins[] = {
1696 /* RX, TX */
1697 RCAR_GP_PIN(0, 13), RCAR_GP_PIN(0, 12),
1698};
1699
1700static const unsigned int scif4_data_b_mux[] = {
1701 RX4_B_MARK, TX4_B_MARK,
1702};
1703
1704static const unsigned int scif4_clk_b_pins[] = {
1705 /* SCK */
1706 RCAR_GP_PIN(0, 8),
1707};
1708
1709static const unsigned int scif4_clk_b_mux[] = {
1710 SCK4_B_MARK,
1711};
1712
1713static const unsigned int scif4_data_c_pins[] = {
1714 /* RX, TX */
1715 RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
1716};
1717
1718static const unsigned int scif4_data_c_mux[] = {
1719 RX4_C_MARK, TX4_C_MARK,
1720};
1721
1722static const unsigned int scif4_ctrl_c_pins[] = {
1723 /* RTS, CTS */
1724 RCAR_GP_PIN(0, 1), RCAR_GP_PIN(0, 0),
1725};
1726
1727static const unsigned int scif4_ctrl_c_mux[] = {
1728 RTS4_N_TANS_C_MARK, CTS4_N_C_MARK,
1729};
1730
1731/* - SCIF5 ------------------------------------------------------------------ */
1732static const unsigned int scif5_data_a_pins[] = {
1733 /* RX, TX */
1734 RCAR_GP_PIN(1, 12), RCAR_GP_PIN(1, 9),
1735};
1736
1737static const unsigned int scif5_data_a_mux[] = {
1738 RX5_A_MARK, TX5_A_MARK,
1739};
1740
1741static const unsigned int scif5_clk_a_pins[] = {
1742 /* SCK */
1743 RCAR_GP_PIN(1, 13),
1744};
1745
1746static const unsigned int scif5_clk_a_mux[] = {
1747 SCK5_A_MARK,
1748};
1749
1750static const unsigned int scif5_data_b_pins[] = {
1751 /* RX, TX */
1752 RCAR_GP_PIN(2, 25), RCAR_GP_PIN(2, 24),
1753};
1754
1755static const unsigned int scif5_data_b_mux[] = {
1756 RX5_B_MARK, TX5_B_MARK,
1757};
1758
1759static const unsigned int scif5_data_c_pins[] = {
1760 /* RX, TX */
1761 RCAR_GP_PIN(0, 2), RCAR_GP_PIN(0, 3),
1762};
1763
1764static const unsigned int scif5_data_c_mux[] = {
1765 RX5_C_MARK, TX5_C_MARK,
1766};
1767
1768/* - SCIF Clock ------------------------------------------------------------- */
1769static const unsigned int scif_clk_a_pins[] = {
1770 /* SCIF_CLK */
1771 RCAR_GP_PIN(5, 3),
1772};
1773
1774static const unsigned int scif_clk_a_mux[] = {
1775 SCIF_CLK_A_MARK,
1776};
1777
1778static const unsigned int scif_clk_b_pins[] = {
1779 /* SCIF_CLK */
1780 RCAR_GP_PIN(5, 7),
1781};
1782
1783static const unsigned int scif_clk_b_mux[] = {
1784 SCIF_CLK_B_MARK,
1785};
1786
1787static const struct sh_pfc_pin_group pinmux_groups[] = {
1788 SH_PFC_PIN_GROUP(avb_link),
1789 SH_PFC_PIN_GROUP(avb_magic),
1790 SH_PFC_PIN_GROUP(avb_phy_int),
1791 SH_PFC_PIN_GROUP(avb_mii),
1792 SH_PFC_PIN_GROUP(avb_avtp_pps),
1793 SH_PFC_PIN_GROUP(avb_avtp_match_a),
1794 SH_PFC_PIN_GROUP(avb_avtp_capture_a),
1795 SH_PFC_PIN_GROUP(i2c1_a),
1796 SH_PFC_PIN_GROUP(i2c1_b),
1797 SH_PFC_PIN_GROUP(i2c1_c),
1798 SH_PFC_PIN_GROUP(i2c1_d),
1799 SH_PFC_PIN_GROUP(i2c2_a),
1800 SH_PFC_PIN_GROUP(i2c2_b),
1801 SH_PFC_PIN_GROUP(i2c2_c),
1802 SH_PFC_PIN_GROUP(i2c2_d),
1803 SH_PFC_PIN_GROUP(i2c2_e),
1804 SH_PFC_PIN_GROUP(i2c4),
1805 SH_PFC_PIN_GROUP(i2c5),
1806 SH_PFC_PIN_GROUP(i2c6_a),
1807 SH_PFC_PIN_GROUP(i2c6_b),
1808 SH_PFC_PIN_GROUP(i2c7_a),
1809 SH_PFC_PIN_GROUP(i2c7_b),
1810 SH_PFC_PIN_GROUP(scif0_data_a),
1811 SH_PFC_PIN_GROUP(scif0_clk_a),
1812 SH_PFC_PIN_GROUP(scif0_ctrl_a),
1813 SH_PFC_PIN_GROUP(scif0_data_b),
1814 SH_PFC_PIN_GROUP(scif0_clk_b),
1815 SH_PFC_PIN_GROUP(scif1_data),
1816 SH_PFC_PIN_GROUP(scif1_clk),
1817 SH_PFC_PIN_GROUP(scif1_ctrl),
1818 SH_PFC_PIN_GROUP(scif2_data_a),
1819 SH_PFC_PIN_GROUP(scif2_clk_a),
1820 SH_PFC_PIN_GROUP(scif2_data_b),
1821 SH_PFC_PIN_GROUP(scif3_data_a),
1822 SH_PFC_PIN_GROUP(scif3_clk_a),
1823 SH_PFC_PIN_GROUP(scif3_ctrl_a),
1824 SH_PFC_PIN_GROUP(scif3_data_b),
1825 SH_PFC_PIN_GROUP(scif3_data_c),
1826 SH_PFC_PIN_GROUP(scif3_clk_c),
1827 SH_PFC_PIN_GROUP(scif4_data_a),
1828 SH_PFC_PIN_GROUP(scif4_clk_a),
1829 SH_PFC_PIN_GROUP(scif4_ctrl_a),
1830 SH_PFC_PIN_GROUP(scif4_data_b),
1831 SH_PFC_PIN_GROUP(scif4_clk_b),
1832 SH_PFC_PIN_GROUP(scif4_data_c),
1833 SH_PFC_PIN_GROUP(scif4_ctrl_c),
1834 SH_PFC_PIN_GROUP(scif5_data_a),
1835 SH_PFC_PIN_GROUP(scif5_clk_a),
1836 SH_PFC_PIN_GROUP(scif5_data_b),
1837 SH_PFC_PIN_GROUP(scif5_data_c),
1838 SH_PFC_PIN_GROUP(scif_clk_a),
1839 SH_PFC_PIN_GROUP(scif_clk_b),
1840};
1841
1842static const char * const avb_groups[] = {
1843 "avb_link",
1844 "avb_magic",
1845 "avb_phy_int",
1846 "avb_mii",
1847 "avb_avtp_pps",
1848 "avb_avtp_match_a",
1849 "avb_avtp_capture_a",
1850};
1851
1852static const char * const i2c1_groups[] = {
1853 "i2c1_a",
1854 "i2c1_b",
1855 "i2c1_c",
1856 "i2c1_d",
1857};
1858
1859static const char * const i2c2_groups[] = {
1860 "i2c2_a",
1861 "i2c2_b",
1862 "i2c2_c",
1863 "i2c2_d",
1864 "i2c2_e",
1865};
1866
1867static const char * const i2c4_groups[] = {
1868 "i2c4",
1869};
1870
1871static const char * const i2c5_groups[] = {
1872 "i2c5",
1873};
1874
1875static const char * const i2c6_groups[] = {
1876 "i2c6_a",
1877 "i2c6_b",
1878};
1879
1880static const char * const i2c7_groups[] = {
1881 "i2c7_a",
1882 "i2c7_b",
1883};
1884
1885static const char * const scif0_groups[] = {
1886 "scif0_data_a",
1887 "scif0_clk_a",
1888 "scif0_ctrl_a",
1889 "scif0_data_b",
1890 "scif0_clk_b",
1891};
1892
1893static const char * const scif1_groups[] = {
1894 "scif1_data",
1895 "scif1_clk",
1896 "scif1_ctrl",
1897};
1898
1899static const char * const scif2_groups[] = {
1900 "scif2_data_a",
1901 "scif2_clk_a",
1902 "scif2_data_b",
1903};
1904
1905static const char * const scif3_groups[] = {
1906 "scif3_data_a",
1907 "scif3_clk_a",
1908 "scif3_ctrl_a",
1909 "scif3_data_b",
1910 "scif3_data_c",
1911 "scif3_clk_c",
1912};
1913
1914static const char * const scif4_groups[] = {
1915 "scif4_data_a",
1916 "scif4_clk_a",
1917 "scif4_ctrl_a",
1918 "scif4_data_b",
1919 "scif4_clk_b",
1920 "scif4_data_c",
1921 "scif4_ctrl_c",
1922};
1923
1924static const char * const scif5_groups[] = {
1925 "scif5_data_a",
1926 "scif5_clk_a",
1927 "scif5_data_b",
1928 "scif5_data_c",
1929};
1930
1931static const char * const scif_clk_groups[] = {
1932 "scif_clk_a",
1933 "scif_clk_b",
1934};
1935
1936static const struct sh_pfc_function pinmux_functions[] = {
1937 SH_PFC_FUNCTION(avb),
1938 SH_PFC_FUNCTION(i2c1),
1939 SH_PFC_FUNCTION(i2c2),
1940 SH_PFC_FUNCTION(i2c4),
1941 SH_PFC_FUNCTION(i2c5),
1942 SH_PFC_FUNCTION(i2c6),
1943 SH_PFC_FUNCTION(i2c7),
1944 SH_PFC_FUNCTION(scif0),
1945 SH_PFC_FUNCTION(scif1),
1946 SH_PFC_FUNCTION(scif2),
1947 SH_PFC_FUNCTION(scif3),
1948 SH_PFC_FUNCTION(scif4),
1949 SH_PFC_FUNCTION(scif5),
1950 SH_PFC_FUNCTION(scif_clk),
1951};
1952
1953static const struct pinmux_cfg_reg pinmux_config_regs[] = {
1954#define F_(x, y) FN_##y
1955#define FM(x) FN_##x
1956 { PINMUX_CFG_REG("GPSR0", 0xe6060100, 32, 1) {
1957 0, 0,
1958 0, 0,
1959 0, 0,
1960 0, 0,
1961 0, 0,
1962 0, 0,
1963 0, 0,
1964 0, 0,
1965 0, 0,
1966 0, 0,
1967 0, 0,
1968 0, 0,
1969 0, 0,
1970 0, 0,
1971 GP_0_17_FN, GPSR0_17,
1972 GP_0_16_FN, GPSR0_16,
1973 GP_0_15_FN, GPSR0_15,
1974 GP_0_14_FN, GPSR0_14,
1975 GP_0_13_FN, GPSR0_13,
1976 GP_0_12_FN, GPSR0_12,
1977 GP_0_11_FN, GPSR0_11,
1978 GP_0_10_FN, GPSR0_10,
1979 GP_0_9_FN, GPSR0_9,
1980 GP_0_8_FN, GPSR0_8,
1981 GP_0_7_FN, GPSR0_7,
1982 GP_0_6_FN, GPSR0_6,
1983 GP_0_5_FN, GPSR0_5,
1984 GP_0_4_FN, GPSR0_4,
1985 GP_0_3_FN, GPSR0_3,
1986 GP_0_2_FN, GPSR0_2,
1987 GP_0_1_FN, GPSR0_1,
1988 GP_0_0_FN, GPSR0_0, }
1989 },
1990 { PINMUX_CFG_REG("GPSR1", 0xe6060104, 32, 1) {
1991 0, 0,
1992 0, 0,
1993 0, 0,
1994 0, 0,
1995 0, 0,
1996 0, 0,
1997 0, 0,
1998 0, 0,
1999 0, 0,
2000 GP_1_22_FN, GPSR1_22,
2001 GP_1_21_FN, GPSR1_21,
2002 GP_1_20_FN, GPSR1_20,
2003 GP_1_19_FN, GPSR1_19,
2004 GP_1_18_FN, GPSR1_18,
2005 GP_1_17_FN, GPSR1_17,
2006 GP_1_16_FN, GPSR1_16,
2007 GP_1_15_FN, GPSR1_15,
2008 GP_1_14_FN, GPSR1_14,
2009 GP_1_13_FN, GPSR1_13,
2010 GP_1_12_FN, GPSR1_12,
2011 GP_1_11_FN, GPSR1_11,
2012 GP_1_10_FN, GPSR1_10,
2013 GP_1_9_FN, GPSR1_9,
2014 GP_1_8_FN, GPSR1_8,
2015 GP_1_7_FN, GPSR1_7,
2016 GP_1_6_FN, GPSR1_6,
2017 GP_1_5_FN, GPSR1_5,
2018 GP_1_4_FN, GPSR1_4,
2019 GP_1_3_FN, GPSR1_3,
2020 GP_1_2_FN, GPSR1_2,
2021 GP_1_1_FN, GPSR1_1,
2022 GP_1_0_FN, GPSR1_0, }
2023 },
2024 { PINMUX_CFG_REG("GPSR2", 0xe6060108, 32, 1) {
2025 0, 0,
2026 0, 0,
2027 0, 0,
2028 0, 0,
2029 0, 0,
2030 0, 0,
2031 GP_2_25_FN, GPSR2_25,
2032 GP_2_24_FN, GPSR2_24,
2033 GP_2_23_FN, GPSR2_23,
2034 GP_2_22_FN, GPSR2_22,
2035 GP_2_21_FN, GPSR2_21,
2036 GP_2_20_FN, GPSR2_20,
2037 GP_2_19_FN, GPSR2_19,
2038 GP_2_18_FN, GPSR2_18,
2039 GP_2_17_FN, GPSR2_17,
2040 GP_2_16_FN, GPSR2_16,
2041 GP_2_15_FN, GPSR2_15,
2042 GP_2_14_FN, GPSR2_14,
2043 GP_2_13_FN, GPSR2_13,
2044 GP_2_12_FN, GPSR2_12,
2045 GP_2_11_FN, GPSR2_11,
2046 GP_2_10_FN, GPSR2_10,
2047 GP_2_9_FN, GPSR2_9,
2048 GP_2_8_FN, GPSR2_8,
2049 GP_2_7_FN, GPSR2_7,
2050 GP_2_6_FN, GPSR2_6,
2051 GP_2_5_FN, GPSR2_5,
2052 GP_2_4_FN, GPSR2_4,
2053 GP_2_3_FN, GPSR2_3,
2054 GP_2_2_FN, GPSR2_2,
2055 GP_2_1_FN, GPSR2_1,
2056 GP_2_0_FN, GPSR2_0, }
2057 },
2058 { PINMUX_CFG_REG("GPSR3", 0xe606010c, 32, 1) {
2059 0, 0,
2060 0, 0,
2061 0, 0,
2062 0, 0,
2063 0, 0,
2064 0, 0,
2065 0, 0,
2066 0, 0,
2067 0, 0,
2068 0, 0,
2069 0, 0,
2070 0, 0,
2071 0, 0,
2072 0, 0,
2073 0, 0,
2074 0, 0,
2075 GP_3_15_FN, GPSR3_15,
2076 GP_3_14_FN, GPSR3_14,
2077 GP_3_13_FN, GPSR3_13,
2078 GP_3_12_FN, GPSR3_12,
2079 GP_3_11_FN, GPSR3_11,
2080 GP_3_10_FN, GPSR3_10,
2081 GP_3_9_FN, GPSR3_9,
2082 GP_3_8_FN, GPSR3_8,
2083 GP_3_7_FN, GPSR3_7,
2084 GP_3_6_FN, GPSR3_6,
2085 GP_3_5_FN, GPSR3_5,
2086 GP_3_4_FN, GPSR3_4,
2087 GP_3_3_FN, GPSR3_3,
2088 GP_3_2_FN, GPSR3_2,
2089 GP_3_1_FN, GPSR3_1,
2090 GP_3_0_FN, GPSR3_0, }
2091 },
2092 { PINMUX_CFG_REG("GPSR4", 0xe6060110, 32, 1) {
2093 0, 0,
2094 0, 0,
2095 0, 0,
2096 0, 0,
2097 0, 0,
2098 0, 0,
2099 0, 0,
2100 0, 0,
2101 0, 0,
2102 0, 0,
2103 0, 0,
2104 0, 0,
2105 0, 0,
2106 0, 0,
2107 0, 0,
2108 0, 0,
2109 0, 0,
2110 0, 0,
2111 0, 0,
2112 0, 0,
2113 0, 0,
2114 GP_4_10_FN, GPSR4_10,
2115 GP_4_9_FN, GPSR4_9,
2116 GP_4_8_FN, GPSR4_8,
2117 GP_4_7_FN, GPSR4_7,
2118 GP_4_6_FN, GPSR4_6,
2119 GP_4_5_FN, GPSR4_5,
2120 GP_4_4_FN, GPSR4_4,
2121 GP_4_3_FN, GPSR4_3,
2122 GP_4_2_FN, GPSR4_2,
2123 GP_4_1_FN, GPSR4_1,
2124 GP_4_0_FN, GPSR4_0, }
2125 },
2126 { PINMUX_CFG_REG("GPSR5", 0xe6060114, 32, 1) {
2127 0, 0,
2128 0, 0,
2129 0, 0,
2130 0, 0,
2131 0, 0,
2132 0, 0,
2133 0, 0,
2134 0, 0,
2135 0, 0,
2136 0, 0,
2137 0, 0,
2138 0, 0,
2139 GP_5_19_FN, GPSR5_19,
2140 GP_5_18_FN, GPSR5_18,
2141 GP_5_17_FN, GPSR5_17,
2142 GP_5_16_FN, GPSR5_16,
2143 GP_5_15_FN, GPSR5_15,
2144 GP_5_14_FN, GPSR5_14,
2145 GP_5_13_FN, GPSR5_13,
2146 GP_5_12_FN, GPSR5_12,
2147 GP_5_11_FN, GPSR5_11,
2148 GP_5_10_FN, GPSR5_10,
2149 GP_5_9_FN, GPSR5_9,
2150 GP_5_8_FN, GPSR5_8,
2151 GP_5_7_FN, GPSR5_7,
2152 GP_5_6_FN, GPSR5_6,
2153 GP_5_5_FN, GPSR5_5,
2154 GP_5_4_FN, GPSR5_4,
2155 GP_5_3_FN, GPSR5_3,
2156 GP_5_2_FN, GPSR5_2,
2157 GP_5_1_FN, GPSR5_1,
2158 GP_5_0_FN, GPSR5_0, }
2159 },
2160 { PINMUX_CFG_REG("GPSR6", 0xe6060118, 32, 1) {
2161 0, 0,
2162 0, 0,
2163 0, 0,
2164 0, 0,
2165 0, 0,
2166 0, 0,
2167 0, 0,
2168 0, 0,
2169 0, 0,
2170 0, 0,
2171 0, 0,
2172 0, 0,
2173 0, 0,
2174 0, 0,
2175 GP_6_17_FN, GPSR6_17,
2176 GP_6_16_FN, GPSR6_16,
2177 GP_6_15_FN, GPSR6_15,
2178 GP_6_14_FN, GPSR6_14,
2179 GP_6_13_FN, GPSR6_13,
2180 GP_6_12_FN, GPSR6_12,
2181 GP_6_11_FN, GPSR6_11,
2182 GP_6_10_FN, GPSR6_10,
2183 GP_6_9_FN, GPSR6_9,
2184 GP_6_8_FN, GPSR6_8,
2185 GP_6_7_FN, GPSR6_7,
2186 GP_6_6_FN, GPSR6_6,
2187 GP_6_5_FN, GPSR6_5,
2188 GP_6_4_FN, GPSR6_4,
2189 GP_6_3_FN, GPSR6_3,
2190 GP_6_2_FN, GPSR6_2,
2191 GP_6_1_FN, GPSR6_1,
2192 GP_6_0_FN, GPSR6_0, }
2193 },
2194#undef F_
2195#undef FM
2196
2197#define F_(x, y) x,
2198#define FM(x) FN_##x,
2199 { PINMUX_CFG_REG("IPSR0", 0xe6060200, 32, 4) {
2200 IP0_31_28
2201 IP0_27_24
2202 IP0_23_20
2203 IP0_19_16
2204 IP0_15_12
2205 IP0_11_8
2206 IP0_7_4
2207 IP0_3_0 }
2208 },
2209 { PINMUX_CFG_REG("IPSR1", 0xe6060204, 32, 4) {
2210 IP1_31_28
2211 IP1_27_24
2212 IP1_23_20
2213 IP1_19_16
2214 IP1_15_12
2215 IP1_11_8
2216 IP1_7_4
2217 IP1_3_0 }
2218 },
2219 { PINMUX_CFG_REG("IPSR2", 0xe6060208, 32, 4) {
2220 IP2_31_28
2221 IP2_27_24
2222 IP2_23_20
2223 IP2_19_16
2224 IP2_15_12
2225 IP2_11_8
2226 IP2_7_4
2227 IP2_3_0 }
2228 },
2229 { PINMUX_CFG_REG("IPSR3", 0xe606020c, 32, 4) {
2230 IP3_31_28
2231 IP3_27_24
2232 IP3_23_20
2233 IP3_19_16
2234 IP3_15_12
2235 IP3_11_8
2236 IP3_7_4
2237 IP3_3_0 }
2238 },
2239 { PINMUX_CFG_REG("IPSR4", 0xe6060210, 32, 4) {
2240 IP4_31_28
2241 IP4_27_24
2242 IP4_23_20
2243 IP4_19_16
2244 IP4_15_12
2245 IP4_11_8
2246 IP4_7_4
2247 IP4_3_0 }
2248 },
2249 { PINMUX_CFG_REG("IPSR5", 0xe6060214, 32, 4) {
2250 IP5_31_28
2251 IP5_27_24
2252 IP5_23_20
2253 IP5_19_16
2254 IP5_15_12
2255 IP5_11_8
2256 IP5_7_4
2257 IP5_3_0 }
2258 },
2259 { PINMUX_CFG_REG("IPSR6", 0xe6060218, 32, 4) {
2260 IP6_31_28
2261 IP6_27_24
2262 IP6_23_20
2263 IP6_19_16
2264 IP6_15_12
2265 IP6_11_8
2266 IP6_7_4
2267 IP6_3_0 }
2268 },
2269 { PINMUX_CFG_REG("IPSR7", 0xe606021c, 32, 4) {
2270 IP7_31_28
2271 IP7_27_24
2272 IP7_23_20
2273 IP7_19_16
2274 IP7_15_12
2275 IP7_11_8
2276 IP7_7_4
2277 IP7_3_0 }
2278 },
2279 { PINMUX_CFG_REG("IPSR8", 0xe6060220, 32, 4) {
2280 IP8_31_28
2281 IP8_27_24
2282 IP8_23_20
2283 IP8_19_16
2284 IP8_15_12
2285 IP8_11_8
2286 IP8_7_4
2287 IP8_3_0 }
2288 },
2289 { PINMUX_CFG_REG("IPSR9", 0xe6060224, 32, 4) {
2290 IP9_31_28
2291 IP9_27_24
2292 IP9_23_20
2293 IP9_19_16
2294 IP9_15_12
2295 IP9_11_8
2296 IP9_7_4
2297 IP9_3_0 }
2298 },
2299 { PINMUX_CFG_REG("IPSR10", 0xe6060228, 32, 4) {
2300 IP10_31_28
2301 IP10_27_24
2302 IP10_23_20
2303 IP10_19_16
2304 IP10_15_12
2305 IP10_11_8
2306 IP10_7_4
2307 IP10_3_0 }
2308 },
2309 { PINMUX_CFG_REG("IPSR11", 0xe606022c, 32, 4) {
2310 IP11_31_28
2311 IP11_27_24
2312 IP11_23_20
2313 IP11_19_16
2314 IP11_15_12
2315 IP11_11_8
2316 IP11_7_4
2317 IP11_3_0 }
2318 },
2319 { PINMUX_CFG_REG("IPSR12", 0xe6060230, 32, 4) {
2320 IP12_31_28
2321 IP12_27_24
2322 IP12_23_20
2323 IP12_19_16
2324 IP12_15_12
2325 IP12_11_8
2326 IP12_7_4
2327 IP12_3_0 }
2328 },
2329 { PINMUX_CFG_REG("IPSR13", 0xe6060234, 32, 4) {
2330 IP13_31_28
2331 IP13_27_24
2332 IP13_23_20
2333 IP13_19_16
2334 IP13_15_12
2335 IP13_11_8
2336 IP13_7_4
2337 IP13_3_0 }
2338 },
2339 { PINMUX_CFG_REG("IPSR14", 0xe6060238, 32, 4) {
2340 IP14_31_28
2341 IP14_27_24
2342 IP14_23_20
2343 IP14_19_16
2344 IP14_15_12
2345 IP14_11_8
2346 IP14_7_4
2347 IP14_3_0 }
2348 },
2349 { PINMUX_CFG_REG("IPSR15", 0xe606023c, 32, 4) {
2350 IP15_31_28
2351 IP15_27_24
2352 IP15_23_20
2353 IP15_19_16
2354 IP15_15_12
2355 IP15_11_8
2356 IP15_7_4
2357 IP15_3_0 }
2358 },
2359#undef F_
2360#undef FM
2361
2362#define F_(x, y) x,
2363#define FM(x) FN_##x,
2364 { PINMUX_CFG_REG_VAR("MOD_SEL0", 0xe6060500, 32,
2365 1, 2, 1, 2, 1, 1, 1, 1, 2, 3, 1,
2366 1, 1, 2, 2, 1, 1, 1, 2, 1, 1, 1, 2) {
2367 /* RESERVED 31 */
2368 0, 0,
2369 MOD_SEL0_30_29
2370 MOD_SEL0_28
2371 MOD_SEL0_27_26
2372 MOD_SEL0_25
2373 MOD_SEL0_24
2374 MOD_SEL0_23
2375 MOD_SEL0_22
2376 MOD_SEL0_21_20
2377 MOD_SEL0_19_18_17
2378 MOD_SEL0_16
2379 MOD_SEL0_15
2380 MOD_SEL0_14
2381 MOD_SEL0_13_12
2382 MOD_SEL0_11_10
2383 MOD_SEL0_9
2384 MOD_SEL0_8
2385 MOD_SEL0_7
2386 MOD_SEL0_6_5
2387 MOD_SEL0_4
2388 MOD_SEL0_3
2389 MOD_SEL0_2
2390 MOD_SEL0_1_0 }
2391 },
2392 { PINMUX_CFG_REG_VAR("MOD_SEL1", 0xe6060504, 32,
2393 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1,
2394 1, 2, 2, 2, 1, 1, 2, 1, 4) {
2395 MOD_SEL1_31
2396 MOD_SEL1_30
2397 MOD_SEL1_29
2398 MOD_SEL1_28
2399 /* RESERVED 27 */
2400 0, 0,
2401 MOD_SEL1_26
2402 MOD_SEL1_25
2403 MOD_SEL1_24_23_22
2404 MOD_SEL1_21_20_19
2405 MOD_SEL1_18
2406 MOD_SEL1_17
2407 MOD_SEL1_16
2408 MOD_SEL1_15
2409 MOD_SEL1_14_13
2410 MOD_SEL1_12_11
2411 MOD_SEL1_10_9
2412 MOD_SEL1_8
2413 MOD_SEL1_7
2414 MOD_SEL1_6_5
2415 MOD_SEL1_4
2416 /* RESERVED 3, 2, 1, 0 */
2417 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
2418 },
2419 { },
2420};
2421
2422static const struct pinmux_bias_reg pinmux_bias_regs[] = {
2423 { PINMUX_BIAS_REG("PUEN0", 0xe6060400, "PUD0", 0xe6060440) {
2424 [0] = RCAR_GP_PIN(2, 23), /* RD# */
2425 [1] = RCAR_GP_PIN(2, 22), /* BS# */
2426 [2] = RCAR_GP_PIN(2, 21), /* AVB_PHY_INT */
2427 [3] = PIN_NUMBER('P', 5), /* AVB_MDC */
2428 [4] = PIN_NUMBER('P', 4), /* AVB_MDIO */
2429 [5] = RCAR_GP_PIN(2, 20), /* AVB_TXCREFCLK */
2430 [6] = PIN_NUMBER('N', 6), /* AVB_TD3 */
2431 [7] = PIN_NUMBER('N', 5), /* AVB_TD2 */
2432 [8] = PIN_NUMBER('N', 3), /* AVB_TD1 */
2433 [9] = PIN_NUMBER('N', 2), /* AVB_TD0 */
2434 [10] = PIN_NUMBER('N', 1), /* AVB_TXC */
2435 [11] = PIN_NUMBER('P', 3), /* AVB_TX_CTL */
2436 [12] = RCAR_GP_PIN(2, 19), /* AVB_RD3 */
2437 [13] = RCAR_GP_PIN(2, 18), /* AVB_RD2 */
2438 [14] = RCAR_GP_PIN(2, 17), /* AVB_RD1 */
2439 [15] = RCAR_GP_PIN(2, 16), /* AVB_RD0 */
2440 [16] = RCAR_GP_PIN(2, 15), /* AVB_RXC */
2441 [17] = RCAR_GP_PIN(2, 14), /* AVB_RX_CTL */
2442 [18] = RCAR_GP_PIN(2, 13), /* RPC_RESET# */
2443 [19] = RCAR_GP_PIN(2, 12), /* RPC_INT# */
2444 [20] = RCAR_GP_PIN(2, 11), /* QSPI1_SSL */
2445 [21] = RCAR_GP_PIN(2, 10), /* QSPI1_IO3 */
2446 [22] = RCAR_GP_PIN(2, 9), /* QSPI1_IO2 */
2447 [23] = RCAR_GP_PIN(2, 8), /* QSPI1_MISO/IO1 */
2448 [24] = RCAR_GP_PIN(2, 7), /* QSPI1_MOSI/IO0 */
2449 [25] = RCAR_GP_PIN(2, 6), /* QSPI1_SPCLK */
2450 [26] = RCAR_GP_PIN(2, 5), /* QSPI0_SSL */
2451 [27] = RCAR_GP_PIN(2, 4), /* QSPI0_IO3 */
2452 [28] = RCAR_GP_PIN(2, 3), /* QSPI0_IO2 */
2453 [29] = RCAR_GP_PIN(2, 2), /* QSPI0_MISO/IO1 */
2454 [30] = RCAR_GP_PIN(2, 1), /* QSPI0_MOSI/IO0 */
2455 [31] = RCAR_GP_PIN(2, 0), /* QSPI0_SPCLK */
2456 } },
2457 { PINMUX_BIAS_REG("PUEN1", 0xe6060404, "PUD1", 0xe6060444) {
2458 [0] = RCAR_GP_PIN(0, 4), /* D4 */
2459 [1] = RCAR_GP_PIN(0, 3), /* D3 */
2460 [2] = RCAR_GP_PIN(0, 2), /* D2 */
2461 [3] = RCAR_GP_PIN(0, 1), /* D1 */
2462 [4] = RCAR_GP_PIN(0, 0), /* D0 */
2463 [5] = RCAR_GP_PIN(1, 22), /* WE0# */
2464 [6] = RCAR_GP_PIN(1, 21), /* CS0# */
2465 [7] = RCAR_GP_PIN(1, 20), /* CLKOUT */
2466 [8] = RCAR_GP_PIN(1, 19), /* A19 */
2467 [9] = RCAR_GP_PIN(1, 18), /* A18 */
2468 [10] = RCAR_GP_PIN(1, 17), /* A17 */
2469 [11] = RCAR_GP_PIN(1, 16), /* A16 */
2470 [12] = RCAR_GP_PIN(1, 15), /* A15 */
2471 [13] = RCAR_GP_PIN(1, 14), /* A14 */
2472 [14] = RCAR_GP_PIN(1, 13), /* A13 */
2473 [15] = RCAR_GP_PIN(1, 12), /* A12 */
2474 [16] = RCAR_GP_PIN(1, 11), /* A11 */
2475 [17] = RCAR_GP_PIN(1, 10), /* A10 */
2476 [18] = RCAR_GP_PIN(1, 9), /* A9 */
2477 [19] = RCAR_GP_PIN(1, 8), /* A8 */
2478 [20] = RCAR_GP_PIN(1, 7), /* A7 */
2479 [21] = RCAR_GP_PIN(1, 6), /* A6 */
2480 [22] = RCAR_GP_PIN(1, 5), /* A5 */
2481 [23] = RCAR_GP_PIN(1, 4), /* A4 */
2482 [24] = RCAR_GP_PIN(1, 3), /* A3 */
2483 [25] = RCAR_GP_PIN(1, 2), /* A2 */
2484 [26] = RCAR_GP_PIN(1, 1), /* A1 */
2485 [27] = RCAR_GP_PIN(1, 0), /* A0 */
2486 [28] = PIN_NONE,
2487 [29] = PIN_NONE,
2488 [30] = RCAR_GP_PIN(2, 25), /* PUEN_EX_WAIT0 */
2489 [31] = RCAR_GP_PIN(2, 24), /* PUEN_RD/WR# */
2490 } },
2491 { PINMUX_BIAS_REG("PUEN2", 0xe6060408, "PUD2", 0xe6060448) {
2492 [0] = RCAR_GP_PIN(3, 1), /* SD0_CMD */
2493 [1] = RCAR_GP_PIN(3, 0), /* SD0_CLK */
2494 [2] = PIN_NUMBER('H', 1), /* ASEBRK */
2495 [3] = PIN_NONE,
2496 [4] = PIN_NUMBER('G', 2), /* TDI */
2497 [5] = PIN_NUMBER('F', 3), /* TMS */
2498 [6] = PIN_NUMBER('F', 4), /* TCK */
2499 [7] = PIN_NUMBER('F', 1), /* TRST# */
2500 [8] = PIN_NONE,
2501 [9] = PIN_NONE,
2502 [10] = PIN_NONE,
2503 [11] = PIN_NONE,
2504 [12] = PIN_NONE,
2505 [13] = PIN_NONE,
2506 [14] = PIN_NONE,
2507 [15] = PIN_NUMBER('G', 3), /* FSCLKST# */
2508 [16] = RCAR_GP_PIN(0, 17), /* SDA4 */
2509 [17] = RCAR_GP_PIN(0, 16), /* SCL4 */
2510 [18] = PIN_NONE,
2511 [19] = PIN_NONE,
2512 [20] = PIN_A_NUMBER('D', 3), /* PRESETOUT# */
2513 [21] = RCAR_GP_PIN(0, 15), /* D15 */
2514 [22] = RCAR_GP_PIN(0, 14), /* D14 */
2515 [23] = RCAR_GP_PIN(0, 13), /* D13 */
2516 [24] = RCAR_GP_PIN(0, 12), /* D12 */
2517 [25] = RCAR_GP_PIN(0, 11), /* D11 */
2518 [26] = RCAR_GP_PIN(0, 10), /* D10 */
2519 [27] = RCAR_GP_PIN(0, 9), /* D9 */
2520 [28] = RCAR_GP_PIN(0, 8), /* D8 */
2521 [29] = RCAR_GP_PIN(0, 7), /* D7 */
2522 [30] = RCAR_GP_PIN(0, 6), /* D6 */
2523 [31] = RCAR_GP_PIN(0, 5), /* D5 */
2524 } },
2525 { PINMUX_BIAS_REG("PUEN3", 0xe606040c, "PUD3", 0xe606044c) {
2526 [0] = RCAR_GP_PIN(5, 0), /* SCK0_A */
2527 [1] = RCAR_GP_PIN(5, 4), /* RTS0#/TANS_A */
2528 [2] = RCAR_GP_PIN(5, 3), /* CTS0#_A */
2529 [3] = RCAR_GP_PIN(5, 2), /* TX0_A */
2530 [4] = RCAR_GP_PIN(5, 1), /* RX0_A */
2531 [5] = PIN_NONE,
2532 [6] = PIN_NONE,
2533 [7] = RCAR_GP_PIN(3, 15), /* SD1_WP */
2534 [8] = RCAR_GP_PIN(3, 14), /* SD1_CD */
2535 [9] = RCAR_GP_PIN(3, 13), /* SD0_WP */
2536 [10] = RCAR_GP_PIN(3, 12), /* SD0_CD */
2537 [11] = RCAR_GP_PIN(4, 10), /* SD3_DS */
2538 [12] = RCAR_GP_PIN(4, 9), /* SD3_DAT7 */
2539 [13] = RCAR_GP_PIN(4, 8), /* SD3_DAT6 */
2540 [14] = RCAR_GP_PIN(4, 7), /* SD3_DAT5 */
2541 [15] = RCAR_GP_PIN(4, 6), /* SD3_DAT4 */
2542 [16] = RCAR_GP_PIN(4, 5), /* SD3_DAT3 */
2543 [17] = RCAR_GP_PIN(4, 4), /* SD3_DAT2 */
2544 [18] = RCAR_GP_PIN(4, 3), /* SD3_DAT1 */
2545 [19] = RCAR_GP_PIN(4, 2), /* SD3_DAT0 */
2546 [20] = RCAR_GP_PIN(4, 1), /* SD3_CMD */
2547 [21] = RCAR_GP_PIN(4, 0), /* SD3_CLK */
2548 [22] = RCAR_GP_PIN(3, 11), /* SD1_DAT3 */
2549 [23] = RCAR_GP_PIN(3, 10), /* SD1_DAT2 */
2550 [24] = RCAR_GP_PIN(3, 9), /* SD1_DAT1 */
2551 [25] = RCAR_GP_PIN(3, 8), /* SD1_DAT0 */
2552 [26] = RCAR_GP_PIN(3, 7), /* SD1_CMD */
2553 [27] = RCAR_GP_PIN(3, 6), /* SD1_CLK */
2554 [28] = RCAR_GP_PIN(3, 5), /* SD0_DAT3 */
2555 [29] = RCAR_GP_PIN(3, 4), /* SD0_DAT2 */
2556 [30] = RCAR_GP_PIN(3, 3), /* SD0_DAT1 */
2557 [31] = RCAR_GP_PIN(3, 2), /* SD0_DAT0 */
2558 } },
2559 { PINMUX_BIAS_REG("PUEN4", 0xe6060410, "PUD4", 0xe6060450) {
2560 [0] = RCAR_GP_PIN(6, 8), /* AUDIO_CLKA */
2561 [1] = RCAR_GP_PIN(6, 16), /* SSI_SDATA6 */
2562 [2] = RCAR_GP_PIN(6, 15), /* SSI_WS6 */
2563 [3] = RCAR_GP_PIN(6, 14), /* SSI_SCK6 */
2564 [4] = RCAR_GP_PIN(6, 13), /* SSI_SDATA5 */
2565 [5] = RCAR_GP_PIN(6, 12), /* SSI_WS5 */
2566 [6] = RCAR_GP_PIN(6, 11), /* SSI_SCK5 */
2567 [7] = RCAR_GP_PIN(6, 10), /* SSI_SDATA4 */
2568 [8] = RCAR_GP_PIN(6, 7), /* SSI_SDATA3 */
2569 [9] = RCAR_GP_PIN(6, 6), /* SSI_WS349 */
2570 [10] = RCAR_GP_PIN(6, 5), /* SSI_SCK349 */
2571 [11] = RCAR_GP_PIN(6, 4), /* SSI_SDATA2 */
2572 [12] = RCAR_GP_PIN(6, 3), /* SSI_SDATA1 */
2573 [13] = RCAR_GP_PIN(6, 2), /* SSI_SDATA0 */
2574 [14] = RCAR_GP_PIN(6, 1), /* SSI_WS01239 */
2575 [15] = RCAR_GP_PIN(6, 0), /* SSI_SCK01239 */
2576 [16] = PIN_NUMBER('T', 21), /* MLB_REF */
2577 [17] = RCAR_GP_PIN(5, 19), /* MLB_DAT */
2578 [18] = RCAR_GP_PIN(5, 18), /* MLB_SIG */
2579 [19] = RCAR_GP_PIN(5, 17), /* MLB_CLK */
2580 [20] = RCAR_GP_PIN(5, 16), /* SSI_SDATA9 */
2581 [21] = RCAR_GP_PIN(5, 15), /* MSIOF0_SS2 */
2582 [22] = RCAR_GP_PIN(5, 14), /* MSIOF0_SS1 */
2583 [23] = RCAR_GP_PIN(5, 13), /* MSIOF0_SYNC */
2584 [24] = RCAR_GP_PIN(5, 12), /* MSIOF0_TXD */
2585 [25] = RCAR_GP_PIN(5, 11), /* MSIOF0_RXD */
2586 [26] = RCAR_GP_PIN(5, 10), /* MSIOF0_SCK */
2587 [27] = RCAR_GP_PIN(5, 9), /* RX2_A */
2588 [28] = RCAR_GP_PIN(5, 8), /* TX2_A */
2589 [29] = RCAR_GP_PIN(5, 7), /* SCK2_A */
2590 [30] = RCAR_GP_PIN(5, 6), /* TX1 */
2591 [31] = RCAR_GP_PIN(5, 5), /* RX1 */
2592 } },
2593 { PINMUX_BIAS_REG("PUEN5", 0xe6060414, "PUD5", 0xe6060454) {
2594 [0] = PIN_NONE,
2595 [1] = PIN_NONE,
2596 [2] = PIN_NONE,
2597 [3] = PIN_NONE,
2598 [4] = PIN_NONE,
2599 [5] = PIN_NONE,
2600 [6] = PIN_NONE,
2601 [7] = PIN_NONE,
2602 [8] = PIN_NONE,
2603 [9] = PIN_NONE,
2604 [10] = PIN_NONE,
2605 [11] = PIN_NONE,
2606 [12] = PIN_NONE,
2607 [13] = PIN_NONE,
2608 [14] = PIN_NONE,
2609 [15] = PIN_NONE,
2610 [16] = PIN_NONE,
2611 [17] = PIN_NONE,
2612 [18] = PIN_NONE,
2613 [19] = PIN_NONE,
2614 [20] = PIN_NONE,
2615 [21] = PIN_NONE,
2616 [22] = PIN_NONE,
2617 [23] = PIN_NONE,
2618 [24] = PIN_NONE,
2619 [25] = PIN_NONE,
2620 [26] = PIN_NONE,
2621 [27] = PIN_NONE,
2622 [28] = PIN_NONE,
2623 [29] = PIN_NONE,
2624 [30] = RCAR_GP_PIN(6, 9), /* PUEN_USB30_OVC */
2625 [31] = RCAR_GP_PIN(6, 17), /* PUEN_USB30_PWEN */
2626 } },
2627 { /* sentinel */ },
2628};
2629
2630static unsigned int r8a77990_pinmux_get_bias(struct sh_pfc *pfc,
2631 unsigned int pin)
2632{
2633 const struct pinmux_bias_reg *reg;
2634 unsigned int bit;
2635
2636 reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit);
2637 if (!reg)
2638 return PIN_CONFIG_BIAS_DISABLE;
2639
2640 if (!(sh_pfc_read(pfc, reg->puen) & BIT(bit)))
2641 return PIN_CONFIG_BIAS_DISABLE;
2642 else if (sh_pfc_read(pfc, reg->pud) & BIT(bit))
2643 return PIN_CONFIG_BIAS_PULL_UP;
2644 else
2645 return PIN_CONFIG_BIAS_PULL_DOWN;
2646}
2647
2648static void r8a77990_pinmux_set_bias(struct sh_pfc *pfc, unsigned int pin,
2649 unsigned int bias)
2650{
2651 const struct pinmux_bias_reg *reg;
2652 u32 enable, updown;
2653 unsigned int bit;
2654
2655 reg = sh_pfc_pin_to_bias_reg(pfc, pin, &bit);
2656 if (!reg)
2657 return;
2658
2659 enable = sh_pfc_read(pfc, reg->puen) & ~BIT(bit);
2660 if (bias != PIN_CONFIG_BIAS_DISABLE)
2661 enable |= BIT(bit);
2662
2663 updown = sh_pfc_read(pfc, reg->pud) & ~BIT(bit);
2664 if (bias == PIN_CONFIG_BIAS_PULL_UP)
2665 updown |= BIT(bit);
2666
2667 sh_pfc_write(pfc, reg->pud, updown);
2668 sh_pfc_write(pfc, reg->puen, enable);
2669}
2670
2671static const struct sh_pfc_soc_operations r8a77990_pinmux_ops = {
2672 .get_bias = r8a77990_pinmux_get_bias,
2673 .set_bias = r8a77990_pinmux_set_bias,
2674};
2675
2676const struct sh_pfc_soc_info r8a77990_pinmux_info = {
2677 .name = "r8a77990_pfc",
2678 .ops = &r8a77990_pinmux_ops,
2679 .unlock_reg = 0xe6060000, /* PMMR */
2680
2681 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2682
2683 .pins = pinmux_pins,
2684 .nr_pins = ARRAY_SIZE(pinmux_pins),
2685 .groups = pinmux_groups,
2686 .nr_groups = ARRAY_SIZE(pinmux_groups),
2687 .functions = pinmux_functions,
2688 .nr_functions = ARRAY_SIZE(pinmux_functions),
2689
2690 .cfg_regs = pinmux_config_regs,
2691 .bias_regs = pinmux_bias_regs,
2692
2693 .pinmux_data = pinmux_data,
2694 .pinmux_data_size = ARRAY_SIZE(pinmux_data),
2695};
diff --git a/drivers/pinctrl/sh-pfc/sh_pfc.h b/drivers/pinctrl/sh-pfc/sh_pfc.h
index 7fad897cd9f5..3d0b31636d6d 100644
--- a/drivers/pinctrl/sh-pfc/sh_pfc.h
+++ b/drivers/pinctrl/sh-pfc/sh_pfc.h
@@ -274,6 +274,7 @@ extern const struct sh_pfc_soc_info r8a73a4_pinmux_info;
274extern const struct sh_pfc_soc_info r8a7740_pinmux_info; 274extern const struct sh_pfc_soc_info r8a7740_pinmux_info;
275extern const struct sh_pfc_soc_info r8a7743_pinmux_info; 275extern const struct sh_pfc_soc_info r8a7743_pinmux_info;
276extern const struct sh_pfc_soc_info r8a7745_pinmux_info; 276extern const struct sh_pfc_soc_info r8a7745_pinmux_info;
277extern const struct sh_pfc_soc_info r8a77470_pinmux_info;
277extern const struct sh_pfc_soc_info r8a7778_pinmux_info; 278extern const struct sh_pfc_soc_info r8a7778_pinmux_info;
278extern const struct sh_pfc_soc_info r8a7779_pinmux_info; 279extern const struct sh_pfc_soc_info r8a7779_pinmux_info;
279extern const struct sh_pfc_soc_info r8a7790_pinmux_info; 280extern const struct sh_pfc_soc_info r8a7790_pinmux_info;
@@ -287,6 +288,7 @@ extern const struct sh_pfc_soc_info r8a7796_pinmux_info;
287extern const struct sh_pfc_soc_info r8a77965_pinmux_info; 288extern const struct sh_pfc_soc_info r8a77965_pinmux_info;
288extern const struct sh_pfc_soc_info r8a77970_pinmux_info; 289extern const struct sh_pfc_soc_info r8a77970_pinmux_info;
289extern const struct sh_pfc_soc_info r8a77980_pinmux_info; 290extern const struct sh_pfc_soc_info r8a77980_pinmux_info;
291extern const struct sh_pfc_soc_info r8a77990_pinmux_info;
290extern const struct sh_pfc_soc_info r8a77995_pinmux_info; 292extern const struct sh_pfc_soc_info r8a77995_pinmux_info;
291extern const struct sh_pfc_soc_info sh7203_pinmux_info; 293extern const struct sh_pfc_soc_info sh7203_pinmux_info;
292extern const struct sh_pfc_soc_info sh7264_pinmux_info; 294extern const struct sh_pfc_soc_info sh7264_pinmux_info;
@@ -415,9 +417,13 @@ extern const struct sh_pfc_soc_info shx3_pinmux_info;
415 PORT_GP_CFG_1(bank, 9, fn, sfx, cfg) 417 PORT_GP_CFG_1(bank, 9, fn, sfx, cfg)
416#define PORT_GP_10(bank, fn, sfx) PORT_GP_CFG_10(bank, fn, sfx, 0) 418#define PORT_GP_10(bank, fn, sfx) PORT_GP_CFG_10(bank, fn, sfx, 0)
417 419
418#define PORT_GP_CFG_12(bank, fn, sfx, cfg) \ 420#define PORT_GP_CFG_11(bank, fn, sfx, cfg) \
419 PORT_GP_CFG_10(bank, fn, sfx, cfg), \ 421 PORT_GP_CFG_10(bank, fn, sfx, cfg), \
420 PORT_GP_CFG_1(bank, 10, fn, sfx, cfg), \ 422 PORT_GP_CFG_1(bank, 10, fn, sfx, cfg)
423#define PORT_GP_11(bank, fn, sfx) PORT_GP_CFG_11(bank, fn, sfx, 0)
424
425#define PORT_GP_CFG_12(bank, fn, sfx, cfg) \
426 PORT_GP_CFG_11(bank, fn, sfx, cfg), \
421 PORT_GP_CFG_1(bank, 11, fn, sfx, cfg) 427 PORT_GP_CFG_1(bank, 11, fn, sfx, cfg)
422#define PORT_GP_12(bank, fn, sfx) PORT_GP_CFG_12(bank, fn, sfx, 0) 428#define PORT_GP_12(bank, fn, sfx) PORT_GP_CFG_12(bank, fn, sfx, 0)
423 429
diff --git a/drivers/pinctrl/sunxi/Kconfig b/drivers/pinctrl/sunxi/Kconfig
index 5de1f63b07bb..95282cda6cee 100644
--- a/drivers/pinctrl/sunxi/Kconfig
+++ b/drivers/pinctrl/sunxi/Kconfig
@@ -81,4 +81,8 @@ config PINCTRL_SUN50I_H6
81 def_bool ARM64 && ARCH_SUNXI 81 def_bool ARM64 && ARCH_SUNXI
82 select PINCTRL_SUNXI 82 select PINCTRL_SUNXI
83 83
84config PINCTRL_SUN50I_H6_R
85 def_bool ARM64 && ARCH_SUNXI
86 select PINCTRL_SUNXI
87
84endif 88endif
diff --git a/drivers/pinctrl/sunxi/Makefile b/drivers/pinctrl/sunxi/Makefile
index 3c4aec6611e9..adb8443aa55c 100644
--- a/drivers/pinctrl/sunxi/Makefile
+++ b/drivers/pinctrl/sunxi/Makefile
@@ -19,5 +19,6 @@ obj-$(CONFIG_PINCTRL_SUN8I_H3_R) += pinctrl-sun8i-h3-r.o
19obj-$(CONFIG_PINCTRL_SUN8I_V3S) += pinctrl-sun8i-v3s.o 19obj-$(CONFIG_PINCTRL_SUN8I_V3S) += pinctrl-sun8i-v3s.o
20obj-$(CONFIG_PINCTRL_SUN50I_H5) += pinctrl-sun50i-h5.o 20obj-$(CONFIG_PINCTRL_SUN50I_H5) += pinctrl-sun50i-h5.o
21obj-$(CONFIG_PINCTRL_SUN50I_H6) += pinctrl-sun50i-h6.o 21obj-$(CONFIG_PINCTRL_SUN50I_H6) += pinctrl-sun50i-h6.o
22obj-$(CONFIG_PINCTRL_SUN50I_H6_R) += pinctrl-sun50i-h6-r.o
22obj-$(CONFIG_PINCTRL_SUN9I_A80) += pinctrl-sun9i-a80.o 23obj-$(CONFIG_PINCTRL_SUN9I_A80) += pinctrl-sun9i-a80.o
23obj-$(CONFIG_PINCTRL_SUN9I_A80_R) += pinctrl-sun9i-a80-r.o 24obj-$(CONFIG_PINCTRL_SUN9I_A80_R) += pinctrl-sun9i-a80-r.o
diff --git a/drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c b/drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c
new file mode 100644
index 000000000000..4557e18d5989
--- /dev/null
+++ b/drivers/pinctrl/sunxi/pinctrl-sun50i-h6-r.c
@@ -0,0 +1,128 @@
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Allwinner H6 R_PIO pin controller driver
4 *
5 * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
6 *
7 * Based on pinctrl-sun6i-a31-r.c, which is:
8 * Copyright (C) 2014 Boris Brezillon
9 * Boris Brezillon <boris.brezillon@free-electrons.com>
10 * Copyright (C) 2014 Maxime Ripard
11 * Maxime Ripard <maxime.ripard@free-electrons.com>
12 */
13
14#include <linux/init.h>
15#include <linux/platform_device.h>
16#include <linux/of.h>
17#include <linux/of_device.h>
18#include <linux/pinctrl/pinctrl.h>
19#include <linux/reset.h>
20
21#include "pinctrl-sunxi.h"
22
23static const struct sunxi_desc_pin sun50i_h6_r_pins[] = {
24 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 0),
25 SUNXI_FUNCTION(0x0, "gpio_in"),
26 SUNXI_FUNCTION(0x1, "gpio_out"),
27 SUNXI_FUNCTION(0x3, "s_i2c"), /* SCK */
28 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PL_EINT0 */
29 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1),
30 SUNXI_FUNCTION(0x0, "gpio_in"),
31 SUNXI_FUNCTION(0x1, "gpio_out"),
32 SUNXI_FUNCTION(0x3, "s_i2c"), /* SDA */
33 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PL_EINT1 */
34 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 2),
35 SUNXI_FUNCTION(0x0, "gpio_in"),
36 SUNXI_FUNCTION(0x1, "gpio_out"),
37 SUNXI_FUNCTION(0x2, "s_uart"), /* TX */
38 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PL_EINT2 */
39 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 3),
40 SUNXI_FUNCTION(0x0, "gpio_in"),
41 SUNXI_FUNCTION(0x1, "gpio_out"),
42 SUNXI_FUNCTION(0x2, "s_uart"), /* RX */
43 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PL_EINT3 */
44 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 4),
45 SUNXI_FUNCTION(0x0, "gpio_in"),
46 SUNXI_FUNCTION(0x1, "gpio_out"),
47 SUNXI_FUNCTION(0x2, "s_jtag"), /* MS */
48 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PL_EINT4 */
49 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 5),
50 SUNXI_FUNCTION(0x0, "gpio_in"),
51 SUNXI_FUNCTION(0x1, "gpio_out"),
52 SUNXI_FUNCTION(0x2, "s_jtag"), /* CK */
53 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PL_EINT5 */
54 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 6),
55 SUNXI_FUNCTION(0x0, "gpio_in"),
56 SUNXI_FUNCTION(0x1, "gpio_out"),
57 SUNXI_FUNCTION(0x2, "s_jtag"), /* DO */
58 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PL_EINT6 */
59 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 7),
60 SUNXI_FUNCTION(0x0, "gpio_in"),
61 SUNXI_FUNCTION(0x1, "gpio_out"),
62 SUNXI_FUNCTION(0x2, "s_jtag"), /* DI */
63 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PL_EINT7 */
64 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 8),
65 SUNXI_FUNCTION(0x0, "gpio_in"),
66 SUNXI_FUNCTION(0x1, "gpio_out"),
67 SUNXI_FUNCTION(0x2, "s_pwm"),
68 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PL_EINT8 */
69 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 9),
70 SUNXI_FUNCTION(0x0, "gpio_in"),
71 SUNXI_FUNCTION(0x1, "gpio_out"),
72 SUNXI_FUNCTION(0x2, "s_cir_rx"),
73 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PL_EINT9 */
74 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 10),
75 SUNXI_FUNCTION(0x0, "gpio_in"),
76 SUNXI_FUNCTION(0x1, "gpio_out"),
77 SUNXI_FUNCTION(0x2, "s_w1"),
78 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PL_EINT10 */
79 /* Hole */
80 SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 0),
81 SUNXI_FUNCTION(0x0, "gpio_in"),
82 SUNXI_FUNCTION(0x1, "gpio_out"),
83 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)), /* PM_EINT0 */
84 SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 1),
85 SUNXI_FUNCTION(0x0, "gpio_in"),
86 SUNXI_FUNCTION(0x1, "gpio_out"),
87 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)), /* PM_EINT1 */
88 SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 2),
89 SUNXI_FUNCTION(0x0, "gpio_in"),
90 SUNXI_FUNCTION(0x1, "gpio_out"),
91 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2), /* PM_EINT2 */
92 SUNXI_FUNCTION(0x3, "1wire")),
93 SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 3),
94 SUNXI_FUNCTION(0x0, "gpio_in"),
95 SUNXI_FUNCTION(0x1, "gpio_out"),
96 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)), /* PM_EINT3 */
97 SUNXI_PIN(SUNXI_PINCTRL_PIN(M, 4),
98 SUNXI_FUNCTION(0x0, "gpio_in"),
99 SUNXI_FUNCTION(0x1, "gpio_out"),
100 SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)), /* PM_EINT4 */
101};
102
103static const struct sunxi_pinctrl_desc sun50i_h6_r_pinctrl_data = {
104 .pins = sun50i_h6_r_pins,
105 .npins = ARRAY_SIZE(sun50i_h6_r_pins),
106 .pin_base = PL_BASE,
107 .irq_banks = 2,
108};
109
110static int sun50i_h6_r_pinctrl_probe(struct platform_device *pdev)
111{
112 return sunxi_pinctrl_init(pdev,
113 &sun50i_h6_r_pinctrl_data);
114}
115
116static const struct of_device_id sun50i_h6_r_pinctrl_match[] = {
117 { .compatible = "allwinner,sun50i-h6-r-pinctrl", },
118 {}
119};
120
121static struct platform_driver sun50i_h6_r_pinctrl_driver = {
122 .probe = sun50i_h6_r_pinctrl_probe,
123 .driver = {
124 .name = "sun50i-h6-r-pinctrl",
125 .of_match_table = sun50i_h6_r_pinctrl_match,
126 },
127};
128builtin_platform_driver(sun50i_h6_r_pinctrl_driver);
diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c b/drivers/pinctrl/tegra/pinctrl-tegra.c
index 72c718e66ebb..49c7c1499bc3 100644
--- a/drivers/pinctrl/tegra/pinctrl-tegra.c
+++ b/drivers/pinctrl/tegra/pinctrl-tegra.c
@@ -33,17 +33,6 @@
33#include "../pinctrl-utils.h" 33#include "../pinctrl-utils.h"
34#include "pinctrl-tegra.h" 34#include "pinctrl-tegra.h"
35 35
36struct tegra_pmx {
37 struct device *dev;
38 struct pinctrl_dev *pctl;
39
40 const struct tegra_pinctrl_soc_data *soc;
41 const char **group_pins;
42
43 int nbanks;
44 void __iomem **regs;
45};
46
47static inline u32 pmx_readl(struct tegra_pmx *pmx, u32 bank, u32 reg) 36static inline u32 pmx_readl(struct tegra_pmx *pmx, u32 bank, u32 reg)
48{ 37{
49 return readl(pmx->regs[bank] + reg); 38 return readl(pmx->regs[bank] + reg);
diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.h b/drivers/pinctrl/tegra/pinctrl-tegra.h
index 33b17cb1471e..aa33c20766c4 100644
--- a/drivers/pinctrl/tegra/pinctrl-tegra.h
+++ b/drivers/pinctrl/tegra/pinctrl-tegra.h
@@ -16,6 +16,17 @@
16#ifndef __PINMUX_TEGRA_H__ 16#ifndef __PINMUX_TEGRA_H__
17#define __PINMUX_TEGRA_H__ 17#define __PINMUX_TEGRA_H__
18 18
19struct tegra_pmx {
20 struct device *dev;
21 struct pinctrl_dev *pctl;
22
23 const struct tegra_pinctrl_soc_data *soc;
24 const char **group_pins;
25
26 int nbanks;
27 void __iomem **regs;
28};
29
19enum tegra_pinconf_param { 30enum tegra_pinconf_param {
20 /* argument: tegra_pinconf_pull */ 31 /* argument: tegra_pinconf_pull */
21 TEGRA_PINCONF_PARAM_PULL, 32 TEGRA_PINCONF_PARAM_PULL,
diff --git a/drivers/pinctrl/tegra/pinctrl-tegra20.c b/drivers/pinctrl/tegra/pinctrl-tegra20.c
index 7e38ee9bae78..b6dd939d32cc 100644
--- a/drivers/pinctrl/tegra/pinctrl-tegra20.c
+++ b/drivers/pinctrl/tegra/pinctrl-tegra20.c
@@ -19,6 +19,7 @@
19 * more details. 19 * more details.
20 */ 20 */
21 21
22#include <linux/clk-provider.h>
22#include <linux/init.h> 23#include <linux/init.h>
23#include <linux/of.h> 24#include <linux/of.h>
24#include <linux/platform_device.h> 25#include <linux/platform_device.h>
@@ -2231,9 +2232,36 @@ static const struct tegra_pinctrl_soc_data tegra20_pinctrl = {
2231 .drvtype_in_mux = false, 2232 .drvtype_in_mux = false,
2232}; 2233};
2233 2234
2235static const char *cdev1_parents[] = {
2236 "dev1_osc_div", "pll_a_out0", "pll_m_out1", "audio",
2237};
2238
2239static const char *cdev2_parents[] = {
2240 "dev2_osc_div", "hclk", "pclk", "pll_p_out4",
2241};
2242
2243static void tegra20_pinctrl_register_clock_muxes(struct platform_device *pdev)
2244{
2245 struct tegra_pmx *pmx = platform_get_drvdata(pdev);
2246
2247 clk_register_mux(NULL, "cdev1_mux", cdev1_parents, 4, 0,
2248 pmx->regs[1] + 0x8, 2, 2, CLK_MUX_READ_ONLY, NULL);
2249
2250 clk_register_mux(NULL, "cdev2_mux", cdev2_parents, 4, 0,
2251 pmx->regs[1] + 0x8, 4, 2, CLK_MUX_READ_ONLY, NULL);
2252}
2253
2234static int tegra20_pinctrl_probe(struct platform_device *pdev) 2254static int tegra20_pinctrl_probe(struct platform_device *pdev)
2235{ 2255{
2236 return tegra_pinctrl_probe(pdev, &tegra20_pinctrl); 2256 int err;
2257
2258 err = tegra_pinctrl_probe(pdev, &tegra20_pinctrl);
2259 if (err)
2260 return err;
2261
2262 tegra20_pinctrl_register_clock_muxes(pdev);
2263
2264 return 0;
2237} 2265}
2238 2266
2239static const struct of_device_id tegra20_pinctrl_of_match[] = { 2267static const struct of_device_id tegra20_pinctrl_of_match[] = {
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
index 0976fbfecd50..58825f68b58b 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld11.c
@@ -481,6 +481,31 @@ static const int emmc_dat8_muxvals[] = {0, 0, 0, 0};
481static const unsigned ether_rmii_pins[] = {6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 481static const unsigned ether_rmii_pins[] = {6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
482 16, 17}; 482 16, 17};
483static const int ether_rmii_muxvals[] = {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}; 483static const int ether_rmii_muxvals[] = {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4};
484static const unsigned hscin0_ci_pins[] = {102, 103, 104, 105, 106, 107, 108,
485 109, 110, 111, 112};
486static const int hscin0_ci_muxvals[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
487static const unsigned hscin0_p_pins[] = {102, 103, 104, 105, 106, 107, 108, 109,
488 110, 111, 112};
489static const int hscin0_p_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
490static const unsigned hscin0_s_pins[] = {116, 117, 118, 119};
491static const int hscin0_s_muxvals[] = {3, 3, 3, 3};
492static const unsigned hscin1_p_pins[] = {124, 125, 126, 127, 128, 129, 130, 131,
493 132, 133, 134};
494static const int hscin1_p_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
495static const unsigned hscin1_s_pins[] = {120, 121, 122, 123};
496static const int hscin1_s_muxvals[] = {3, 3, 3, 3};
497static const unsigned hscin2_s_pins[] = {124, 125, 126, 127};
498static const int hscin2_s_muxvals[] = {3, 3, 3, 3};
499static const unsigned hscout0_ci_pins[] = {113, 114, 115, 116, 117, 118, 119,
500 120, 121, 122, 123};
501static const int hscout0_ci_muxvals[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
502static const unsigned hscout0_p_pins[] = {113, 114, 115, 116, 117, 118, 119,
503 120, 121, 122, 123};
504static const int hscout0_p_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
505static const unsigned hscout0_s_pins[] = {116, 117, 118, 119};
506static const int hscout0_s_muxvals[] = {4, 4, 4, 4};
507static const unsigned hscout1_s_pins[] = {120, 121, 122, 123};
508static const int hscout1_s_muxvals[] = {4, 4, 4, 4};
484static const unsigned i2c0_pins[] = {63, 64}; 509static const unsigned i2c0_pins[] = {63, 64};
485static const int i2c0_muxvals[] = {0, 0}; 510static const int i2c0_muxvals[] = {0, 0};
486static const unsigned i2c1_pins[] = {65, 66}; 511static const unsigned i2c1_pins[] = {65, 66};
@@ -556,6 +581,16 @@ static const struct uniphier_pinctrl_group uniphier_ld11_groups[] = {
556 UNIPHIER_PINCTRL_GROUP(emmc), 581 UNIPHIER_PINCTRL_GROUP(emmc),
557 UNIPHIER_PINCTRL_GROUP(emmc_dat8), 582 UNIPHIER_PINCTRL_GROUP(emmc_dat8),
558 UNIPHIER_PINCTRL_GROUP(ether_rmii), 583 UNIPHIER_PINCTRL_GROUP(ether_rmii),
584 UNIPHIER_PINCTRL_GROUP(hscin0_ci),
585 UNIPHIER_PINCTRL_GROUP(hscin0_p),
586 UNIPHIER_PINCTRL_GROUP(hscin0_s),
587 UNIPHIER_PINCTRL_GROUP(hscin1_p),
588 UNIPHIER_PINCTRL_GROUP(hscin1_s),
589 UNIPHIER_PINCTRL_GROUP(hscin2_s),
590 UNIPHIER_PINCTRL_GROUP(hscout0_ci),
591 UNIPHIER_PINCTRL_GROUP(hscout0_p),
592 UNIPHIER_PINCTRL_GROUP(hscout0_s),
593 UNIPHIER_PINCTRL_GROUP(hscout1_s),
559 UNIPHIER_PINCTRL_GROUP(i2c0), 594 UNIPHIER_PINCTRL_GROUP(i2c0),
560 UNIPHIER_PINCTRL_GROUP(i2c1), 595 UNIPHIER_PINCTRL_GROUP(i2c1),
561 UNIPHIER_PINCTRL_GROUP(i2c3), 596 UNIPHIER_PINCTRL_GROUP(i2c3),
@@ -583,6 +618,15 @@ static const char * const aout1_groups[] = {"aout1"};
583static const char * const aoutiec1_groups[] = {"aoutiec1"}; 618static const char * const aoutiec1_groups[] = {"aoutiec1"};
584static const char * const emmc_groups[] = {"emmc", "emmc_dat8"}; 619static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
585static const char * const ether_rmii_groups[] = {"ether_rmii"}; 620static const char * const ether_rmii_groups[] = {"ether_rmii"};
621static const char * const hscin0_groups[] = {"hscin0_ci",
622 "hscin0_p",
623 "hscin0_s"};
624static const char * const hscin1_groups[] = {"hscin1_p", "hscin1_s"};
625static const char * const hscin2_groups[] = {"hscin2_s"};
626static const char * const hscout0_groups[] = {"hscout0_ci",
627 "hscout0_p",
628 "hscout0_s"};
629static const char * const hscout1_groups[] = {"hscout1_s"};
586static const char * const i2c0_groups[] = {"i2c0"}; 630static const char * const i2c0_groups[] = {"i2c0"};
587static const char * const i2c1_groups[] = {"i2c1"}; 631static const char * const i2c1_groups[] = {"i2c1"};
588static const char * const i2c3_groups[] = {"i2c3"}; 632static const char * const i2c3_groups[] = {"i2c3"};
@@ -603,6 +647,11 @@ static const struct uniphier_pinmux_function uniphier_ld11_functions[] = {
603 UNIPHIER_PINMUX_FUNCTION(aoutiec1), 647 UNIPHIER_PINMUX_FUNCTION(aoutiec1),
604 UNIPHIER_PINMUX_FUNCTION(emmc), 648 UNIPHIER_PINMUX_FUNCTION(emmc),
605 UNIPHIER_PINMUX_FUNCTION(ether_rmii), 649 UNIPHIER_PINMUX_FUNCTION(ether_rmii),
650 UNIPHIER_PINMUX_FUNCTION(hscin0),
651 UNIPHIER_PINMUX_FUNCTION(hscin1),
652 UNIPHIER_PINMUX_FUNCTION(hscin2),
653 UNIPHIER_PINMUX_FUNCTION(hscout0),
654 UNIPHIER_PINMUX_FUNCTION(hscout1),
606 UNIPHIER_PINMUX_FUNCTION(i2c0), 655 UNIPHIER_PINMUX_FUNCTION(i2c0),
607 UNIPHIER_PINMUX_FUNCTION(i2c1), 656 UNIPHIER_PINMUX_FUNCTION(i2c1),
608 UNIPHIER_PINMUX_FUNCTION(i2c3), 657 UNIPHIER_PINMUX_FUNCTION(i2c3),
diff --git a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
index bf8f0c3bea5e..9f449b35e300 100644
--- a/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
+++ b/drivers/pinctrl/uniphier/pinctrl-uniphier-ld20.c
@@ -566,6 +566,33 @@ static const int ether_rgmii_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
566static const unsigned ether_rmii_pins[] = {30, 31, 32, 33, 34, 35, 36, 37, 39, 566static const unsigned ether_rmii_pins[] = {30, 31, 32, 33, 34, 35, 36, 37, 39,
567 41, 42, 45}; 567 41, 42, 45};
568static const int ether_rmii_muxvals[] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1}; 568static const int ether_rmii_muxvals[] = {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1};
569static const unsigned hscin0_ci_pins[] = {102, 103, 104, 105, 106, 107, 108,
570 109, 110, 111, 112};
571static const int hscin0_ci_muxvals[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
572static const unsigned hscin0_p_pins[] = {102, 103, 104, 105, 106, 107, 108, 109,
573 110, 111, 112};
574static const int hscin0_p_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
575static const unsigned hscin0_s_pins[] = {116, 117, 118, 119};
576static const int hscin0_s_muxvals[] = {3, 3, 3, 3};
577static const unsigned hscin1_p_pins[] = {124, 125, 126, 127, 128, 129, 130, 131,
578 132, 133, 134};
579static const int hscin1_p_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
580static const unsigned hscin1_s_pins[] = {120, 121, 122, 123};
581static const int hscin1_s_muxvals[] = {3, 3, 3, 3};
582static const unsigned hscin2_s_pins[] = {124, 125, 126, 127};
583static const int hscin2_s_muxvals[] = {3, 3, 3, 3};
584static const unsigned hscin3_s_pins[] = {129, 130, 131, 132};
585static const int hscin3_s_muxvals[] = {3, 3, 3, 3};
586static const unsigned hscout0_ci_pins[] = {113, 114, 115, 116, 117, 118, 119,
587 120, 121, 122, 123};
588static const int hscout0_ci_muxvals[] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
589static const unsigned hscout0_p_pins[] = {113, 114, 115, 116, 117, 118, 119,
590 120, 121, 122, 123};
591static const int hscout0_p_muxvals[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
592static const unsigned hscout0_s_pins[] = {116, 117, 118, 119};
593static const int hscout0_s_muxvals[] = {4, 4, 4, 4};
594static const unsigned hscout1_s_pins[] = {120, 121, 122, 123};
595static const int hscout1_s_muxvals[] = {4, 4, 4, 4};
569static const unsigned i2c0_pins[] = {63, 64}; 596static const unsigned i2c0_pins[] = {63, 64};
570static const int i2c0_muxvals[] = {0, 0}; 597static const int i2c0_muxvals[] = {0, 0};
571static const unsigned i2c1_pins[] = {65, 66}; 598static const unsigned i2c1_pins[] = {65, 66};
@@ -641,6 +668,17 @@ static const struct uniphier_pinctrl_group uniphier_ld20_groups[] = {
641 UNIPHIER_PINCTRL_GROUP(emmc_dat8), 668 UNIPHIER_PINCTRL_GROUP(emmc_dat8),
642 UNIPHIER_PINCTRL_GROUP(ether_rgmii), 669 UNIPHIER_PINCTRL_GROUP(ether_rgmii),
643 UNIPHIER_PINCTRL_GROUP(ether_rmii), 670 UNIPHIER_PINCTRL_GROUP(ether_rmii),
671 UNIPHIER_PINCTRL_GROUP(hscin0_ci),
672 UNIPHIER_PINCTRL_GROUP(hscin0_p),
673 UNIPHIER_PINCTRL_GROUP(hscin0_s),
674 UNIPHIER_PINCTRL_GROUP(hscin1_p),
675 UNIPHIER_PINCTRL_GROUP(hscin1_s),
676 UNIPHIER_PINCTRL_GROUP(hscin2_s),
677 UNIPHIER_PINCTRL_GROUP(hscin3_s),
678 UNIPHIER_PINCTRL_GROUP(hscout0_ci),
679 UNIPHIER_PINCTRL_GROUP(hscout0_p),
680 UNIPHIER_PINCTRL_GROUP(hscout0_s),
681 UNIPHIER_PINCTRL_GROUP(hscout1_s),
644 UNIPHIER_PINCTRL_GROUP(i2c0), 682 UNIPHIER_PINCTRL_GROUP(i2c0),
645 UNIPHIER_PINCTRL_GROUP(i2c1), 683 UNIPHIER_PINCTRL_GROUP(i2c1),
646 UNIPHIER_PINCTRL_GROUP(i2c3), 684 UNIPHIER_PINCTRL_GROUP(i2c3),
@@ -668,6 +706,16 @@ static const char * const aoutiec1_groups[] = {"aoutiec1"};
668static const char * const emmc_groups[] = {"emmc", "emmc_dat8"}; 706static const char * const emmc_groups[] = {"emmc", "emmc_dat8"};
669static const char * const ether_rgmii_groups[] = {"ether_rgmii"}; 707static const char * const ether_rgmii_groups[] = {"ether_rgmii"};
670static const char * const ether_rmii_groups[] = {"ether_rmii"}; 708static const char * const ether_rmii_groups[] = {"ether_rmii"};
709static const char * const hscin0_groups[] = {"hscin0_ci",
710 "hscin0_p",
711 "hscin0_s"};
712static const char * const hscin1_groups[] = {"hscin1_p", "hscin1_s"};
713static const char * const hscin2_groups[] = {"hscin2_s"};
714static const char * const hscin3_groups[] = {"hscin3_s"};
715static const char * const hscout0_groups[] = {"hscout0_ci",
716 "hscout0_p",
717 "hscout0_s"};
718static const char * const hscout1_groups[] = {"hscout1_s"};
671static const char * const i2c0_groups[] = {"i2c0"}; 719static const char * const i2c0_groups[] = {"i2c0"};
672static const char * const i2c1_groups[] = {"i2c1"}; 720static const char * const i2c1_groups[] = {"i2c1"};
673static const char * const i2c3_groups[] = {"i2c3"}; 721static const char * const i2c3_groups[] = {"i2c3"};
@@ -691,6 +739,12 @@ static const struct uniphier_pinmux_function uniphier_ld20_functions[] = {
691 UNIPHIER_PINMUX_FUNCTION(emmc), 739 UNIPHIER_PINMUX_FUNCTION(emmc),
692 UNIPHIER_PINMUX_FUNCTION(ether_rgmii), 740 UNIPHIER_PINMUX_FUNCTION(ether_rgmii),
693 UNIPHIER_PINMUX_FUNCTION(ether_rmii), 741 UNIPHIER_PINMUX_FUNCTION(ether_rmii),
742 UNIPHIER_PINMUX_FUNCTION(hscin0),
743 UNIPHIER_PINMUX_FUNCTION(hscin1),
744 UNIPHIER_PINMUX_FUNCTION(hscin2),
745 UNIPHIER_PINMUX_FUNCTION(hscin3),
746 UNIPHIER_PINMUX_FUNCTION(hscout0),
747 UNIPHIER_PINMUX_FUNCTION(hscout1),
694 UNIPHIER_PINMUX_FUNCTION(i2c0), 748 UNIPHIER_PINMUX_FUNCTION(i2c0),
695 UNIPHIER_PINMUX_FUNCTION(i2c1), 749 UNIPHIER_PINMUX_FUNCTION(i2c1),
696 UNIPHIER_PINMUX_FUNCTION(i2c3), 750 UNIPHIER_PINMUX_FUNCTION(i2c3),