All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Anson Huang <Anson.Huang@nxp.com>
Cc: broonie@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com, marex@denx.de,
	linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Linux-imx@nxp.com
Subject: Re: [PATCH V2 2/3] dt-bindings: spi: Convert imx cspi to json-schema
Date: Mon, 15 Jun 2020 11:14:41 -0600	[thread overview]
Message-ID: <20200615171441.GA1971091@bogus> (raw)
In-Reply-To: <1591235731-15673-3-git-send-email-Anson.Huang@nxp.com>

On Thu, Jun 04, 2020 at 09:55:30AM +0800, Anson Huang wrote:
> Convert the i.MX CSPI binding to DT schema format using json-schema,
> update compatible, remove obsolete properties "fsl,spi-num-chipselects"
> and update the example based on latest DT file.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> Changes since V1:
> 	- add "unevaluatedProperties: false".
> ---
>  .../devicetree/bindings/spi/fsl-imx-cspi.txt       | 56 ------------
>  .../devicetree/bindings/spi/fsl-imx-cspi.yaml      | 99 ++++++++++++++++++++++
>  2 files changed, 99 insertions(+), 56 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
>  create mode 100644 Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml
> 
> diff --git a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
> deleted file mode 100644
> index 33bc58f..0000000
> --- a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
> +++ /dev/null
> @@ -1,56 +0,0 @@
> -* Freescale (Enhanced) Configurable Serial Peripheral Interface
> -  (CSPI/eCSPI) for i.MX
> -
> -Required properties:
> -- compatible :
> -  - "fsl,imx1-cspi" for SPI compatible with the one integrated on i.MX1
> -  - "fsl,imx21-cspi" for SPI compatible with the one integrated on i.MX21
> -  - "fsl,imx27-cspi" for SPI compatible with the one integrated on i.MX27
> -  - "fsl,imx31-cspi" for SPI compatible with the one integrated on i.MX31
> -  - "fsl,imx35-cspi" for SPI compatible with the one integrated on i.MX35
> -  - "fsl,imx51-ecspi" for SPI compatible with the one integrated on i.MX51
> -  - "fsl,imx53-ecspi" for SPI compatible with the one integrated on i.MX53 and later Soc
> -  - "fsl,imx8mq-ecspi" for SPI compatible with the one integrated on i.MX8MQ
> -  - "fsl,imx8mm-ecspi" for SPI compatible with the one integrated on i.MX8MM
> -  - "fsl,imx8mn-ecspi" for SPI compatible with the one integrated on i.MX8MN
> -  - "fsl,imx8mp-ecspi" for SPI compatible with the one integrated on i.MX8MP
> -- reg : Offset and length of the register set for the device
> -- interrupts : Should contain CSPI/eCSPI interrupt
> -- clocks : Clock specifiers for both ipg and per clocks.
> -- clock-names : Clock names should include both "ipg" and "per"
> -See the clock consumer binding,
> -	Documentation/devicetree/bindings/clock/clock-bindings.txt
> -
> -Recommended properties:
> -- cs-gpios : GPIOs to use as chip selects, see spi-bus.txt.  While the native chip
> -select lines can be used, they appear to always generate a pulse between each
> -word of a transfer.  Most use cases will require GPIO based chip selects to
> -generate a valid transaction.
> -
> -Optional properties:
> -- num-cs :  Number of total chip selects, see spi-bus.txt.
> -- dmas: DMA specifiers for tx and rx dma. See the DMA client binding,
> -Documentation/devicetree/bindings/dma/dma.txt.
> -- dma-names: DMA request names, if present, should include "tx" and "rx".
> -- fsl,spi-rdy-drctl: Integer, representing the value of DRCTL, the register
> -controlling the SPI_READY handling. Note that to enable the DRCTL consideration,
> -the SPI_READY mode-flag needs to be set too.
> -Valid values are: 0 (disabled), 1 (edge-triggered burst) and 2 (level-triggered burst).
> -
> -Obsolete properties:
> -- fsl,spi-num-chipselects : Contains the number of the chipselect
> -
> -Example:
> -
> -ecspi@70010000 {
> -	#address-cells = <1>;
> -	#size-cells = <0>;
> -	compatible = "fsl,imx51-ecspi";
> -	reg = <0x70010000 0x4000>;
> -	interrupts = <36>;
> -	cs-gpios = <&gpio3 24 0>, /* GPIO3_24 */
> -		   <&gpio3 25 0>; /* GPIO3_25 */
> -	dmas = <&sdma 3 7 1>, <&sdma 4 7 2>;
> -	dma-names = "rx", "tx";
> -	fsl,spi-rdy-drctl = <1>;
> -};
> diff --git a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml
> new file mode 100644
> index 0000000..606af7d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml
> @@ -0,0 +1,99 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/fsl-imx-cspi.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale (Enhanced) Configurable Serial Peripheral Interface (CSPI/eCSPI) for i.MX
> +
> +maintainers:
> +  - Shawn Guo <shawn.guo@linaro.org>
> +
> +allOf:
> +  - $ref: "/schemas/spi/spi-controller.yaml#"
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: fsl,imx1-cspi
> +      - const: fsl,imx21-cspi
> +      - const: fsl,imx27-cspi
> +      - const: fsl,imx31-cspi
> +      - const: fsl,imx35-cspi
> +      - const: fsl,imx51-ecspi
> +      - const: fsl,imx53-ecspi
> +      - items:
> +        - enum:
> +          - fsl,imx50-ecspi
> +          - fsl,imx6q-ecspi
> +          - fsl,imx6sx-ecspi
> +          - fsl,imx6sl-ecspi
> +          - fsl,imx6sll-ecspi
> +          - fsl,imx6ul-ecspi
> +          - fsl,imx7d-ecspi
> +          - fsl,imx8mq-ecspi
> +          - fsl,imx8mm-ecspi
> +          - fsl,imx8mn-ecspi
> +          - fsl,imx8mp-ecspi
> +        - const: fsl,imx51-ecspi
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    items:
> +      - description: SoC SPI ipg clock
> +      - description: SoC SPI per clock
> +    maxItems: 2

Can drop 'maxItems', it is redundant here.

> +
> +  clock-names:
> +    items:
> +      - const: ipg
> +      - const: per
> +    maxItems: 2

And here.

> +
> +  dmas:
> +    items:
> +      - description: DMA controller phandle and request line for RX
> +      - description: DMA controller phandle and request line for TX
> +
> +  dma-names:
> +    items:
> +      - const: rx
> +      - const: tx
> +
> +  fsl,spi-rdy-drctl:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: |
> +      Integer, representing the value of DRCTL, the register controlling
> +      the SPI_READY handling. Note that to enable the DRCTL consideration,
> +      the SPI_READY mode-flag needs to be set too.
> +      Valid values are: 0 (disabled), 1 (edge-triggered burst) and 2 (level-triggered burst).
> +    enum: [0, 1, 2]
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/imx5-clock.h>
> +
> +    spi@70010000 {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        compatible = "fsl,imx51-ecspi";
> +        reg = <0x70010000 0x4000>;
> +        interrupts = <36>;
> +        clocks = <&clks IMX5_CLK_ECSPI1_IPG_GATE>,
> +                 <&clks IMX5_CLK_ECSPI1_PER_GATE>;
> +        clock-names = "ipg", "per";
> +    };
> -- 
> 2.7.4
> 

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Anson Huang <Anson.Huang@nxp.com>
Cc: marex@denx.de, devicetree@vger.kernel.org, shawnguo@kernel.org,
	s.hauer@pengutronix.de, linux-kernel@vger.kernel.org,
	linux-spi@vger.kernel.org, broonie@kernel.org, Linux-imx@nxp.com,
	kernel@pengutronix.de, festevam@gmail.com,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH V2 2/3] dt-bindings: spi: Convert imx cspi to json-schema
Date: Mon, 15 Jun 2020 11:14:41 -0600	[thread overview]
Message-ID: <20200615171441.GA1971091@bogus> (raw)
In-Reply-To: <1591235731-15673-3-git-send-email-Anson.Huang@nxp.com>

