ipq806x: add qca8k support qca8k_trunk
authorJohn Crispin <john@phrozen.org>
Thu, 24 May 2018 22:03:29 +0000 (00:03 +0200)
committerJohn Crispin <john@phrozen.org>
Thu, 24 May 2018 22:03:29 +0000 (00:03 +0200)
Signed-off-by: John Crispin <john@phrozen.org>
14 files changed:
target/linux/ipq806x/Makefile
target/linux/ipq806x/base-files/etc/board.d/02_network
target/linux/ipq806x/config-4.14
target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-c2600.dts
target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-d7800.dts
target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-db149.dts
target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts
target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-r7500.dts
target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts
target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts
target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
target/linux/ipq806x/files-4.14/arch/arm/boot/dts/qcom-ipq8065-r7800.dts
target/linux/ipq806x/patches-4.14/0075-dsa-inherit-parent-mac.patch [new file with mode: 0644]

index 13be76e7ba9fc7a01d7baebcc6b4f8b145648557..53c93de0054a6ebb61da37cf9868c2c609ba1057 100644 (file)
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 ARCH:=arm
 BOARD:=ipq806x
 BOARDNAME:=Qualcomm Atheros IPQ806X
-FEATURES:=squashfs nand fpu
+FEATURES:=squashfs nand fpu ramdisk
 CPU_TYPE:=cortex-a15
 CPU_SUBTYPE:=neon-vfpv4
 MAINTAINER:=John Crispin <john@phrozen.org>
index 9d8af44855527dc40fb93d8d9a316ca068b8b190..9e878526d8f978acd4c3b2b4a66a8318f69a2dce 100755 (executable)
@@ -18,9 +18,10 @@ netgear,r7500 |\
 netgear,r7500v2 |\
 netgear,r7800 |\
 qcom,ipq8064-ap148 |\
+tplink,c2600 |\
 tplink,vr2600v)
-       ucidef_add_switch "switch0" \
-               "1:lan" "2:lan" "3:lan" "4:lan" "6@eth1" "5:wan" "0@eth0"
+       ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
+       ucidef_set_interface_wan "wan"
        ;;
 linksys,ea8500)
        hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
@@ -29,15 +30,6 @@ linksys,ea8500)
        ucidef_set_interface_macaddr "lan" "$hw_mac_addr"
        ucidef_set_interface_macaddr "wan" "$hw_mac_addr"
        ;;
-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,c2600)
-       ucidef_add_switch "switch0" \
-               "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6@eth1" "5:wan" "0@eth0"
-       ;;
 zyxel,nbg6817)
        hw_mac_addr=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
        ucidef_add_switch "switch0" \
index 8d31e4f77d39ae9ed87530ef1c86e5c73a410717..89a53ce7478e4a2baa18deccc6b25f4085e6dcb9 100644 (file)
@@ -2,7 +2,6 @@ CONFIG_ALIGNMENT_TRAP=y
 # CONFIG_AMBA_PL08X is not set
 # CONFIG_APQ_GCC_8084 is not set
 # CONFIG_APQ_MMCC_8084 is not set
-CONFIG_AR8216_PHY=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
 CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
 CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
index a3df82909e267891d0823e15e79d861ae9251378..6f2d8ce2e3aee8e9f8af99887124c65184bbb307 100644 (file)
                        pinctrl-0 = <&mdio0_pins>;
                        pinctrl-names = "default";
 
-                       phy0: ethernet-phy@0 {
-                               device_type = "ethernet-phy";
+                       phy_port1: 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 */
-                                       >;
                        };
 
-                       phy4: ethernet-phy@4 {
-                               device_type = "ethernet-phy";
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
                                reg = <4>;
                        };
