Skip to contentSkip to conversation

net: dsa: b53: BCM11360 support

PATCH Superseded Eric Anholt 7 participants 21 messages Apr 24, 2017 – Apr 25, 2017

Subsystems (6)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover net: dsa: b53: BCM11360 support

This little patch series follows on from Florian's fixes that he just sent, and enables the ethernet on the 911360_EP board.

Without Florian's fixes, the controller comes up and forwarding happens between eth1 and eth2, but the CPU's eth0 packets don't get forwarded.

Eric Anholt (2):
net: dsa: b53: Add compatible strings for the Cygnus-family BCM11360.
ARM: dts: Add the ethernet and ethernet PHY to the cygnus core DT.

 Documentation/devicetree/bindings/net/dsa/b53.txt |  3 ++
 arch/arm/boot/dts/bcm-cygnus.dtsi                 | 60 +++++++++++++++++++++++
 arch/arm/boot/dts/bcm911360_entphn.dts            |  8 +++
 drivers/net/dsa/b53/b53_srab.c                    |  2 +
 4 files changed, 73 insertions(+)
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/2 net: dsa: b53: Add compatible strings for the Cygnus-family BCM11360.

Cygnus is a small family of SoCs, of which we currently have devicetree for BCM11360 and BCM58300. The 11360's B53 is mostly the same as 58xx, just requiring a tiny bit of setup that was previously missing.

---
 Documentation/devicetree/bindings/net/dsa/b53.txt | 3 +++
 drivers/net/dsa/b53/b53_srab.c                    | 2 ++
 2 files changed, 5 insertions(+)
Documentation/devicetree/bindings/net/dsa/b53.txt +3 -0
index d6c6e41648d4..49c93d3c0839 100644
@@ -29,6 +29,9 @@ Required properties:
       "brcm,bcm58625-srab"
       "brcm,bcm88312-srab" and the mandatory "brcm,nsp-srab string
 
+  For the BCM11360 SoC, must be:
+      "brcm,bcm11360-srab" and the mandatory "brcm,cygnus-srab string
+
   For the BCM63xx/33xx SoCs with an integrated switch, must be one of:
       "brcm,bcm3384-switch"
       "brcm,bcm6328-switch"
drivers/net/dsa/b53/b53_srab.c +2 -0
index 8a62b6a69703..c37ffd1b6833 100644
@@ -364,6 +364,7 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm53018-srab" },
 	{ .compatible = "brcm,bcm53019-srab" },
 	{ .compatible = "brcm,bcm5301x-srab" },
+	{ .compatible = "brcm,bcm11360-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58522-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58525-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58535-srab", .data = (void *)BCM58XX_DEVICE_ID },
@@ -371,6 +372,7 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm58623-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58625-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm88312-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,cygnus-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,nsp-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ /* sentinel */ },
 };
Signature · 1 line
2.11.0
#11 lore raw

PATCH 2/2 ARM: dts: Add the ethernet and ethernet PHY to the cygnus core DT.

In reply to Eric Anholt

Cygnus has a single amac controller connected to the B53 switch with 2 PHYs. On the BCM911360_EP platform, those two PHYs are connected to the external ethernet jacks.

---
 arch/arm/boot/dts/bcm-cygnus.dtsi      | 60 ++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/bcm911360_entphn.dts |  8 +++++
 2 files changed, 68 insertions(+)
arch/arm/boot/dts/bcm-cygnus.dtsi +60 -0
index 009f1346b817..318899df9972 100644
@@ -142,6 +142,56 @@
 			interrupts = <0>;
 		};
 
+		mdio: mdio at 18002000 {
+			compatible = "brcm,iproc-mdio";
+			reg = <0x18002000 0x8>;
+			#size-cells = <1>;
+			#address-cells = <0>;
+
+			gphy0: eth-gphy at 0 {
+				reg = <0>;
+				max-speed = <1000>;
+			};
+
+			gphy1: eth-gphy at 1 {
+				reg = <1>;
+				max-speed = <1000>;
+			};
+		};
+
+		dsa: dsa at 18007000 {
+			compatible = "brcm,bcm11360-srab", "brcm,cygnus-srab";
+			reg = <0x18007000 0x1000>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port0 at 0 {
+					reg = <0>;
+					phy-handle = <&gphy0>;
+					phy-mode = "rgmii";
+				};
+
+				port1 at 1 {
+					reg = <1>;
+					phy-handle = <&gphy1>;
+					phy-mode = "rgmii";
+				};
+
+				port8 at 8 {
+					reg = <8>;
+					label = "cpu";
+					ethernet = <&eth0>;
+					fixed-link {
+						speed = <1000>;
+						full-duplex;
+					};
+				};
+			};
+		};
+
 		i2c0: i2c at 18008000 {
 			compatible = "brcm,cygnus-iproc-i2c", "brcm,iproc-i2c";
 			reg = <0x18008000 0x100>;
@@ -295,6 +345,16 @@
 			status = "disabled";
 		};
 
