ralink: add support for the mt7530 eval board

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 38345
This commit is contained in:
John Crispin 2013-10-08 21:10:15 +00:00
parent 697bb191b0
commit e382d2c7e6
5 changed files with 177 additions and 40 deletions

View File

@ -47,7 +47,7 @@
pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "mdio", "i2c", "uartf";
ralink,group = "i2c", "uartf";
ralink,function = "gpio";
};
};
@ -56,16 +56,19 @@
ethernet@10100000 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
ralink,port-map = "llllw";
port@4 {
compatible = "ralink,mt7620a-gsw-port", "ralink,eth-port";
reg = <4>;
status = "okay";
phy-mode = "rgmii";
phy-handle = <&phy4>;
};
port@5 {
compatible = "ralink,mt7620a-gsw-port", "ralink,eth-port";
reg = <5>;
status = "okay";
phy-mode = "rgmii";
phy-handle = <&phy5>;
};
@ -87,9 +90,6 @@
gsw@10110000 {
ralink,port4 = "gmac";
pinctrl-names = "default";
pinctrl-0 = <&ephy_pins>;
};
sdhci@10130000 {

View File

@ -0,0 +1,107 @@
/dts-v1/;
/include/ "mt7620a.dtsi"
/ {
compatible = "ralink,mt7620a-eval-board", "ralink,mt7620a-soc";
model = "Ralink MT7620a + MT7530 evaluation board";
palmbus@10000000 {
spi@b00 {
status = "okay";
m25p80@0 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "s25fl064k";
reg = <0 0>;
linux,modalias = "m25p80", "s25fl064k";
spi-max-frequency = <10000000>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
label = "firmware";
reg = <0x50000 0x7b0000>;
};
};
};
};
pinctrl {
state_default: pinctrl0 {
gpio {
ralink,group = "i2c", "uartf";
ralink,function = "gpio";
};
};
};
ethernet@10100000 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
ralink,port-map = "llllw";
port@5 {
status = "okay";
ralink,fixed-link = <1000 1 1 1>;
phy-mode = "rgmii";
};
mdio-bus {
status = "okay";
phy0: ethernet-phy@0 {
reg = <0>;
phy-mode = "rgmii";
};
phy1: ethernet-phy@1 {
reg = <1>;
phy-mode = "rgmii";
};
phy2: ethernet-phy@2 {
reg = <2>;
phy-mode = "rgmii";
};
phy3: ethernet-phy@3 {
reg = <3>;
phy-mode = "rgmii";
};
phy4: ethernet-phy@4 {
reg = <4>;
phy-mode = "rgmii";
};
phy1f: ethernet-phy@1f {
reg = <0x1f>;
phy-mode = "rgmii";
};
};
};
gsw@10110000 {
ralink,port4 = "gmac";
};
pcie@10140000 {
status = "okay";
};
};

View File

@ -298,13 +298,13 @@
};
};
rgmii1_pins: rgmii1 {
mdio {
rgmii1 {
ralink,group = "rgmii1";
ralink,function = "rgmii1";
};
};
rgmii2_pins: rgmii2 {
mdio {
rgmii2 {
ralink,group = "rgmii2";
ralink,function = "rgmii2";
};
@ -333,14 +333,28 @@
interrupt-parent = <&cpuintc>;
interrupts = <5>;
resets = <&rstctrl 21 &rstctrl 23>;
reset-names = "fe", "esw";
port@4 {
compatible = "ralink,mt7620a-gsw-port", "ralink,eth-port";
reg = <4>;
status = "disabled";
};
port@5 {
compatible = "ralink,mt7620a-gsw-port", "ralink,eth-port";
reg = <5>;
status = "disabled";
};
mdio-bus {
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
pinctrl-names = "default";
pinctrl-0 = <&mdio_pins>;
};
};

View File

@ -612,6 +612,7 @@ endif
Image/Build/Profile/MT7620a=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a,MT7620a)
Image/Build/Profile/MT7620a_MT7610e=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_mt7610e,MT7620a_MT7610e)
Image/Build/Profile/MT7620a_MT7530=$(call BuildFirmware/Default8M/$(1),$(1),mt7620a_mt7530,MT7620a_MT7530)
Image/Build/Profile/RP-N53=$(call BuildFirmware/Default8M/$(1),$(1),rp_n53,RP-N53)
dlink810l_mtd_size=6881280
Image/Build/Profile/DIR-810L=$(call BuildFirmware/CustomFlash/$(1),$(1),dir-810l,DIR-810L,$(dlink810l_mtd_size))
@ -620,6 +621,7 @@ ifeq ($(SUBTARGET),mt7620a)
define Image/Build/Profile/Default
$(call Image/Build/Profile/MT7620a,$(1))
$(call Image/Build/Profile/MT7620a_MT7610e,$(1))
$(call Image/Build/Profile/MT7620a_MT7530,$(1))
$(call Image/Build/Profile/RP-N53,$(1))
$(call Image/Build/Profile/DIR-810L,$(1))
endef

