From 87c7cac8f76378836f8a12d899cc1aad5b1e1792 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 26 Mar 2018 00:27:25 +0200 Subject: [PATCH] lantiq: Use device tree on BT Home HUB 5A This updates the device tree and the board.d files to work with device tree on the BTHH5A. Signed-off-by: Hauke Mehrtens --- .../lantiq/base-files/etc/board.d/02_network | 3 +- .../arch/mips/boot/dts/BTHOMEHUBV5A.dts | 51 ++++++++++++------- .../files-4.14/arch/mips/boot/dts/vr9.dtsi | 24 ++++++--- 3 files changed, 50 insertions(+), 28 deletions(-) diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network index ca974b071e..c25723e280 100755 --- a/target/linux/lantiq/base-files/etc/board.d/02_network +++ b/target/linux/lantiq/base-files/etc/board.d/02_network @@ -106,8 +106,7 @@ bt,homehub-v3a) bt,homehub-v5a) lan_mac=$(mtd_get_mac_binary_ubi caldata 4364) wan_mac=$(macaddr_add "$lan_mac" 1) - ucidef_add_switch "switch0" \ - "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0" + ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan" ;; netgear,dgn1000b) diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV5A.dts b/target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV5A.dts index a3be0a5c9c..acbed18989 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV5A.dts +++ b/target/linux/lantiq/files-4.14/arch/mips/boot/dts/BTHOMEHUBV5A.dts @@ -117,43 +117,59 @@ }; ð0 { - lan: interface@0 { - compatible = "lantiq,xrx200-pdi"; + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&gswip { + dsa,member = <0 0>; + + ports { #address-cells = <1>; #size-cells = <0>; - reg = <0>; - lantiq,switch; - ethernet@0 { - compatible = "lantiq,xrx200-pdi-port"; + port@0 { reg = <0>; + label = "lan3"; phy-mode = "rgmii"; phy-handle = <&phy0>; }; - ethernet@1 { - compatible = "lantiq,xrx200-pdi-port"; + + port@1 { reg = <1>; + label = "lan4"; phy-mode = "rgmii"; phy-handle = <&phy1>; }; - ethernet@2 { - compatible = "lantiq,xrx200-pdi-port"; + + port@2 { reg = <2>; + label = "lan2"; phy-mode = "gmii"; phy-handle = <&phy11>; }; - ethernet@4 { - compatible = "lantiq,xrx200-pdi-port"; + + port@4 { reg = <4>; + label = "lan1"; phy-mode = "gmii"; phy-handle = <&phy13>; }; - ethernet@5 { - compatible = "lantiq,xrx200-pdi-port"; + + port@5 { reg = <5>; + label = "wan"; phy-mode = "rgmii"; phy-handle = <&phy5>; }; + + port@6 { + reg = <0x6>; + label = "cpu"; + ethernet = <ð0>; + }; }; mdio@0 { @@ -164,33 +180,30 @@ phy0: ethernet-phy@0 { reg = <0x0>; - compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22"; }; phy1: ethernet-phy@1 { reg = <0x1>; - compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22"; }; phy5: ethernet-phy@5 { reg = <0x5>; - compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22"; }; phy11: ethernet-phy@11 { reg = <0x11>; - compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22"; }; phy13: ethernet-phy@13 { reg = <0x13>; - compatible = "lantiq,phy11g", "ethernet-phy-ieee802.3-c22"; }; }; }; &gphy0 { lantiq,gphy-mode = ; + compatible = "lantiq,xrx200a2x-gphy"; }; &gphy1 { lantiq,gphy-mode = ; + compatible = "lantiq,xrx200a2x-gphy"; }; &gpio { diff --git a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/vr9.dtsi b/target/linux/lantiq/files-4.14/arch/mips/boot/dts/vr9.dtsi index 1bc1d608b9..0d17e096c1 100644 --- a/target/linux/lantiq/files-4.14/arch/mips/boot/dts/vr9.dtsi +++ b/target/linux/lantiq/files-4.14/arch/mips/boot/dts/vr9.dtsi @@ -270,19 +270,29 @@ phy-names = "usb2-phy"; }; - eth0: eth@e108000 { + eth0: eth@E10B308 { #address-cells = <1>; #size-cells = <0>; compatible = "lantiq,xrx200-net"; - reg = < 0xe108000 0x3000 /* switch */ - 0xe10b100 0x70 /* mdio */ - 0xe10b1d8 0x30 /* mii */ - 0xe10b308 0x30 /* pmac */ + reg = < 0xE10B308 0x30 /* pmac */ >; interrupt-parent = <&icu0>; interrupts = <75 73 72>; - resets = <&reset0 21 16>, <&reset0 8 8>; - reset-names = "switch", "ppe"; + resets = <&reset0 21 16>, <&reset0 8 8>, <&reset0 3 3>; + reset-names = "switch", "ppe", "ppe_dsp"; + lantiq,phys = <&gphy0>, <&gphy1>; + }; + + gswip: gswip@E108000 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "lantiq,xrx200-gswip"; + reg = < 0xE108000 0x3000 /* switch */ + 0xE10B100 0x70 /* mdio */ + 0xE10B1D8 0x30 /* mii */ + >; + resets = <&reset0 21 16>, <&reset0 8 8>, <&reset0 3 3>; + reset-names = "switch", "ppe", "ppe_dsp"; lantiq,phys = <&gphy0>, <&gphy1>; }; -- 2.30.2