+		eth0: enet at 18042000 {
+			compatible = "brcm,amac";
+			reg = <0x18042000 0x1000>,
+			      <0x18110000 0x1000>;
+			reg-names = "amac_base", "idm_base";
+			interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
+			max-speed = <1000>;
+			status = "disabled";
+		};
+
 		nand: nand at 18046000 {
 			compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1";
 			reg = <0x18046000 0x600>, <0xf8105408 0x600>,
arch/arm/boot/dts/bcm911360_entphn.dts +8 -0
index 8b3800f46288..2a1f54ab3574 100644
@@ -57,6 +57,14 @@
 	};
 };
 
+&dsa {
+	status = "okay";
+};
+
+&eth0 {
+	status = "okay";
+};
+
 &uart3 {
 	status = "okay";
 };
Signature · 1 line
2.11.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] net: dsa: b53: Add compatible strings for the Cygnus-family BCM11360.

In reply to Eric Anholt
Quoted 6 lines · Eric Anholt

Cygnus is a small family of SoCs, of which we currently have devicetree for BCM11360 and BCM58300. The 11360's B53 is mostly the same as 58xx, just requiring a tiny bit of setup that was previously missing.

Signature · 1 line
Florian
Reviewed-by on v1 2/2
#12 lore raw

Re: [PATCH 2/2] ARM: dts: Add the ethernet and ethernet PHY to the cygnus core DT.

In reply to Eric Anholt
Quoted 5 lines · Eric Anholt

Cygnus has a single amac controller connected to the B53 switch with 2 PHYs. On the BCM911360_EP platform, those two PHYs are connected to the external ethernet jacks.

This looks fine, just a few nits on the label names:

Quoted 21 lines
---
 arch/arm/boot/dts/bcm-cygnus.dtsi      | 60 ++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/bcm911360_entphn.dts |  8 +++++
 2 files changed, 68 insertions(+)
arch/arm/boot/dts/bcm-cygnus.dtsi +8 -0
index 009f1346b817..318899df9972 100644
@@ -142,6 +142,56 @@
 			interrupts = <0>;
 		};
 
+		mdio: mdio at 18002000 {
+			compatible = "brcm,iproc-mdio";
+			reg = <0x18002000 0x8>;
+			#size-cells = <1>;
+			#address-cells = <0>;
+
+			gphy0: eth-gphy at 0 {
+				reg = <0>;

arch/arm/boot/dts/bcm-cygnus.dtsi line 162

Quoted 10 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +10 -0
+				max-speed = <1000>;
+			};
+
+			gphy1: eth-gphy at 1 {
+				reg = <1>;
+				max-speed = <1000>;
+			};
+		};
+
+		dsa: dsa at 18007000 {

This would be better named switch: switch at 18007000

arch/arm/boot/dts/bcm-cygnus.dtsi line 171

Quoted 9 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +9 -0
+			compatible = "brcm,bcm11360-srab", "brcm,cygnus-srab";
+			reg = <0x18007000 0x1000>;
+			status = "disabled";
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port0 at 0 {

You can probably just put port at 0

arch/arm/boot/dts/bcm-cygnus.dtsi line 177

Quoted 6 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +6 -0
+					reg = <0>;
+					phy-handle = <&gphy0>;
+					phy-mode = "rgmii";
+				};
+
+				port1 at 1 {

And so on

arch/arm/boot/dts/bcm-cygnus.dtsi line 183

Quoted 6 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +6 -0
+					reg = <1>;
+					phy-handle = <&gphy1>;
+					phy-mode = "rgmii";
+				};
+
+				port8 at 8 {

And so forth

Quoted 36 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +21 -0
+					reg = <8>;
+					label = "cpu";
+					ethernet = <&eth0>;
+					fixed-link {
+						speed = <1000>;
+						full-duplex;
+					};
+				};
+			};
+		};
+
 		i2c0: i2c at 18008000 {
 			compatible = "brcm,cygnus-iproc-i2c", "brcm,iproc-i2c";
 			reg = <0x18008000 0x100>;
@@ -295,6 +345,16 @@
 			status = "disabled";
 		};
 
+		eth0: enet at 18042000 {
+			compatible = "brcm,amac";
+			reg = <0x18042000 0x1000>,
+			      <0x18110000 0x1000>;
+			reg-names = "amac_base", "idm_base";
+			interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
+			max-speed = <1000>;
+			status = "disabled";
+		};
+
 		nand: nand at 18046000 {
 			compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1";
 			reg = <0x18046000 0x600>, <0xf8105408 0x600>,
arch/arm/boot/dts/bcm911360_entphn.dts +0 -0
index 8b3800f46288..2a1f54ab3574 100644

arch/arm/boot/dts/bcm911360_entphn.dts line 62

Quoted 6 lines
arch/arm/boot/dts/bcm911360_entphn.dts +3 -0
@@ -57,6 +57,14 @@
 	};
 };
 
+&dsa {
+	status = "okay";
+};

And that would be &switch here then.

With that fixed:

Quoted 9 lines
arch/arm/boot/dts/bcm911360_entphn.dts +5 -0
+
+&eth0 {
+	status = "okay";
+};
+
 &uart3 {
 	status = "okay";
 };
Signature · 1 line
Florian
maintainer
#14 lore raw

Re: [PATCH 2/2] ARM: dts: Add the ethernet and ethernet PHY to the cygnus core DT.

