From d288bd58dcb27017e0f73e341c8694e06febbca6 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 9 Mar 2019 11:08:27 +0100 Subject: [PATCH] ipq40xx: convert Cisco Meraki MR33 to DSA This patch converts the Cisco Meraki MR33 to use ipqess + qca8k's DSA. Signed-off-by: Christian Lamparter --- .../ipq40xx/base-files/etc/board.d/02_network | 4 +- .../lib/preinit/05_set_iface_mac_ipq40xx.sh | 3 +- .../arch/arm/boot/dts/qcom-ipq4029-mr33.dts | 56 +++++++++---------- 3 files changed, 31 insertions(+), 32 deletions(-) diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index 13588d8af8..e269d44af4 100755 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -25,7 +25,6 @@ ipq40xx_setup_interfaces() dlink,dap-2610 |\ engenius,eap1300|\ engenius,emd1|\ - meraki,mr33|\ netgear,ex6100v2|\ netgear,ex6150v2|\ zyxel,wre6606) @@ -93,6 +92,9 @@ ipq40xx_setup_interfaces() "0u@eth0" "3:lan:2" "4:lan:1" ucidef_set_interface_wan "eth1" ;; + meraki,mr33) + ucidef_set_interface_lan "lan" + ;; qxwlan,e2600ac-c1 |\ qxwlan,e2600ac-c2) ucidef_set_interfaces_lan_wan "eth0" "eth1" diff --git a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh index 66c815ba19..28d5bb3d40 100644 --- a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh +++ b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh @@ -30,8 +30,7 @@ preinit_set_mac_address() { ip link set dev eth1 address $(macaddr_add "${base_mac}" 1) ;; meraki,mr33) - mac_lan=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) - [ -n "$mac_lan" ] && ip link set dev eth0 address "$mac_lan" + lan_mac=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) ;; zyxel,nbg6617) base_mac=$(cat /sys/class/net/eth0/address) diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-mr33.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-mr33.dts index 5003572420..8a21fdaa1c 100644 --- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-mr33.dts +++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-mr33.dts @@ -26,6 +26,7 @@ led-failsafe = &status_red; led-running = &status_green; led-upgrade = &power_orange; + ethernet0 = &gmac; }; /* Do we really need this defined? */ @@ -39,12 +40,6 @@ status = "okay"; }; - mdio@90000 { - status = "okay"; - pinctrl-0 = <&mdio_pins>; - pinctrl-names = "default"; - }; - /* It is a 56-bit counter that supplies the count to the ARM arch timers and without upstream driver */ counter@4a1000 { @@ -52,12 +47,6 @@ reg = <0x4a1000 0x4>; }; - ess_tcsr@1953000 { - compatible = "qcom,tcsr"; - reg = <0x1953000 0x1000>; - qcom,ess-interface-select = ; - }; - tcsr@1949000 { compatible = "qcom,tcsr"; reg = <0x1949000 0x100>; @@ -88,19 +77,6 @@ watchdog@b017000 { status = "okay"; }; - - ess-switch@c000000 { - switch_mac_mode = <0x3>; /* mac mode for RGMII RMII */ - switch_lan_bmp = <0x0>; /* lan port bitmap */ - switch_wan_bmp = <0x10>; /* wan port bitmap */ - }; - - edma@c080000 { - qcom,single-phy; - qcom,num_gmac = <1>; - phy-mode = "rgmii-rxid"; - status = "okay"; - }; }; keys { @@ -138,10 +114,32 @@ status = "okay"; }; -&gmac0 { - qcom,phy_mdio_addr = <1>; - qcom,poll_required = <1>; - vlan_tag = <0 0x20>; +&mdio { + status = "okay"; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; +}; + +&ess { + mac-mode = <0x3>; /* mac mode for RGMII RMII */ + status = "okay"; + + ports { + /delete-node/ port@1; + /delete-node/ port@2; + /delete-node/ port@3; + /delete-node/ port@4; + + port@5 { + phy-mode = "rgmii-rxid"; + phy-handle = <ðphy1>; + label = "lan"; + }; + }; +}; + +&gmac { + status = "okay"; }; &blsp1_i2c3 { -- 2.30.2