arm64: dts: broadcom: bcm4908: describe internal switch
authorRafał Miłecki <rafal@milecki.pl>
Wed, 13 Jan 2021 11:14:06 +0000 (12:14 +0100)
committerFlorian Fainelli <f.fainelli@gmail.com>
Wed, 27 Jan 2021 00:26:30 +0000 (16:26 -0800)
BCM4908 has internal switch with 5 GPHYs. Ports 0 - 3 are always
connected to the internal PHYs. Remaining ports depend on device setup.

Asus GT-AC5300 has an extra switch with its PHYs accessible using the
internal MDIO.

CPU port and Ethernet interface remain to be documented.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908-asus-gt-ac5300.dts
arch/arm64/boot/dts/broadcom/bcm4908/bcm4908.dtsi

index 13c6b86eef210866e8bdbfcb1734b6029b799b25..6e4ad66ff536007c8fa41dcf7c122048fe64f3c7 100644 (file)
        };
 };
 
+&ports {
+       port@0 {
+               label = "lan2";
+       };
+
+       port@1 {
+               label = "lan1";
+       };
+
+       port@2 {
+               label = "lan6";
+       };
+
+       port@3 {
+               label = "lan5";
+       };
+
+       /* External BCM53134S switch */
+       port@7 {
+               label = "sw";
+               reg = <7>;
+
+               fixed-link {
+                       speed = <1000>;
+                       full-duplex;
+               };
+       };
+};
+
+&mdio {
+       /* lan8 */
+       ethernet-phy@0 {
+               reg = <0>;
+       };
+
+       /* lan7 */
+       ethernet-phy@1 {
+               reg = <1>;
+       };
+
+       /* lan4 */
+       ethernet-phy@2 {
+               reg = <2>;
+       };
+
+       /* lan3 */
+       ethernet-phy@3 {
+               reg = <3>;
+       };
+};
+
 &nandcs {
        nand-ecc-strength = <4>;
        nand-ecc-step-size = <512>;
index b5b772a9a51b7675bf178a3693d825edf8d0610e..3fa01886f3a1169131fea20d8409396f40fe3b16 100644 (file)
                compatible = "simple-bus";
                #address-cells = <1>;
                #size-cells = <1>;
-               ranges = <0x00 0x00 0x80000000 0x10000>;
+               ranges = <0x00 0x00 0x80000000 0xd0000>;
 
                usb@c300 {
                        compatible = "generic-ehci";
                        interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
                        status = "disabled";
                };
+
+               ethernet-switch@80000 {
+                       compatible = "simple-bus";
+                       #size-cells = <1>;
+                       #address-cells = <1>;
+                       ranges = <0 0x80000 0x50000>;
+
+                       ethernet-switch@0 {
+                               compatible = "brcm,bcm4908-switch";
+                               reg = <0x0 0x40000>,
+                                     <0x40000 0x110>,
+                                     <0x40340 0x30>,
+                                     <0x40380 0x30>,
+                                     <0x40600 0x34>,
+                                     <0x40800 0x208>;
+                               reg-names = "core", "reg", "intrl2_0",
+                                           "intrl2_1", "fcb", "acb";
+                               interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>,
+                                            <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH>;
+                               brcm,num-gphy = <5>;
+                               brcm,num-rgmii-ports = <2>;
+
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               ports: ports {
+                                       #address-cells = <1>;
+                                       #size-cells = <0>;
+
+                                       port@0 {
+                                               reg = <0>;
+                                               phy-mode = "internal";
+                                               phy-handle = <&phy8>;
+                                       };
+
+                                       port@1 {
+                                               reg = <1>;
+                                               phy-mode = "internal";
+                                               phy-handle = <&phy9>;
+                                       };
+
+                                       port@2 {
+                                               reg = <2>;
+                                               phy-mode = "internal";
+                                               phy-handle = <&phy10>;
+                                       };
+
+                                       port@3 {
+                                               reg = <3>;
+                                               phy-mode = "internal";
+                                               phy-handle = <&phy11>;
+                                       };
+                               };
+                       };
+
+                       mdio: mdio@405c0 {
+                               compatible = "brcm,unimac-mdio";
+                               reg = <0x405c0 0x8>;
+                               reg-names = "mdio";
+                               #size-cells = <0>;
+                               #address-cells = <1>;
+
+                               phy8: ethernet-phy@8 {
+                                       reg = <8>;
+                               };
+
+                               phy9: ethernet-phy@9 {
+                                       reg = <9>;
+                               };
+
+                               phy10: ethernet-phy@a {
+                                       reg = <10>;
+                               };
+
+                               phy11: ethernet-phy@b {
+                                       reg = <11>;
+                               };
+
+                               phy12: ethernet-phy@c {
+                                       reg = <12>;
+                               };
+                       };
+               };
        };
 
        bus@ff800000 {