In reply to Eric Anholt
Quoted 6 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +6 -0
+		mdio: mdio at 18002000 {
+			compatible = "brcm,iproc-mdio";
+			reg = <0x18002000 0x8>;
+			#size-cells = <1>;
+			#address-cells = <0>;
+

arch/arm/boot/dts/bcm-cygnus.dtsi line 160

Quoted 10 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +10 -0
+			gphy0: eth-gphy at 0 {
+				reg = <0>;
+				max-speed = <1000>;
+			};
+
+			gphy1: eth-gphy at 1 {
+				reg = <1>;
+				max-speed = <1000>;
+			};
+		};

Hi Eric

Do these max-speed properties do anything useful? Is the PHY capable of > 1Gbps?

Thanks
Andrew

#3 lore raw

Re: [PATCH 1/2] net: dsa: b53: Add compatible strings for the Cygnus-family BCM11360.

In reply to Eric Anholt

Minor comment in line

Quoted 16 lines · Eric Anholt

Cygnus is a small family of SoCs, of which we currently have devicetree for BCM11360 and BCM58300. The 11360's B53 is mostly the same as 58xx, just requiring a tiny bit of setup that was previously missing.

---
 Documentation/devicetree/bindings/net/dsa/b53.txt | 3 +++
 drivers/net/dsa/b53/b53_srab.c                    | 2 ++
 2 files changed, 5 insertions(+)
Documentation/devicetree/bindings/net/dsa/b53.txt +0 -0
index d6c6e41648d4..49c93d3c0839 100644

Documentation/devicetree/bindings/net/dsa/b53.txt Required properties: · line 34

Quoted 6 lines
Documentation/devicetree/bindings/net/dsa/b53.txt +3 -0
@@ -29,6 +29,9 @@ Required properties:
       "brcm,bcm58625-srab"
       "brcm,bcm88312-srab" and the mandatory "brcm,nsp-srab string
 
+  For the BCM11360 SoC, must be:
+      "brcm,bcm11360-srab" and the mandatory "brcm,cygnus-srab string
+

place in alphabetical order in the doc?

Quoted 24 lines
Documentation/devicetree/bindings/net/dsa/b53.txt +0 -0
   For the BCM63xx/33xx SoCs with an integrated switch, must be one of:
       "brcm,bcm3384-switch"
       "brcm,bcm6328-switch"
drivers/net/dsa/b53/b53_srab.c +2 -0
index 8a62b6a69703..c37ffd1b6833 100644
@@ -364,6 +364,7 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm53018-srab" },
 	{ .compatible = "brcm,bcm53019-srab" },
 	{ .compatible = "brcm,bcm5301x-srab" },
+	{ .compatible = "brcm,bcm11360-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58522-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58525-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58535-srab", .data = (void *)BCM58XX_DEVICE_ID },
@@ -371,6 +372,7 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm58623-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58625-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm88312-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,cygnus-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,nsp-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ /* sentinel */ },
 };
#6 lore raw

Re: [PATCH 1/2] net: dsa: b53: Add compatible strings for the Cygnus-family BCM11360.

In reply to Eric Anholt

Hi Eric

A comment on the Device ID.

Quoted 38 lines · Eric Anholt

Cygnus is a small family of SoCs, of which we currently have devicetree for BCM11360 and BCM58300. The 11360's B53 is mostly the same as 58xx, just requiring a tiny bit of setup that was previously missing.

---
 Documentation/devicetree/bindings/net/dsa/b53.txt | 3 +++
 drivers/net/dsa/b53/b53_srab.c                    | 2 ++
 2 files changed, 5 insertions(+)
Documentation/devicetree/bindings/net/dsa/b53.txt +3 -0
index d6c6e41648d4..49c93d3c0839 100644
@@ -29,6 +29,9 @@ Required properties:
       "brcm,bcm58625-srab"
       "brcm,bcm88312-srab" and the mandatory "brcm,nsp-srab string
 
+  For the BCM11360 SoC, must be:
+      "brcm,bcm11360-srab" and the mandatory "brcm,cygnus-srab string
+
   For the BCM63xx/33xx SoCs with an integrated switch, must be one of:
       "brcm,bcm3384-switch"
       "brcm,bcm6328-switch"
drivers/net/dsa/b53/b53_srab.c +1 -0
index 8a62b6a69703..c37ffd1b6833 100644
@@ -364,6 +364,7 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm53018-srab" },
 	{ .compatible = "brcm,bcm53019-srab" },
 	{ .compatible = "brcm,bcm5301x-srab" },
+	{ .compatible = "brcm,bcm11360-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58522-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58525-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58535-srab", .data = (void *)BCM58XX_DEVICE_ID },

