ipq806x: convert each device to DSA implementation
authorChristian Marangi <ansuelsmth@gmail.com>
Fri, 6 Aug 2021 10:40:54 +0000 (12:40 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Sat, 30 Sep 2023 11:51:16 +0000 (13:51 +0200)
Convert each ipq806x device to DSA implementation using the qca8k
driver. Rework 02_network to follow the new naming scheme.
Update 01_leds to use netdev trigger with correct DSA port and drop
now unused switch trigger.

Currently secondary CPU is disabled and will be reneabled later.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
29 files changed:
target/linux/ipq806x/Makefile
target/linux/ipq806x/base-files/etc/board.d/01_leds
target/linux/ipq806x/base-files/etc/board.d/02_network
target/linux/ipq806x/base-files/etc/board.d/05_compat-version [new file with mode: 0644]
target/linux/ipq806x/config-6.1
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8062-wg2600hp3.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ad7200.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ap161.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-d7800.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-db149.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ea7500-v1.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-g10.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-onhub.dtsi
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wg2600hp.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wpq864.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8064-wxr-2533dhp.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-nighthawk.dtsi
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts
target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-tr4400-v2.dts
target/linux/ipq806x/image/chromium.mk
target/linux/ipq806x/image/generic.mk

index 108abce6b30c84f3d8201680e92e77b4db6df2e2..74a0007a4e01995bd09f5d6f1a3864a3c597f0b4 100644 (file)
@@ -16,7 +16,7 @@ KERNELNAME:=zImage Image dtbs
 
 include $(INCLUDE_DIR)/target.mk
 DEFAULT_PACKAGES += \
-       kmod-leds-gpio kmod-gpio-button-hotplug swconfig \
+       kmod-leds-gpio kmod-gpio-button-hotplug \
        kmod-ata-ahci kmod-ata-ahci-platform \
        kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
        kmod-phy-qcom-ipq806x-usb kmod-usb3 kmod-usb-dwc3-qcom \
index d4d40bd646324137947a7a605f1c4f4cdea39fac..950b7ad9688ca37429a480029b6b370ca60f27d5 100644 (file)
@@ -11,7 +11,7 @@ board=$(board_name)
 case "$board" in
 buffalo,wxr-2533dhp)
        ucidef_set_led_wlan "wlan" "WLAN" "white:wireless" "phy0tpt"
-       ucidef_set_led_switch "wan" "WAN" "white:internet" "switch0" "0x20"
+       ucidef_set_led_netdev "wan" "WAN" "white:internet" "wan"
        ;;
 compex,wpq864)
        ucidef_set_led_usbport "usb" "USB" "green:usb" "usb1-port1" "usb2-port1"
@@ -28,10 +28,10 @@ meraki,mr52)
 nec,wg2600hp)
        ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy1tpt"
        ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy0tpt"
-       ucidef_set_led_switch "wan" "WAN" "green:active" "switch0" "0x2"
+       ucidef_set_led_netdev "wan" "WAN" "green:active" "wan"
        ;;
 nec,wg2600hp3)
-       ucidef_set_led_switch "wan" "WAN" "green:active" "switch0" "0x2"
+       ucidef_set_led_netdev "wan" "WAN" "green:active" "wan"
        ;;
 netgear,d7800 |\
 netgear,r7500 |\
@@ -41,7 +41,7 @@ netgear,xr450 |\
 netgear,xr500)
        ucidef_set_led_usbport "usb1" "USB 1" "white:usb1" "usb1-port1" "usb2-port1"
        ucidef_set_led_usbport "usb2" "USB 2" "white:usb2" "usb3-port1" "usb4-port1"
-       ucidef_set_led_switch "wan" "WAN" "white:wan" "switch0" "0x20"
+       ucidef_set_led_netdev "wan" "WAN" "white:wan" "wan"
        ucidef_set_led_ide "esata" "eSATA" "white:esata"
        ;;
 nokia,ac400i)
@@ -55,8 +55,8 @@ nokia,ac400i)
 tplink,ad7200)
        ucidef_set_led_usbport "usb1" "USB 1" "blue:usb1" "usb1-port1" "usb2-port1"
        ucidef_set_led_usbport "usb2" "USB 2" "blue:usb3" "usb3-port1" "usb4-port1"
-       ucidef_set_led_switch "wan" "wan" "blue:wan" "switch0" "0x02"
-       ucidef_set_led_switch "lan" "lan" "blue:lan" "switch0" "0x3c"
+       ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan"
+       ucidef_set_led_netdev "lan" "lan" "blue:lan" "br-lan"
        ucidef_set_led_wlan "wlan2g" "wlan2g" "blue:wlan2g" "phy2tpt"
        ucidef_set_led_wlan "wlan5g" "wlan5g" "blue:wlan5g" "phy1tpt"
        ucidef_set_led_netdev "wlan60g" "wlan60g" "blue:wlan60g" "wlan0"