On Thu, Jun 04, 2020 at 09:55:30AM +0800, Anson Huang wrote:
> Convert the i.MX CSPI binding to DT schema format using json-schema,
> update compatible, remove obsolete properties "fsl,spi-num-chipselects"
> and update the example based on latest DT file.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
> Changes since V1:
> 	- add "unevaluatedProperties: false".
> ---
>  .../devicetree/bindings/spi/fsl-imx-cspi.txt       | 56 ------------
>  .../devicetree/bindings/spi/fsl-imx-cspi.yaml      | 99 ++++++++++++++++++++++
>  2 files changed, 99 insertions(+), 56 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
>  create mode 100644 Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml
> 
> diff --git a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
> deleted file mode 100644
> index 33bc58f..0000000
> --- a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt
> +++ /dev/null
> @@ -1,56 +0,0 @@
> -* Freescale (Enhanced) Configurable Serial Peripheral Interface
> -  (CSPI/eCSPI) for i.MX
> -
> -Required properties:
> -- compatible :
> -  - "fsl,imx1-cspi" for SPI compatible with the one integrated on i.MX1
> -  - "fsl,imx21-cspi" for SPI compatible with the one integrated on i.MX21
> -  - "fsl,imx27-cspi" for SPI compatible with the one integrated on i.MX27
> -  - "fsl,imx31-cspi" for SPI compatible with the one integrated on i.MX31
> -  - "fsl,imx35-cspi" for SPI compatible with the one integrated on i.MX35
> -  - "fsl,imx51-ecspi" for SPI compatible with the one integrated on i.MX51
> -  - "fsl,imx53-ecspi" for SPI compatible with the one integrated on i.MX53 and later Soc
> -  - "fsl,imx8mq-ecspi" for SPI compatible with the one integrated on i.MX8MQ
> -  - "fsl,imx8mm-ecspi" for SPI compatible with the one integrated on i.MX8MM
> -  - "fsl,imx8mn-ecspi" for SPI compatible with the one integrated on i.MX8MN
> -  - "fsl,imx8mp-ecspi" for SPI compatible with the one integrated on i.MX8MP
> -- reg : Offset and length of the register set for the device
> -- interrupts : Should contain CSPI/eCSPI interrupt
> -- clocks : Clock specifiers for both ipg and per clocks.
> -- clock-names : Clock names should include both "ipg" and "per"
> -See the clock consumer binding,
> -	Documentation/devicetree/bindings/clock/clock-bindings.txt
> -
> -Recommended properties:
> -- cs-gpios : GPIOs to use as chip selects, see spi-bus.txt.  While the native chip
> -select lines can be used, they appear to always generate a pulse between each
> -word of a transfer.  Most use cases will require GPIO based chip selects to
> -generate a valid transaction.
> -
> -Optional properties:
> -- num-cs :  Number of total chip selects, see spi-bus.txt.
> -- dmas: DMA specifiers for tx and rx dma. See the DMA client binding,
> -Documentation/devicetree/bindings/dma/dma.txt.
> -- dma-names: DMA request names, if present, should include "tx" and "rx".
> -- fsl,spi-rdy-drctl: Integer, representing the value of DRCTL, the register
> -controlling the SPI_READY handling. Note that to enable the DRCTL consideration,
> -the SPI_READY mode-flag needs to be set too.
> -Valid values are: 0 (disabled), 1 (edge-triggered burst) and 2 (level-triggered burst).
> -
> -Obsolete properties:
> -- fsl,spi-num-chipselects : Contains the number of the chipselect
> -
> -Example:
> -
> -ecspi@70010000 {
> -	#address-cells = <1>;
> -	#size-cells = <0>;
> -	compatible = "fsl,imx51-ecspi";
> -	reg = <0x70010000 0x4000>;
> -	interrupts = <36>;
> -	cs-gpios = <&gpio3 24 0>, /* GPIO3_24 */
> -		   <&gpio3 25 0>; /* GPIO3_25 */
> -	dmas = <&sdma 3 7 1>, <&sdma 4 7 2>;
> -	dma-names = "rx", "tx";
> -	fsl,spi-rdy-drctl = <1>;
> -};
> diff --git a/Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml
> new file mode 100644
> index 0000000..606af7d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/fsl-imx-cspi.yaml
> @@ -0,0 +1,99 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/fsl-imx-cspi.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale (Enhanced) Configurable Serial Peripheral Interface (CSPI/eCSPI) for i.MX
> +
> +maintainers:
> +  - Shawn Guo <shawn.guo@linaro.org>
> +
> +allOf:
> +  - $ref: "/schemas/spi/spi-controller.yaml#"
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: fsl,imx1-cspi
> +      - const: fsl,imx21-cspi
> +      - const: fsl,imx27-cspi
> +      - const: fsl,imx31-cspi
> +      - const: fsl,imx35-cspi
> +      - const: fsl,imx51-ecspi
> +      - const: fsl,imx53-ecspi
> +      - items:
> +        - enum:
> +          - fsl,imx50-ecspi
> +          - fsl,imx6q-ecspi
> +          - fsl,imx6sx-ecspi
> +          - fsl,imx6sl-ecspi
> +          - fsl,imx6sll-ecspi
> +          - fsl,imx6ul-ecspi
> +          - fsl,imx7d-ecspi
> +          - fsl,imx8mq-ecspi
> +          - fsl,imx8mm-ecspi
> +          - fsl,imx8mn-ecspi
> +          - fsl,imx8mp-ecspi
> +        - const: fsl,imx51-ecspi
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    items:
> +      - description: SoC SPI ipg clock
> +      - description: SoC SPI per clock
> +    maxItems: 2

