aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-10-30 08:44:00 +0000
committerJohn Crispin <blogic@openwrt.org>2014-10-30 08:44:00 +0000
commita0c3e9537692428c1d68a064934751842092735d (patch)
tree7b40b10496f090eb1cd8343292ef63fdf7a75089 /target
parent3234f4fe61dadea461041fc4a516d569d9f93610 (diff)
downloadupstream-a0c3e9537692428c1d68a064934751842092735d.tar.gz
upstream-a0c3e9537692428c1d68a064934751842092735d.tar.bz2
upstream-a0c3e9537692428c1d68a064934751842092735d.zip
ralink: mt7530 - force wan port up
some bootloaders (linksys e1700) set wonky hw trap values. reset this upon boot to make all ports work. Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@43117 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ramips/patches-3.14/0035-NET-MIPS-add-ralink-SoC-ethernet-driver.patch19
1 files changed, 14 insertions, 5 deletions
diff --git a/target/linux/ramips/patches-3.14/0035-NET-MIPS-add-ralink-SoC-ethernet-driver.patch b/target/linux/ramips/patches-3.14/0035-NET-MIPS-add-ralink-SoC-ethernet-driver.patch
index 7bf8545533..853ad79ab7 100644
--- a/target/linux/ramips/patches-3.14/0035-NET-MIPS-add-ralink-SoC-ethernet-driver.patch
+++ b/target/linux/ramips/patches-3.14/0035-NET-MIPS-add-ralink-SoC-ethernet-driver.patch
@@ -97,7 +97,7 @@ Index: linux-3.14.18/arch/mips/ralink/rt305x.c
Index: linux-3.14.18/drivers/net/ethernet/Kconfig
===================================================================
--- linux-3.14.18.orig/drivers/net/ethernet/Kconfig 2014-09-06 01:34:59.000000000 +0200
-+++ linux-3.14.18/drivers/net/ethernet/Kconfig 2014-10-30 09:02:30.444086136 +0100
++++ linux-3.14.18/drivers/net/ethernet/Kconfig 2014-10-30 09:43:22.196245753 +0100
@@ -134,6 +134,7 @@
source "drivers/net/ethernet/packetengines/Kconfig"
source "drivers/net/ethernet/pasemi/Kconfig"
@@ -109,7 +109,7 @@ Index: linux-3.14.18/drivers/net/ethernet/Kconfig
Index: linux-3.14.18/drivers/net/ethernet/Makefile
===================================================================
--- linux-3.14.18.orig/drivers/net/ethernet/Makefile 2014-09-06 01:34:59.000000000 +0200
-+++ linux-3.14.18/drivers/net/ethernet/Makefile 2014-10-30 09:02:30.444086136 +0100
++++ linux-3.14.18/drivers/net/ethernet/Makefile 2014-10-30 09:43:22.196245753 +0100
@@ -56,6 +56,7 @@
obj-$(CONFIG_NET_PACKET_ENGINE) += packetengines/
obj-$(CONFIG_NET_VENDOR_PASEMI) += pasemi/
@@ -2876,8 +2876,8 @@ Index: linux-3.14.18/drivers/net/ethernet/ralink/mdio_rt2880.h
Index: linux-3.14.18/drivers/net/ethernet/ralink/mt7530.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-3.14.18/drivers/net/ethernet/ralink/mt7530.c 2014-10-30 09:02:23.967839289 +0100
-@@ -0,0 +1,579 @@
++++ linux-3.14.18/drivers/net/ethernet/ralink/mt7530.c 2014-10-30 09:37:26.847089658 +0100
+@@ -0,0 +1,588 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
@@ -2940,6 +2940,9 @@ Index: linux-3.14.18/drivers/net/ethernet/ralink/mt7530.c
+#define REG_ESW_PORT_PCR(x) (0x2004 | ((x) << 8))
+#define REG_ESW_PORT_PVC(x) (0x2010 | ((x) << 8))
+#define REG_ESW_PORT_PPBV1(x) (0x2014 | ((x) << 8))
++
++#define REG_HWTRAP 0x7804
++
+enum {
+ /* Global attributes. */
+ MT7530_ATTR_ENABLE_VLAN,
@@ -3448,13 +3451,19 @@ Index: linux-3.14.18/drivers/net/ethernet/ralink/mt7530.c
+ return ret;
+ }
+
-+ dev_info(dev, "loaded %s driver\n", swdev->name);
+
+ map = mt7530_find_mapping(dev->of_node);
+ if (map)
+ mt7530_apply_mapping(mt7530, map);
+ mt7530_apply_config(swdev);
+
++ /* magic vodoo */
++ if (bus && mt7530_r32(mt7530, REG_HWTRAP) != 0x1117edf) {
++ dev_info(dev, "fixing up MHWTRAP register - bootloader probably played with it\n");
++ mt7530_w32(mt7530, REG_HWTRAP, 0x1117edf);
++ }
++ dev_info(dev, "loaded %s driver\n", swdev->name);
++
+ return 0;
+}
Index: linux-3.14.18/drivers/net/ethernet/ralink/mt7530.h