@@ -64,18 +64,18 @@ tplink,ad7200)
 tplink,c2600)
        ucidef_set_led_usbport "usb1" "USB 1" "white:usb_2" "usb1-port1" "usb2-port1"
        ucidef_set_led_usbport "usb2" "USB 2" "white:usb_4" "usb3-port1" "usb4-port1"
-       ucidef_set_led_switch "wan" "wan" "white:wan" "switch0" "0x20"
-       ucidef_set_led_switch "lan" "lan" "white:lan" "switch0" "0x1e"
+       ucidef_set_led_netdev "wan" "wan" "white:wan" "wan"
+       ucidef_set_led_netdev "lan" "lan" "white:lan" "br-lan"
        ;;
 tplink,vr2600v)
        ucidef_set_led_usbport "usb" "USB" "white:usb" "usb1-port1" "usb2-port1" "usb3-port1" "usb4-port1"
-       ucidef_set_led_switch "lan" "lan" "white:lan" "switch0" "0x1e"
+       ucidef_set_led_netdev "lan" "lan" "white:lan" "br-lan"
        ucidef_set_led_wlan "wlan2g" "WLAN2G" "white:wlan2g" "phy0tpt"
        ucidef_set_led_wlan "wlan5g" "WLAN5G" "white:wlan5g" "phy1tpt"
-       ucidef_set_led_switch "wan" "wan" "white:wan" "switch0" "0x20"
+       ucidef_set_led_netdev "wan" "WAN" "white:wan" "wan"
        ;;
 zyxel,nbg6817)
-       ucidef_set_led_netdev "wan" "WAN" "white:internet" "eth1"
+       ucidef_set_led_netdev "wan" "WAN" "white:internet" "wan"
        ;;
 esac
 
index bc45298da65087bbc8cee885e18629efd663a412..d64805b8f5e4319f694d526116f888b4a78a19d0 100644 (file)
@@ -12,81 +12,50 @@ ipq806x_setup_interfaces()
 
        case "$board" in
        arris,tr4400-v2)
-               ucidef_set_interfaces_lan_wan "eth1" "eth2"
-               ucidef_add_switch "switch0" \
-                       "1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "0u@eth0"
+               ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "eth2"
                ;;
        askey,rt4230w-rev6 |\
        asrock,g10 |\
-       nec,wg2600hp)
-               ucidef_add_switch "switch0" \
-                       "2:lan" "3:lan" "4:lan" "5:lan" "6@eth1" "1:wan" "0@eth0"
-               ;;
+       nec,wg2600hp |\
        buffalo,wxr-2533dhp |\
        compex,wpq864 |\
        netgear,d7800 |\
        netgear,r7500 |\
        netgear,r7500v2 |\
-       qcom,ipq8064-ap148)
-               ucidef_add_switch "switch0" \
-                       "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
-               ;;
-       edgecore,ecw5410)
-               ucidef_set_interfaces_lan_wan "eth1" "eth0"
-               ;;
-       linksys,ea7500-v1)
-               ucidef_add_switch "switch0" \
-                       "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6@eth1" "1:wan" "0@eth0"
-       ;;
-       linksys,ea8500)
-               ucidef_add_switch "switch0" \
-                       "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
-               ;;
-       meraki,mr42)
-               ucidef_set_interface_lan "eth0"
-               ;;
-       meraki,mr52)
-               ucidef_set_interfaces_lan_wan "eth0" "eth1"
-               ;;
-       nec,wg2600hp3)
-               ucidef_add_switch "switch0" \
-                       "2:lan" "3:lan" "4:lan" "5:lan" "0@eth1" "1:wan" "6@eth0"
-               ;;
+       qcom,ipq8064-ap148 |\
+       linksys,ea7500-v1 |\
+       linksys,ea8500 |\
+       nec,wg2600hp3 |\
        netgear,r7800 |\
-       netgear,xr450 |\
        netgear,xr500 |\
+       netgear,xr450 |\
        tplink,c2600 |\
-       tplink,vr2600v)
-               ucidef_add_switch "switch0" \
-                       "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6@eth1" "5:wan" "0@eth0"
-               ;;
-       qcom,ipq8064-ap161)
-               ucidef_set_interface_lan "eth1 eth2"
-               ucidef_add_switch "switch0" \
-                       "0:lan" "1:lan" "2:lan" "3u@eth1" "6:wan" "4u@eth0"
-               ;;
-       qcom,ipq8064-db149)
-               ucidef_set_interface_lan "eth1 eth2 eth3"
-               ucidef_add_switch "switch0" \
-                       "1:lan" "2:lan" "3:lan" "4:lan" "6u@eth1" "5:wan" "0u@eth0"
-               ;;
-       tplink,ad7200)
-               ucidef_add_switch "switch0" \
-                       "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6@eth1" "1:wan" "0@eth0"
+       tplink,vr2600v |\
+       tplink,ad7200 |\
+       zyxel,nbg6817)
+               ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
                ;;
        asus,onhub |\
        tplink,onhub)
