linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joakim Zhang <qiangqing.zhang@nxp.com>
To: davem@davemloft.net, kuba@kernel.org, robh+dt@kernel.org,
	shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com
Cc: linux-imx@nxp.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next 1/2] dt-bindings: net: fsl,fec: improve the binding a bit
Date: Wed, 21 Jul 2021 18:12:19 +0800	[thread overview]
Message-ID: <20210721101220.22781-2-qiangqing.zhang@nxp.com> (raw)
In-Reply-To: <20210721101220.22781-1-qiangqing.zhang@nxp.com>

This patch improves the yaml a bit according to Rob Herring comments:
1) normalize interrupt-names property, there is no reason to support
random order.
2) validate each string in clock-names property.
3) add constraints for fsl,num-tx-queues/fsl,num-rx-queues property.
4) change additionalProperties to false in order to do strict checking.

Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 .../devicetree/bindings/net/fsl,fec.yaml      | 34 +++++++++++--------
 1 file changed, 19 insertions(+), 15 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/fsl,fec.yaml b/Documentation/devicetree/bindings/net/fsl,fec.yaml
index 0f8ca4e574c6..dbcbec95fc9e 100644
--- a/Documentation/devicetree/bindings/net/fsl,fec.yaml
+++ b/Documentation/devicetree/bindings/net/fsl,fec.yaml
@@ -49,19 +49,21 @@ properties:
     maxItems: 4
 
   interrupt-names:
-    description:
-      Names of the interrupts listed in interrupts property in the same order.
-      The defaults if not specified are
-      __Number of interrupts__   __Default__
-            1                       "int0"
-            2                       "int0", "pps"
-            3                       "int0", "int1", "int2"
-            4                       "int0", "int1", "int2", "pps"
-      The order may be changed as long as they correspond to the interrupts
-      property. Currently, only i.mx7 uses "int1" and "int2". They correspond to
-      tx/rx queues 1 and 2. "int0" will be used for queue 0 and ENET_MII interrupts.
-      For imx6sx, "int0" handles all 3 queues and ENET_MII. "pps" is for the pulse
-      per second interrupt associated with 1588 precision time protocol(PTP).
+    oneOf:
+      - items:
+          - const: int0
+      - items:
+          - const: int0
+          - const: pps
+      - items:
+          - const: int0
+          - const: int1
+          - const: int2
+      - items:
+          - const: int0
+          - const: int1
+          - const: int2
+          - const: pps
 
   clocks:
     minItems: 2
@@ -80,7 +82,7 @@ properties:
   clock-names:
     minItems: 2
     maxItems: 5
-    contains:
+    items:
       enum:
         - ipg
         - ahb
@@ -107,12 +109,14 @@ properties:
     description:
       The property is valid for enet-avb IP, which supports hw multi queues.
       Should specify the tx queue number, otherwise set tx queue number to 1.
+    enum: [1, 2, 3]
 
   fsl,num-rx-queues:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
       The property is valid for enet-avb IP, which supports hw multi queues.
       Should specify the rx queue number, otherwise set rx queue number to 1.
+    enum: [1, 2, 3]
 
   fsl,magic-packet:
     $ref: /schemas/types.yaml#/definitions/flag
@@ -179,7 +183,7 @@ required:
 # least undocumented properties. However, PHY may have a deprecated option to
 # place PHY OF properties in the MAC node, such as Micrel PHY, and we can find
 # these boards which is based on i.MX6QDL.
-additionalProperties: true
+additionalProperties: false
 
 examples:
   - |
-- 
2.17.1


  reply	other threads:[~2021-07-21 10:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 10:12 [PATCH net-next 0/2] dt-bindings: net: improve fec binding Joakim Zhang
2021-07-21 10:12 ` Joakim Zhang [this message]
2021-07-21 10:12 ` [PATCH net-next 2/2] ARM: dts: imx6qdl: move phy properties into phy device node Joakim Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210721101220.22781-2-qiangqing.zhang@nxp.com \
    --to=qiangqing.zhang@nxp.com \
    --cc=davem@davemloft.net \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --subject='Re: [PATCH net-next 1/2] dt-bindings: net: fsl,fec: improve the binding a bit' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).