Skip to contentSkip to conversation

ARM: dts: sun7i: Add BCM53125 Device Tree nodes

PATCH New Florian Fainelli 3 participants 8 messages Jun 12, 2016 – Jun 27, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: dts: sun7i: Add BCM53125 Device Tree nodes

Hi all,

This patch adds the Device Tree nodes to support the BCM53125 switch hanging off the GMAC MDIO bus on the Lamobo R1 board.

The B53 driver has been accepted into net-next just recently:

https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=23c731e830009a51a39a7a558179007235c84eb7

Florian Fainelli (1):
ARM: dts: sun7i: Add BCM53125 Device Tree nodes

 arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts | 60 +++++++++++++++++++++++++++++--
 1 file changed, 57 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 ARM: dts: sun7i: Add BCM53125 Device Tree nodes

Now that we have a proper binding for Ethernet switches hanging off different buses, and a driver for the BCM53125 switch, add its Device Tree as a child MDIO node, at MDIO address 30 (Broadcom pseudo-PHY address) and describe the ports layout of the Lamobo R1 board.

---
 arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts | 60 +++++++++++++++++++++++++++++--
 1 file changed, 57 insertions(+), 3 deletions(-)
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +57 -3
index 5ee43d8bf174..697582397dcf 100644
@@ -110,13 +110,67 @@
 &gmac {
 	pinctrl-names = "default";
 	pinctrl-0 = <&gmac_pins_rgmii_a>;
-	phy = <&phy1>;
 	phy-mode = "rgmii";
 	phy-supply = <&reg_gmac_3v3>;
 	status = "okay";
 
-	phy1: ethernet-phy at 1 {
-		reg = <1>;
+	fixed-link {
+		speed = <1000>;
+		full-duplex;
+	};
+
+	mdio1 {
+		compatible = "snps,dwmac-mdio";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		switch: ethernet-switch at 30 {
+			compatible = "brcm,bcm53125";
+			reg = <30>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port at 0 {
+					reg = <0>;
+					label = "lan2";
+				};
+
+				port at 1 {
+					reg = <1>;
+					label = "lan3";
+				};
+
+				port at 2 {
+					reg = <2>;
+					label = "lan4";
+				};
+
+				port at 3 {
+					reg = <3>;
+					label = "wan";
+				};
+
+				port at 4 {
+					reg = <4>;
+					label = "lan1";
+				};
+
+				port at 8 {
+					reg = <8>;
+					label = "cpu";
+					ethernet = <&gmac>;
+					phy-mode = "rgmii";
+					fixed-link {
+						speed = <1000>;
+						full-duplex;
+					};
+				};
+			};
+		};
 	};
 };
 
Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/1 ARM: dts: sun7i: Add BCM53125 Device Tree nodes

Hi,

Quoted 21 lines · Florian Fainelli

Now that we have a proper binding for Ethernet switches hanging off different buses, and a driver for the BCM53125 switch, add its Device Tree as a child MDIO node, at MDIO address 30 (Broadcom pseudo-PHY address) and describe the ports layout of the Lamobo R1 board.

---
 arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts | 60 +++++++++++++++++++++++++++++--
 1 file changed, 57 insertions(+), 3 deletions(-)
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +0 -1
index 5ee43d8bf174..697582397dcf 100644
@@ -110,13 +110,67 @@
 &gmac {
        pinctrl-names = "default";
        pinctrl-0 = <&gmac_pins_rgmii_a>;
-       phy = <&phy1>;
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;

arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts line 122

Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +6 -2
        status = "okay";
 
-       phy1: ethernet-phy at 1 {
-               reg = <1>;
+       fixed-link {
+               speed = <1000>;
+               full-duplex;
+       };
+
+       mdio1 {

mdio will suffice.

arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts line 127

Quoted 5 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +5 -0
+               compatible = "snps,dwmac-mdio";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               switch: ethernet-switch at 30 {

30 decimal or 0x30 hex? We typically use hex values here.

Otherwise this patch looks good. You should send it to Maxime though.

ChenYu

Quoted 52 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +46 -1
+                       compatible = "brcm,bcm53125";
+                       reg = <30>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port at 0 {
+                                       reg = <0>;
+                                       label = "lan2";
+                               };
+
+                               port at 1 {
+                                       reg = <1>;
+                                       label = "lan3";
+                               };
+
+                               port at 2 {
+                                       reg = <2>;
+                                       label = "lan4";
+                               };
+
+                               port at 3 {
+                                       reg = <3>;
+                                       label = "wan";
+                               };
+
+                               port at 4 {
+                                       reg = <4>;
+                                       label = "lan1";
+                               };
+
+                               port at 8 {
+                                       reg = <8>;
+                                       label = "cpu";
+                                       ethernet = <&gmac>;
+                                       phy-mode = "rgmii";
+                                       fixed-link {
+                                               speed = <1000>;
+                                               full-duplex;
+                                       };
+                               };
+                       };
+               };
        };
 };
 