+               ucidef_set_interfaces_lan_wan "lan1" "wan"
+               ;;
+       edgecore,ecw5410)
                ucidef_set_interfaces_lan_wan "eth1" "eth0"
-               ucidef_add_switch "switch0" \
-                       "1:lan" "6@eth1" "2:wan" "0@eth0"
                ;;
-       nokia,ac400i |\
+       qcom,ipq8064-ap161)
+               ucidef_set_interface_lan "eth1 eth2 lan1 lan2 lan3 lan4" "wan"
+               ;;
+       qcom,ipq8064-db149)
+               ucidef_set_interface_lan "eth1 eth2 eth3 lan1 lan2 lan3 lan4" "wan"
+               ;;
        ubnt,unifi-ac-hd)
                ucidef_set_interface_lan "eth0 eth1"
                ;;
-       zyxel,nbg6817)
-               ucidef_add_switch "switch0" \
-                       "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
+       meraki,mr42)
+               ucidef_set_interface_lan "eth0"
+               ;;
+       meraki,mr52)
+               ucidef_set_interfaces_lan_wan "eth0" "eth1"
                ;;
        *)
                echo "Unsupported hardware. Network interfaces not intialized"
@@ -94,34 +63,33 @@ ipq806x_setup_interfaces()
        esac
 }
 
-ipq806x_setup_mac_address()
+ipq806x_setup_macs()
 {
        local board="$1"
 
        case "$board" in
-       linksys,ea7500-v1)
-               hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
-               ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
-               ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
+               linksys,ea7500-v1)
+                       hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+                       ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
+                       ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
                ;;
-       linksys,ea8500)
-               hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
-               ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
-               ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
+               linksys,ea8500)
+                       hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
+                       ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
+                       ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
                ;;
-       zyxel,nbg6817)
-               hw_mac_addr=$(mtd_get_mac_ascii 0:appsblenv ethaddr)
-               ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
-               ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 3)"
+               zyxel,nbg6817)
+                       hw_mac_addr=$(mtd_get_mac_ascii 0:appsblenv ethaddr)
+                       ucidef_set_interface_macaddr "lan" "$(macaddr_add $hw_mac_addr 2)"
+                       ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 3)"
                ;;
        esac
 }
 
 board_config_update
-
 board=$(board_name)
 
-ipq806x_setup_mac_address $board
+ipq806x_setup_macs $board
 ipq806x_setup_interfaces $board
 
 board_config_flush
diff --git a/target/linux/ipq806x/base-files/etc/board.d/05_compat-version b/target/linux/ipq806x/base-files/etc/board.d/05_compat-version
new file mode 100644 (file)
index 0000000..74135b0
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# Copyright (C) 2020 OpenWrt.org
+#
+
+. /lib/functions.sh
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+case "$(board_name)" in
+       arris,tr4400-v2 |\
+       askey,rt4230w-rev6 |\
+       asrock,g10 |\
+       buffalo,wxr-2533dhp |\
+       compex,wpq864 |\
+       nec,wg2600hp |\
+       nec,wg2600hp3 |\
+       netgear,d7800 |\
+       netgear,r7500 |\
+       netgear,r7500v2 |\
+       netgear,r7800 |\
+       netgear,xr450 |\
+       netgear,xr500 |\
+       nokia,ac400i |\
+       qcom,ipq8064-ap148 |\
+       qcom,ipq8064-ap161 |\
+       qcom,ipq8064-db149 |\
+       tplink,ad7200 |\
+       tplink,c2600 |\
+       tplink,vr2600v |\
+       zyxel,nbg6817 |\
+       asus,onhub |\
+       tplink,onhub)
+               ucidef_set_compat_version "1.1"
+               ;;
+       linksys,ea7500-v1 |\
+       linksys,ea8500)
+               ucidef_set_compat_version "2.1"
+               ;;
+esac
+
+board_config_flush
+
+exit 0
index 960e16ae74df6bf32ac919effa2825e31d129e3a..a1214dc9178004df96dc793b2393877428a03c29 100644 (file)
@@ -1,7 +1,6 @@
 CONFIG_ALIGNMENT_TRAP=y
 # CONFIG_APQ_GCC_8084 is not set
 # CONFIG_APQ_MMCC_8084 is not set
-CONFIG_AR8216_PHY=y
 CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 # CONFIG_ARCH_IPQ40XX is not set
