1 From d59fe652e3674e98caa688b4ddc9308007267adc Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Mon, 19 Aug 2013 13:49:52 +0200
4 Subject: [PATCH] pinctrl: ralink; add pinctrl driver
6 Signed-off-by: John Crispin <blogic@openwrt.org>
8 arch/mips/Kconfig | 2 +
9 arch/mips/ralink/common.h | 21 +--
10 arch/mips/ralink/dts/mt7620a.dtsi | 7 +
11 drivers/pinctrl/Kconfig | 5 +
12 drivers/pinctrl/Makefile | 1 +
13 drivers/pinctrl/pinctrl-rt2880.c | 368 +++++++++++++++++++++++++++++++++++++
14 6 files changed, 385 insertions(+), 19 deletions(-)
15 create mode 100644 drivers/pinctrl/pinctrl-rt2880.c
17 --- a/arch/mips/Kconfig
18 +++ b/arch/mips/Kconfig
19 @@ -446,6 +446,8 @@ config RALINK
20 select HAVE_MACH_CLKDEV
22 select ARCH_REQUIRE_GPIOLIB
24 + select PINCTRL_RT2880
27 bool "SGI IP22 (Indy/Indigo2)"
28 --- a/drivers/pinctrl/Kconfig
29 +++ b/drivers/pinctrl/Kconfig
30 @@ -114,6 +114,11 @@ config PINCTRL_LANTIQ
34 +config PINCTRL_RT2880
42 --- a/drivers/pinctrl/Makefile
43 +++ b/drivers/pinctrl/Makefile
44 @@ -45,6 +45,7 @@ obj-$(CONFIG_PINCTRL_EXYNOS5440) += pinc
45 obj-$(CONFIG_PINCTRL_S3C64XX) += pinctrl-s3c64xx.o
46 obj-$(CONFIG_PINCTRL_XWAY) += pinctrl-xway.o
47 obj-$(CONFIG_PINCTRL_LANTIQ) += pinctrl-lantiq.o
48 +obj-$(CONFIG_PINCTRL_RT2880) += pinctrl-rt2880.o
50 obj-$(CONFIG_PLAT_ORION) += mvebu/
51 obj-$(CONFIG_ARCH_SHMOBILE) += sh-pfc/
53 +++ b/drivers/pinctrl/pinctrl-rt2880.c
56 + * linux/drivers/pinctrl/pinctrl-rt2880.c
58 + * This program is free software; you can redistribute it and/or modify
59 + * it under the terms of the GNU General Public License version 2 as
60 + * publishhed by the Free Software Foundation.
62 + * Copyright (C) 2013 John Crispin <blogic@openwrt.org>
65 +#include <linux/module.h>
66 +#include <linux/device.h>
67 +#include <linux/io.h>
68 +#include <linux/platform_device.h>
69 +#include <linux/slab.h>
70 +#include <linux/of.h>
71 +#include <linux/pinctrl/pinctrl.h>
72 +#include <linux/pinctrl/pinconf.h>
73 +#include <linux/pinctrl/pinmux.h>
74 +#include <linux/pinctrl/consumer.h>
75 +#include <linux/pinctrl/machine.h>
77 +#include <asm/mach-ralink/ralink_regs.h>
78 +#include <asm/mach-ralink/pinmux.h>
79 +#include <asm/mach-ralink/mt7620.h>
83 +#define SYSC_REG_GPIO_MODE 0x60
88 + struct pinctrl_pin_desc *pads;
89 + struct pinctrl_desc *desc;
91 + struct rt2880_pmx_func **func;
94 + struct rt2880_pmx_group *groups;
95 + const char **group_names;
102 +struct rt2880_pmx_group *rt2880_pinmux_data = NULL;
104 +static int rt2880_get_group_count(struct pinctrl_dev *pctrldev)
106 + struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
108 + return p->group_count;
111 +static const char *rt2880_get_group_name(struct pinctrl_dev *pctrldev,
114 + struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
116 + if (group >= p->group_count)
119 + return p->group_names[group];
122 +static int rt2880_get_group_pins(struct pinctrl_dev *pctrldev,
124 + const unsigned **pins,
125 + unsigned *num_pins)
127 + struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
129 + if (group >= p->group_count)
132 + *pins = p->groups[group].func[0].pins;
133 + *num_pins = p->groups[group].func[0].pin_count;
138 +static void rt2880_pinctrl_dt_free_map(struct pinctrl_dev *pctrldev,
139 + struct pinctrl_map *map, unsigned num_maps)
143 + for (i = 0; i < num_maps; i++)
144 + if (map[i].type == PIN_MAP_TYPE_CONFIGS_PIN ||
145 + map[i].type == PIN_MAP_TYPE_CONFIGS_GROUP)
146 + kfree(map[i].data.configs.configs);
150 +static void rt2880_pinctrl_pin_dbg_show(struct pinctrl_dev *pctrldev,
151 + struct seq_file *s,
154 + seq_printf(s, "ralink pio");
157 +static void rt2880_pinctrl_dt_subnode_to_map(struct pinctrl_dev *pctrldev,
158 + struct device_node *np,
159 + struct pinctrl_map **map)
161 + const char *function;
162 + int func = of_property_read_string(np, "ralink,function", &function);
163 + int grps = of_property_count_strings(np, "ralink,group");
169 + for (i = 0; i < grps; i++) {
172 + of_property_read_string_index(np, "ralink,group", i, &group);
174 + (*map)->type = PIN_MAP_TYPE_MUX_GROUP;
175 + (*map)->name = function;
176 + (*map)->data.mux.group = group;
177 + (*map)->data.mux.function = function;
182 +static int rt2880_pinctrl_dt_node_to_map(struct pinctrl_dev *pctrldev,
183 + struct device_node *np_config,
184 + struct pinctrl_map **map,
185 + unsigned *num_maps)
188 + struct pinctrl_map *tmp;
189 + struct device_node *np;
191 + for_each_child_of_node(np_config, np) {
192 + int ret = of_property_count_strings(np, "ralink,group");
201 + *map = kzalloc(max_maps * sizeof(struct pinctrl_map), GFP_KERNEL);
207 + for_each_child_of_node(np_config, np)
208 + rt2880_pinctrl_dt_subnode_to_map(pctrldev, np, &tmp);
209 + *num_maps = max_maps;
214 +static const struct pinctrl_ops rt2880_pctrl_ops = {
215 + .get_groups_count = rt2880_get_group_count,
216 + .get_group_name = rt2880_get_group_name,
217 + .get_group_pins = rt2880_get_group_pins,
218 + .pin_dbg_show = rt2880_pinctrl_pin_dbg_show,
219 + .dt_node_to_map = rt2880_pinctrl_dt_node_to_map,
220 + .dt_free_map = rt2880_pinctrl_dt_free_map,
223 +static int rt2880_pmx_func_count(struct pinctrl_dev *pctrldev)
225 + struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
227 + return p->func_count;
230 +static const char *rt2880_pmx_func_name(struct pinctrl_dev *pctrldev,
233 + struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
235 + return p->func[func]->name;
238 +static int rt2880_pmx_group_get_groups(struct pinctrl_dev *pctrldev,
240 + const char * const **groups,
241 + unsigned * const num_groups)
243 + struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
245 + if (p->func[func]->group_count == 1)
246 + *groups = &p->group_names[p->func[func]->groups[0]];
248 + *groups = p->group_names;
250 + *num_groups = p->func[func]->group_count;
255 +static int rt2880_pmx_group_enable(struct pinctrl_dev *pctrldev,
259 + struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
262 + /* dont allow double use */
263 + if (p->groups[group].enabled) {
264 + dev_err(p->dev, "%s is already enabled\n", p->groups[group].name);
268 + p->groups[group].enabled = 1;
269 + p->func[func]->enabled = 1;
271 + mode = rt_sysc_r32(SYSC_REG_GPIO_MODE);
272 + mode &= ~(p->groups[group].mask << p->groups[group].shift);
274 + /* function 0 is gpio and needs special handling */
278 + mode |= p->groups[group].mask << p->groups[group].shift;
279 + /* mark the pins as gpio */
280 + for (i = 0; i < p->groups[group].func[0].pin_count; i++)
281 + p->gpio[p->groups[group].func[0].pins[i]] = 1;
283 + mode |= p->func[func]->value << p->groups[group].shift;
285 + rt_sysc_w32(mode, SYSC_REG_GPIO_MODE);
290 +static int rt2880_pmx_group_gpio_request_enable(struct pinctrl_dev *pctrldev,
291 + struct pinctrl_gpio_range *range,
294 + struct rt2880_priv *p = pinctrl_dev_get_drvdata(pctrldev);
296 + if (!p->gpio[pin]) {
297 + dev_err(p->dev, "pin %d is not set to gpio mux\n", pin);
304 +static const struct pinmux_ops rt2880_pmx_group_ops = {
305 + .get_functions_count = rt2880_pmx_func_count,
306 + .get_function_name = rt2880_pmx_func_name,
307 + .get_function_groups = rt2880_pmx_group_get_groups,
308 + .enable = rt2880_pmx_group_enable,
309 + .gpio_request_enable = rt2880_pmx_group_gpio_request_enable,
312 +static struct pinctrl_desc rt2880_pctrl_desc = {
313 + .owner = THIS_MODULE,
314 + .name = "rt2880-pinmux",
315 + .pctlops = &rt2880_pctrl_ops,
316 + .pmxops = &rt2880_pmx_group_ops,
319 +static struct rt2880_pmx_func gpio_func = {
323 +static int rt2880_pinmux_index(struct rt2880_priv *p)
325 + struct rt2880_pmx_func **f;
326 + struct rt2880_pmx_group *mux = p->groups;
329 + /* count the mux functions */
330 + while (mux->name) {
335 + /* allocate the group names array needed by the gpio function */
336 + p->group_names = devm_kzalloc(p->dev, sizeof(char *) * p->group_count, GFP_KERNEL);
337 + if (!p->group_names)
340 + for (i = 0; i < p->group_count; i++) {
341 + p->group_names[i] = p->groups[i].name;
342 + p->func_count += p->groups[i].func_count;
345 + /* we have a dummy function[0] for gpio */
348 + /* allocate our function and group mapping index buffers */
349 + f = p->func = devm_kzalloc(p->dev, sizeof(struct rt2880_pmx_func) * p->func_count, GFP_KERNEL);
350 + gpio_func.groups = devm_kzalloc(p->dev, sizeof(int) * p->group_count, GFP_KERNEL);
351 + if (!f || !gpio_func.groups)
354 + /* add a backpointer to the function so it knows its group */
355 + gpio_func.group_count = p->group_count;
356 + for (i = 0; i < gpio_func.group_count; i++)
357 + gpio_func.groups[i] = i;
362 + /* add remaining functions */
363 + for (i = 0; i < p->group_count; i++) {
364 + for (j = 0; j < p->groups[i].func_count; j++) {
367 + f[c] = &p->groups[i].func[j];
368 + f[c]->groups = devm_kzalloc(p->dev, sizeof(int), GFP_KERNEL);
369 + f[c]->groups[0] = i;
370 + f[c]->group_count = 1;
377 +static int rt2880_pinmux_pins(struct rt2880_priv *p)
381 + /* loop over the functions and initialize the pins array. also work out the highest pin used */
382 + for (i = 0; i < p->func_count; i++) {
385 + if (!p->func[i]->pin_count)
388 + p->func[i]->pins = devm_kzalloc(p->dev, sizeof(int) * p->func[i]->pin_count, GFP_KERNEL);
389 + for (j = 0; j < p->func[i]->pin_count; j++)
390 + p->func[i]->pins[j] = p->func[i]->pin_first + j;
392 + pin = p->func[i]->pin_first + p->func[i]->pin_count;
393 + if (pin > p->max_pins)
397 + /* the buffer that tells us which pins are gpio */
398 + p->gpio = devm_kzalloc(p->dev,sizeof(uint8_t) * p->max_pins,
400 + /* the pads needed to tell pinctrl about our pins */
401 + p->pads = devm_kzalloc(p->dev,
402 + sizeof(struct pinctrl_pin_desc) * p->max_pins,
404 + if (!p->pads || !p->gpio ) {
405 + dev_err(p->dev, "Failed to allocate gpio data\n");
409 + /* pin 0 is always a gpio */
413 + for (i = 0; i < p->max_pins; i++) {
414 + /* strlen("ioXY") + 1 = 5 */
415 + char *name = devm_kzalloc(p->dev, 5, GFP_KERNEL);
418 + dev_err(p->dev, "Failed to allocate pad name\n");
421 + snprintf(name, 5, "io%d", i);
422 + p->pads[i].number = i;
423 + p->pads[i].name = name;
425 + p->desc->pins = p->pads;
426 + p->desc->npins = p->max_pins;
431 +static int rt2880_pinmux_probe(struct platform_device *pdev)
433 + struct rt2880_priv *p;
434 + struct pinctrl_dev *dev;
435 + struct device_node *np;
437 + if (!rt2880_pinmux_data)
440 + /* setup the private data */
441 + p = devm_kzalloc(&pdev->dev, sizeof(struct rt2880_priv), GFP_KERNEL);
445 + p->dev = &pdev->dev;
446 + p->desc = &rt2880_pctrl_desc;
447 + p->groups = rt2880_pinmux_data;
448 + platform_set_drvdata(pdev, p);
450 + /* init the device */
451 + if (rt2880_pinmux_index(p)) {
452 + dev_err(&pdev->dev, "failed to load index\n");
455 + if (rt2880_pinmux_pins(p)) {
456 + dev_err(&pdev->dev, "failed to load pins\n");
459 + dev = pinctrl_register(p->desc, &pdev->dev, p);
461 + return PTR_ERR(dev);
463 + /* finalize by adding gpio ranges for enables gpio controllers */
464 + for_each_compatible_node(np, NULL, "ralink,rt2880-gpio") {
465 + const __be32 *ngpio, *gpiobase;
466 + struct pinctrl_gpio_range *range;
469 + if (!of_device_is_available(np))
472 + ngpio = of_get_property(np, "ralink,num-gpios", NULL);
473 + gpiobase = of_get_property(np, "ralink,gpio-base", NULL);
474 + if (!ngpio || !gpiobase) {
475 + dev_err(&pdev->dev, "failed to load chip info\n");
479 + range = devm_kzalloc(p->dev, sizeof(struct pinctrl_gpio_range) + 4, GFP_KERNEL);
480 + range->name = name = (char *) &range[1];
481 + sprintf(name, "pio");
482 + range->npins = __be32_to_cpu(*ngpio);
483 + range->base = __be32_to_cpu(*gpiobase);
484 + pinctrl_add_gpio_range(dev, range);
490 +static const struct of_device_id rt2880_pinmux_match[] = {
491 + { .compatible = "ralink,rt2880-pinmux" },
494 +MODULE_DEVICE_TABLE(of, rt2880_pinmux_match);
496 +static struct platform_driver rt2880_pinmux_driver = {
497 + .probe = rt2880_pinmux_probe,
499 + .name = "rt2880-pinmux",
500 + .owner = THIS_MODULE,
501 + .of_match_table = rt2880_pinmux_match,
505 +int __init rt2880_pinmux_init(void)
507 + return platform_driver_register(&rt2880_pinmux_driver);
510 +core_initcall_sync(rt2880_pinmux_init);
512 +++ b/arch/mips/include/asm/mach-ralink/pinmux.h
515 + * This program is free software; you can redistribute it and/or modify
516 + * it under the terms of the GNU General Public License version 2 as
517 + * publishhed by the Free Software Foundation.
519 + * Copyright (C) 2012 John Crispin <blogic@openwrt.org>
522 +#ifndef _RT288X_PINMUX_H__
523 +#define _RT288X_PINMUX_H__
525 +#define FUNC(name, value, pin_first, pin_count) { name, value, pin_first, pin_count }
526 +#define GRP(_name, _func, _mask, _shift) \
527 + { .name = _name, .mask = _mask, .shift = _shift, \
529 + .func_count = ARRAY_SIZE(_func) }
531 +struct rt2880_pmx_group;
533 +struct rt2880_pmx_func {
547 +struct rt2880_pmx_group {
554 + struct rt2880_pmx_func *func;
558 +extern struct rt2880_pmx_group *rt2880_pinmux_data;
561 --- a/arch/mips/ralink/mt7620.c
562 +++ b/arch/mips/ralink/mt7620.c
564 #include <asm/mipsregs.h>
565 #include <asm/mach-ralink/ralink_regs.h>
566 #include <asm/mach-ralink/mt7620.h>
567 +#include <asm/mach-ralink/pinmux.h>
571 @@ -48,118 +49,40 @@ static int dram_type;
572 /* the pll dividers */
573 static u32 mt7620_clk_divider[] = { 2, 3, 4, 8 };
575 -static struct ralink_pinmux_grp mode_mux[] = {
578 - .mask = MT7620_GPIO_MODE_I2C,
583 - .mask = MT7620_GPIO_MODE_SPI,
587 - .name = "uartlite",
588 - .mask = MT7620_GPIO_MODE_UART1,
593 - .mask = MT7620_GPIO_MODE_WDT,
598 - .mask = MT7620_GPIO_MODE_MDIO,
603 - .mask = MT7620_GPIO_MODE_RGMII1,
607 - .name = "spi refclk",
608 - .mask = MT7620_GPIO_MODE_SPI_REF_CLK,
613 - .mask = MT7620_GPIO_MODE_JTAG,
617 - /* shared lines with jtag */
619 - .mask = MT7620_GPIO_MODE_EPHY,
624 - .mask = MT7620_GPIO_MODE_JTAG,
629 - .mask = MT7620_GPIO_MODE_RGMII2,
634 - .mask = MT7620_GPIO_MODE_WLED,
638 +static struct rt2880_pmx_func i2c_grp[] = { FUNC("i2c", 1, 1, 2) };
639 +static struct rt2880_pmx_func spi_grp[] = { FUNC("spi", 1, 3, 4) };
640 +static struct rt2880_pmx_func uartf_grp[] = {
641 + FUNC("uartf", MT7620_GPIO_MODE_UARTF, 7, 8),
642 + FUNC("pcm uartf", MT7620_GPIO_MODE_PCM_UARTF, 7, 8),
643 + FUNC("pcm i2s", MT7620_GPIO_MODE_PCM_I2S, 7, 8),
644 + FUNC("i2s uartf", MT7620_GPIO_MODE_I2S_UARTF, 7, 8),
645 + FUNC("pcm gpio", MT7620_GPIO_MODE_PCM_GPIO, 11, 4),
646 + FUNC("gpio uartf", MT7620_GPIO_MODE_GPIO_UARTF, 7, 4),
647 + FUNC("gpio i2s", MT7620_GPIO_MODE_GPIO_I2S, 7, 4),
650 -static struct ralink_pinmux_grp uart_mux[] = {
653 - .mask = MT7620_GPIO_MODE_UARTF,
657 - .name = "pcm uartf",
658 - .mask = MT7620_GPIO_MODE_PCM_UARTF,
663 - .mask = MT7620_GPIO_MODE_PCM_I2S,
667 - .name = "i2s uartf",
668 - .mask = MT7620_GPIO_MODE_I2S_UARTF,
672 - .name = "pcm gpio",
673 - .mask = MT7620_GPIO_MODE_PCM_GPIO,
677 - .name = "gpio uartf",
678 - .mask = MT7620_GPIO_MODE_GPIO_UARTF,
682 - .name = "gpio i2s",
683 - .mask = MT7620_GPIO_MODE_GPIO_I2S,
688 - .mask = MT7620_GPIO_MODE_GPIO,
692 -struct ralink_pinmux rt_gpio_pinmux = {
695 - .uart_shift = MT7620_GPIO_MODE_UART0_SHIFT,
696 - .uart_mask = MT7620_GPIO_MODE_UART0_MASK,
697 +static struct rt2880_pmx_func uartlite_grp[] = { FUNC("uartlite", 1, 15, 2) };
698 +static struct rt2880_pmx_func wdt_grp[] = { FUNC("wdt", 1, 17, 1) };
699 +static struct rt2880_pmx_func mdio_grp[] = { FUNC("mdio", 1, 22, 2) };
700 +static struct rt2880_pmx_func rgmii1_grp[] = { FUNC("rgmii1", 1, 24, 12) };
701 +static struct rt2880_pmx_func refclk_grp[] = { FUNC("spi refclk", 1, 37, 3) };
702 +static struct rt2880_pmx_func ephy_grp[] = { FUNC("ephy", 1, 40, 5) };
703 +static struct rt2880_pmx_func rgmii2_grp[] = { FUNC("rgmii2", 1, 60, 12) };
704 +static struct rt2880_pmx_func wled_grp[] = { FUNC("wled", 1, 72, 1) };
706 +static struct rt2880_pmx_group mt7620a_pinmux_data[] = {
707 + GRP("i2c", i2c_grp, 1, MT7620_GPIO_MODE_I2C),
708 + GRP("spi", spi_grp, 1, MT7620_GPIO_MODE_SPI),
709 + GRP("uartlite", uartlite_grp, 1, MT7620_GPIO_MODE_UART1),
710 + GRP("wdt", wdt_grp, 1, MT7620_GPIO_MODE_WDT),
711 + GRP("mdio", mdio_grp, 1, MT7620_GPIO_MODE_MDIO),
712 + GRP("rgmii1", rgmii1_grp, 1, MT7620_GPIO_MODE_RGMII1),
713 + GRP("spi refclk", refclk_grp, 1, MT7620_GPIO_MODE_SPI_REF_CLK),
714 + GRP("rgmii2", rgmii2_grp, 1, MT7620_GPIO_MODE_RGMII2),
715 + GRP("ephy", ephy_grp, 1, MT7620_GPIO_MODE_EPHY),
716 + GRP("wled", wled_grp, 1, MT7620_GPIO_MODE_WLED),
717 + GRP("uartf", uartf_grp, MT7620_GPIO_MODE_UART0_MASK,
718 + MT7620_GPIO_MODE_UART0_SHIFT),
722 void __init ralink_clk_init(void)
723 @@ -281,4 +204,6 @@ void prom_soc_init(struct ralink_soc_inf
724 (pmu0 & PMU_SW_SET) ? ("sw") : ("hw"));
725 pr_info("Digital PMU set to %s control\n",
726 (pmu1 & DIG_SW_SEL) ? ("sw") : ("hw"));
728 + rt2880_pinmux_data = mt7620a_pinmux_data;
730 --- a/arch/mips/ralink/rt305x.c
731 +++ b/arch/mips/ralink/rt305x.c
733 #include <asm/mipsregs.h>
734 #include <asm/mach-ralink/ralink_regs.h>
735 #include <asm/mach-ralink/rt305x.h>
736 +#include <asm/mach-ralink/pinmux.h>
740 enum rt305x_soc_type rt305x_soc;
742 -static struct ralink_pinmux_grp mode_mux[] = {
745 - .mask = RT305X_GPIO_MODE_I2C,
746 - .gpio_first = RT305X_GPIO_I2C_SD,
747 - .gpio_last = RT305X_GPIO_I2C_SCLK,
750 - .mask = RT305X_GPIO_MODE_SPI,
751 - .gpio_first = RT305X_GPIO_SPI_EN,
752 - .gpio_last = RT305X_GPIO_SPI_CLK,
754 - .name = "uartlite",
755 - .mask = RT305X_GPIO_MODE_UART1,
756 - .gpio_first = RT305X_GPIO_UART1_TXD,
757 - .gpio_last = RT305X_GPIO_UART1_RXD,
760 - .mask = RT305X_GPIO_MODE_JTAG,
761 - .gpio_first = RT305X_GPIO_JTAG_TDO,
762 - .gpio_last = RT305X_GPIO_JTAG_TDI,
765 - .mask = RT305X_GPIO_MODE_MDIO,
766 - .gpio_first = RT305X_GPIO_MDIO_MDC,
767 - .gpio_last = RT305X_GPIO_MDIO_MDIO,
770 - .mask = RT305X_GPIO_MODE_SDRAM,
771 - .gpio_first = RT305X_GPIO_SDRAM_MD16,
772 - .gpio_last = RT305X_GPIO_SDRAM_MD31,
775 - .mask = RT305X_GPIO_MODE_RGMII,
776 - .gpio_first = RT305X_GPIO_GE0_TXD0,
777 - .gpio_last = RT305X_GPIO_GE0_RXCLK,
779 +static struct rt2880_pmx_func i2c_func[] = { FUNC("i2c", 0, 1, 2) };
780 +static struct rt2880_pmx_func spi_func[] = { FUNC("spi", 0, 3, 4) };
781 +static struct rt2880_pmx_func uartf_func[] = {
782 + FUNC("uartf", RT305X_GPIO_MODE_UARTF, 7, 8),
783 + FUNC("pcm uartf", RT305X_GPIO_MODE_PCM_UARTF, 7, 8),
784 + FUNC("pcm i2s", RT305X_GPIO_MODE_PCM_I2S, 7, 8),
785 + FUNC("i2s uartf", RT305X_GPIO_MODE_I2S_UARTF, 7, 8),
786 + FUNC("pcm gpio", RT305X_GPIO_MODE_PCM_GPIO, 11, 4),
787 + FUNC("gpio uartf", RT305X_GPIO_MODE_GPIO_UARTF, 7, 4),
788 + FUNC("gpio i2s", RT305X_GPIO_MODE_GPIO_I2S, 7, 4),
790 +static struct rt2880_pmx_func uartlite_func[] = { FUNC("uartlite", 0, 15, 2) };
791 +static struct rt2880_pmx_func jtag_func[] = { FUNC("jtag", 0, 17, 25) };
792 +static struct rt2880_pmx_func mdio_func[] = { FUNC("mdio", 0, 22, 2) };
793 +static struct rt2880_pmx_func rt5350_led_func[] = { FUNC("led", 0, 22, 5) };
794 +static struct rt2880_pmx_func sdram_func[] = { FUNC("sdram", 0, 24, 16) };
795 +static struct rt2880_pmx_func rt3352_rgmii_func[] = { FUNC("rgmii", 0, 24, 12) };
796 +static struct rt2880_pmx_func rgmii_func[] = { FUNC("rgmii", 0, 40, 12) };
797 +static struct rt2880_pmx_func rt3352_lna_func[] = { FUNC("lna", 0, 36, 2) };
798 +static struct rt2880_pmx_func rt3352_pa_func[] = { FUNC("pa", 0, 38, 2) };
799 +static struct rt2880_pmx_func rt3352_led_func[] = { FUNC("led", 0, 40, 5) };
801 +static struct rt2880_pmx_group rt3050_pinmux_data[] = {
802 + GRP("i2c", i2c_func, 1, RT305X_GPIO_MODE_I2C),
803 + GRP("spi", spi_func, 1, RT305X_GPIO_MODE_SPI),
804 + GRP("uartf", uartf_func, RT305X_GPIO_MODE_UART0_MASK,
805 + RT305X_GPIO_MODE_UART0_SHIFT),
806 + GRP("uartlite", uartlite_func, 1, RT305X_GPIO_MODE_UART1),
807 + GRP("jtag", jtag_func, 1, RT305X_GPIO_MODE_JTAG),
808 + GRP("mdio", mdio_func, 1, RT305X_GPIO_MODE_MDIO),
809 + GRP("rgmii", rgmii_func, 1, RT305X_GPIO_MODE_RGMII),
810 + GRP("sdram", sdram_func, 1, RT305X_GPIO_MODE_SDRAM),
814 +static struct rt2880_pmx_group rt3352_pinmux_data[] = {
815 + GRP("i2c", i2c_func, 1, RT305X_GPIO_MODE_I2C),
816 + GRP("spi", spi_func, 1, RT305X_GPIO_MODE_SPI),
817 + GRP("uartf", uartf_func, RT305X_GPIO_MODE_UART0_MASK,
818 + RT305X_GPIO_MODE_UART0_SHIFT),
819 + GRP("uartlite", uartlite_func, 1, RT305X_GPIO_MODE_UART1),
820 + GRP("jtag", jtag_func, 1, RT305X_GPIO_MODE_JTAG),
821 + GRP("mdio", mdio_func, 1, RT305X_GPIO_MODE_MDIO),
822 + GRP("rgmii", rt3352_rgmii_func, 1, RT305X_GPIO_MODE_RGMII),
823 + GRP("lna", rt3352_lna_func, 1, RT3352_GPIO_MODE_LNA),
824 + GRP("pa", rt3352_pa_func, 1, RT3352_GPIO_MODE_PA),
825 + GRP("led", rt3352_led_func, 1, RT5350_GPIO_MODE_PHY_LED),
829 -static struct ralink_pinmux_grp uart_mux[] = {
832 - .mask = RT305X_GPIO_MODE_UARTF,
833 - .gpio_first = RT305X_GPIO_7,
834 - .gpio_last = RT305X_GPIO_14,
836 - .name = "pcm uartf",
837 - .mask = RT305X_GPIO_MODE_PCM_UARTF,
838 - .gpio_first = RT305X_GPIO_7,
839 - .gpio_last = RT305X_GPIO_14,
842 - .mask = RT305X_GPIO_MODE_PCM_I2S,
843 - .gpio_first = RT305X_GPIO_7,
844 - .gpio_last = RT305X_GPIO_14,
846 - .name = "i2s uartf",
847 - .mask = RT305X_GPIO_MODE_I2S_UARTF,
848 - .gpio_first = RT305X_GPIO_7,
849 - .gpio_last = RT305X_GPIO_14,
851 - .name = "pcm gpio",
852 - .mask = RT305X_GPIO_MODE_PCM_GPIO,
853 - .gpio_first = RT305X_GPIO_10,
854 - .gpio_last = RT305X_GPIO_14,
856 - .name = "gpio uartf",
857 - .mask = RT305X_GPIO_MODE_GPIO_UARTF,
858 - .gpio_first = RT305X_GPIO_7,
859 - .gpio_last = RT305X_GPIO_10,
861 - .name = "gpio i2s",
862 - .mask = RT305X_GPIO_MODE_GPIO_I2S,
863 - .gpio_first = RT305X_GPIO_7,
864 - .gpio_last = RT305X_GPIO_10,
867 - .mask = RT305X_GPIO_MODE_GPIO,
869 +static struct rt2880_pmx_group rt5350_pinmux_data[] = {
870 + GRP("i2c", i2c_func, 1, RT305X_GPIO_MODE_I2C),
871 + GRP("spi", spi_func, 1, RT305X_GPIO_MODE_SPI),
872 + GRP("uartf", uartf_func, RT305X_GPIO_MODE_UART0_MASK,
873 + RT305X_GPIO_MODE_UART0_SHIFT),
874 + GRP("uartlite", uartlite_func, 1, RT305X_GPIO_MODE_UART1),
875 + GRP("jtag", jtag_func, 1, RT305X_GPIO_MODE_JTAG),
876 + GRP("led", rt5350_led_func, 1, RT5350_GPIO_MODE_PHY_LED),
880 static void rt305x_wdt_reset(void)
881 @@ -114,14 +95,6 @@ static void rt305x_wdt_reset(void)
882 rt_sysc_w32(t, SYSC_REG_SYSTEM_CONFIG);
885 -struct ralink_pinmux rt_gpio_pinmux = {
888 - .uart_shift = RT305X_GPIO_MODE_UART0_SHIFT,
889 - .uart_mask = RT305X_GPIO_MODE_UART0_MASK,
890 - .wdt_reset = rt305x_wdt_reset,
893 static unsigned long rt5350_get_mem_size(void)
895 void __iomem *sysc = (void __iomem *) KSEG1ADDR(RT305X_SYSC_BASE);
896 @@ -291,11 +264,14 @@ void prom_soc_init(struct ralink_soc_inf
897 soc_info->mem_base = RT305X_SDRAM_BASE;
898 if (soc_is_rt5350()) {
899 soc_info->mem_size = rt5350_get_mem_size();
900 + rt2880_pinmux_data = rt5350_pinmux_data;
901 } else if (soc_is_rt305x() || soc_is_rt3350()) {
902 soc_info->mem_size_min = RT305X_MEM_SIZE_MIN;
903 soc_info->mem_size_max = RT305X_MEM_SIZE_MAX;
904 + rt2880_pinmux_data = rt3050_pinmux_data;
905 } else if (soc_is_rt3352()) {
906 soc_info->mem_size_min = RT3352_MEM_SIZE_MIN;
907 soc_info->mem_size_max = RT3352_MEM_SIZE_MAX;
908 + rt2880_pinmux_data = rt3352_pinmux_data;
911 --- a/arch/mips/include/asm/mach-ralink/rt305x.h
912 +++ b/arch/mips/include/asm/mach-ralink/rt305x.h
913 @@ -125,24 +125,28 @@ static inline int soc_is_rt5350(void)
914 #define RT305X_GPIO_GE0_TXD0 40
915 #define RT305X_GPIO_GE0_RXCLK 51
917 -#define RT305X_GPIO_MODE_I2C BIT(0)
918 -#define RT305X_GPIO_MODE_SPI BIT(1)
919 #define RT305X_GPIO_MODE_UART0_SHIFT 2
920 #define RT305X_GPIO_MODE_UART0_MASK 0x7
921 #define RT305X_GPIO_MODE_UART0(x) ((x) << RT305X_GPIO_MODE_UART0_SHIFT)
922 -#define RT305X_GPIO_MODE_UARTF 0x0
923 -#define RT305X_GPIO_MODE_PCM_UARTF 0x1
924 -#define RT305X_GPIO_MODE_PCM_I2S 0x2
925 -#define RT305X_GPIO_MODE_I2S_UARTF 0x3
926 -#define RT305X_GPIO_MODE_PCM_GPIO 0x4
927 -#define RT305X_GPIO_MODE_GPIO_UARTF 0x5
928 -#define RT305X_GPIO_MODE_GPIO_I2S 0x6
929 -#define RT305X_GPIO_MODE_GPIO 0x7
930 -#define RT305X_GPIO_MODE_UART1 BIT(5)
931 -#define RT305X_GPIO_MODE_JTAG BIT(6)
932 -#define RT305X_GPIO_MODE_MDIO BIT(7)
933 -#define RT305X_GPIO_MODE_SDRAM BIT(8)
934 -#define RT305X_GPIO_MODE_RGMII BIT(9)
935 +#define RT305X_GPIO_MODE_UARTF 0
936 +#define RT305X_GPIO_MODE_PCM_UARTF 1
937 +#define RT305X_GPIO_MODE_PCM_I2S 2
938 +#define RT305X_GPIO_MODE_I2S_UARTF 3
939 +#define RT305X_GPIO_MODE_PCM_GPIO 4
940 +#define RT305X_GPIO_MODE_GPIO_UARTF 5
941 +#define RT305X_GPIO_MODE_GPIO_I2S 6
942 +#define RT305X_GPIO_MODE_GPIO 7
944 +#define RT305X_GPIO_MODE_I2C 0
945 +#define RT305X_GPIO_MODE_SPI 1
946 +#define RT305X_GPIO_MODE_UART1 5
947 +#define RT305X_GPIO_MODE_JTAG 6
948 +#define RT305X_GPIO_MODE_MDIO 7
949 +#define RT305X_GPIO_MODE_SDRAM 8
950 +#define RT305X_GPIO_MODE_RGMII 9
951 +#define RT5350_GPIO_MODE_PHY_LED 14
952 +#define RT3352_GPIO_MODE_LNA 18
953 +#define RT3352_GPIO_MODE_PA 20
955 #define RT3352_SYSC_REG_SYSCFG0 0x010
956 #define RT3352_SYSC_REG_SYSCFG1 0x014
957 --- a/arch/mips/include/asm/mach-ralink/mt7620.h
958 +++ b/arch/mips/include/asm/mach-ralink/mt7620.h
960 #define MT7620_DDR2_SIZE_MIN 32
961 #define MT7620_DDR2_SIZE_MAX 256
963 -#define MT7620_GPIO_MODE_I2C BIT(0)
964 #define MT7620_GPIO_MODE_UART0_SHIFT 2
965 #define MT7620_GPIO_MODE_UART0_MASK 0x7
966 #define MT7620_GPIO_MODE_UART0(x) ((x) << MT7620_GPIO_MODE_UART0_SHIFT)
968 #define MT7620_GPIO_MODE_GPIO_UARTF 0x5
969 #define MT7620_GPIO_MODE_GPIO_I2S 0x6
970 #define MT7620_GPIO_MODE_GPIO 0x7
971 -#define MT7620_GPIO_MODE_UART1 BIT(5)
972 -#define MT7620_GPIO_MODE_MDIO BIT(8)
973 -#define MT7620_GPIO_MODE_RGMII1 BIT(9)
974 -#define MT7620_GPIO_MODE_RGMII2 BIT(10)
975 -#define MT7620_GPIO_MODE_SPI BIT(11)
976 -#define MT7620_GPIO_MODE_SPI_REF_CLK BIT(12)
977 -#define MT7620_GPIO_MODE_WLED BIT(13)
978 -#define MT7620_GPIO_MODE_JTAG BIT(15)
979 -#define MT7620_GPIO_MODE_EPHY BIT(15)
980 -#define MT7620_GPIO_MODE_WDT BIT(22)
982 +#define MT7620_GPIO_MODE_I2C 0
983 +#define MT7620_GPIO_MODE_UART1 5
984 +#define MT7620_GPIO_MODE_MDIO 8
985 +#define MT7620_GPIO_MODE_RGMII1 9
986 +#define MT7620_GPIO_MODE_RGMII2 10
987 +#define MT7620_GPIO_MODE_SPI 11
988 +#define MT7620_GPIO_MODE_SPI_REF_CLK 12
989 +#define MT7620_GPIO_MODE_WLED 13
990 +#define MT7620_GPIO_MODE_JTAG 15
991 +#define MT7620_GPIO_MODE_EPHY 15
992 +#define MT7620_GPIO_MODE_WDT 22
995 --- a/arch/mips/include/asm/mach-ralink/rt3883.h
996 +++ b/arch/mips/include/asm/mach-ralink/rt3883.h
998 #define RT3883_CLKCFG1_PCI_CLK_EN BIT(19)
999 #define RT3883_CLKCFG1_UPHY0_CLK_EN BIT(18)
1001 -#define RT3883_GPIO_MODE_I2C BIT(0)
1002 -#define RT3883_GPIO_MODE_SPI BIT(1)
1003 #define RT3883_GPIO_MODE_UART0_SHIFT 2
1004 #define RT3883_GPIO_MODE_UART0_MASK 0x7
1005 #define RT3883_GPIO_MODE_UART0(x) ((x) << RT3883_GPIO_MODE_UART0_SHIFT)
1006 @@ -125,11 +123,15 @@
1007 #define RT3883_GPIO_MODE_GPIO_UARTF 0x5
1008 #define RT3883_GPIO_MODE_GPIO_I2S 0x6
1009 #define RT3883_GPIO_MODE_GPIO 0x7
1010 -#define RT3883_GPIO_MODE_UART1 BIT(5)
1011 -#define RT3883_GPIO_MODE_JTAG BIT(6)
1012 -#define RT3883_GPIO_MODE_MDIO BIT(7)
1013 -#define RT3883_GPIO_MODE_GE1 BIT(9)
1014 -#define RT3883_GPIO_MODE_GE2 BIT(10)
1016 +#define RT3883_GPIO_MODE_I2C 0
1017 +#define RT3883_GPIO_MODE_SPI 1
1018 +#define RT3883_GPIO_MODE_UART1 5
1019 +#define RT3883_GPIO_MODE_JTAG 6
1020 +#define RT3883_GPIO_MODE_MDIO 7
1021 +#define RT3883_GPIO_MODE_GE1 9
1022 +#define RT3883_GPIO_MODE_GE2 10
1024 #define RT3883_GPIO_MODE_PCI_SHIFT 11
1025 #define RT3883_GPIO_MODE_PCI_MASK 0x7
1026 #define RT3883_GPIO_MODE_PCI (RT3883_GPIO_MODE_PCI_MASK << RT3883_GPIO_MODE_PCI_SHIFT)
1027 --- a/arch/mips/ralink/common.h
1028 +++ b/arch/mips/ralink/common.h
1031 #define RAMIPS_SYS_TYPE_LEN 32
1033 -struct ralink_pinmux_grp {
1040 -struct ralink_pinmux {
1041 - struct ralink_pinmux_grp *mode;
1042 - struct ralink_pinmux_grp *uart;
1045 - void (*wdt_reset)(void);
1046 - struct ralink_pinmux_grp *pci;
1050 -extern struct ralink_pinmux rt_gpio_pinmux;
1052 struct ralink_soc_info {
1053 unsigned char sys_type[RAMIPS_SYS_TYPE_LEN];
1054 unsigned char *compatible;
1055 --- a/arch/mips/ralink/rt3883.c
1056 +++ b/arch/mips/ralink/rt3883.c
1057 @@ -17,132 +17,50 @@
1058 #include <asm/mipsregs.h>
1059 #include <asm/mach-ralink/ralink_regs.h>
1060 #include <asm/mach-ralink/rt3883.h>
1061 +#include <asm/mach-ralink/pinmux.h>
1065 -static struct ralink_pinmux_grp mode_mux[] = {
1068 - .mask = RT3883_GPIO_MODE_I2C,
1069 - .gpio_first = RT3883_GPIO_I2C_SD,
1070 - .gpio_last = RT3883_GPIO_I2C_SCLK,
1073 - .mask = RT3883_GPIO_MODE_SPI,
1074 - .gpio_first = RT3883_GPIO_SPI_CS0,
1075 - .gpio_last = RT3883_GPIO_SPI_MISO,
1077 - .name = "uartlite",
1078 - .mask = RT3883_GPIO_MODE_UART1,
1079 - .gpio_first = RT3883_GPIO_UART1_TXD,
1080 - .gpio_last = RT3883_GPIO_UART1_RXD,
1083 - .mask = RT3883_GPIO_MODE_JTAG,
1084 - .gpio_first = RT3883_GPIO_JTAG_TDO,
1085 - .gpio_last = RT3883_GPIO_JTAG_TCLK,
1088 - .mask = RT3883_GPIO_MODE_MDIO,
1089 - .gpio_first = RT3883_GPIO_MDIO_MDC,
1090 - .gpio_last = RT3883_GPIO_MDIO_MDIO,
1093 - .mask = RT3883_GPIO_MODE_GE1,
1094 - .gpio_first = RT3883_GPIO_GE1_TXD0,
1095 - .gpio_last = RT3883_GPIO_GE1_RXCLK,
1098 - .mask = RT3883_GPIO_MODE_GE2,
1099 - .gpio_first = RT3883_GPIO_GE2_TXD0,
1100 - .gpio_last = RT3883_GPIO_GE2_RXCLK,
1103 - .mask = RT3883_GPIO_MODE_PCI,
1104 - .gpio_first = RT3883_GPIO_PCI_AD0,
1105 - .gpio_last = RT3883_GPIO_PCI_AD31,
1108 - .mask = RT3883_GPIO_MODE_LNA_A,
1109 - .gpio_first = RT3883_GPIO_LNA_PE_A0,
1110 - .gpio_last = RT3883_GPIO_LNA_PE_A2,
1113 - .mask = RT3883_GPIO_MODE_LNA_G,
1114 - .gpio_first = RT3883_GPIO_LNA_PE_G0,
1115 - .gpio_last = RT3883_GPIO_LNA_PE_G2,
1117 +static struct rt2880_pmx_func i2c_func[] = { FUNC("i2c", 0, 1, 2) };
1118 +static struct rt2880_pmx_func spi_func[] = { FUNC("spi", 0, 3, 4) };
1119 +static struct rt2880_pmx_func uartf_func[] = {
1120 + FUNC("uartf", RT3883_GPIO_MODE_UARTF, 7, 8),
1121 + FUNC("pcm uartf", RT3883_GPIO_MODE_PCM_UARTF, 7, 8),
1122 + FUNC("pcm i2s", RT3883_GPIO_MODE_PCM_I2S, 7, 8),
1123 + FUNC("i2s uartf", RT3883_GPIO_MODE_I2S_UARTF, 7, 8),
1124 + FUNC("pcm gpio", RT3883_GPIO_MODE_PCM_GPIO, 11, 4),
1125 + FUNC("gpio uartf", RT3883_GPIO_MODE_GPIO_UARTF, 7, 4),
1126 + FUNC("gpio i2s", RT3883_GPIO_MODE_GPIO_I2S, 7, 4),
1129 -static struct ralink_pinmux_grp uart_mux[] = {
1132 - .mask = RT3883_GPIO_MODE_UARTF,
1133 - .gpio_first = RT3883_GPIO_7,
1134 - .gpio_last = RT3883_GPIO_14,
1136 - .name = "pcm uartf",
1137 - .mask = RT3883_GPIO_MODE_PCM_UARTF,
1138 - .gpio_first = RT3883_GPIO_7,
1139 - .gpio_last = RT3883_GPIO_14,
1141 - .name = "pcm i2s",
1142 - .mask = RT3883_GPIO_MODE_PCM_I2S,
1143 - .gpio_first = RT3883_GPIO_7,
1144 - .gpio_last = RT3883_GPIO_14,
1146 - .name = "i2s uartf",
1147 - .mask = RT3883_GPIO_MODE_I2S_UARTF,
1148 - .gpio_first = RT3883_GPIO_7,
1149 - .gpio_last = RT3883_GPIO_14,
1151 - .name = "pcm gpio",
1152 - .mask = RT3883_GPIO_MODE_PCM_GPIO,
1153 - .gpio_first = RT3883_GPIO_11,
1154 - .gpio_last = RT3883_GPIO_14,
1156 - .name = "gpio uartf",
1157 - .mask = RT3883_GPIO_MODE_GPIO_UARTF,
1158 - .gpio_first = RT3883_GPIO_7,
1159 - .gpio_last = RT3883_GPIO_10,
1161 - .name = "gpio i2s",
1162 - .mask = RT3883_GPIO_MODE_GPIO_I2S,
1163 - .gpio_first = RT3883_GPIO_7,
1164 - .gpio_last = RT3883_GPIO_10,
1167 - .mask = RT3883_GPIO_MODE_GPIO,
1169 +static struct rt2880_pmx_func uartlite_func[] = { FUNC("uartlite", 0, 15, 2) };
1170 +static struct rt2880_pmx_func jtag_func[] = { FUNC("jtag", 0, 17, 25) };
1171 +static struct rt2880_pmx_func mdio_func[] = { FUNC("mdio", 0, 22, 2) };
1172 +static struct rt2880_pmx_func lna_a_func[] = { FUNC("lna a", 0, 32, 3) };
1173 +static struct rt2880_pmx_func lna_g_func[] = { FUNC("lna a", 0, 35, 3) };
1174 +static struct rt2880_pmx_func pci_func[] = {
1175 + FUNC("pci-dev", 0, 40, 32),
1176 + FUNC("pci-host2", 1, 40, 32),
1177 + FUNC("pci-host1", 2, 40, 32),
1178 + FUNC("pci-fnc", 3, 40, 32)
1180 +static struct rt2880_pmx_func ge1_func[] = { FUNC("ge1", 0, 72, 12) };
1181 +static struct rt2880_pmx_func ge2_func[] = { FUNC("ge1", 0, 84, 12) };
1183 -static struct ralink_pinmux_grp pci_mux[] = {
1185 - .name = "pci-dev",
1187 - .gpio_first = RT3883_GPIO_PCI_AD0,
1188 - .gpio_last = RT3883_GPIO_PCI_AD31,
1190 - .name = "pci-host2",
1192 - .gpio_first = RT3883_GPIO_PCI_AD0,
1193 - .gpio_last = RT3883_GPIO_PCI_AD31,
1195 - .name = "pci-host1",
1197 - .gpio_first = RT3883_GPIO_PCI_AD0,
1198 - .gpio_last = RT3883_GPIO_PCI_AD31,
1200 - .name = "pci-fnc",
1202 - .gpio_first = RT3883_GPIO_PCI_AD0,
1203 - .gpio_last = RT3883_GPIO_PCI_AD31,
1205 - .name = "pci-gpio",
1207 - .gpio_first = RT3883_GPIO_PCI_AD0,
1208 - .gpio_last = RT3883_GPIO_PCI_AD31,
1210 +static struct rt2880_pmx_group rt3883_pinmux_data[] = {
1211 + GRP("i2c", i2c_func, 1, RT3883_GPIO_MODE_I2C),
1212 + GRP("spi", spi_func, 1, RT3883_GPIO_MODE_SPI),
1213 + GRP("uartf", uartf_func, RT3883_GPIO_MODE_UART0_MASK,
1214 + RT3883_GPIO_MODE_UART0_SHIFT),
1215 + GRP("uartlite", uartlite_func, 1, RT3883_GPIO_MODE_UART1),
1216 + GRP("jtag", jtag_func, 1, RT3883_GPIO_MODE_JTAG),
1217 + GRP("mdio", mdio_func, 1, RT3883_GPIO_MODE_MDIO),
1218 + GRP("lna a", lna_a_func, 1, RT3883_GPIO_MODE_LNA_A),
1219 + GRP("lna g", lna_g_func, 1, RT3883_GPIO_MODE_LNA_G),
1220 + GRP("pci", pci_func, RT3883_GPIO_MODE_PCI_MASK,
1221 + RT3883_GPIO_MODE_PCI_SHIFT),
1222 + GRP("ge1", ge1_func, 1, RT3883_GPIO_MODE_GE1),
1223 + GRP("ge2", ge2_func, 1, RT3883_GPIO_MODE_GE2),
1227 static void rt3883_wdt_reset(void)
1228 @@ -155,17 +73,6 @@ static void rt3883_wdt_reset(void)
1229 rt_sysc_w32(t, RT3883_SYSC_REG_SYSCFG1);
1232 -struct ralink_pinmux rt_gpio_pinmux = {
1235 - .uart_shift = RT3883_GPIO_MODE_UART0_SHIFT,
1236 - .uart_mask = RT3883_GPIO_MODE_UART0_MASK,
1237 - .wdt_reset = rt3883_wdt_reset,
1239 - .pci_shift = RT3883_GPIO_MODE_PCI_SHIFT,
1240 - .pci_mask = RT3883_GPIO_MODE_PCI_MASK,
1243 void __init ralink_clk_init(void)
1245 unsigned long cpu_rate, sys_rate;
1246 @@ -243,4 +150,6 @@ void prom_soc_init(struct ralink_soc_inf
1247 soc_info->mem_base = RT3883_SDRAM_BASE;
1248 soc_info->mem_size_min = RT3883_MEM_SIZE_MIN;
1249 soc_info->mem_size_max = RT3883_MEM_SIZE_MAX;
1251 + rt2880_pinmux_data = rt3883_pinmux_data;