View File

@ -49,7 +49,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
Index: linux-3.10.13/arch/mips/include/asm/mach-ralink/rt305x_esw_platform.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/arch/mips/include/asm/mach-ralink/rt305x_esw_platform.h 2013-10-08 17:26:47.060172632 +0200
+++ linux-3.10.13/arch/mips/include/asm/mach-ralink/rt305x_esw_platform.h 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,27 @@
+/*
+ * Ralink RT305x SoC platform device registration
@ -80,8 +80,8 @@ Index: linux-3.10.13/arch/mips/include/asm/mach-ralink/rt305x_esw_platform.h
+#endif /* _RT305X_ESW_PLATFORM_H */
Index: linux-3.10.13/arch/mips/ralink/rt305x.c
===================================================================
--- linux-3.10.13.orig/arch/mips/ralink/rt305x.c 2013-10-08 17:26:43.276172503 +0200
+++ linux-3.10.13/arch/mips/ralink/rt305x.c 2013-10-08 17:26:47.060172632 +0200
--- linux-3.10.13.orig/arch/mips/ralink/rt305x.c 2013-09-27 02:18:49.000000000 +0200
+++ linux-3.10.13/arch/mips/ralink/rt305x.c 2013-10-08 22:40:10.480133783 +0200
@@ -221,6 +221,7 @@
}
@ -92,8 +92,8 @@ Index: linux-3.10.13/arch/mips/ralink/rt305x.c
ralink_clk_add("10000120.watchdog", wdt_rate);
Index: linux-3.10.13/drivers/net/ethernet/Kconfig
===================================================================
--- linux-3.10.13.orig/drivers/net/ethernet/Kconfig 2013-10-08 17:26:43.276172503 +0200
+++ linux-3.10.13/drivers/net/ethernet/Kconfig 2013-10-08 17:26:47.064172635 +0200
--- linux-3.10.13.orig/drivers/net/ethernet/Kconfig 2013-09-27 02:18:49.000000000 +0200
+++ linux-3.10.13/drivers/net/ethernet/Kconfig 2013-10-08 18:51:20.136389536 +0200
@@ -135,6 +135,7 @@
source "drivers/net/ethernet/packetengines/Kconfig"
source "drivers/net/ethernet/pasemi/Kconfig"
@ -104,8 +104,8 @@ Index: linux-3.10.13/drivers/net/ethernet/Kconfig
source "drivers/net/ethernet/rdc/Kconfig"
Index: linux-3.10.13/drivers/net/ethernet/Makefile
===================================================================
--- linux-3.10.13.orig/drivers/net/ethernet/Makefile 2013-10-08 17:26:43.276172503 +0200
+++ linux-3.10.13/drivers/net/ethernet/Makefile 2013-10-08 17:26:47.064172635 +0200
--- linux-3.10.13.orig/drivers/net/ethernet/Makefile 2013-09-27 02:18:49.000000000 +0200
+++ linux-3.10.13/drivers/net/ethernet/Makefile 2013-10-08 18:51:20.136389536 +0200
@@ -53,6 +53,7 @@
obj-$(CONFIG_NET_PACKET_ENGINE) += packetengines/
obj-$(CONFIG_NET_VENDOR_PASEMI) += pasemi/
@ -117,7 +117,7 @@ Index: linux-3.10.13/drivers/net/ethernet/Makefile
Index: linux-3.10.13/drivers/net/ethernet/ralink/Kconfig
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/Kconfig 2013-10-08 17:26:47.064172635 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/Kconfig 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,31 @@
+config NET_RALINK
+ tristate "Ralink RT288X/RT3X5X/RT3662/RT3883/MT7620 ethernet driver"
@ -153,7 +153,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/Kconfig
Index: linux-3.10.13/drivers/net/ethernet/ralink/Makefile
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/Makefile 2013-10-08 17:26:47.064172635 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/Makefile 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,18 @@
+#
+# Makefile for the Ralink SoCs built-in ethernet macs
@ -176,7 +176,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/Makefile
Index: linux-3.10.13/drivers/net/ethernet/ralink/esw_rt3052.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/esw_rt3052.c 2013-10-08 17:26:47.068172664 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/esw_rt3052.c 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,1463 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -1644,7 +1644,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/esw_rt3052.c
Index: linux-3.10.13/drivers/net/ethernet/ralink/esw_rt3052.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/esw_rt3052.h 2013-10-08 17:26:47.068172664 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/esw_rt3052.h 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,32 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -1681,7 +1681,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/esw_rt3052.h
Index: linux-3.10.13/drivers/net/ethernet/ralink/gsw_mt7620a.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/gsw_mt7620a.c 2013-10-08 17:26:47.068172664 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/gsw_mt7620a.c 2013-10-08 22:38:18.884129024 +0200
@@ -0,0 +1,566 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -2252,7 +2252,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/gsw_mt7620a.c
Index: linux-3.10.13/drivers/net/ethernet/ralink/gsw_mt7620a.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/gsw_mt7620a.h 2013-10-08 17:26:47.068172664 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/gsw_mt7620a.h 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,30 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -2287,7 +2287,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/gsw_mt7620a.h
Index: linux-3.10.13/drivers/net/ethernet/ralink/mdio.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/mdio.c 2013-10-08 17:26:47.068172664 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/mdio.c 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,244 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -2536,7 +2536,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/mdio.c
Index: linux-3.10.13/drivers/net/ethernet/ralink/mdio.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/mdio.h 2013-10-08 17:26:47.072172683 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/mdio.h 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,29 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -2570,7 +2570,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/mdio.h
Index: linux-3.10.13/drivers/net/ethernet/ralink/mdio_rt2880.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/mdio_rt2880.c 2013-10-08 17:26:47.072172683 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/mdio_rt2880.c 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,232 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -2807,7 +2807,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/mdio_rt2880.c
Index: linux-3.10.13/drivers/net/ethernet/ralink/mdio_rt2880.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/mdio_rt2880.h 2013-10-08 17:26:47.072172683 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/mdio_rt2880.h 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,26 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -2838,8 +2838,8 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/mdio_rt2880.h
Index: linux-3.10.13/drivers/net/ethernet/ralink/ralink_soc_eth.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/ralink_soc_eth.c 2013-10-08 17:26:47.072172683 +0200
@@ -0,0 +1,738 @@
+++ linux-3.10.13/drivers/net/ethernet/ralink/ralink_soc_eth.c 2013-10-08 20:19:33.904615836 +0200
@@ -0,0 +1,741 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
@ -2871,6 +2871,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/ralink_soc_eth.c
+#include <linux/of_net.h>
+#include <linux/of_mdio.h>
+#include <linux/if_vlan.h>
+#include <linux/reset.h>
+
+#include <asm/mach-ralink/ralink_regs.h>
+
@ -3472,6 +3473,8 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/ralink_soc_eth.c
+ struct clk *sysclk;
+ int err;
+
+ device_reset(&pdev->dev);
+
+ match = of_match_device(of_fe_match, &pdev->dev);
+ soc = (struct fe_soc_data *) match->data;
+ if (soc->reg_table)
@ -3581,7 +3584,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/ralink_soc_eth.c
Index: linux-3.10.13/drivers/net/ethernet/ralink/ralink_soc_eth.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/ralink_soc_eth.h 2013-10-08 17:26:47.076172688 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/ralink_soc_eth.h 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,375 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -3961,7 +3964,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/ralink_soc_eth.h
Index: linux-3.10.13/drivers/net/ethernet/ralink/soc_mt7620.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/soc_mt7620.c 2013-10-08 17:26:47.076172688 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/soc_mt7620.c 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,112 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -4078,7 +4081,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/soc_mt7620.c
Index: linux-3.10.13/drivers/net/ethernet/ralink/soc_rt2880.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/soc_rt2880.c 2013-10-08 17:26:47.076172688 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/soc_rt2880.c 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,51 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -4134,7 +4137,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/soc_rt2880.c
Index: linux-3.10.13/drivers/net/ethernet/ralink/soc_rt305x.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/soc_rt305x.c 2013-10-08 17:26:47.076172688 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/soc_rt305x.c 2013-10-08 18:51:20.136389536 +0200
@@ -0,0 +1,113 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -4252,7 +4255,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/soc_rt305x.c
Index: linux-3.10.13/drivers/net/ethernet/ralink/soc_rt3883.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/soc_rt3883.c 2013-10-08 17:26:47.076172688 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/soc_rt3883.c 2013-10-08 18:51:20.140389534 +0200
@@ -0,0 +1,60 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
@ -4317,8 +4320,8 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/soc_rt3883.c
Index: linux-3.10.13/drivers/net/ethernet/ralink/mt7530.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/mt7530.c 2013-10-08 17:29:27.020179572 +0200
@@ -0,0 +1,456 @@
+++ linux-3.10.13/drivers/net/ethernet/ralink/mt7530.c 2013-10-08 22:36:55.640125451 +0200
@@ -0,0 +1,467 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
@ -4633,6 +4636,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/mt7530.c
+ mt7530_w32(priv, 0x2310, 0x810000c0);
+ mt7530_w32(priv, 0x2410, 0x810000c0);
+ mt7530_w32(priv, 0x2510, 0x810000c0);
+
+ // set CPU/P7 port as user port
+ mt7530_w32(priv, 0x2610, 0x81000000);
+ mt7530_w32(priv, 0x2710, 0x81000000);
@ -4643,6 +4647,16 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/mt7530.c
+
+ for (i = 0; i < MT7530_NUM_VLANS; i++) {
+ u8 ports = priv->vlans[i].ports;
+ u32 val = mt7530_r32(priv, 0x100 + 4 * (i / 2));
+
+ if (i % 2 == 0) {
+ val &= 0xfff000;
+ val |= i;
+ } else {
+ val &= 0xfff;
+ val |= (i << 12);
+ }
+ mt7530_w32(priv, 0x100 + 4 * (i / 2), val);
+
+ if (ports)
+ mt7530_w32(priv, REG_ESW_VLAN_VAWD1, BIT(30) | (ports << 16) | BIT(0));
@ -4778,7 +4792,7 @@ Index: linux-3.10.13/drivers/net/ethernet/ralink/mt7530.c
Index: linux-3.10.13/drivers/net/ethernet/ralink/mt7530.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-3.10.13/drivers/net/ethernet/ralink/mt7530.h 2013-10-08 17:29:59.596180829 +0200
+++ linux-3.10.13/drivers/net/ethernet/ralink/mt7530.h 2013-10-08 18:51:20.140389534 +0200
@@ -0,0 +1,20 @@
+/*
+ * This program is free software; you can redistribute it and/or