index c55287a4f129b886bd86d59eeb7e1f1379320496..e3987c6d07dfa625038a95508ecc6e1e89b21e49 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x04 0x80080080  /* PAD0_MODE */
-                       0x0c 0x06000000  /* PAD6_MODE */
-                       0x10 0x002613a0  /* PWS_REG */
-                       0x50 0xcc36cc36  /* LED_CTRL0 */
-                       0x54 0xca36ca36  /* LED_CTRL1 */
-                       0x58 0xc936c936  /* LED_CTRL2 */
-                       0x5c 0x03ffff00  /* LED_CTRL3 */
-                       0x7c 0x0000004e  /* PORT0_STATUS */
-                       0x94 0x0000004e  /* PORT6_STATUS */
-                       0xe0 0xc74164de  /* SGMII_CTRL */
-                       0xe4 0x0006a545  /* MAC_PWR_SEL */
-                       >;
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
+
+                       /*
+                       port@6 {
+                               reg = <6>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "sgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 3494b2bde2f28e8070263c353f978dfb71b21d73..9d05cf40326ab3bc097539ad59b0a65358ded114 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       >;
-       };
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
 
-       phy4: ethernet-phy@4 {
-               reg = <4>;
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 6cb21fc4f3f08ae595d13901a2e9cefbcd102fda..f76e098d9e6188126a31cbb116cef41cfe95a4a6 100644 (file)
        };
 };
 
+&mdio0 {
+       switch@10 {
+               ports {
+                       port@1 {
+                               label = "wan";
+                       };
+
+                       port@2 {
+                               label = "lan1";
+                       };
+
+                       port@3 {
+                               label = "lan2";
+                       };
+
+                       port@4 {
+                               label = "lan3";
+                       };
+
+                       port@5 {
+                               label = "lan4";
+                       };
+               };
+       };
+};
+
 &pcie2 {
        status = "okay";
        max-link-speed = <1>;
index d3b7c44877e2ea934b7284dea5ff3dc54a826e1b..bd8f0d60192951894b805aa581eaf9aa02cbe33a 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       >;
-       };
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
+
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
 
-       phy4: ethernet-phy@4 {
-               reg = <4>;
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 02ddbf31180fc18af6c9f13d63af0977fac5e6b7..9d0b451f4360cb548c68fa37d46e8736daa961dd 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x20080     /* PAD6_MODE */
-                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       >;
-       };
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac0>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
+
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
 
-       phy4: ethernet-phy@4 {
-               reg = <4>;
-               qca,phy-rgmii-en;
-               qca,txclk-delay-en;
-               qca,rxclk-delay-en;
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 
        phy3: ethernet-phy@3 {
index b8273c614ae92c174f527654fab9773fa47e06e4..c8e4a1810eb9f5c2dd33c8e8ba5ff0e135d0dfff 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       >;
-       };
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
 
-       phy4: ethernet-phy@4 {
-               reg = <4>;
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index f628df919b48726710ca435690aa7711dc967153..063f27c6d2d09c94f1bba9b10fa1a32dc0ca4c05 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-               >;
-       };
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac0>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
+
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
 
-       phy4: ethernet-phy@4 {
-               reg = <4>;
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 
        phy6: ethernet-phy@6 {
        status = "okay";
        phy-mode = "rgmii";
        qcom,id = <0>;
-       phy-handle = <&phy4>;
 
        pinctrl-0 = <&rgmii0_pins>;
        pinctrl-names = "default";
index 9d82d52d273ffd632d166bc48aa626deff3a5084..aab44ea9e3188cbd926ee79a9008c3ccf03d1b26 100644 (file)
                reg = <0x6080000 0x1f80000>;
        };
 };
+
+&mdio0 {
+       switch@10 {
+               ports {
+                       port@1 {
+                               label = "wan";
+                       };
+
+                       port@2 {
+                               label = "lan1";
+                       };
+
+                       port@3 {
+                               label = "lan2";
+                       };
+
+                       port@4 {
+                               label = "lan3";
+                       };
+
+                       port@5 {
+                               label = "lan4";
+                       };
+               };
+       };
+};
index 1c6a4bdacd02c242bc3bb0a50ad44741cc404c4f..bc3a2c304964d63291bbcec020174398795aac2a 100644 (file)
        };
 };
 
