Skip to contentSkip to conversation

ARM: dts: BCM5301X: Fix DTC warning for NAND node

PATCH Applied Arınç ÜNAL 3 participants 16 messages Apr 1, 2022 – Apr 10, 2022 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 ARM: dts: BCM5301X: Fix DTC warning for NAND node

Remove the unnecessary #address-cells and #size-cells properties on the nand@0 node to fix the warning below.

Warning (avoid_unnecessary_addr_size): /nand-controller@18028000/nand@0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

---
 arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi | 2 --
 1 file changed, 2 deletions(-)
arch/arm/boot/dts/bcm5301x-nand-cs0.dtsi +0 -2
index be9a00ff752d..bdf1b4a608e6 100644
@@ -10,8 +10,6 @@ nand-controller@18028000 {
 		nandcs: nand@0 {
 			compatible = "brcm,nandcs";
 			reg = <0>;
-			#address-cells = <1>;
-			#size-cells = <1>;
 
 			partitions {
 				compatible = "brcm,bcm947xx-cfe-partitions";
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/5 ARM: dts: BCM5301X: Remove cell properties from srab ports on Asus RT-AC88U

Remove #address-cells and #size-cells properties from the ports node of &srab. They are already defined on bcm5301x.dtsi, there's no need to define them again.

---
 arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +1 -4
index 82f9629f0abb..cf793c558437 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 /*
- * Copyright (C) 2021 Arınç ÜNAL <[email protected]>
+ * Copyright (C) 2021-2022 Arınç ÜNAL <[email protected]>
  */
 
 /dts-v1/;
@@ -177,9 +177,6 @@ &srab {
 	dsa,member = <0 0>;
 
 	ports {
-		#address-cells = <1>;
-		#size-cells = <0>;
-
 		port@0 {
 			reg = <0>;
 			label = "lan4";
Signature · 1 line
2.25.1
Acked-by on v1 2/5
#2 lore raw

Re: [PATCH 2/5] ARM: dts: BCM5301X: Remove cell properties from srab ports on Asus RT-AC88U

Quoted 5 lines · Arınç ÜNAL

Remove #address-cells and #size-cells properties from the ports node of &srab. They are already defined on bcm5301x.dtsi, there's no need to define them again.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#3 lore raw

Re: [PATCH 2/5] ARM: dts: BCM5301X: Remove cell properties from srab ports on Asus RT-AC88U

In reply to Arınç ÜNAL
Quoted 6 lines · Arınç ÜNAL

Remove #address-cells and #size-cells properties from the ports node of &srab. They are already defined on bcm5301x.dtsi, there's no need to define them again.

---

Applied to https://github.com/Broadcom/stblinux/commits/devicetree/next, thanks! --
Florian

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw

PATCH 3/5 ARM: dts: BCM5301X: Add rgmii to port@5 of Broadcom switch on Asus RT-AC88U

In reply to Arınç ÜNAL

Define phy-mode of the Broadcom switch's port@5 as rgmii. This doesn't seem to matter but let's explicitly define it since phy-mode as rgmii is defined on the other side which is port@6 of the Realtek switch.

---
 arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 1 +
 1 file changed, 1 insertion(+)
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +1 -0
index cf793c558437..5696dd5fbaf4 100644
@@ -205,6 +205,7 @@ port@4 {
 		sw0_p5: port@5 {
 			reg = <5>;
 			label = "extsw";
+			phy-mode = "rgmii";
 
 			fixed-link {
 				speed = <1000>;
Signature · 1 line
2.25.1
#5 lore raw

Re: [PATCH 3/5] ARM: dts: BCM5301X: Add rgmii to port@5 of Broadcom switch on Asus RT-AC88U

Quoted 6 lines · Arınç ÜNAL

Define phy-mode of the Broadcom switch's port@5 as rgmii. This doesn't seem to matter but let's explicitly define it since phy-mode as rgmii is defined on the other side which is port@6 of the Realtek switch.

---

Applied to https://github.com/Broadcom/stblinux/commits/devicetree/next, thanks! --
Florian

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#6 lore raw

PATCH 4/5 ARM: dts: BCM5301X: Retrieve gmac1 MAC address from NVRAM on Asus RT-AC88U

In reply to Arınç ÜNAL

The et1macaddr NVRAM variable contains a MAC address for gmac1 on Asus RT-AC88U. Add NVMEM cell for it and reference it in the gmac1 node.

The Broadcom GBit BCMA driver will issue the MAC address for gmac{0,1,2} retrieved from et{0,1,2}mac from SPROM without this but let's explicitly define it as mac-address on the devicetree.
Refer to drivers/net/ethernet/broadcom/bgmac-bcma.c:147.

---
 arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +8 -0
index 5696dd5fbaf4..2f944d1c0330 100644
@@ -25,6 +25,9 @@ memory@0 {
 	nvram@1c080000 {
 		compatible = "brcm,nvram";
 		reg = <0x1c080000 0x00180000>;
+
+		et1macaddr: et1macaddr {
+		};
 	};
 
 	leds {
@@ -239,6 +242,11 @@ fixed-link {
 	};
 };
 
+&gmac1 {
+	nvmem-cells = <&et1macaddr>;
+	nvmem-cell-names = "mac-address";
+};
+
 &usb2 {
 	vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
 };
Signature · 1 line
2.25.1
Acked-by on v1 4/5
#7 lore raw

Re: [PATCH 4/5] ARM: dts: BCM5301X: Retrieve gmac1 MAC address from NVRAM on Asus RT-AC88U

Quoted 7 lines · Arınç ÜNAL

The et1macaddr NVRAM variable contains a MAC address for gmac1 on Asus RT-AC88U. Add NVMEM cell for it and reference it in the gmac1 node.

The Broadcom GBit BCMA driver will issue the MAC address for gmac{0,1,2} retrieved from et{0,1,2}mac from SPROM without this but let's explicitly define it as mac-address on the devicetree.
Refer to drivers/net/ethernet/broadcom/bgmac-bcma.c:147.

It doesn't matter how Linux handles that in details. You're working on hardware binding.

Change is OK of course.

If you need to reference sth it should be Documentation/devicetree/bindings/net/ethernet-controller.yaml

Quoted 1 line

I'd drop bgmac-bcma.c reference but nevertheless:

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#8 lore raw

Re: [PATCH 4/5] ARM: dts: BCM5301X: Retrieve gmac1 MAC address from NVRAM on Asus RT-AC88U

In reply to Arınç ÜNAL
Quoted 10 lines · Arınç ÜNAL

The et1macaddr NVRAM variable contains a MAC address for gmac1 on Asus RT-AC88U. Add NVMEM cell for it and reference it in the gmac1 node.

The Broadcom GBit BCMA driver will issue the MAC address for gmac{0,1,2} retrieved from et{0,1,2}mac from SPROM without this but let's explicitly define it as mac-address on the devicetree.
Refer to drivers/net/ethernet/broadcom/bgmac-bcma.c:147.

---

Applied to https://github.com/Broadcom/stblinux/commits/devicetree/next, thanks! --
Florian

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#9 lore raw

PATCH 5/5 ARM: dts: BCM5301X: Disable unused gmac0 and gmac2 on Asus RT-AC88U

In reply to Arınç ÜNAL

Disable gmac0 and gmac2 which are currently not used. This doesn't seem to be implemented yet on drivers/net/ethernet/broadcom/bgmac-bcma.c but this change is harmless, nonetheless.

---
 arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +8 -0
index 2f944d1c0330..0f5c5d576814 100644
@@ -242,11 +242,19 @@ fixed-link {
 	};
 };
 
+&gmac0 {
+	status = "disabled";
+};
+
 &gmac1 {
 	nvmem-cells = <&et1macaddr>;
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac2 {
+	status = "disabled";
+};
+
 &usb2 {
 	vcc-gpio = <&chipcommon 9 GPIO_ACTIVE_HIGH>;
 };
Signature · 1 line
2.25.1
#10 lore raw

Re: [PATCH 5/5] ARM: dts: BCM5301X: Disable unused gmac0 and gmac2 on Asus RT-AC88U

Quoted 3 lines · Arınç ÜNAL

Disable gmac0 and gmac2 which are currently not used. This doesn't seem to be implemented yet on drivers/net/ethernet/broadcom/bgmac-bcma.c but this change is harmless, nonetheless.

It doesn't matter whether Linux respects that.

Quoted 16 lines
---
 arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +2 -0
index 2f944d1c0330..0f5c5d576814 100644
@@ -242,11 +242,19 @@ fixed-link {
 	};
 };
 
+&gmac0 {
+	status = "disabled";

arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts fixed-link { · line 256

Quoted 10 lines
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +5 -0
+};
+
 &gmac1 {
 	nvmem-cells = <&et1macaddr>;
 	nvmem-cell-names = "mac-address";
 };
 
+&gmac2 {
+	status = "disabled";
+};

I don't think that is correct. Those interfaces are still there and they are actually connected to switch ports. If you configure your switch properly you can use them.

Someone may want to use e.g. gmac0 & gmac1 with two sets of ports to speed up network communication.

I think gmac2 is required if you want to enable FA (flow acceleration / accelerator) - even though there isn't Linux driver for it yet.

They are not disabled / unpopulated / non functional interfaces.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#11 lore raw

Re: [PATCH 5/5] ARM: dts: BCM5301X: Disable unused gmac0 and gmac2 on Asus RT-AC88U

Quoted 39 lines · Rafał Miłecki
Quoted 3 lines · Arınç ÜNAL

Disable gmac0 and gmac2 which are currently not used. This doesn't seem to be implemented yet on drivers/net/ethernet/broadcom/bgmac-bcma.c but this change is harmless, nonetheless.

It doesn't matter whether Linux respects that.

Quoted 16 lines

---
 arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 8 ++++++++

 1 file changed, 8 insertions(+)
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +2 -0
index 2f944d1c0330..0f5c5d576814 100644
@@ -242,11 +242,19 @@ fixed-link {
      };
  };
 
+&gmac0 {
+    status = "disabled";

arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts fixed-link { · line 256

Quoted 10 lines
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +5 -0
+};
+
  &gmac1 {
      nvmem-cells = <&et1macaddr>;
      nvmem-cell-names = "mac-address";
  };
 
+&gmac2 {
+    status = "disabled";
+};

I don't think that is correct. Those interfaces are still there and they are actually connected to switch ports. If you configure your switch properly you can use them.

Quoted 7 lines

Someone may want to use e.g. gmac0 & gmac1 with two sets of ports to speed up network communication.

I think gmac2 is required if you want to enable FA (flow acceleration / accelerator) - even though there isn't Linux driver for it yet.

They are not disabled / unpopulated / non functional interfaces.

I understand your point. However, while we're not supposed to care whether the kernel respects the bindings, don't we also need to make the bindings work on the version of the Linux kernel we're submitting the bindings to?

With the current way DSA works, only one switch port can be used as a CPU port. If we were to remove the status = "disabled" property from port@8 which connects to gmac2, it'd break the communication between the switch and the CPU on the current Linux kernel.

If a new driver or a feature is introduced, we should update the bindings accordingly afterwards.

For this reason, I don't see an issue with explaining the driver side of it on the commit log for DT bindings.

DT bindings are not exactly static either. Someone could want to use gmac2 instead of gmac1. In that case, I think they should change the bindings themselves as it's for their own use.

By the way, gmac0 would be wired to port@5 but since port@5 is wired to realtek switch's port@6 instead, it's actually non-functional.

Arınç

#12 lore raw

Re: [PATCH 5/5] ARM: dts: BCM5301X: Disable unused gmac0 and gmac2 on Asus RT-AC88U

Quoted 43 lines · Arınç ÜNAL
Quoted 42 lines · Rafał Miłecki
Quoted 3 lines · Arınç ÜNAL

Disable gmac0 and gmac2 which are currently not used. This doesn't seem to be implemented yet on drivers/net/ethernet/broadcom/bgmac-bcma.c but this change is harmless, nonetheless.

It doesn't matter whether Linux respects that.

Quoted 16 lines

---
 arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 8 ++++++++

 1 file changed, 8 insertions(+)
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +2 -0
index 2f944d1c0330..0f5c5d576814 100644
@@ -242,11 +242,19 @@ fixed-link {
      };
  };
 
+&gmac0 {
+    status = "disabled";

arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts fixed-link { · line 256

Quoted 10 lines
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +5 -0
+};
+
  &gmac1 {
      nvmem-cells = <&et1macaddr>;
      nvmem-cell-names = "mac-address";
  };
 
+&gmac2 {
+    status = "disabled";
+};

I don't think that is correct. Those interfaces are still there and they are actually connected to switch ports. If you configure your switch properly you can use them.

Someone may want to use e.g. gmac0 & gmac1 with two sets of ports to speed up network communication.

Quoted 8 lines
Quoted 4 lines

I think gmac2 is required if you want to enable FA (flow acceleration / accelerator) - even though there isn't Linux driver for it yet.

They are not disabled / unpopulated / non functional interfaces.

I understand your point. However, while we're not supposed to care whether the kernel respects the bindings, don't we also need to make the bindings work on the version of the Linux kernel we're submitting the bindings to?

With the current way DSA works, only one switch port can be used as a CPU port. If we were to remove the status = "disabled" property from port@8 which connects to gmac2, it'd break the communication between the switch and the CPU on the current Linux kernel.

Are you sure? Because DSA still picks up the CPU port from lowest port to highest port number. If port 6 is enabled, then it should take precedence.

Quoted 6 lines

If a new driver or a feature is introduced, we should update the bindings accordingly afterwards.

For this reason, I don't see an issue with explaining the driver side of it on the commit log for DT bindings.

DT bindings are not exactly static either. Someone could want to use gmac2 instead of gmac1. In that case, I think they should change the bindings themselves as it's for their own use.

This is true, but we are not changing the binding here, the binding is the contract between the DTB provider and the DTB consumer, it describes properties, their shape and size etc. We are just changing the status of particular nodes.

Quoted 7 lines

By the way, gmac0 would be wired to port@5 but since port@5 is wired to realtek switch's port@6 instead, it's actually non-functional.

Arınç

Signature · 6 lines
Florian

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#13 lore raw

Re: [PATCH 5/5] ARM: dts: BCM5301X: Disable unused gmac0 and gmac2 on Asus RT-AC88U

Quoted 47 lines · Florian Fainelli
Quoted 46 lines · Arınç ÜNAL
Quoted 45 lines · Rafał Miłecki
Quoted 3 lines · Arınç ÜNAL

Disable gmac0 and gmac2 which are currently not used. This doesn't seem to be implemented yet on drivers/net/ethernet/broadcom/bgmac-bcma.c but this change is harmless, nonetheless.

It doesn't matter whether Linux respects that.

Quoted 16 lines

---
 arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts | 8 ++++++++

 1 file changed, 8 insertions(+)
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +2 -0
index 2f944d1c0330..0f5c5d576814 100644
@@ -242,11 +242,19 @@ fixed-link {
      };
  };
 
+&gmac0 {
+    status = "disabled";

arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts fixed-link { · line 256

Quoted 10 lines
arch/arm/boot/dts/bcm47094-asus-rt-ac88u.dts +5 -0
+};
+
  &gmac1 {
      nvmem-cells = <&et1macaddr>;
      nvmem-cell-names = "mac-address";
  };
 
+&gmac2 {
+    status = "disabled";
+};

I don't think that is correct. Those interfaces are still there and they are actually connected to switch ports. If you configure your switch properly you can use them.

Someone may want to use e.g. gmac0 & gmac1 with two sets of ports to speed up network communication.

I think gmac2 is required if you want to enable FA (flow acceleration / accelerator) - even though there isn't Linux driver for it yet.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

They are not disabled / unpopulated / non functional interfaces.

I understand your point. However, while we're not supposed to care whether the kernel respects the bindings, don't we also need to make the bindings work on the version of the Linux kernel we're submitting the bindings to?

With the current way DSA works, only one switch port can be used as a CPU port. If we were to remove the status = "disabled" property from port@8 which connects to gmac2, it'd break the communication between the switch and the CPU on the current Linux kernel.

Are you sure? Because DSA still picks up the CPU port from lowest port to highest port number. If port 6 is enabled, then it should take precedence.

I just tested this on the router. You're right. We can keep port@8 enabled. I also made sure gmac0 is not connected to any switch GMAC. I'll send a patch to address these.

Quoted 9 lines
Quoted 7 lines

If a new driver or a feature is introduced, we should update the bindings accordingly afterwards.

For this reason, I don't see an issue with explaining the driver side of it on the commit log for DT bindings.

DT bindings are not exactly static either. Someone could want to use gmac2 instead of gmac1. In that case, I think they should change the bindings themselves as it's for their own use.

This is true, but we are not changing the binding here, the binding is the contract between the DTB provider and the DTB consumer, it describes properties, their shape and size etc. We are just changing the status of particular nodes.

Understood, thank you.

By the way, I don't see my applied patches on the link you referred to.

Arınç

Acked-by on v1 1/5
#14 lore raw
In reply to Arınç ÜNAL
Quoted 8 lines · Arınç ÜNAL

Remove the unnecessary #address-cells and #size-cells properties on the nand@0 node to fix the warning below.

Warning (avoid_unnecessary_addr_size):
/nand-controller@18028000/nand@0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#15 lore raw
In reply to Arınç ÜNAL
Quoted 7 lines · Arınç ÜNAL

Remove the unnecessary #address-cells and #size-cells properties on the nand@0 node to fix the warning below.

Warning (avoid_unnecessary_addr_size): /nand-controller@18028000/nand@0: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property

---

Applied to https://github.com/Broadcom/stblinux/commits/devicetree/next, thanks! --
Florian

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel