linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leo Li <leoyang.li@nxp.com>
To: Michael Walle <michael@walle.cc>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: Shawn Guo <shawnguo@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Marc Zyngier <maz@kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH v3 3/4] dt-bindings: interrupt-controller: fsl,ls-extirq: convert to YAML
Date: Wed, 27 Apr 2022 20:08:51 +0000	[thread overview]
Message-ID: <AS8PR04MB89464877E53B7F7B14A814178FFA9@AS8PR04MB8946.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <20220427075338.1156449-4-michael@walle.cc>



> -----Original Message-----
> From: Michael Walle <michael@walle.cc>
> Sent: Wednesday, April 27, 2022 2:54 AM
> To: Rob Herring <robh+dt@kernel.org>; Krzysztof Kozlowski
> <krzysztof.kozlowski+dt@linaro.org>
> Cc: Leo Li <leoyang.li@nxp.com>; Michael Walle <michael@walle.cc>; Shawn
> Guo <shawnguo@kernel.org>; Thomas Gleixner <tglx@linutronix.de>; Marc
> Zyngier <maz@kernel.org>; linuxppc-dev@lists.ozlabs.org; linux-arm-
> kernel@lists.infradead.org; devicetree@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: [PATCH v3 3/4] dt-bindings: interrupt-controller: fsl,ls-extirq:
> convert to YAML
> 
> Convert the fsl,ls-extirq binding to the new YAML format.
> 
> In contrast to the original binding documentation, there are three
> compatibles which are used in their corresponding device trees which have a
> specific compatible and the (already documented) fallback
> compatible:
>  - "fsl,ls1046a-extirq", "fsl,ls1043a-extirq"
>  - "fsl,ls2080a-extirq", "fsl,ls1088a-extirq"
>  - "fsl,lx2160a-extirq", "fsl,ls1088a-extirq"
> 
> Depending on the number of the number of the external IRQs which is
> usually 12 except for the LS1021A where there are only 6, the interrupt-map-
> mask was reduced from 0xffffffff to 0xf and 0x7 respectively and the number
> of interrupt-map entries have to match.

I assume this change won't prevent driver to be compatible with older device trees using the 0xffffffff?  The original 0xffffffff should work for both 6/12 interrupts or whatever reasonable number of interrupts that maybe used in future SoCs.  So the purpose of this change is to make the binding more specific to catch more errors in device tree?

> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
> changes since v2:
>  - drop $ref to interrupt-controller.yaml
>  - use a more strict interrupt-map-mask and make it conditional on SoC
> 
> changes since v1:
>  - new patch
> 
>  .../interrupt-controller/fsl,ls-extirq.txt    |  53 --------
>  .../interrupt-controller/fsl,ls-extirq.yaml   | 118 ++++++++++++++++++
>  2 files changed, 118 insertions(+), 53 deletions(-)  delete mode 100644
> Documentation/devicetree/bindings/interrupt-controller/fsl,ls-extirq.txt
>  create mode 100644 Documentation/devicetree/bindings/interrupt-
> controller/fsl,ls-extirq.yaml
> 
> diff --git a/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-
> extirq.txt b/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-
> extirq.txt
> deleted file mode 100644
> index 4d47df1a5c91..000000000000
> --- a/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-
> extirq.txt
> +++ /dev/null
> @@ -1,53 +0,0 @@
> -* Freescale Layerscape external IRQs
> -
> -Some Layerscape SOCs (LS1021A, LS1043A, LS1046A -LS1088A, LS208xA,
> LX216xA) support inverting -the polarity of certain external interrupt lines.
> -
> -The device node must be a child of the node representing the -
> Supplemental Configuration Unit (SCFG).
> -
> -Required properties:
> -- compatible: should be "fsl,<soc-name>-extirq", e.g. "fsl,ls1021a-extirq".
> -  "fsl,ls1043a-extirq": for LS1043A, LS1046A.
> -  "fsl,ls1088a-extirq": for LS1088A, LS208xA, LX216xA.
> -- #interrupt-cells: Must be 2. The first element is the index of the
> -  external interrupt line. The second element is the trigger type.
> -- #address-cells: Must be 0.
> -- interrupt-controller: Identifies the node as an interrupt controller
> -- reg: Specifies the Interrupt Polarity Control Register (INTPCR) in
> -  the SCFG or the External Interrupt Control Register (IRQCR) in
> -  the ISC.
> -- interrupt-map: Specifies the mapping from external interrupts to GIC
> -  interrupts.
> -- interrupt-map-mask: Must be <0xffffffff 0>.
> -
> -Example:
> -	scfg: scfg@1570000 {
> -		compatible = "fsl,ls1021a-scfg", "syscon";
> -		reg = <0x0 0x1570000 0x0 0x10000>;
> -		big-endian;
> -		#address-cells = <1>;
> -		#size-cells = <1>;
> -		ranges = <0x0 0x0 0x1570000 0x10000>;
> -
> -		extirq: interrupt-controller@1ac {
> -			compatible = "fsl,ls1021a-extirq";
> -			#interrupt-cells = <2>;
> -			#address-cells = <0>;
> -			interrupt-controller;
> -			reg = <0x1ac 4>;
> -			interrupt-map =
> -				<0 0 &gic GIC_SPI 163
> IRQ_TYPE_LEVEL_HIGH>,
> -				<1 0 &gic GIC_SPI 164
> IRQ_TYPE_LEVEL_HIGH>,
> -				<2 0 &gic GIC_SPI 165
> IRQ_TYPE_LEVEL_HIGH>,
> -				<3 0 &gic GIC_SPI 167
> IRQ_TYPE_LEVEL_HIGH>,
> -				<4 0 &gic GIC_SPI 168
> IRQ_TYPE_LEVEL_HIGH>,
> -				<5 0 &gic GIC_SPI 169
> IRQ_TYPE_LEVEL_HIGH>;
> -			interrupt-map-mask = <0xffffffff 0x0>;
> -		};
> -	};
> -
> -
> -	interrupts-extended = <&gic GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>,
> -			      <&extirq 1 IRQ_TYPE_LEVEL_LOW>;
> diff --git a/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-
> extirq.yaml b/Documentation/devicetree/bindings/interrupt-
> controller/fsl,ls-extirq.yaml
> new file mode 100644
> index 000000000000..887e565b9573
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/interrupt-controller/fsl,ls-exti
> +++ rq.yaml
> @@ -0,0 +1,118 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> +---
> +$id:
> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevic
> e
> +tree.org%2Fschemas%2Finterrupt-controller%2Ffsl%2Cls-
> extirq.yaml%23&amp
> +;data=05%7C01%7Cleoyang.li%40nxp.com%7Cdda04b02c8fb455d29a608da2
> 8230f9a
> +%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C1%7C63786642829380089
> 0%7CUnkn
> +own%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6I
> k1haWwiL
> +CJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=FVelhP%2B5CgDLZ8IUc
> 1%2B7b5MOP6n
> +TspGvJyT%2BLtbon70%3D&amp;reserved=0
> +$schema:
> +https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevic
> e
> +tree.org%2Fmeta-
> schemas%2Fcore.yaml%23&amp;data=05%7C01%7Cleoyang.li%40
> +nxp.com%7Cdda04b02c8fb455d29a608da28230f9a%7C686ea1d3bc2b4c6fa9
> 2cd99c5c
> +301635%7C0%7C1%7C637866428293800890%7CUnknown%7CTWFpbGZsb3d
> 8eyJWIjoiMC4
> +wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%
> 7C%7C%7C
> +&amp;sdata=qwIgHY4ZOMNHm7nYBXrqqahH652mZwxGgQ9t1HJzMRQ%3D
> &amp;reserved=
> +0
> +
> +title: Freescale Layerscape External Interrupt Controller
> +
> +maintainers:
> +  - Shawn Guo <shawnguo@kernel.org>
> +  - Li Yang <leoyang.li@nxp.com>
> +
> +description: |
> +  Some Layerscape SOCs (LS1021A, LS1043A, LS1046A LS1088A, LS208xA,
> +  LX216xA) support inverting the polarity of certain external interrupt
> +  lines.
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - enum:
> +          - fsl,ls1021a-extirq
> +          - fsl,ls1043a-extirq
> +          - fsl,ls1088a-extirq
> +      - items:
> +          - enum:
> +              - fsl,ls1046a-extirq
> +          - const: fsl,ls1043a-extirq
> +      - items:
> +          - enum:
> +              - fsl,ls2080a-extirq
> +              - fsl,lx2160a-extirq
> +          - const: fsl,ls1088a-extirq
> +
> +  '#interrupt-cells':
> +    const: 2
> +
> +  '#address-cells':
> +    const: 0
> +
> +  interrupt-controller: true
> +
> +  reg:
> +    maxItems: 1
> +    description:
> +      Specifies the Interrupt Polarity Control Register (INTPCR) in the
> +      SCFG or the External Interrupt Control Register (IRQCR) in the ISC.
> +
> +  interrupt-map:
> +    description: Specifies the mapping from external interrupts to GIC
> interrupts.
> +
> +  interrupt-map-mask: true
> +
> +required:
> +  - compatible
> +  - '#interrupt-cells'
> +  - '#address-cells'
> +  - interrupt-controller
> +  - reg
> +  - interrupt-map
> +  - interrupt-map-mask
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - fsl,ls1021a-extirq
> +    then:
> +      properties:
> +        interrupt-map:
> +          minItems: 6
> +          maxItems: 6
> +        interrupt-map-mask:
> +          items:
> +            - const: 0x7
> +            - const: 0
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - fsl,ls1043a-extirq
> +              - fsl,ls1046a-extirq
> +              - fsl,ls1088a-extirq
> +              - fsl,ls2080a-extirq
> +              - fsl,lx2160a-extirq
> +    then:
> +      properties:
> +        interrupt-map:
> +          minItems: 12
> +          maxItems: 12
> +        interrupt-map-mask:
> +          items:
> +            - const: 0xf
> +            - const: 0
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +    interrupt-controller@1ac {
> +            compatible = "fsl,ls1021a-extirq";
> +            #interrupt-cells = <2>;
> +            #address-cells = <0>;
> +            interrupt-controller;
> +            reg = <0x1ac 4>;
> +            interrupt-map =
> +                    <0 0 &gic GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
> +                    <1 0 &gic GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>,
> +                    <2 0 &gic GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>,
> +                    <3 0 &gic GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>,
> +                    <4 0 &gic GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>,
> +                    <5 0 &gic GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
> +            interrupt-map-mask = <0x7 0x0>;
> +    };
> --
> 2.30.2


  reply	other threads:[~2022-04-27 20:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  7:53 [PATCH v3 0/4] dt-bindings: convert freescale extirq and scfg schemas Michael Walle
2022-04-27  7:53 ` [PATCH v3 1/4] ARM: dts: ls1021a: reduce the interrupt-map-mask Michael Walle
2022-05-05  3:56   ` Shawn Guo
2022-04-27  7:53 ` [PATCH v3 2/4] arm64: dts: freescale: reduce the interrup-map-mask Michael Walle
2022-05-05  3:56   ` Shawn Guo
2022-04-27  7:53 ` [PATCH v3 3/4] dt-bindings: interrupt-controller: fsl,ls-extirq: convert to YAML Michael Walle
2022-04-27 20:08   ` Leo Li [this message]
2022-04-28  6:16     ` Krzysztof Kozlowski
2022-04-28  7:10   ` Krzysztof Kozlowski
2022-04-28 22:46   ` Rob Herring
2022-04-27  7:53 ` [PATCH v3 4/4] dt-bindings: fsl: convert fsl,layerscape-scfg " Michael Walle
2022-04-27 14:18   ` Rob Herring
2022-04-28 22:47   ` Rob Herring

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=AS8PR04MB89464877E53B7F7B14A814178FFA9@AS8PR04MB8946.eurprd04.prod.outlook.com \
    --to=leoyang.li@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maz@kernel.org \
    --cc=michael@walle.cc \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=tglx@linutronix.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).