-&mdio0 {
-       phy4: ethernet-phy@4 {
-               reg = <4>;
-       };
-};
-
 &gmac1 {
        qcom,phy_mdio_addr = <4>;
        qcom,poll_required = <1>;
index 910bd86bc5ff2c1c34cd00f8c165d9aab1151c5d..fac43e785fb2eaaad63e3c8829055398cb49b9e7 100644 (file)
        reset-gpios = <&qcom_pinmux 63 GPIO_ACTIVE_HIGH>;
        reset-post-delay-us = <12000>;
 
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x00010 0x2613a0    /* PWS_REG */
-                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       >;
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
+
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 63a72b53ae734b045df314951107eef8e99447bf..6795e8fa4fb33f889c709e56a96aa05246011b0d 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       >;
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
+
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 5366105954745dd8f5e2c5eb4905e1401732cd7b..d20b55c2c2967689e4f694d7a4c42cfe6756855d 100644 (file)
                pinctrl-0 = <&mdio_pins>;
                pinctrl-names = "default";
 
-               phy0: ethernet-phy@0 {
-                       reg = <0>;
-                       qca,ar8327-initvals = <
-                               0x00004 0x7600000   /* PAD0_MODE */
-                               0x00008 0x1000000   /* PAD5_MODE */
-                               0x0000c 0x80        /* PAD6_MODE */
-                               0x000e4 0xaa545     /* MAC_POWER_SEL */
-                               0x000e0 0xc74164de  /* SGMII_CTRL */
-                               0x0007c 0x4e        /* PORT0_STATUS */
-                               0x00094 0x4e        /* PORT6_STATUS */
-                               >;
-               };
-
-               phy1: ethernet-phy@1 {
-                       reg = <1>;
+               switch@10 {
+                       compatible = "qca,qca8337";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0x10>;
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@0 {
+                                       reg = <0>;
+                                       label = "cpu";
+                                       ethernet = <&gmac0>;
+                                       phy-mode = "rgmii";
+                                       tx-internal-delay-ps = <1000>;
+                                       rx-internal-delay-ps = <1000>;
+
+                                       fixed-link {
+                                               speed = <1000>;
+                                               full-duplex;
+                                       };
+                               };
+
+                               port@1 {
+                                       reg = <1>;
+                                       label = "lan1";
+                                       phy-mode = "internal";
+                                       phy-handle = <&phy_port1>;
+                               };
+
+                               port@2 {
+                                       reg = <2>;
+                                       label = "wan";
+                                       phy-mode = "internal";
+                                       phy-handle = <&phy_port2>;
+                               };
+
+                               /*
+                               port@6 {
+                                       reg = <0>;
+                                       label = "cpu";
+                                       ethernet = <&gmac2>;
+                                       phy-mode = "rgmii";
+
+                                       fixed-link {
+                                               speed = <1000>;
+                                               full-duplex;
+                                               pause;
+                                               asym-pause;
+                                       };
+                               };
+                               */
+                       };
+
+                       mdio {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               phy_port1: phy@0 {
+                                       reg = <0>;
+                               };
+
+                               phy_port2: phy@1 {
+                                       reg = <1>;
+                               };
+                       };
                };
        };
 
index 7bea5b6bcebb24a83316f3d456f711499cdd7d37..ff464d9d1e8fbf15b2635a96998f1169acd9655a 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       >;
-       };
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
 
-       phy4: ethernet-phy@4 {
-               reg = <4>;
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 6f0ba09c8725c558d74132672da5e5d1e587d079..030d4456683f4b901c61457bb7999c8252f38f46 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0xaa545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       >;
-       };
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
 
-       phy4: ethernet-phy@4 {
-               reg = <4>;
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index b0db8c88635cd69422bdc2db25bc1c1d0d8a4d01..4fddf5e90a42f0f7d0c6c11ffde16d96753e2d63 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       >;
-       };
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
 
-       phy4: ethernet-phy@4 {
-               reg = <4>;
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 431c9cd9af84805701a1d4995f2526322bb6d745..47829a08aa2701ad3a6798479f75cf5d7b300098 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x06000000  /* PAD0_MODE */
-                       0x0000c 0x00080080  /* PAD6_MODE */
-                       0x000e4 0x0006a545  /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x0000004e  /* PORT0_STATUS */
-                       0x00094 0x0000004e  /* PORT6_STATUS */
-                       >;
-       };
+switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
+
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
 
-       ethernet-phy@4 {
-               reg = <4>;
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 359b4cd470ca9265b93f48f2c7e40deb6ceca3ad..37055f110b4968a89797cbf4d37cefdc746562e1 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       >;
-       };
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
 
-       ethernet-phy@4 {
-               reg = <4>;
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 39fd81fe5537f38cb5fe93400c6c80c023bb3606..97d76e11f0d1471a4747b4e500768afe20496eee 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x07600000  /* PAD0_MODE */
-                       0x00008 0x01000000  /* PAD5_MODE */
-                       0x0000c 0x00000080  /* PAD6_MODE */
-                       0x00050 0xcc35cc35  /* LED_CTRL0 */
-                       0x00054 0xca35ca35  /* LED_CTRL1 */
-                       0x00058 0xc935c935  /* LED_CTRL2 */
-                       0x0005c 0x03ffff00  /* LED_CTRL3 */
-                       0x000e4 0x0006a545  /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x0000007e  /* PORT0_STATUS */
-                       0x00094 0x0000007e  /* PORT6_STATUS */
-                       >;
-       };
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
 