drivers/net/dsa/b53/b53_srab.c static const struct of_device_id b53_srab_of_match[] = { · line 375

Quoted 4 lines
drivers/net/dsa/b53/b53_srab.c +1 -0
@@ -371,6 +372,7 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm58623-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58625-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm88312-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,cygnus-srab", .data = (void *)BCM58XX_DEVICE_ID },

The device ID should be 0xd300. This is the actual value read from the switch regs. This also requires an entry in the 'b53_switch_chips' structure in b53_common.c.

drivers/net/dsa/b53/b53_srab.c static const struct of_device_id b53_srab_of_match[] = { · line 378

Quoted 3 lines
drivers/net/dsa/b53/b53_srab.c +0 -0
 	{ .compatible = "brcm,nsp-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ /* sentinel */ },
 };

Other wise this patch set looks good.

I was testing a similar change (except for the above, which doesn't affect the functionality) to get the switch working and it works.

Thanks
Arun

#7 lore raw

Re: [PATCH 1/2] net: dsa: b53: Add compatible strings for the Cygnus-family BCM11360.

Quoted 42 lines · Arun Parameswaran

Hi Eric

A comment on the Device ID.

Quoted 36 lines · Eric Anholt

Cygnus is a small family of SoCs, of which we currently have devicetree for BCM11360 and BCM58300. The 11360's B53 is mostly the same as 58xx, just requiring a tiny bit of setup that was previously missing.

---
 Documentation/devicetree/bindings/net/dsa/b53.txt | 3 +++
 drivers/net/dsa/b53/b53_srab.c                    | 2 ++
 2 files changed, 5 insertions(+)
Documentation/devicetree/bindings/net/dsa/b53.txt +3 -0
index d6c6e41648d4..49c93d3c0839 100644
@@ -29,6 +29,9 @@ Required properties:
       "brcm,bcm58625-srab"
       "brcm,bcm88312-srab" and the mandatory "brcm,nsp-srab string
 
+  For the BCM11360 SoC, must be:
+      "brcm,bcm11360-srab" and the mandatory "brcm,cygnus-srab string
+
   For the BCM63xx/33xx SoCs with an integrated switch, must be one of:
       "brcm,bcm3384-switch"
       "brcm,bcm6328-switch"
drivers/net/dsa/b53/b53_srab.c +1 -0
index 8a62b6a69703..c37ffd1b6833 100644
@@ -364,6 +364,7 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm53018-srab" },
 	{ .compatible = "brcm,bcm53019-srab" },
 	{ .compatible = "brcm,bcm5301x-srab" },
+	{ .compatible = "brcm,bcm11360-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58522-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58525-srab", .data = (void *)BCM58XX_DEVICE_ID },
Quoted 8 lines

drivers/net/dsa/b53/b53_srab.c static const struct of_device_id b53_srab_of_match[] = { · line 375

Quoted 6 lines
drivers/net/dsa/b53/b53_srab.c +1 -0
 	{ .compatible = "brcm,bcm58535-srab", .data = (void *)BCM58XX_DEVICE_ID },
@@ -371,6 +372,7 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm58623-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58625-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm88312-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,cygnus-srab", .data = (void *)BCM58XX_DEVICE_ID },

The device ID should be 0xd300. This is the actual value read from the switch regs. This also requires an entry in the 'b53_switch_chips' structure in b53_common.c.

These are not real ID numbers, these are values that indicate the generation of the switch being embedded into the SoC. Within b53_common.c we don't have to differentiate a Starfighter 2 embedded in BCM11360, NSP, or 7445 or 7278, which is why using 58XX_DEVICE_ID should be good enough.

Quoted 11 lines

drivers/net/dsa/b53/b53_srab.c static const struct of_device_id b53_srab_of_match[] = { · line 378

Quoted 3 lines
drivers/net/dsa/b53/b53_srab.c +0 -0
 	{ .compatible = "brcm,nsp-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ /* sentinel */ },
 };

Other wise this patch set looks good.

I was testing a similar change (except for the above, which doesn't affect the functionality) to get the switch working and it works.

Thanks
Arun

Signature · 1 line
Florian
#8 lore raw

Re: [PATCH 1/2] net: dsa: b53: Add compatible strings for the Cygnus-family BCM11360.

Quoted 51 lines · Florian Fainelli
Quoted 42 lines · Arun Parameswaran

Hi Eric

A comment on the Device ID.

Quoted 36 lines · Eric Anholt

Cygnus is a small family of SoCs, of which we currently have devicetree for BCM11360 and BCM58300. The 11360's B53 is mostly the same as 58xx, just requiring a tiny bit of setup that was previously missing.

---
 Documentation/devicetree/bindings/net/dsa/b53.txt | 3 +++
 drivers/net/dsa/b53/b53_srab.c                    | 2 ++
 2 files changed, 5 insertions(+)
Documentation/devicetree/bindings/net/dsa/b53.txt +3 -0
index d6c6e41648d4..49c93d3c0839 100644
@@ -29,6 +29,9 @@ Required properties:
       "brcm,bcm58625-srab"
       "brcm,bcm88312-srab" and the mandatory "brcm,nsp-srab string
 
+  For the BCM11360 SoC, must be:
+      "brcm,bcm11360-srab" and the mandatory "brcm,cygnus-srab string
+
   For the BCM63xx/33xx SoCs with an integrated switch, must be one of:
       "brcm,bcm3384-switch"
       "brcm,bcm6328-switch"
drivers/net/dsa/b53/b53_srab.c +1 -0
index 8a62b6a69703..c37ffd1b6833 100644
@@ -364,6 +364,7 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm53018-srab" },
 	{ .compatible = "brcm,bcm53019-srab" },
 	{ .compatible = "brcm,bcm5301x-srab" },
+	{ .compatible = "brcm,bcm11360-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58522-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58525-srab", .data = (void *)BCM58XX_DEVICE_ID },
Quoted 8 lines

drivers/net/dsa/b53/b53_srab.c static const struct of_device_id b53_srab_of_match[] = { · line 375

Quoted 6 lines
drivers/net/dsa/b53/b53_srab.c +1 -0
 	{ .compatible = "brcm,bcm58535-srab", .data = (void *)BCM58XX_DEVICE_ID },
@@ -371,6 +372,7 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm58623-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58625-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm88312-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,cygnus-srab", .data = (void *)BCM58XX_DEVICE_ID },

The device ID should be 0xd300. This is the actual value read from the switch regs. This also requires an entry in the 'b53_switch_chips' structure in b53_common.c.

Quoted 5 lines

These are not real ID numbers, these are values that indicate the generation of the switch being embedded into the SoC. Within b53_common.c we don't have to differentiate a Starfighter 2 embedded in BCM11360, NSP, or 7445 or 7278, which is why using 58XX_DEVICE_ID should be good enough.

Ok. Thanks.

I was under the impression, that these id's could be used in the b53_switch_detect() API to auto detect the switch. In that API, the switch ID is read from the Management page register.

Quoted 12 lines
Quoted 11 lines

drivers/net/dsa/b53/b53_srab.c static const struct of_device_id b53_srab_of_match[] = { · line 378

Quoted 3 lines
drivers/net/dsa/b53/b53_srab.c +0 -0
 	{ .compatible = "brcm,nsp-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ /* sentinel */ },
 };

Other wise this patch set looks good.

I was testing a similar change (except for the above, which doesn't affect the functionality) to get the switch working and it works.

Thanks
Arun

#9 lore raw

Re: [PATCH 1/2] net: dsa: b53: Add compatible strings for the Cygnus-family BCM11360.

Quoted 59 lines · Arun Parameswaran
Quoted 51 lines · Florian Fainelli
Quoted 42 lines · Arun Parameswaran

Hi Eric

A comment on the Device ID.

Quoted 36 lines · Eric Anholt

Cygnus is a small family of SoCs, of which we currently have devicetree for BCM11360 and BCM58300. The 11360's B53 is mostly the same as 58xx, just requiring a tiny bit of setup that was previously missing.

---
 Documentation/devicetree/bindings/net/dsa/b53.txt | 3 +++
 drivers/net/dsa/b53/b53_srab.c                    | 2 ++
 2 files changed, 5 insertions(+)
Documentation/devicetree/bindings/net/dsa/b53.txt +3 -0
index d6c6e41648d4..49c93d3c0839 100644
@@ -29,6 +29,9 @@ Required properties:
       "brcm,bcm58625-srab"
       "brcm,bcm88312-srab" and the mandatory "brcm,nsp-srab string
 
+  For the BCM11360 SoC, must be:
+      "brcm,bcm11360-srab" and the mandatory "brcm,cygnus-srab string
+
   For the BCM63xx/33xx SoCs with an integrated switch, must be one of:
       "brcm,bcm3384-switch"
       "brcm,bcm6328-switch"
drivers/net/dsa/b53/b53_srab.c +1 -0
index 8a62b6a69703..c37ffd1b6833 100644
@@ -364,6 +364,7 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm53018-srab" },
 	{ .compatible = "brcm,bcm53019-srab" },
 	{ .compatible = "brcm,bcm5301x-srab" },
+	{ .compatible = "brcm,bcm11360-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58522-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58525-srab", .data = (void *)BCM58XX_DEVICE_ID },
Quoted 8 lines

drivers/net/dsa/b53/b53_srab.c static const struct of_device_id b53_srab_of_match[] = { · line 375

Quoted 6 lines
drivers/net/dsa/b53/b53_srab.c +1 -0
 	{ .compatible = "brcm,bcm58535-srab", .data = (void *)BCM58XX_DEVICE_ID },
@@ -371,6 +372,7 @@ static const struct of_device_id b53_srab_of_match[] = {
 	{ .compatible = "brcm,bcm58623-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm58625-srab", .data = (void *)BCM58XX_DEVICE_ID },
 	{ .compatible = "brcm,bcm88312-srab", .data = (void *)BCM58XX_DEVICE_ID },
+	{ .compatible = "brcm,cygnus-srab", .data = (void *)BCM58XX_DEVICE_ID },

The device ID should be 0xd300. This is the actual value read from the switch regs. This also requires an entry in the 'b53_switch_chips' structure in b53_common.c.

Quoted 5 lines

These are not real ID numbers, these are values that indicate the generation of the switch being embedded into the SoC. Within b53_common.c we don't have to differentiate a Starfighter 2 embedded in BCM11360, NSP, or 7445 or 7278, which is why using 58XX_DEVICE_ID should be good enough.

Quoted 5 lines

Ok. Thanks.

I was under the impression, that these id's could be used in the b53_switch_detect() API to auto detect the switch. In that API, the switch ID is read from the Management page register.

For external switches that is the case, but for internal/integrated switches, the ID is not always representative of the switch. This is why the choice of a chip-type ID was used here while adding support for NSP to the b53 driver.

Signature · 1 line
Florian
#4 lore raw

Re: [PATCH 1/2] net: dsa: b53: Add compatible strings for the Cygnus-family BCM11360.

In reply to Scott Branden
Quoted 22 lines · Scott Branden

Minor comment in line

Quoted 19 lines · Eric Anholt

Cygnus is a small family of SoCs, of which we currently have devicetree for BCM11360 and BCM58300. The 11360's B53 is mostly the same as 58xx, just requiring a tiny bit of setup that was previously missing.

---
 Documentation/devicetree/bindings/net/dsa/b53.txt | 3 +++
 drivers/net/dsa/b53/b53_srab.c                    | 2 ++
 2 files changed, 5 insertions(+)
Documentation/devicetree/bindings/net/dsa/b53.txt +0 -0
index d6c6e41648d4..49c93d3c0839 100644
@@ -29,6 +29,9 @@ Required properties:
       "brcm,bcm58625-srab"
       "brcm,bcm88312-srab" and the mandatory "brcm,nsp-srab string
 
Quoted 4 lines

Documentation/devicetree/bindings/net/dsa/b53.txt Required properties: · line 34

Quoted 3 lines
Documentation/devicetree/bindings/net/dsa/b53.txt +3 -0
+  For the BCM11360 SoC, must be:
+      "brcm,bcm11360-srab" and the mandatory "brcm,cygnus-srab string
+

place in alphabetical order in the doc?

Moved it above BCM5310x now. I hope that's what you meant.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170424/ec506094/attachment.sig>

#5 lore raw

Re: [PATCH 1/2] net: dsa: b53: Add compatible strings for the Cygnus-family BCM11360.

Quoted 24 lines · Eric Anholt
Quoted 22 lines · Scott Branden

Minor comment in line

Quoted 19 lines · Eric Anholt

Cygnus is a small family of SoCs, of which we currently have devicetree for BCM11360 and BCM58300. The 11360's B53 is mostly the same as 58xx, just requiring a tiny bit of setup that was previously missing.

---
 Documentation/devicetree/bindings/net/dsa/b53.txt | 3 +++
 drivers/net/dsa/b53/b53_srab.c                    | 2 ++
 2 files changed, 5 insertions(+)
Documentation/devicetree/bindings/net/dsa/b53.txt +0 -0
index d6c6e41648d4..49c93d3c0839 100644
@@ -29,6 +29,9 @@ Required properties:
       "brcm,bcm58625-srab"
       "brcm,bcm88312-srab" and the mandatory "brcm,nsp-srab string
 
Quoted 7 lines
Quoted 4 lines

Documentation/devicetree/bindings/net/dsa/b53.txt Required properties: · line 34

Quoted 3 lines
Documentation/devicetree/bindings/net/dsa/b53.txt +3 -0
+  For the BCM11360 SoC, must be:
+      "brcm,bcm11360-srab" and the mandatory "brcm,cygnus-srab string
+

place in alphabetical order in the doc?

Moved it above BCM5310x now. I hope that's what you meant.

Yes, sorry for not being more clear.

#15 lore raw

Re: [PATCH 2/2] ARM: dts: Add the ethernet and ethernet PHY to the cygnus core DT.

In reply to Andrew Lunn
Quoted 19 lines · Andrew Lunn
Quoted 6 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +6 -0
+		mdio: mdio at 18002000 {
+			compatible = "brcm,iproc-mdio";
+			reg = <0x18002000 0x8>;
+			#size-cells = <1>;
+			#address-cells = <0>;
+

arch/arm/boot/dts/bcm-cygnus.dtsi line 160

Quoted 10 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +10 -0
+			gphy0: eth-gphy at 0 {
+				reg = <0>;
+				max-speed = <1000>;
+			};
+
+			gphy1: eth-gphy at 1 {
+				reg = <1>;
+				max-speed = <1000>;
+			};
+		};

Hi Eric

Quoted 2 lines

Do these max-speed properties do anything useful? Is the PHY capable of > 1Gbps?

Not sure where I had those copy-and-pasted from, but they don't seem
necessary. Dropped.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170424/ee121fb9/attachment.sig>

#13 lore raw

Re: [PATCH 2/2] ARM: dts: Add the ethernet and ethernet PHY to the cygnus core DT.

In reply to Florian Fainelli
Quoted 8 lines · Florian Fainelli
Quoted 5 lines · Eric Anholt

Cygnus has a single amac controller connected to the B53 switch with 2 PHYs. On the BCM911360_EP platform, those two PHYs are connected to the external ethernet jacks.

This looks fine, just a few nits on the label names:

Thanks. I've applied all of these (and Andrew's and Scott's
suggestions), and I'll send out a new version once the DT maintainers
have had a chance to look.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170424/897c79ae/attachment.sig>

#10 lore raw

Re: [PATCH 1/2] net: dsa: b53: Add compatible strings for the Cygnus-family BCM11360.

In reply to Eric Anholt

Hello!

Quoted 16 lines · Eric Anholt

Cygnus is a small family of SoCs, of which we currently have devicetree for BCM11360 and BCM58300. The 11360's B53 is mostly the same as 58xx, just requiring a tiny bit of setup that was previously missing.

---
 Documentation/devicetree/bindings/net/dsa/b53.txt | 3 +++
 drivers/net/dsa/b53/b53_srab.c                    | 2 ++
 2 files changed, 5 insertions(+)
Documentation/devicetree/bindings/net/dsa/b53.txt +0 -0
index d6c6e41648d4..49c93d3c0839 100644

Documentation/devicetree/bindings/net/dsa/b53.txt Required properties: · line 33

Quoted 5 lines
Documentation/devicetree/bindings/net/dsa/b53.txt +2 -0
@@ -29,6 +29,9 @@ Required properties:
       "brcm,bcm58625-srab"
       "brcm,bcm88312-srab" and the mandatory "brcm,nsp-srab string
 
+  For the BCM11360 SoC, must be:
+      "brcm,bcm11360-srab" and the mandatory "brcm,cygnus-srab string

Missing closing quote here and above?

[...]

MBR, Sergei

#16 lore raw

Re: [PATCH 2/2] ARM: dts: Add the ethernet and ethernet PHY to the cygnus core DT.

In reply to Eric Anholt

Hello.

Quoted 3 lines · Eric Anholt

Cygnus has a single amac controller connected to the B53 switch with 2 PHYs. On the BCM911360_EP platform, those two PHYs are connected to the external ethernet jacks.

My spell checker trips on "amac" and "ethernet" -- perhaps they need
capitalization?

Quoted 11 lines
---
 arch/arm/boot/dts/bcm-cygnus.dtsi      | 60 ++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/bcm911360_entphn.dts |  8 +++++
 2 files changed, 68 insertions(+)
arch/arm/boot/dts/bcm-cygnus.dtsi +0 -0
index 009f1346b817..318899df9972 100644

arch/arm/boot/dts/bcm-cygnus.dtsi line 151

Quoted 10 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +7 -0
@@ -142,6 +142,56 @@
 			interrupts = <0>;
 		};
 
+		mdio: mdio at 18002000 {
+			compatible = "brcm,iproc-mdio";
+			reg = <0x18002000 0x8>;
+			#size-cells = <1>;
+			#address-cells = <0>;
+
+			gphy0: eth-gphy at 0 {

The node anmes must be generic, the DT spec has standardized
"ethernet-phy" name for this case.

Quoted 9 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +9 -0
+				reg = <0>;
+				max-speed = <1000>;
+			};
+
+			gphy1: eth-gphy at 1 {
+				reg = <1>;
+				max-speed = <1000>;
+			};
+		};

[...]

arch/arm/boot/dts/bcm-cygnus.dtsi line 352

Quoted 9 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +5 -0
@@ -295,6 +345,16 @@
 			status = "disabled";
 		};
 
+		eth0: enet at 18042000 {
+			compatible = "brcm,amac";
+			reg = <0x18042000 0x1000>,
+			      <0x18110000 0x1000>;
+			reg-names = "amac_base", "idm_base";

I don't think "_base" suffixes are necessary here.

[...]

MBR, Sergei

#20 lore raw

Re: [PATCH 2/2] ARM: dts: Add the ethernet and ethernet PHY to the cygnus core DT.

In reply to Eric Anholt
Quoted 14 lines · Eric Anholt

Cygnus has a single amac controller connected to the B53 switch with 2 PHYs. On the BCM911360_EP platform, those two PHYs are connected to the external ethernet jacks.

---
 arch/arm/boot/dts/bcm-cygnus.dtsi      | 60 ++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/bcm911360_entphn.dts |  8 +++++
 2 files changed, 68 insertions(+)
arch/arm/boot/dts/bcm-cygnus.dtsi +0 -0
index 009f1346b817..318899df9972 100644

[...]

arch/arm/boot/dts/bcm-cygnus.dtsi line 348

Quoted 5 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +1 -0
@@ -295,6 +345,16 @@
 			status = "disabled";
 		};
 
+		eth0: enet at 18042000 {

Oh, and this one should be named "ethernet", according to the DT spec.

arch/arm/boot/dts/bcm-cygnus.dtsi line 360

Quoted 12 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +9 -0
+			compatible = "brcm,amac";
+			reg = <0x18042000 0x1000>,
+			      <0x18110000 0x1000>;
+			reg-names = "amac_base", "idm_base";
+			interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>;
+			max-speed = <1000>;
+			status = "disabled";
+		};
+
 		nand: nand at 18046000 {
 			compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1";
 			reg = <0x18046000 0x600>, <0xf8105408 0x600>,

[...]

MBR, Sergei

#17 lore raw

Re: [PATCH 2/2] ARM: dts: Add the ethernet and ethernet PHY to the cygnus core DT.

In reply to Sergei Shtylyov
Quoted 56 lines · Sergei Shtylyov

Hello.

Quoted 3 lines · Eric Anholt

Cygnus has a single amac controller connected to the B53 switch with 2 PHYs. On the BCM911360_EP platform, those two PHYs are connected to the external ethernet jacks.

My spell checker trips on "amac" and "ethernet" -- perhaps they need
capitalization?

Quoted 13 lines
---
 arch/arm/boot/dts/bcm-cygnus.dtsi      | 60
++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/bcm911360_entphn.dts |  8 +++++
 2 files changed, 68 insertions(+)
arch/arm/boot/dts/bcm-cygnus.dtsi +0 -0
index 009f1346b817..318899df9972 100644

arch/arm/boot/dts/bcm-cygnus.dtsi line 151

Quoted 10 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +7 -0
@@ -142,6 +142,56 @@
                        interrupts = <0>;
                };
 
+               mdio: mdio at 18002000 {
+                       compatible = "brcm,iproc-mdio";
+                       reg = <0x18002000 0x8>;
+                       #size-cells = <1>;
+                       #address-cells = <0>;
+
+                       gphy0: eth-gphy at 0 {

The node anmes must be generic, the DT spec has standardized
"ethernet-phy" name for this case.

Quoted 9 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +9 -0
+                               reg = <0>;
+                               max-speed = <1000>;
+                       };
+
+                       gphy1: eth-gphy at 1 {
+                               reg = <1>;
+                               max-speed = <1000>;
+                       };
+               };

[...]

Quoted 5 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +0 -0
@@ -295,6 +345,16 @@
                        status = "disabled";
                };
 
Quoted 8 lines

arch/arm/boot/dts/bcm-cygnus.dtsi line 352

Quoted 5 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +5 -0
+               eth0: enet at 18042000 {
+                       compatible = "brcm,amac";
+                       reg = <0x18042000 0x1000>,
+                             <0x18110000 0x1000>;
+                       reg-names = "amac_base", "idm_base";

I don't think "_base" suffixes are necessary here.

100% necessary, per the driver. See
drivers/net/ethernet/broadcom/bgmac-platform.c

Quoted 5 lines

[...]

MBR, Sergei

#18 lore raw

Re: [PATCH 2/2] ARM: dts: Add the ethernet and ethernet PHY to the cygnus core DT.

Hello!

Quoted 3 lines · Jon Mason
Quoted 3 lines
Quoted 3 lines

Cygnus has a single amac controller connected to the B53 switch with 2 PHYs. On the BCM911360_EP platform, those two PHYs are connected to the external ethernet jacks.

[...]

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
---
 arch/arm/boot/dts/bcm-cygnus.dtsi      | 60
++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/bcm911360_entphn.dts |  8 +++++
 2 files changed, 68 insertions(+)
arch/arm/boot/dts/bcm-cygnus.dtsi +0 -0
index 009f1346b817..318899df9972 100644

[...]

Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +0 -0
@@ -295,6 +345,16 @@
                        status = "disabled";
                };
 
Quoted 8 lines

arch/arm/boot/dts/bcm-cygnus.dtsi line 352

Quoted 5 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +5 -0
+               eth0: enet at 18042000 {
+                       compatible = "brcm,amac";
+                       reg = <0x18042000 0x1000>,
+                             <0x18110000 0x1000>;
+                       reg-names = "amac_base", "idm_base";

I don't think "_base" suffixes are necessary here.

Quoted 2 lines

100% necessary, per the driver. See
drivers/net/ethernet/broadcom/bgmac-platform.c

I'd recommend to fix the driver/bindings then...

MBR, Sergei

#19 lore raw

Re: [PATCH 2/2] ARM: dts: Add the ethernet and ethernet PHY to the cygnus core DT.

Quoted 41 lines · Sergei Shtylyov

Hello!

Quoted 3 lines · Jon Mason
Quoted 3 lines
Quoted 3 lines

Cygnus has a single amac controller connected to the B53 switch with 2 PHYs. On the BCM911360_EP platform, those two PHYs are connected to the external ethernet jacks.

[...]

Quoted 12 lines
Quoted 12 lines
Quoted 12 lines
---
 arch/arm/boot/dts/bcm-cygnus.dtsi      | 60
++++++++++++++++++++++++++++++++++
 arch/arm/boot/dts/bcm911360_entphn.dts |  8 +++++
 2 files changed, 68 insertions(+)
arch/arm/boot/dts/bcm-cygnus.dtsi +0 -0
index 009f1346b817..318899df9972 100644

[...]

Quoted 16 lines
Quoted 14 lines

arch/arm/boot/dts/bcm-cygnus.dtsi line 352

Quoted 10 lines
arch/arm/boot/dts/bcm-cygnus.dtsi +5 -0
@@ -295,6 +345,16 @@
                        status = "disabled";
                };
 
+               eth0: enet at 18042000 {
+                       compatible = "brcm,amac";
+                       reg = <0x18042000 0x1000>,
+                             <0x18110000 0x1000>;
+                       reg-names = "amac_base", "idm_base";

I don't think "_base" suffixes are necessary here.

Quoted 5 lines
Quoted 2 lines

100% necessary, per the driver. See
drivers/net/ethernet/broadcom/bgmac-platform.c

I'd recommend to fix the driver/bindings then...

They're already in use in other device trees. So, we'd need to support backward compatibility on them, thus removing any real benefit to changing them.

Quoted 3 lines

MBR, Sergei