lantiq: xrx200: add support for lan3 and lan4 on AVM 5490/5491
authorAleksander Jan Bajkowski <olek2@wp.pl>
Fri, 3 Jan 2025 18:59:22 +0000 (19:59 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 4 Jan 2025 13:58:43 +0000 (14:58 +0100)
On the AVM 5490/5491, lan1, lan2 and wan ports are connected directly
to the internal GSWIP switch. The lan3 and lan4 ports are connected via
an external QCA8334 switch. This commit adds the missing entries in dts
and adds the driver module.

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://github.com/openwrt/openwrt/pull/17473
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz5490.dtsi
target/linux/lantiq/image/vr9.mk
target/linux/lantiq/xrx200/base-files/etc/board.d/02_network

index b38ac9f8b84a7da4520a82fb04fd135738d6fc57..2ba8e680b486f5d6981ea26d85f1cfe8ae2a13f6 100644 (file)
        phy9: ethernet-phy@9 {
                reg = <0x09>;
        };
+
+       switch@0 {
+               compatible = "qca,qca8334";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
+               reg = <0>;
+
+               dsa,member = <1 0>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               ethernet = <&rgmii0>;
+                               phy-mode = "rgmii-txid";
+                               tx-internal-delay-ps = <3000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+               };
+       };
 };
 
 &gswip_ports {
                phy-handle = <&phy6>;
        };
 
+       rgmii0: port@1 {
+               reg = <1>;
+               label = "sw0";
+               phy-mode = "rgmii";
+
+               fixed-link {
+                       speed = <1000>;
+                       full-duplex;
+               };
+       };
+
        port@2 {
                reg = <2>;
                label = "lan2";
index e2608213dc5f4f993a8e566409f45e0d3bdd2914..48a372f4768a2b48327eb39840d98a84ae02bf26 100644 (file)
@@ -177,7 +177,7 @@ define Device/avm_fritz5490
   DEVICE_VARIANT := Other NAND
   KERNEL_SIZE := 4096k
   IMAGE_SIZE := 49152k
-  DEVICE_PACKAGES := kmod-usb3 fritz-tffs \
+  DEVICE_PACKAGES := kmod-dsa-qca8k kmod-phy-qca83xx kmod-usb3 fritz-tffs \
        -ltq-vdsl-vr9-vectoring-fw-installer -kmod-ltq-vdsl-vr9-mei \
        -kmod-ltq-vdsl-vr9 -kmod-ltq-atm-vr9 -kmod-ltq-ptm-vr9 \
        -ltq-vdsl-vr9-app -kmod-owl-loader \
@@ -195,7 +195,7 @@ define Device/avm_fritz5490-micron
   DEVICE_VARIANT := Micron NAND
   KERNEL_SIZE := 4096k
   IMAGE_SIZE := 49152k
-  DEVICE_PACKAGES := kmod-usb3 fritz-tffs \
+  DEVICE_PACKAGES := kmod-dsa-qca8k kmod-phy-qca83xx kmod-usb3 fritz-tffs \
        -ltq-vdsl-vr9-vectoring-fw-installer -kmod-ltq-vdsl-vr9-mei \
        -kmod-ltq-vdsl-vr9 -kmod-ltq-atm-vr9 -kmod-ltq-ptm-vr9 \
        -ltq-vdsl-vr9-app -kmod-owl-loader \
index 6c35c7a4debb18cbc2e744ae8b55baaa8b452547..8c2cdb12af51f73f72d763b2cd62fbd3b3d811b0 100644 (file)
@@ -14,15 +14,13 @@ lantiq_setup_interfaces()
        arcadyan,arv7519rw22)
                ucidef_set_interface_lan "lan1 lan2 lan3 lan4 lan5"
                ;;
-       avm,fritz5490|\
-       avm,fritz5490-micron)
-               ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
-               ;;
        arcadyan,vgv7510kw22-brn|\
        arcadyan,vgv7510kw22-nor|\
        arcadyan,vgv7519-brn|\
        arcadyan,vgv7519-nor|\
        arcadyan,vrv9510kwac23|\
+       avm,fritz5490|\
+       avm,fritz5490-micron|\
        bt,homehub-v5a|\
        lantiq,easy80920-nand|\
        lantiq,easy80920-nor|\