-       ethernet-phy@4 {
-               reg = <4>;
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 60a949f44e30e71d88f8f3cb2335c1f1716b30d2..96becfb4c1e61d45e0112b93b77e03b62e462b30 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
 
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0xaa545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       0x00970 0x1e864443  /* QM_PORT0_CTRL0 */
-                       0x00974 0x000001c6  /* QM_PORT0_CTRL1 */
-                       0x00978 0x19008643  /* QM_PORT1_CTRL0 */
-                       0x0097c 0x000001c6  /* QM_PORT1_CTRL1 */
-                       0x00980 0x19008643  /* QM_PORT2_CTRL0 */
-                       0x00984 0x000001c6  /* QM_PORT2_CTRL1 */
-                       0x00988 0x19008643  /* QM_PORT3_CTRL0 */
-                       0x0098c 0x000001c6  /* QM_PORT3_CTRL1 */
-                       0x00990 0x19008643  /* QM_PORT4_CTRL0 */
-                       0x00994 0x000001c6  /* QM_PORT4_CTRL1 */
-                       0x00998 0x1e864443  /* QM_PORT5_CTRL0 */
-                       0x0099c 0x000001c6  /* QM_PORT5_CTRL1 */
-                       0x009a0 0x1e864443  /* QM_PORT6_CTRL0 */
-                       0x009a4 0x000001c6  /* QM_PORT6_CTRL1 */
-                       >;
-       };
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
+
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
 
-       phy4: ethernet-phy@4 {
-               reg = <4>;
-               qca,ar8327-initvals = <
-                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       >;
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 2328c497ea162977245d929535ad8d0d1864d957..ecd2c5634a9e66b997a5ef95eccfec444296744a 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0xaa545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       0x00970 0x1e864443  /* QM_PORT0_CTRL0 */
-                       0x00974 0x000001c6  /* QM_PORT0_CTRL1 */
-                       0x00978 0x19008643  /* QM_PORT1_CTRL0 */
-                       0x0097c 0x000001c6  /* QM_PORT1_CTRL1 */
-                       0x00980 0x19008643  /* QM_PORT2_CTRL0 */
-                       0x00984 0x000001c6  /* QM_PORT2_CTRL1 */
-                       0x00988 0x19008643  /* QM_PORT3_CTRL0 */
-                       0x0098c 0x000001c6  /* QM_PORT3_CTRL1 */
-                       0x00990 0x19008643  /* QM_PORT4_CTRL0 */
-                       0x00994 0x000001c6  /* QM_PORT4_CTRL1 */
-                       0x00998 0x1e864443  /* QM_PORT5_CTRL0 */
-                       0x0099c 0x000001c6  /* QM_PORT5_CTRL1 */
-                       0x009a0 0x1e864443  /* QM_PORT6_CTRL0 */
-                       0x009a4 0x000001c6  /* QM_PORT6_CTRL1 */
-                       >;
-               qca,ar8327-vlans = <
-                       0x1     0x5e        /* VLAN1 Ports 1/2/3/4/6 */
-                       0x2     0x21        /* VLAN2 Ports 0/5 */
-               >;
-       };
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
 
-       phy4: ethernet-phy@4 {
-               reg = <4>;
-               qca,ar8327-initvals = <
-                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       >;
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 8d9601b63247289bcfce3108db7a7d442468ed24..87948bb1d6ab2368f896f1af0df92ae069093887 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       phy0: ethernet-phy@0 {
-               reg = <0x0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0xaa545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       0x00050 0xcf02cf02  /* LED_CTRL_0 */
-                       0x00054 0xc832c832  /* LED_CTRL_1 */
-                       >;
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac0>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "wan";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       port@5 {
+                               reg = <5>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port5>;
+                       };
+
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac2>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
+                               reg = <4>;
+                       };
+               };
        };
 };
 
index 7b236af253e6409838c9bc109541c20dffaa5d4d..bb00bbe7d3179134bb27c2e931018c9cbc5b36e1 100644 (file)
        pinctrl-0 = <&mdio0_pins>;
        pinctrl-names = "default";
 
