summaryrefslogtreecommitdiff
path: root/target/linux/ramips
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-08-05 12:49:19 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-08-05 12:49:19 +0000
commitcfa0f1e910855a04b98d46bda14183dea421d2f8 (patch)
treea83ac0f0a0193c87c876d30f4ff2e04203e766a8 /target/linux/ramips
parentdf0c5923af1db77e6d6b4c27e9cf1a8b290d3eb3 (diff)
ramips: re-implement PCI mux
Parallel flash access on RT3662/RT3883 based devices is broken without that. It was fixed already some time ago, but that change seems lost somewhere. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37708 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips')
-rw-r--r--target/linux/ramips/patches-3.10/0002-MIPS-ralink-add-pinmux-driver.patch19
1 files changed, 17 insertions, 2 deletions
diff --git a/target/linux/ramips/patches-3.10/0002-MIPS-ralink-add-pinmux-driver.patch b/target/linux/ramips/patches-3.10/0002-MIPS-ralink-add-pinmux-driver.patch
index 1d17e4d54f..67dd69db40 100644
--- a/target/linux/ramips/patches-3.10/0002-MIPS-ralink-add-pinmux-driver.patch
+++ b/target/linux/ramips/patches-3.10/0002-MIPS-ralink-add-pinmux-driver.patch
@@ -49,7 +49,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
--- /dev/null
+++ b/arch/mips/ralink/pinmux.c
-@@ -0,0 +1,77 @@
+@@ -0,0 +1,92 @@
+/*
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
@@ -83,7 +83,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ const __be32 *wdt;
+ struct device_node *np;
+ struct property *prop;
-+ const char *uart, *pin;
++ const char *uart, *pci, *pin;
+ u32 mode = 0;
+ int m;
+
@@ -125,5 +125,20 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+ if (wdt && *wdt && rt_gpio_pinmux.wdt_reset)
+ rt_gpio_pinmux.wdt_reset();
+
++ pci = NULL;
++ if (rt_gpio_pinmux.pci)
++ of_property_read_string(np, "ralink,pcimux", &pci);
++
++ if (pci) {
++ mode &= ~(rt_gpio_pinmux.pci_mask << rt_gpio_pinmux.pci_shift);
++ if (ralink_mux_mask(pci, rt_gpio_pinmux.pci, &m)) {
++ mode |= rt_gpio_pinmux.pci_mask << rt_gpio_pinmux.pci_shift;
++ pr_debug("pinmux: failed to load pcimux \"%s\"\n", pci);
++ } else {
++ mode |= m << rt_gpio_pinmux.pci_shift;
++ pr_debug("pinmux: registered pcimux \"%s\"\n", pci);
++ }
++ }
++
+ rt_sysc_w32(mode, SYSC_REG_GPIO_MODE);
+}