Can drop 'maxItems', it is redundant here.

> +
> +  clock-names:
> +    items:
> +      - const: ipg
> +      - const: per
> +    maxItems: 2

And here.

> +
> +  dmas:
> +    items:
> +      - description: DMA controller phandle and request line for RX
> +      - description: DMA controller phandle and request line for TX
> +
> +  dma-names:
> +    items:
> +      - const: rx
> +      - const: tx
> +
> +  fsl,spi-rdy-drctl:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: |
> +      Integer, representing the value of DRCTL, the register controlling
> +      the SPI_READY handling. Note that to enable the DRCTL consideration,
> +      the SPI_READY mode-flag needs to be set too.
> +      Valid values are: 0 (disabled), 1 (edge-triggered burst) and 2 (level-triggered burst).
> +    enum: [0, 1, 2]
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/imx5-clock.h>
> +
> +    spi@70010000 {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        compatible = "fsl,imx51-ecspi";
> +        reg = <0x70010000 0x4000>;
> +        interrupts = <36>;
> +        clocks = <&clks IMX5_CLK_ECSPI1_IPG_GATE>,
> +                 <&clks IMX5_CLK_ECSPI1_PER_GATE>;
> +        clock-names = "ipg", "per";
> +    };
> -- 
> 2.7.4
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-06-15 17:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04  1:55 [PATCH V2 0/3] Convert mxs/imx spi/cspi/lpspi binding to json-schema Anson Huang
2020-06-04  1:55 ` Anson Huang
2020-06-04  1:55 ` [PATCH V2 1/3] dt-bindings: spi: Convert mxs spi " Anson Huang
2020-06-04  1:55   ` Anson Huang
2020-06-15 17:12   ` Rob Herring
2020-06-15 17:12     ` Rob Herring
2020-06-04  1:55 ` [PATCH V2 2/3] dt-bindings: spi: Convert imx cspi " Anson Huang
2020-06-04  1:55   ` Anson Huang
2020-06-15 17:14   ` Rob Herring [this message]
2020-06-15 17:14     ` Rob Herring
2020-06-04  1:55 ` [PATCH V2 3/3] dt-bindings: spi: Convert imx lpspi " Anson Huang
2020-06-04  1:55   ` Anson Huang

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=20200615171441.GA1971091@bogus \
    --to=robh@kernel.org \
    --cc=Anson.Huang@nxp.com \
    --cc=Linux-imx@nxp.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.