-       ethernet-phy@0 {
-               reg = <0x0>;
-               qca,ar8327-initvals = <
-                       0x00004 0x7600000   /* PAD0_MODE */
-                       0x00008 0x1000000   /* PAD5_MODE */
-                       0x0000c 0x80        /* PAD6_MODE */
-                       0x000e4 0xaa545     /* MAC_POWER_SEL */
-                       0x000e0 0xc74164de  /* SGMII_CTRL */
-                       0x0007c 0x4e        /* PORT0_STATUS */
-                       0x00094 0x4e        /* PORT6_STATUS */
-                       >;
+       switch@10 {
+               compatible = "qca,qca8337";
+               #address-cells = <1>;
+               #size-cells = <0>;
+               reg = <0x10>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac0>;
+                               phy-mode = "rgmii";
+                               tx-internal-delay-ps = <1000>;
+                               rx-internal-delay-ps = <1000>;
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                               };
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan1";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port1>;
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port2>;
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan3";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port3>;
+                       };
+
+                       port@4 {
+                               reg = <4>;
+                               label = "lan4";
+                               phy-mode = "internal";
+                               phy-handle = <&phy_port4>;
+                       };
+
+                       /*
+                       port@6 {
+                               reg = <0>;
+                               label = "cpu";
+                               ethernet = <&gmac1>;
+                               phy-mode = "rgmii";
+
+                               fixed-link {
+                                       speed = <1000>;
+                                       full-duplex;
+                                       pause;
+                                       asym-pause;
+                               };
+                       };
+                       */
+               };
+
+               mdio {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+               };
        };
 
        phy7: ethernet-phy@7 {
index ba989299760ea53fa2d774bd2e1792a431af6ed4..637f17a94acade184cb701ecbf18810079759112 100644 (file)
@@ -1,3 +1,8 @@
+define Device/dsa-migration
+  DEVICE_COMPAT_VERSION := 1.1
+  DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
+endef
+
 define Build/cros-gpt
        cp $@ $@.tmp 2>/dev/null || true
        ptgen -o $@.tmp -g \
@@ -47,6 +52,7 @@ endef
 
 define Device/asus_onhub
        $(call Device/OnhubImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := ASUS
        DEVICE_MODEL := OnHub SRT-AC1900
        DEVICE_DTS := $$(SOC)-asus-onhub
@@ -56,6 +62,7 @@ TARGET_DEVICES += asus_onhub
 
 define Device/tplink_onhub
        $(call Device/OnhubImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := TP-Link
        DEVICE_MODEL := OnHub AC1900 Cloud Router
        DEVICE_DTS := $$(SOC)-tplink-onhub
index a3e9eb59e723650d48ae4a33d526e37dbcda9f48..0339a612d8e26e2db0090eeaeba8ab08dd395fee 100644 (file)
@@ -8,6 +8,16 @@ define Device/kernel-size-migration
        use the force flag when image check fails. Settings will be lost. ***
 endef
 
+define Device/dsa-migration
+  DEVICE_COMPAT_VERSION := 1.1
+  DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
+endef
+
+define Device/dsa-migration-from-2_0
+  DEVICE_COMPAT_VERSION := 2.1
+  DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
+endef
+
 define Build/buffalo-rootfs-cksum
        ( \
                echo -ne "\x$$(od -A n -t u1 $@ | tr -s ' ' '\n' | \
@@ -67,6 +77,7 @@ endef
 
 define Device/arris_tr4400-v2
        $(call Device/LegacyImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := Arris
        DEVICE_MODEL := TR4400
        DEVICE_VARIANT := v2
@@ -80,6 +91,7 @@ TARGET_DEVICES += arris_tr4400-v2
 
 define Device/askey_rt4230w-rev6
        $(call Device/LegacyImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := Askey
        DEVICE_MODEL := RT4230W
        DEVICE_VARIANT := REV6
@@ -94,6 +106,7 @@ TARGET_DEVICES += askey_rt4230w-rev6
 define Device/asrock_g10
        $(call Device/FitImage)
        $(call Device/UbiFit)
+       $(Device/dsa-migration)
        SOC := qcom-ipq8064
        DEVICE_VENDOR := ASRock
        DEVICE_MODEL := G10
@@ -107,6 +120,7 @@ TARGET_DEVICES += asrock_g10
 
 define Device/buffalo_wxr-2533dhp
        $(call Device/LegacyImage)
+       $(Device/dsa-migration)
        SOC := qcom-ipq8064
        DEVICE_VENDOR := Buffalo
        DEVICE_MODEL := WXR-2533DHP
@@ -123,6 +137,7 @@ TARGET_DEVICES += buffalo_wxr-2533dhp
 define Device/compex_wpq864
        $(call Device/FitImage)
        $(call Device/UbiFit)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := Compex
        DEVICE_MODEL := WPQ864
        BLOCKSIZE := 128k
@@ -148,6 +163,7 @@ TARGET_DEVICES += edgecore_ecw5410
 define Device/linksys_ea7500-v1
        $(call Device/LegacyImage)
        $(Device/kernel-size-migration)
+       $(Device/dsa-migration-from-2_0)
        DEVICE_VENDOR := Linksys
        DEVICE_MODEL := EA7500
        DEVICE_VARIANT := v1
@@ -168,6 +184,7 @@ TARGET_DEVICES += linksys_ea7500-v1
 define Device/linksys_ea8500
        $(call Device/LegacyImage)
        $(Device/kernel-size-migration)
+       $(Device/dsa-migration-from-2_0)
        DEVICE_VENDOR := Linksys
        DEVICE_MODEL := EA8500
        SOC := qcom-ipq8064
@@ -223,6 +240,7 @@ TARGET_DEVICES += meraki_mr52
 
 define Device/nec_wg2600hp
        $(call Device/LegacyImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := NEC
        DEVICE_MODEL := Aterm WG2600HP
        SOC := qcom-ipq8064
@@ -236,6 +254,7 @@ TARGET_DEVICES += nec_wg2600hp
 
 define Device/nec_wg2600hp3
        $(call Device/LegacyImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := NEC Platforms
        DEVICE_MODEL := Aterm WG2600HP3
        SOC := qcom-ipq8062
@@ -252,6 +271,7 @@ TARGET_DEVICES += nec_wg2600hp3
 
 define Device/netgear_d7800
        $(call Device/DniImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := NETGEAR
        DEVICE_MODEL := Nighthawk X4 D7800
        SOC := qcom-ipq8064
@@ -271,6 +291,7 @@ TARGET_DEVICES += netgear_d7800
 
 define Device/netgear_r7500
        $(call Device/DniImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := NETGEAR
        DEVICE_MODEL := Nighthawk X4 R7500
        DEVICE_VARIANT := v1
@@ -288,6 +309,7 @@ TARGET_DEVICES += netgear_r7500
 
 define Device/netgear_r7500v2
        $(call Device/DniImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := NETGEAR
        DEVICE_MODEL := Nighthawk X4 R7500
        DEVICE_VARIANT := v2
@@ -306,6 +328,7 @@ TARGET_DEVICES += netgear_r7500v2
 
 define Device/netgear_r7800
        $(call Device/DniImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := NETGEAR
        DEVICE_MODEL := Nighthawk X4S R7800
        SOC := qcom-ipq8065
@@ -322,6 +345,7 @@ TARGET_DEVICES += netgear_r7800
 
 define Device/netgear_xr450
        $(call Device/DniImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := NETGEAR
        DEVICE_MODEL := Nighthawk XR450
        SOC := qcom-ipq8065
@@ -336,6 +360,7 @@ TARGET_DEVICES += netgear_xr450
 
 define Device/netgear_xr500
        $(call Device/DniImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := NETGEAR
        DEVICE_MODEL := Nighthawk XR500
        SOC := qcom-ipq8065
@@ -351,6 +376,7 @@ TARGET_DEVICES += netgear_xr500
 define Device/nokia_ac400i
        $(call Device/FitImage)
        $(call Device/UbiFit)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := Nokia
        DEVICE_MODEL := AC400i
        SOC := qcom-ipq8065
@@ -365,6 +391,7 @@ TARGET_DEVICES += nokia_ac400i
 define Device/qcom_ipq8064-ap148
        $(call Device/FitImage)
        $(call Device/UbiFit)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := Qualcomm
        DEVICE_MODEL := AP148
        DEVICE_VARIANT := standard
@@ -382,6 +409,7 @@ TARGET_DEVICES += qcom_ipq8064-ap148
 define Device/qcom_ipq8064-ap148-legacy
        $(call Device/LegacyImage)
        $(call Device/UbiFit)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := Qualcomm
        DEVICE_MODEL := AP148
        DEVICE_VARIANT := legacy
@@ -398,6 +426,7 @@ TARGET_DEVICES += qcom_ipq8064-ap148-legacy
 define Device/qcom_ipq8064-ap161
        $(call Device/FitImage)
        $(call Device/UbiFit)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := Qualcomm
        DEVICE_MODEL := AP161
        SOC := qcom-ipq8064
@@ -412,6 +441,7 @@ TARGET_DEVICES += qcom_ipq8064-ap161
 
 define Device/qcom_ipq8064-db149
        $(call Device/FitImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := Qualcomm
        DEVICE_MODEL := DB149
        SOC := qcom-ipq8064
@@ -424,6 +454,7 @@ TARGET_DEVICES += qcom_ipq8064-db149
 
 define Device/tplink_ad7200
        $(call Device/TpSafeImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := TP-Link
        DEVICE_MODEL := AD7200
        DEVICE_VARIANT := v1/v2
@@ -440,6 +471,7 @@ TARGET_DEVICES += tplink_ad7200
 
 define Device/tplink_c2600
        $(call Device/TpSafeImage)
+       $(Device/dsa-migration)
        DEVICE_VENDOR := TP-Link
        DEVICE_MODEL := Archer C2600
        DEVICE_VARIANT := v1
@@ -454,6 +486,7 @@ endef
 TARGET_DEVICES += tplink_c2600
 
 define Device/tplink_vr2600v
+       $(Device/dsa-migration)
        DEVICE_VENDOR := TP-Link
        DEVICE_MODEL := Archer VR2600v
        DEVICE_VARIANT := v1
@@ -486,6 +519,7 @@ endef
 TARGET_DEVICES += ubnt_unifi-ac-hd
 
 define Device/zyxel_nbg6817
+       $(Device/dsa-migration)
        DEVICE_VENDOR := ZyXEL
        DEVICE_MODEL := NBG6817
        SOC := qcom-ipq8065