From: Swee Leong Ching <leong.ching.swee@intel.com>
Add dt-bindings for per channel irq.
Signed-off-by: Rohan G Thomas <rohan.g.thomas@intel.com>
Signed-off-by: Swee Leong Ching <leong.ching.swee@intel.com>
---
.../devicetree/bindings/net/snps,dwmac.yaml | 24 +++++++++++++------
1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 5c2769dc689a..e72dded824f4 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -103,17 +103,27 @@ properties:
interrupts:
minItems: 1
- items:
- - description: Combined signal for various interrupt events
- - description: The interrupt to manage the remote wake-up packet detection
- - description: The interrupt that occurs when Rx exits the LPI state
+ maxItems: 19
interrupt-names:
minItems: 1
+ maxItems: 19
items:
- - const: macirq
- - enum: [eth_wake_irq, eth_lpi]
- - const: eth_lpi
+ oneOf:
+ - description: Combined signal for various interrupt events
+ const: macirq
+ - description: The interrupt to manage the remote wake-up packet detection
+ const: eth_wake_irq
+ - description: The interrupt that occurs when Rx exits the LPI state
+ const: eth_lpi
+ - description: DMA Tx per-channel interrupt
+ pattern: '^dma_tx[0-7]?$'
+ - description: DMA Rx per-channel interrupt
+ pattern: '^dma_rx[0-7]?$'
+
+ allOf:
+ - contains:
+ const: macirq
clocks:
minItems: 1
--
2.34.1
On Fri, Dec 22, 2023 at 01:44:48PM +0800, Leong Ching Swee wrote:
> From: Swee Leong Ching <leong.ching.swee@intel.com>
>
> Add dt-bindings for per channel irq.
>
> Signed-off-by: Rohan G Thomas <rohan.g.thomas@intel.com>
> Signed-off-by: Swee Leong Ching <leong.ching.swee@intel.com>
> ---
> .../devicetree/bindings/net/snps,dwmac.yaml | 24 +++++++++++++------
> 1 file changed, 17 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> index 5c2769dc689a..e72dded824f4 100644
> --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> @@ -103,17 +103,27 @@ properties:
>
> interrupts:
> minItems: 1
> - items:
> - - description: Combined signal for various interrupt events
> - - description: The interrupt to manage the remote wake-up packet detection
> - - description: The interrupt that occurs when Rx exits the LPI state
> + maxItems: 19
>
> interrupt-names:
> minItems: 1
> + maxItems: 19
> items:
> - - const: macirq
> - - enum: [eth_wake_irq, eth_lpi]
> - - const: eth_lpi
> + oneOf:
> + - description: Combined signal for various interrupt events
> + const: macirq
> + - description: The interrupt to manage the remote wake-up packet detection
> + const: eth_wake_irq
> + - description: The interrupt that occurs when Rx exits the LPI state
> + const: eth_lpi
> + - description: DMA Tx per-channel interrupt
> + pattern: '^dma_tx[0-7]?$'
> + - description: DMA Rx per-channel interrupt
> + pattern: '^dma_rx[0-7]?$'
> +
> + allOf:
> + - contains:
> + const: macirq
As Rob correctly noted it's also better to make sure that 'macirq' is
placed first in the array. So instead of the constraint above I guess
the next one would make sure both the array has 'macirq' name and it's
the first item:
allOf:
- maxItems: 34
items:
- const: macirq
-Serge(y)
>
> clocks:
> minItems: 1
> --
> 2.34.1
>
>
> -----Original Message-----
> From: Serge Semin <fancer.lancer@gmail.com>
> Sent: Friday, December 22, 2023 10:51 PM
> To: Swee, Leong Ching <leong.ching.swee@intel.com>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>; Alexandre Torgue
> <alexandre.torgue@foss.st.com>; Jose Abreu <joabreu@synopsys.com>;
> David S . Miller <davem@davemloft.net>; Eric Dumazet
> <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo Abeni
> <pabeni@redhat.com>; Rob Herring <robh+dt@kernel.org>; Krzysztof
> Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> <conor+dt@kernel.org>; Giuseppe Cavallaro <peppe.cavallaro@st.com>;
> linux-stm32@st-md-mailman.stormreply.com; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> netdev@vger.kernel.org; devicetree@vger.kernel.org; G Thomas, Rohan
> <rohan.g.thomas@intel.com>
> Subject: Re: [PATCH net-next v1 1/4] dt-bindings: net: snps,dwmac: per
> channel irq
>
> On Fri, Dec 22, 2023 at 01:44:48PM +0800, Leong Ching Swee wrote:
> > From: Swee Leong Ching <leong.ching.swee@intel.com>
> >
> > Add dt-bindings for per channel irq.
> >
> > Signed-off-by: Rohan G Thomas <rohan.g.thomas@intel.com>
> > Signed-off-by: Swee Leong Ching <leong.ching.swee@intel.com>
> > ---
> > .../devicetree/bindings/net/snps,dwmac.yaml | 24 +++++++++++++------
> > 1 file changed, 17 insertions(+), 7 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > index 5c2769dc689a..e72dded824f4 100644
> > --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
> > @@ -103,17 +103,27 @@ properties:
> >
> > interrupts:
> > minItems: 1
> > - items:
> > - - description: Combined signal for various interrupt events
> > - - description: The interrupt to manage the remote wake-up packet
> detection
> > - - description: The interrupt that occurs when Rx exits the LPI state
> > + maxItems: 19
> >
> > interrupt-names:
> > minItems: 1
> > + maxItems: 19
> > items:
> > - - const: macirq
> > - - enum: [eth_wake_irq, eth_lpi]
> > - - const: eth_lpi
> > + oneOf:
> > + - description: Combined signal for various interrupt events
> > + const: macirq
> > + - description: The interrupt to manage the remote wake-up packet
> detection
> > + const: eth_wake_irq
> > + - description: The interrupt that occurs when Rx exits the LPI state
> > + const: eth_lpi
> > + - description: DMA Tx per-channel interrupt
> > + pattern: '^dma_tx[0-7]?$'
> > + - description: DMA Rx per-channel interrupt
> > + pattern: '^dma_rx[0-7]?$'
> > +
>
> > + allOf:
> > + - contains:
> > + const: macirq
>
> As Rob correctly noted it's also better to make sure that 'macirq' is placed first
> in the array. So instead of the constraint above I guess the next one would
> make sure both the array has 'macirq' name and it's the first item:
>
> allOf:
> - maxItems: 34
> items:
> - const: macirq
>
> -Serge(y)
>
interrupt-names:
minItems: 1
maxItems: 19
items:
oneOf:
- description: Combined signal for various interrupt events
const: macirq
- description: The interrupt to manage the remote wake-up packet detection
const: eth_wake_irq
- description: The interrupt that occurs when Rx exits the LPI state
const: eth_lpi
- description: DMA Tx per-channel interrupt
pattern: '^dma_tx[0-7]?$'
- description: DMA Rx per-channel interrupt
pattern: '^dma_rx[0-7]?$'
allOf:
- maxItems: 19
items:
- const: macirq
I am getting the warning/error below when I tried the changes above (but it does make sure macirq is placed first).
Removing maxItems create other error, did I miss anything?
/home/swiplab/build/jim/linux/net-next/Documentation/devicetree/bindings/net/snps,dwmac.yaml: properties:interrupt-names:allOf:0: {'maxItems': 19, 'items': [{'const': 'macirq'}]} should not be
valid under {'required': ['maxItems']}
hint: "maxItems" is not needed with an "items" list
from schema $id: http://devicetree.org/meta-schemas/items.yaml#
/home/swiplab/build/jim/linux/net-next/Documentation/devicetree/bindings/net/snps,dwmac.yaml: properties:interrupt-names:allOf:0: {'maxItems': 19, 'items': [{'const': 'macirq'}]} should not be
valid under {'required': ['maxItems']}
hint: "maxItems" is not needed with an "items" list
> >
> > clocks:
> > minItems: 1
> > --
> > 2.34.1
> >
> >
© 2016 - 2025 Red Hat, Inc.