+
+                       switch0@16 {
+                               compatible = "qca,qca8337";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               reg = <16>;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       port@0 {
+                                               reg = <0>;
+                                               label = "cpu";
+                                               ethernet = <&gmac1>;
+                                               phy-mode = "rgmii";
+
+                                               fixed-link {
+                                                       speed = <1000>;
+                                                       full-duplex;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               label = "lan1";
+                                               phy-handle = <&phy_port1>;
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               label = "lan2";
+                                               phy-handle = <&phy_port2>;
+                                       };
+
+                                       port@3 {
+                                               reg = <3>;
+                                               label = "lan3";
+                                               phy-handle = <&phy_port3>;
+                                       };
+
+                                       port@4 {
+                                               reg = <4>;
+                                               label = "lan4";
+                                               phy-handle = <&phy_port4>;
+                                       };
+
+                                       port@5 {
+                                               reg = <5>;
+                                               label = "wan";
+                                               phy-handle = <&phy_port5>;
+                                       };
+
+                                       /*
+                                        * Disabled until DSA supports multiple CPUs,
+                                        * otherwise it causes undefined behavior.
+                                        *
+                                        * port@6 {
+                                        *      reg = <6>;
+                                        *      label = "cpu";
+                                        *      ethernet = <&gmac2>;
+                                        *      phy-mode = "sgmii";
+                                        *
+                                        *      fixed-link {
+                                        *              speed = <1000>;
+                                        *              full-duplex;
+                                        *      };
+                                        * };
+                                        */
+                               };
+                       };              
                };
 
                gmac1: ethernet@37200000 {
 
                        pinctrl-0 = <&rgmii2_pins>;
                        pinctrl-names = "default";
-
+                       mac-address = [ 00 11 22 33 44 55];
                        fixed-link {
                                speed = <1000>;
                                full-duplex;
                        status = "ok";
                        phy-mode = "sgmii";
                        qcom,id = <2>;
+                       mac-address = [ 00 11 22 33 44 56];
 
                        fixed-link {
                                speed = <1000>;
index b683f0275bafd28572ad4493c1c6f309873ddac0..00906b1ca6de9f1ebfe27ff89855cc38af1058e1 100644 (file)
                        pinctrl-0 = <&mdio0_pins>;
                        pinctrl-names = "default";
 
-                       phy0: ethernet-phy@0 {
-                               device_type = "ethernet-phy";
+                       phy_port1: 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 */
-                                       >;
                        };
 
-                       phy4: ethernet-phy@4 {
-                               device_type = "ethernet-phy";
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
                                reg = <4>;
                        };
+
+                       switch0@16 {
+                               compatible = "qca,qca8337";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               reg = <16>;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       port@0 {
+                                               reg = <0>;
+                                               label = "cpu";
+                                               ethernet = <&gmac1>;
+                                               phy-mode = "rgmii";
+
+                                               fixed-link {
+                                                       speed = <1000>;
+                                                       full-duplex;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               label = "lan1";
+                                               phy-handle = <&phy_port1>;
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               label = "lan2";
+                                               phy-handle = <&phy_port2>;
+                                       };
+
+                                       port@3 {
+                                               reg = <3>;
+                                               label = "lan3";
+                                               phy-handle = <&phy_port3>;
+                                       };
+
+                                       port@4 {
+                                               reg = <4>;
+                                               label = "lan4";
+                                               phy-handle = <&phy_port4>;
+                                       };
+
+                                       port@5 {
+                                               reg = <5>;
+                                               label = "wan";
+                                               phy-handle = <&phy_port5>;
+                                       };
+
+                                       /*
+                                        * Disabled until DSA supports multiple CPUs,
+                                        * otherwise it causes undefined behavior.
+                                        *
+                                        * port@6 {
+                                        *      reg = <6>;
+                                        *      label = "cpu";
+                                        *      ethernet = <&gmac2>;
+                                        *      phy-mode = "sgmii";
+                                        *
+                                        *      fixed-link {
+                                        *              speed = <1000>;
+                                        *              full-duplex;
+                                        *      };
+                                        * };
+                                        */
+                               };
+                       };              
                };
 
                gmac1: ethernet@37200000 {
index 514ddb50147adde79729d4b69e183c5c69aff1d9..836edf34c2d0a5a07f90f0466f3c9d605460e13b 100644 (file)
                        pinctrl-0 = <&mdio0_pins>;
                        pinctrl-names = "default";
 
-                       phy0: ethernet-phy@0 {
-                               device_type = "ethernet-phy";
+                       phy_port1: 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 */
-                                       >;
                        };
 
-                       phy4: ethernet-phy@4 {
-                               device_type = "ethernet-phy";
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
                                reg = <4>;
                        };
+
+                       switch0@16 {
+                               compatible = "qca,qca8337";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               reg = <16>;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       port@0 {
+                                               reg = <0>;
+                                               label = "cpu";
+                                               ethernet = <&gmac1>;
+                                               phy-mode = "rgmii";
+
+                                               fixed-link {
+                                                       speed = <1000>;
+                                                       full-duplex;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               label = "lan4";
+                                               phy-handle = <&phy_port1>;
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               label = "lan3";
+                                               phy-handle = <&phy_port2>;
+                                       };
+
+                                       port@3 {
+                                               reg = <3>;
+                                               label = "lan2";
+                                               phy-handle = <&phy_port3>;
+                                       };
+
+                                       port@4 {
+                                               reg = <4>;
+                                               label = "lan1";
+                                               phy-handle = <&phy_port4>;
+                                       };
+
+                                       port@5 {
+                                               reg = <5>;
+                                               label = "wan";
+                                               phy-handle = <&phy_port5>;
+                                       };
+
+                                       /*
+                                        * Disabled until DSA supports multiple CPUs,
+                                        * otherwise it causes undefined behavior.
+                                        *
+                                        * port@6 {
+                                        *      reg = <6>;
+                                        *      label = "cpu";
+                                        *      ethernet = <&gmac2>;
+                                        *      phy-mode = "sgmii";
+                                        *
+                                        *      fixed-link {
+                                        *              speed = <1000>;
+                                        *              full-duplex;
+                                        *      };
+                                        * };
+                                        */
+                               };
+                       };              
                };
 
                gmac1: ethernet@37200000 {
                        status = "ok";
                        phy-mode = "rgmii";
-                       phy-handle = <&phy4>;
                        qcom,id = <1>;
 
                        pinctrl-0 = <&rgmii2_pins>;
                        pinctrl-names = "default";
 
                        mtd-mac-address = <&art 6>;
+
+                       fixed-link {
+                               speed = <1000>;
+                               full-duplex;
+                       };
                };
 
                gmac2: ethernet@37400000 {
index 4c56866077c05a5dcd2f39cb3e9d071948d50c82..120978106088bd6d9198a30ae164ab02f6aca5b9 100644 (file)
                        pinctrl-0 = <&mdio0_pins>;
                        pinctrl-names = "default";
 
-                       phy0: ethernet-phy@0 {
-                               device_type = "ethernet-phy";
+                       phy_port1: 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 */
-                               >;
                        };
 
-                       phy4: ethernet-phy@4 {
-                               device_type = "ethernet-phy";
-                               reg = <4>;
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
                        };
 
-                       phy6: ethernet-phy@6 {
-                               device_type = "ethernet-phy";
-                               reg = <6>;
+                       phy_port4: phy@3 {
+                               reg = <3>;
                        };
 
-                       phy7: ethernet-phy@7 {
-                               device_type = "ethernet-phy";
-                               reg = <7>;
+                       phy_port5: phy@4 {
+                               reg = <4>;
                        };
+
+                       switch0@16 {
+                               compatible = "qca,qca8337";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               reg = <16>;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       port@0 {
+                                               reg = <0>;
+                                               label = "cpu";
+                                               ethernet = <&gmac1>;
+                                               phy-mode = "rgmii";
+
+                                               fixed-link {
+                                                       speed = <1000>;
+                                                       full-duplex;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               label = "lan4";
+                                               phy-handle = <&phy_port1>;
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               label = "lan3";
+                                               phy-handle = <&phy_port2>;
+                                       };
+
+                                       port@3 {
+                                               reg = <3>;
+                                               label = "lan2";
+                                               phy-handle = <&phy_port3>;
+                                       };
+
+                                       port@4 {
+                                               reg = <4>;
+                                               label = "lan1";
+                                               phy-handle = <&phy_port4>;
+                                       };
+
+                                       port@5 {
+                                               reg = <5>;
+                                               label = "wan";
+                                               phy-handle = <&phy_port5>;
+                                       };
+
+                                       /*
+                                        * Disabled until DSA supports multiple CPUs,
+                                        * otherwise it causes undefined behavior.
+                                        *
+                                        * port@6 {
+                                        *      reg = <6>;
+                                        *      label = "cpu";
+                                        *      ethernet = <&gmac2>;
+                                        *      phy-mode = "sgmii";
+                                        *
+                                        *      fixed-link {
+                                        *              speed = <1000>;
+                                        *              full-duplex;
+                                        *      };
+                                        * };
+                                        */
+                               };
+                       };              
                };
 
                gmac0: ethernet@37000000 {
                        status = "ok";
                        phy-mode = "rgmii";
                        qcom,id = <0>;
-                       phy-handle = <&phy4>;
 
                        pinctrl-0 = <&rgmii0_pins>;
                        pinctrl-names = "default";
                        status = "ok";
                        phy-mode = "sgmii";
                        qcom,id = <2>;
-                       phy-handle = <&phy6>;
                };
 
                gmac3: ethernet@37600000 {
                        status = "ok";
                        phy-mode = "sgmii";
                        qcom,id = <3>;
-                       phy-handle = <&phy7>;
                };
        };
 };
index 1e82a48dbfb712d7c69506d64bb0107f21919c82..4197c5f06ca35ec0045ce50969732edcf449157e 100644 (file)
                        pinctrl-0 = <&mdio0_pins>;
                        pinctrl-names = "default";
 
-                       phy0: ethernet-phy@0 {
-                               device_type = "ethernet-phy";
+                       phy_port1: 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 */
-                                       >;
                        };
 
-                       phy4: ethernet-phy@4 {
-                               device_type = "ethernet-phy";
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
                                reg = <4>;
                        };
+
+                       switch0@16 {
+                               compatible = "qca,qca8337";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               reg = <16>;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       port@0 {
+                                               reg = <0>;
+                                               label = "cpu";
+                                               ethernet = <&gmac1>;
+                                               phy-mode = "rgmii";
+
+                                               fixed-link {
+                                                       speed = <1000>;
+                                                       full-duplex;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               label = "lan1";
+                                               phy-handle = <&phy_port1>;
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               label = "lan2";
+                                               phy-handle = <&phy_port2>;
+                                       };
+
+                                       port@3 {
+                                               reg = <3>;
+                                               label = "lan3";
+                                               phy-handle = <&phy_port3>;
+                                       };
+
+                                       port@4 {
+                                               reg = <4>;
+                                               label = "lan4";
+                                               phy-handle = <&phy_port4>;
+                                       };
+
+                                       port@5 {
+                                               reg = <5>;
+                                               label = "wan";
+                                               phy-handle = <&phy_port5>;
+                                       };
+
+                                       /*
+                                        * Disabled until DSA supports multiple CPUs,
+                                        * otherwise it causes undefined behavior.
+                                        *
+                                        * port@6 {
+                                        *      reg = <6>;
+                                        *      label = "cpu";
+                                        *      ethernet = <&gmac2>;
+                                        *      phy-mode = "sgmii";
+                                        *
+                                        *      fixed-link {
+                                        *              speed = <1000>;
+                                        *              full-duplex;
+                                        *      };
+                                        * };
+                                        */
+                               };
+                       };              
                };
 
                gmac1: ethernet@37200000 {
index 7a209ece12ef43bc0736e81e7caa58fd59199c3c..240d2159e712b5ed78fbd2a81d097cf1a3f1a623 100644 (file)
                        pinctrl-0 = <&mdio0_pins>;
                        pinctrl-names = "default";
 
-                       phy0: ethernet-phy@0 {
-                               device_type = "ethernet-phy";
+                       phy_port1: 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 */
-                                       >;
                        };
 
-                       phy4: ethernet-phy@4 {
-                               device_type = "ethernet-phy";
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
                                reg = <4>;
                        };
+
+                       switch0@16 {
+                               compatible = "qca,qca8337";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               reg = <16>;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       port@0 {
+                                               reg = <0>;
+                                               label = "cpu";
+                                               ethernet = <&gmac1>;
+                                               phy-mode = "rgmii";
+
+                                               fixed-link {
+                                                       speed = <1000>;
+                                                       full-duplex;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               label = "lan4";
+                                               phy-handle = <&phy_port1>;
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               label = "lan3";
+                                               phy-handle = <&phy_port2>;
+                                       };
+
+                                       port@3 {
+                                               reg = <3>;
+                                               label = "lan2";
+                                               phy-handle = <&phy_port3>;
+                                       };
+
+                                       port@4 {
+                                               reg = <4>;
+                                               label = "lan1";
+                                               phy-handle = <&phy_port4>;
+                                       };
+
+                                       port@5 {
+                                               reg = <5>;
+                                               label = "wan";
+                                               phy-handle = <&phy_port5>;
+                                       };
+
+                                       /*
+                                        * Disabled until DSA supports multiple CPUs,
+                                        * otherwise it causes undefined behavior.
+                                        *
+                                        * port@6 {
+                                        *      reg = <6>;
+                                        *      label = "cpu";
+                                        *      ethernet = <&gmac2>;
+                                        *      phy-mode = "sgmii";
+                                        *
+                                        *      fixed-link {
+                                        *              speed = <1000>;
+                                        *              full-duplex;
+                                        *      };
+                                        * };
+                                        */
+                               };
+                       };              
                };
 
                gmac1: ethernet@37200000 {
index 089445fc3ea109fc459bad8bf54ee799df1c326c..3ff835219a76ab2bf4fbd02d963c41c956b48f0c 100644 (file)
                        pinctrl-0 = <&mdio0_pins>;
                        pinctrl-names = "default";
 
-                       phy0: ethernet-phy@0 {
-                               device_type = "ethernet-phy";
+                       phy_port1: 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 */
-                                       >;
                        };
 
-                       phy4: ethernet-phy@4 {
-                               device_type = "ethernet-phy";
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
                                reg = <4>;
                        };
+
+                       switch0@16 {
+                               compatible = "qca,qca8337";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               reg = <16>;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       port@0 {
+                                               reg = <0>;
+                                               label = "cpu";
+                                               ethernet = <&gmac1>;
+                                               phy-mode = "rgmii";
+
+                                               fixed-link {
+                                                       speed = <1000>;
+                                                       full-duplex;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               label = "lan4";
+                                               phy-handle = <&phy_port1>;
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               label = "lan3";
+                                               phy-handle = <&phy_port2>;
+                                       };
+
+                                       port@3 {
+                                               reg = <3>;
+                                               label = "lan2";
+                                               phy-handle = <&phy_port3>;
+                                       };
+
+                                       port@4 {
+                                               reg = <4>;
+                                               label = "lan1";
+                                               phy-handle = <&phy_port4>;
+                                       };
+
+                                       port@5 {
+                                               reg = <5>;
+                                               label = "wan";
+                                               phy-handle = <&phy_port5>;
+                                       };
+
+                                       /*
+                                        * Disabled until DSA supports multiple CPUs,
+                                        * otherwise it causes undefined behavior.
+                                        *
+                                        * port@6 {
+                                        *      reg = <6>;
+                                        *      label = "cpu";
+                                        *      ethernet = <&gmac2>;
+                                        *      phy-mode = "sgmii";
+                                        *
+                                        *      fixed-link {
+                                        *              speed = <1000>;
+                                        *              full-duplex;
+                                        *      };
+                                        * };
+                                        */
+                               };
+                       };              
                };
 
                gmac1: ethernet@37200000 {
index 08775273328be201e995b790dfcd835b3a83f097..90caa108018eae092fcff83252dcef3950242e13 100644 (file)
                        pinctrl-0 = <&mdio0_pins>;
                        pinctrl-names = "default";
 
-                       phy0: ethernet-phy@0 {
-                               device_type = "ethernet-phy";
+                       phy_port1: 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 */
-                                       >;
                        };
 
-                       phy4: ethernet-phy@4 {
-                               device_type = "ethernet-phy";
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
                                reg = <4>;
                        };
+
+                       switch0@16 {
+                               compatible = "qca,qca8337";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               reg = <16>;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       port@0 {
+                                               reg = <0>;
+                                               label = "cpu";
+                                               ethernet = <&gmac1>;
+                                               phy-mode = "rgmii";
+
+                                               fixed-link {
+                                                       speed = <1000>;
+                                                       full-duplex;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               label = "lan4";
+                                               phy-handle = <&phy_port1>;
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               label = "lan3";
+                                               phy-handle = <&phy_port2>;
+                                       };
+
+                                       port@3 {
+                                               reg = <3>;
+                                               label = "lan2";
+                                               phy-handle = <&phy_port3>;
+                                       };
+
+                                       port@4 {
+                                               reg = <4>;
+                                               label = "lan1";
+                                               phy-handle = <&phy_port4>;
+                                       };
+
+                                       port@5 {
+                                               reg = <5>;
+                                               label = "wan";
+                                               phy-handle = <&phy_port5>;
+                                       };
+
+                                       /*
+                                        * Disabled until DSA supports multiple CPUs,
+                                        * otherwise it causes undefined behavior.
+                                        *
+                                        * port@6 {
+                                        *      reg = <6>;
+                                        *      label = "cpu";
+                                        *      ethernet = <&gmac2>;
+                                        *      phy-mode = "sgmii";
+                                        *
+                                        *      fixed-link {
+                                        *              speed = <1000>;
+                                        *              full-duplex;
+                                        *      };
+                                        * };
+                                        */
+                               };
+                       };              
                };
 
                gmac1: ethernet@37200000 {
index 0b96ba64c69a88e2d64ecdc4a0fa65ac2a7ed1d9..112f5c2da8b369928e3d6f8b79e7c650a5d40d8c 100644 (file)
                        pinctrl-0 = <&mdio0_pins>;
                        pinctrl-names = "default";
 
-                       phy0: ethernet-phy@0 {
-                               device_type = "ethernet-phy";
+                       phy_port1: 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 */
-                                       >;
                        };
 
-                       phy4: ethernet-phy@4 {
-                               device_type = "ethernet-phy";
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
+
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
+
+                       phy_port4: phy@3 {
+                               reg = <3>;
+                       };
+
+                       phy_port5: phy@4 {
                                reg = <4>;
-                               qca,ar8327-initvals = <
-                                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                                       0x0000c 0x80        /* PAD6_MODE */
-                                       >;
                        };
+
+                       switch0@16 {
+                               compatible = "qca,qca8337";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               reg = <16>;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       port@0 {
+                                               reg = <0>;
+                                               label = "cpu";
+                                               ethernet = <&gmac1>;
+                                               phy-mode = "rgmii";
+
+                                               fixed-link {
+                                                       speed = <1000>;
+                                                       full-duplex;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               label = "lan1";
+                                               phy-handle = <&phy_port1>;
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               label = "lan2";
+                                               phy-handle = <&phy_port2>;
+                                       };
+
+                                       port@3 {
+                                               reg = <3>;
+                                               label = "lan3";
+                                               phy-handle = <&phy_port3>;
+                                       };
+
+                                       port@4 {
+                                               reg = <4>;
+                                               label = "lan4";
+                                               phy-handle = <&phy_port4>;
+                                       };
+
+                                       port@5 {
+                                               reg = <5>;
+                                               label = "wan";
+                                               phy-handle = <&phy_port5>;
+                                       };
+
+                                       /*
+                                        * Disabled until DSA supports multiple CPUs,
+                                        * otherwise it causes undefined behavior.
+                                        *
+                                        * port@6 {
+                                        *      reg = <6>;
+                                        *      label = "cpu";
+                                        *      ethernet = <&gmac2>;
+                                        *      phy-mode = "sgmii";
+                                        *
+                                        *      fixed-link {
+                                        *              speed = <1000>;
+                                        *              full-duplex;
+                                        *      };
+                                        * };
+                                        */
+                               };
+                       };              
                };
 
                gmac1: ethernet@37200000 {
index fbacc039d6c3895c316a733b70c598205ca2a334..c5823f690c258413737cb4606f41b3d794c7e491 100644 (file)
                        gpios = <&qcom_pinmux 1 GPIO_ACTIVE_HIGH &qcom_pinmux 0 GPIO_ACTIVE_HIGH>;
                        pinctrl-0 = <&mdio0_pins>;
                        pinctrl-names = "default";
+       
+                       phy_port1: phy@0 {
+                               reg = <0>;
+                       };
+
+                       phy_port2: phy@1 {
+                               reg = <1>;
+                       };
 
+                       phy_port3: phy@2 {
+                               reg = <2>;
+                       };
 
-                       phy0: ethernet-phy@0 {
-                               device_type = "ethernet-phy";
-                               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 */
-                               >;
+                       phy_port4: phy@3 {
+                               reg = <3>;
                        };
 
-                       phy4: ethernet-phy@4 {
-                               device_type = "ethernet-phy";
+                       phy_port5: phy@4 {
                                reg = <4>;
-                               qca,ar8327-initvals = <
-                                       0x000e4 0x6a545     /* MAC_POWER_SEL */
-                                       0x0000c 0x80        /* PAD6_MODE */
-                                       >;
                        };
+
+                       switch0@16 {
+                               compatible = "qca,qca8337";
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               reg = <16>;
+
+                               ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+                                       port@0 {
+                                               reg = <0>;
+                                               label = "cpu";
+                                               ethernet = <&gmac1>;
+                                               phy-mode = "rgmii";
+
+                                               fixed-link {
+                                                       speed = <1000>;
+                                                       full-duplex;
+                                               };
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               label = "lan4";
+                                               phy-handle = <&phy_port1>;
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               label = "lan3";
+                                               phy-handle = <&phy_port2>;
+                                       };
+
+                                       port@3 {
+                                               reg = <3>;
+                                               label = "lan2";
+                                               phy-handle = <&phy_port3>;
+                                       };
+
+                                       port@4 {
+                                               reg = <4>;
+                                               label = "lan1";
+                                               phy-handle = <&phy_port4>;
+                                       };
+
+                                       port@5 {
+                                               reg = <5>;
+                                               label = "wan";
+                                               phy-handle = <&phy_port5>;
+                                       };
+
+                                       /*
+                                        * Disabled until DSA supports multiple CPUs,
+                                        * otherwise it causes undefined behavior.
+                                        *
+                                        * port@6 {
+                                        *      reg = <6>;
+                                        *      label = "cpu";
+                                        *      ethernet = <&gmac2>;
+                                        *      phy-mode = "sgmii";
+                                        *
+                                        *      fixed-link {
+                                        *              speed = <1000>;
+                                        *              full-duplex;
+                                        *      };
+                                        * };
+                                        */
+                               };
+                       };              
                };
 
                gmac1: ethernet@37200000 {
diff --git a/target/linux/ipq806x/patches-4.14/0075-dsa-inherit-parent-mac.patch b/target/linux/ipq806x/patches-4.14/0075-dsa-inherit-parent-mac.patch
new file mode 100644 (file)
index 0000000..42b1bd2
--- /dev/null
@@ -0,0 +1,42 @@
+From 171b14b660f35f593748ac62bbdbb43ace2c582d Mon Sep 17 00:00:00 2001
+From: John Crispin <john@phrozen.org>
+Date: Tue, 1 Nov 2016 01:44:15 +0100
+Subject: [PATCH 10/22] net: dsa: make the slave device inheret the MAC of the
+ parent
+
+This patch makes all slave devices inherit the parent devices MAC.
+
+Signed-off-by: John Crispin <john@phrozen.org>
+---
+ net/dsa/slave.c |   11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+Index: linux-4.14.43/net/dsa/slave.c
+===================================================================
+--- linux-4.14.43.orig/net/dsa/slave.c
++++ linux-4.14.43/net/dsa/slave.c
+@@ -151,6 +151,16 @@ static int dsa_slave_close(struct net_de
+       return 0;
+ }
++static int dsa_slave_init(struct net_device *dev)
++{
++      struct dsa_slave_priv *p = netdev_priv(dev);
++      struct net_device *master = dsa_master_netdev(p);
++      struct sockaddr sa;
++
++      ether_addr_copy(sa.sa_data, master->dev_addr);
++      return eth_mac_addr(dev, &sa);
++}
++
+ static void dsa_slave_change_rx_flags(struct net_device *dev, int change)
+ {
+       struct dsa_slave_priv *p = netdev_priv(dev);
+@@ -1032,6 +1042,7 @@ static const struct ethtool_ops dsa_slav
+ static const struct net_device_ops dsa_slave_netdev_ops = {
+       .ndo_open               = dsa_slave_open,
+       .ndo_stop               = dsa_slave_close,
++      .ndo_init               = dsa_slave_init,
+       .ndo_start_xmit         = dsa_slave_xmit,
+       .ndo_change_rx_flags    = dsa_slave_change_rx_flags,
+       .ndo_set_rx_mode        = dsa_slave_set_rx_mode,