devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports
@ 2022-07-31 15:00 Vladimir Oltean
  2022-07-31 16:02 ` Rob Herring
  2022-08-01 16:22 ` Jakub Kicinski
  0 siblings, 2 replies; 5+ messages in thread
From: Vladimir Oltean @ 2022-07-31 15:00 UTC (permalink / raw)
  To: netdev
  Cc: devicetree, Rob Herring, Krzysztof Kozlowski, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Andrew Lunn,
	Vivien Didelot, Florian Fainelli, Oleksij Rempel,
	Christian Marangi, John Crispin, Kurt Kanzenbach, Mans Rullgard,
	Arun Ramadoss, Woojung Huh, UNGLinuxDriver, Claudiu Manoil,
	Alexandre Belloni, George McCollister, DENG Qingfang, Sean Wang,
	Landen Chao, Matthias Brugger, Hauke Mehrtens,
	Martin Blumenstingl, Aleksander Jan Bajkowski, Alvin Šipraga,
	Luiz Angelo Daros de Luca, Linus Walleij, Pawel Dembicki,
	Clément Léger, Geert Uytterhoeven, Russell King,
	Marek Behún, Marcin Wojtas

It is desirable that new DSA drivers are written to expect that all
their ports register with phylink, and not rely on the DSA core's
workarounds to skip this process.

To that end, DSA is being changed to warn existing drivers when such DT
blobs are in use:
https://patchwork.kernel.org/project/netdevbpf/cover/20220729132119.1191227-1-vladimir.oltean@nxp.com/

Introduce another layer of validation in the DSA DT schema, and assert
that CPU and DSA ports must have phylink-related properties present.

Suggested-by: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
I've sent this patch separately because at least right now I don't have
a reason to resend the other 4 patches linked above, and this has no
dependency on those.

 .../devicetree/bindings/net/dsa/dsa-port.yaml | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml b/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml
index 09317e16cb5d..a9420302c5d8 100644
--- a/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml
@@ -76,6 +76,28 @@ properties:
 required:
   - reg
 
+if:
+  oneOf:
+    - properties:
+        ethernet:
+          items:
+            $ref: /schemas/types.yaml#/definitions/phandle
+    - properties:
+        link:
+          items:
+            $ref: /schemas/types.yaml#/definitions/phandle-array
+then:
+  allOf:
+  - required:
+    - phy-mode
+  - oneOf:
+    - required:
+      - fixed-link
+    - required:
+      - phy-handle
+    - required:
+      - managed
+
 additionalProperties: true
 
 ...
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-08-01 17:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-31 15:00 [PATCH net-next] dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports Vladimir Oltean
2022-07-31 16:02 ` Rob Herring
2022-08-01 16:22 ` Jakub Kicinski
2022-08-01 16:29   ` Vladimir Oltean
2022-08-01 17:17     ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).