Thread (6 messages) flat view 6 messages, 3 authors, 2024-01-29

RE: [EXT] [PATCH net-next] net: marvell,prestera: Fix example PCI bus addressing

From: Elad Nachman <enachman@marvell.com>
Date: 2024-01-23 10:00:01
Also in: linux-devicetree, lkml

quoted hunk ↗ jump to hunk
-----Original Message-----
From: Rob Herring <robh@kernel.org>
Sent: Monday, January 22, 2024 7:35 PM
To: David S. Miller <davem@davemloft.net>; Eric Dumazet
[off-list ref]; Jakub Kicinski [off-list ref]; Paolo Abeni
[off-list ref]; Krzysztof Kozlowski
[off-list ref]; Conor Dooley [off-list ref];
Miquel Raynal [off-list ref]
Cc: netdev@vger.kernel.org; devicetree@vger.kernel.org; linux-
kernel@vger.kernel.org
Subject: [EXT] [PATCH net-next] net: marvell,prestera: Fix example PCI bus
addressing

External Email

----------------------------------------------------------------------
The example for PCI devices has some addressing errors. 'reg' is written as if
the parent bus is PCI, but the default bus for examples is 1 address and size
cell. 'ranges' is defining config space with a size of 0. Generally, config space
should not be defined in 'ranges', only PCI memory and I/O spaces. Fix these
issues by updating the values with made-up, but valid values.

This was uncovered with recent dtschema changes.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/net/marvell,prestera.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/marvell,prestera.yaml
b/Documentation/devicetree/bindings/net/marvell,prestera.yaml
index 5ea8b73663a5..16ff892f7bbd 100644
--- a/Documentation/devicetree/bindings/net/marvell,prestera.yaml
+++ b/Documentation/devicetree/bindings/net/marvell,prestera.yaml
@@ -78,8 +78,8 @@ examples:
     pcie@0 {
         #address-cells = <3>;
         #size-cells = <2>;
-        ranges = <0x0 0x0 0x0 0x0 0x0 0x0>;
-        reg = <0x0 0x0 0x0 0x0 0x0 0x0>;
+        ranges = <0x02000000 0x0 0x100000 0x10000000 0x0 0x0>;
+        reg = <0x0 0x1000>;
         device_type = "pci";

         switch@0,0 {
--
2.43.0
This yaml has a mix-up of device P/N (belonging to AC3, BC2) and PCIe IDs (belonging to AC3X, Aldrin2)
Looks like a part of the yaml was updated, and another part was not

There is a reference here of actual usage of prestera switch device:
https://github.com/dentproject/linux/blob/dent-linux-5.15.y/arch/arm64/boot/dts/marvell/accton-as4564-26p.dts

So actual ranges and reg could be used instead of made up ones.

But the actual real life dts places the prestera at the top level of the dts, not under pci.

I am not aware of any dts/dtsi using such kind of switch node under pcie node, similar to the example given in the yaml file, and did not manage to find any under latest linux-next for both arm and arm64 dts directories (please correct me here if I am wrong).

So the question here is if this pci example really necessary for the prestera device, or can be removed altogether (which is what I think is best to do).

Elad.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help