--

2.7.4

#3 lore raw

PATCH 1/1 ARM: dts: sun7i: Add BCM53125 Device Tree nodes

Quoted 7 lines · Chen-Yu Tsai

Hi,

Quoted 4 lines · Florian Fainelli

Now that we have a proper binding for Ethernet switches hanging off different buses, and a driver for the BCM53125 switch, add its Device Tree as a child MDIO node, at MDIO address 30 (Broadcom pseudo-PHY address) and describe the ports layout of the Lamobo R1 board.

You should also mention the board in the commit subject line.

ChenYu

Quoted 94 lines
Quoted 17 lines
---
 arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts | 60 +++++++++++++++++++++++++++++--
 1 file changed, 57 insertions(+), 3 deletions(-)
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +0 -1
index 5ee43d8bf174..697582397dcf 100644
@@ -110,13 +110,67 @@
 &gmac {
        pinctrl-names = "default";
        pinctrl-0 = <&gmac_pins_rgmii_a>;
-       phy = <&phy1>;
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;

arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts line 122

Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +6 -2
        status = "okay";
 
-       phy1: ethernet-phy at 1 {
-               reg = <1>;
+       fixed-link {
+               speed = <1000>;
+               full-duplex;
+       };
+
+       mdio1 {

mdio will suffice.

arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts line 127

Quoted 5 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +5 -0
+               compatible = "snps,dwmac-mdio";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               switch: ethernet-switch at 30 {

30 decimal or 0x30 hex? We typically use hex values here.

Otherwise this patch looks good. You should send it to Maxime though.

ChenYu

Quoted 52 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +46 -1
+                       compatible = "brcm,bcm53125";
+                       reg = <30>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port at 0 {
+                                       reg = <0>;
+                                       label = "lan2";
+                               };
+
+                               port at 1 {
+                                       reg = <1>;
+                                       label = "lan3";
+                               };
+
+                               port at 2 {
+                                       reg = <2>;
+                                       label = "lan4";
+                               };
+
+                               port at 3 {
+                                       reg = <3>;
+                                       label = "wan";
+                               };
+
+                               port at 4 {
+                                       reg = <4>;
+                                       label = "lan1";
+                               };
+
+                               port at 8 {
+                                       reg = <8>;
+                                       label = "cpu";
+                                       ethernet = <&gmac>;
+                                       phy-mode = "rgmii";
+                                       fixed-link {
+                                               speed = <1000>;
+                                               full-duplex;
+                                       };
+                               };
+                       };
+               };
        };
 };
 
--

2.7.4

#4 lore raw

PATCH 1/1 ARM: dts: sun7i: Add BCM53125 Device Tree nodes

In reply to Chen-Yu Tsai

Le 23/06/2016 22:48, Chen-Yu Tsai a ?crit :

Quoted 13 lines
Quoted 13 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +0 -1
index 5ee43d8bf174..697582397dcf 100644
@@ -110,13 +110,67 @@
 &gmac {
        pinctrl-names = "default";
        pinctrl-0 = <&gmac_pins_rgmii_a>;
-       phy = <&phy1>;
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;
        status = "okay";
 
Quoted 10 lines

arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts line 122

Quoted 8 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +6 -2
-       phy1: ethernet-phy at 1 {
-               reg = <1>;
+       fixed-link {
+               speed = <1000>;
+               full-duplex;
+       };
+
+       mdio1 {

mdio will suffice.

There is another label in sun7i-a20.dtsi named mdio which is for the MDIO controller node matching allwinner,sun4i-a10-mdio, which is not the one we want here, we want the MDIO controller associated with the Synopsys GMAC.

Quoted 8 lines

arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts line 127

Quoted 6 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +5 -0
+               compatible = "snps,dwmac-mdio";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               switch: ethernet-switch at 30 {

30 decimal or 0x30 hex? We typically use hex values here.

30 decimal, will fix that.

Signature · 1 line
Florian
#5 lore raw

PATCH 1/1 ARM: dts: sun7i: Add BCM53125 Device Tree nodes

Hi Florian,

Quoted 25 lines · Florian Fainelli

Le 23/06/2016 22:48, Chen-Yu Tsai a ?crit :

Quoted 13 lines
Quoted 13 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +0 -1
index 5ee43d8bf174..697582397dcf 100644
@@ -110,13 +110,67 @@
 &gmac {
        pinctrl-names = "default";
        pinctrl-0 = <&gmac_pins_rgmii_a>;
-       phy = <&phy1>;
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;
        status = "okay";
 
Quoted 10 lines

arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts line 122

Quoted 8 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +6 -2
-       phy1: ethernet-phy at 1 {
-               reg = <1>;
+       fixed-link {
+               speed = <1000>;
+               full-duplex;
+       };
+
+       mdio1 {

mdio will suffice.

Quoted 4 lines

There is another label in sun7i-a20.dtsi named mdio which is for the MDIO controller node matching allwinner,sun4i-a10-mdio, which is not the one we want here, we want the MDIO controller associated with the Synopsys GMAC.

Yes, but it's in a different node, and you're not using any labels, so I don't really see how that would conflict.

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160626/62a53454/attachment-0001.sig>
#6 lore raw

PATCH 1/1 ARM: dts: sun7i: Add BCM53125 Device Tree nodes

Le 26/06/2016 01:05, Maxime Ripard a ?crit :

Quoted 28 lines

Hi Florian,

Quoted 25 lines · Florian Fainelli

Le 23/06/2016 22:48, Chen-Yu Tsai a ?crit :

Quoted 23 lines
Quoted 11 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +0 -1
index 5ee43d8bf174..697582397dcf 100644
@@ -110,13 +110,67 @@
 &gmac {
        pinctrl-names = "default";
        pinctrl-0 = <&gmac_pins_rgmii_a>;
-       phy = <&phy1>;
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;

arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts line 122

Quoted 10 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +6 -2
        status = "okay";
 
-       phy1: ethernet-phy at 1 {
-               reg = <1>;
+       fixed-link {
+               speed = <1000>;
+               full-duplex;
+       };
+
+       mdio1 {

mdio will suffice.

Quoted 7 lines
Quoted 4 lines

There is another label in sun7i-a20.dtsi named mdio which is for the MDIO controller node matching allwinner,sun4i-a10-mdio, which is not the one we want here, we want the MDIO controller associated with the Synopsys GMAC.

Yes, but it's in a different node, and you're not using any labels, so I don't really see how that would conflict.

Fair enough, I sent a v2 which uses "mdio-gmac" as a label, should I respin a v3 which just uses "mdio"?

v2 is here;
http://www.spinics.net/lists/arm-kernel/msg514007.html

Signature · 1 line
Florian
#7 lore raw

PATCH 1/1 ARM: dts: sun7i: Add BCM53125 Device Tree nodes

Quoted 34 lines · Florian Fainelli

Le 26/06/2016 01:05, Maxime Ripard a ?crit :

Quoted 33 lines

Hi Florian,

Quoted 29 lines · Florian Fainelli

Le 23/06/2016 22:48, Chen-Yu Tsai a ?crit :

Quoted 13 lines
Quoted 13 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +0 -1
index 5ee43d8bf174..697582397dcf 100644
@@ -110,13 +110,67 @@
 &gmac {
        pinctrl-names = "default";
        pinctrl-0 = <&gmac_pins_rgmii_a>;
-       phy = <&phy1>;
        phy-mode = "rgmii";
        phy-supply = <&reg_gmac_3v3>;
        status = "okay";
 
Quoted 10 lines

arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts line 122

Quoted 8 lines
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +6 -2
-       phy1: ethernet-phy at 1 {
-               reg = <1>;
+       fixed-link {
+               speed = <1000>;
+               full-duplex;
+       };
+
+       mdio1 {

mdio will suffice.

There is another label in sun7i-a20.dtsi named mdio which is for the MDIO controller node matching allwinner,sun4i-a10-mdio, which is not the one we want here, we want the MDIO controller associated with the Synopsys GMAC.

Quoted 5 lines
Quoted 2 lines

Yes, but it's in a different node, and you're not using any labels, so I don't really see how that would conflict.

Fair enough, I sent a v2 which uses "mdio-gmac" as a label, should I respin a v3 which just uses "mdio"?

Yes, please do, thanks!

Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160627/a5cbbb7b/attachment.sig>