2024-05-29 19:37:23

by Frank Li

[permalink] [raw]
Subject: [PATCH 1/1] spi: dt-bindings: fsl-dspi: Convert to yaml format

Convert dt-binding spi-fsl-dspi.txt to yaml format.

Addtional changes during convert:
- compatible string "fsl,ls1028a-dspi" can be followed by
fsl,ls1021a-v1.0-dspi
- Change "dspi0@4002c000" to "spi@4002c000" in example
- Reorder properties in example
- Use GIC include in example

Signed-off-by: Frank Li <[email protected]>
---

Notes:
pass dt_binding_check

make dt_binding_check DT_SCHEMA_FILES=fsl,dspi.yaml
SCHEMA Documentation/devicetree/bindings/processed-schema.json
CHKDT Documentation/devicetree/bindings
LINT Documentation/devicetree/bindings
DTEX Documentation/devicetree/bindings/spi/fsl,dspi.example.dts
DTC_CHK Documentation/devicetree/bindings/spi/fsl,dspi.example.dtb

.../devicetree/bindings/spi/fsl,dspi.yaml | 126 ++++++++++++++++++
.../devicetree/bindings/spi/spi-fsl-dspi.txt | 65 ---------
2 files changed, 126 insertions(+), 65 deletions(-)
create mode 100644 Documentation/devicetree/bindings/spi/fsl,dspi.yaml
delete mode 100644 Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt

diff --git a/Documentation/devicetree/bindings/spi/fsl,dspi.yaml b/Documentation/devicetree/bindings/spi/fsl,dspi.yaml
new file mode 100644
index 0000000000000..12a67b2cc25c8
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/fsl,dspi.yaml
@@ -0,0 +1,126 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/fsl,dspi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ARM Freescale DSPI controller
+
+maintainers:
+ - Frank Li <[email protected]>
+
+properties:
+ compatible:
+ oneOf:
+ - enum:
+ - fsl,vf610-dspi
+ - fsl,ls1021a-v1.0-dspi
+ - fsl,ls1012a-dspi
+ - fsl,ls1028a-dspi
+ - fsl,ls1043a-dspi
+ - fsl,ls1046a-dspi
+ - fsl,ls1088a-dspi
+ - fsl,ls2080a-dspi
+ - fsl,ls2085a-dspi
+ - fsl,lx2160a-dspi
+ - items:
+ - enum:
+ - fsl,ls1012a-dspi
+ - fsl,ls1043a-dspi
+ - fsl,ls1046a-dspi
+ - fsl,ls1088a-dspi
+ - const: fsl,ls1021a-v1.0-dspi
+ - items:
+ - const: fsl,ls2080a-dspi
+ - const: fsl,ls2085a-dspi
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ clock-names:
+ items:
+ - const: dspi
+
+ pinctrl-0: true
+
+ pinctrl-names:
+ items:
+ - const: default
+
+ spi-num-chipselects:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: the number of the chipselect signals.
+
+ big-endian:
+ $ref: /schemas/types.yaml#/definitions/flag
+ description:
+ If present the dspi device's registers are implemented
+ in big endian mode.
+
+ bus-num:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: the slave chip chipselect signal number.
+
+ fsl,spi-cs-sck-delay:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ a delay in nanoseconds between activating chip
+ select and the start of clock signal, at the start of a transfer.
+ fsl,spi-sck-cs-delay:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ a delay in nanoseconds between stopping the clock
+ signal and deactivating chip select, at the end of a transfer.
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - clock-names
+ - interrupts
+ - pinctrl-0
+ - pinctrl-names
+ - spi-num-chipselects
+
+allOf:
+ - $ref: spi-controller.yaml#
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/clock/vf610-clock.h>
+
+ spi@4002c000 {
+ compatible = "fsl,vf610-dspi";
+ reg = <0x4002c000 0x1000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clks VF610_CLK_DSPI0>;
+ clock-names = "dspi";
+ spi-num-chipselects = <5>;
+ bus-num = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_dspi0_1>;
+ big-endian;
+
+ flash@0 {
+ compatible = "atmel,at26df081a";
+ reg = <0>;
+ spi-max-frequency = <16000000>;
+ spi-cpol;
+ spi-cpha;
+ linux,modalias = "m25p80";
+ modal = "at26df081a";
+ fsl,spi-cs-sck-delay = <100>;
+ fsl,spi-sck-cs-delay = <50>;
+ };
+ };
diff --git a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt b/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
deleted file mode 100644
index 30a79da9c039d..0000000000000
--- a/Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-ARM Freescale DSPI controller
-
-Required properties:
-- compatible : must be one of:
- "fsl,vf610-dspi",
- "fsl,ls1021a-v1.0-dspi",
- "fsl,ls1012a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"),
- "fsl,ls1028a-dspi",
- "fsl,ls1043a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"),
- "fsl,ls1046a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"),
- "fsl,ls1088a-dspi" (optionally followed by "fsl,ls1021a-v1.0-dspi"),
- "fsl,ls2080a-dspi" (optionally followed by "fsl,ls2085a-dspi"),
- "fsl,ls2085a-dspi",
- "fsl,lx2160a-dspi",
-- reg : Offset and length of the register set for the device
-- interrupts : Should contain SPI controller interrupt
-- clocks: from common clock binding: handle to dspi clock.
-- clock-names: from common clock binding: Shall be "dspi".
-- pinctrl-0: pin control group to be used for this controller.
-- pinctrl-names: must contain a "default" entry.
-- spi-num-chipselects : the number of the chipselect signals.
-
-Optional property:
-- big-endian: If present the dspi device's registers are implemented
- in big endian mode.
-- bus-num : the slave chip chipselect signal number.
-
-Optional SPI slave node properties:
-- fsl,spi-cs-sck-delay: a delay in nanoseconds between activating chip
- select and the start of clock signal, at the start of a transfer.
-- fsl,spi-sck-cs-delay: a delay in nanoseconds between stopping the clock
- signal and deactivating chip select, at the end of a transfer.
-
-Example:
-
-dspi0@4002c000 {
- #address-cells = <1>;
- #size-cells = <0>;
- compatible = "fsl,vf610-dspi";
- reg = <0x4002c000 0x1000>;
- interrupts = <0 67 0x04>;
- clocks = <&clks VF610_CLK_DSPI0>;
- clock-names = "dspi";
- spi-num-chipselects = <5>;
- bus-num = <0>;
- pinctrl-names = "default";
- pinctrl-0 = <&pinctrl_dspi0_1>;
- big-endian;
-
- sflash: at26df081a@0 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "atmel,at26df081a";
- spi-max-frequency = <16000000>;
- spi-cpol;
- spi-cpha;
- reg = <0>;
- linux,modalias = "m25p80";
- modal = "at26df081a";
- fsl,spi-cs-sck-delay = <100>;
- fsl,spi-sck-cs-delay = <50>;
- };
-};
-
-
--
2.34.1



2024-05-29 21:26:48

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 1/1] spi: dt-bindings: fsl-dspi: Convert to yaml format


On Wed, 29 May 2024 15:36:50 -0400, Frank Li wrote:
> Convert dt-binding spi-fsl-dspi.txt to yaml format.
>
> Addtional changes during convert:
> - compatible string "fsl,ls1028a-dspi" can be followed by
> fsl,ls1021a-v1.0-dspi
> - Change "dspi0@4002c000" to "spi@4002c000" in example
> - Reorder properties in example
> - Use GIC include in example
>
> Signed-off-by: Frank Li <[email protected]>
> ---
>
> Notes:
> pass dt_binding_check
>
> make dt_binding_check DT_SCHEMA_FILES=fsl,dspi.yaml
> SCHEMA Documentation/devicetree/bindings/processed-schema.json
> CHKDT Documentation/devicetree/bindings
> LINT Documentation/devicetree/bindings
> DTEX Documentation/devicetree/bindings/spi/fsl,dspi.example.dts
> DTC_CHK Documentation/devicetree/bindings/spi/fsl,dspi.example.dtb
>
> .../devicetree/bindings/spi/fsl,dspi.yaml | 126 ++++++++++++++++++
> .../devicetree/bindings/spi/spi-fsl-dspi.txt | 65 ---------
> 2 files changed, 126 insertions(+), 65 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/spi/fsl,dspi.yaml
> delete mode 100644 Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
>

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/spi/fsl,dspi.example.dtb: /example-0/spi@4002c000/flash@0: failed to match any schema with compatible: ['atmel,at26df081a']

doc reference errors (make refcheckdocs):
Warning: MAINTAINERS references a file that doesn't exist: Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
MAINTAINERS: Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


2024-05-29 21:29:07

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 1/1] spi: dt-bindings: fsl-dspi: Convert to yaml format

Hi Frank,

kernel test robot noticed the following build warnings:

[auto build test WARNING on broonie-spi/for-next]
[also build test WARNING on robh/for-next krzk-dt/for-next linus/master v6.10-rc1 next-20240529]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Frank-Li/spi-dt-bindings-fsl-dspi-Convert-to-yaml-format/20240530-033848
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
patch link: https://lore.kernel.org/r/20240529193651.1029840-1-Frank.Li%40nxp.com
patch subject: [PATCH 1/1] spi: dt-bindings: fsl-dspi: Convert to yaml format
reproduce: (https://download.01.org/0day-ci/archive/20240530/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

Warning: Documentation/devicetree/bindings/power/wakeup-source.txt references a file that doesn't exist: Documentation/devicetree/bindings/input/qcom,pm8xxx-keypad.txt
Warning: Documentation/devicetree/bindings/regulator/siliconmitus,sm5703-regulator.yaml references a file that doesn't exist: Documentation/devicetree/bindings/mfd/siliconmitus,sm5703.yaml
Warning: Documentation/devicetree/bindings/sound/fsl-asoc-card.txt references a file that doesn't exist: Documentation/devicetree/bindings/sound/fsl,asrc.txt
Warning: Documentation/gpu/amdgpu/display/display-contributing.rst references a file that doesn't exist: Documentation/GPU/amdgpu/display/mpo-overview.rst
>> Warning: MAINTAINERS references a file that doesn't exist: Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
Warning: MAINTAINERS references a file that doesn't exist: Documentation/devicetree/bindings/sound/ti,pcm1681.yaml
Using alabaster theme

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

2024-05-30 15:03:22

by Vladimir Oltean

[permalink] [raw]
Subject: Re: [PATCH 1/1] spi: dt-bindings: fsl-dspi: Convert to yaml format

Hi Frank,

On Wed, May 29, 2024 at 03:36:50PM -0400, Frank Li wrote:
> Convert dt-binding spi-fsl-dspi.txt to yaml format.
>
> Addtional changes during convert:
> - compatible string "fsl,ls1028a-dspi" can be followed by
> fsl,ls1021a-v1.0-dspi
> - Change "dspi0@4002c000" to "spi@4002c000" in example
> - Reorder properties in example
> - Use GIC include in example
>
> Signed-off-by: Frank Li <[email protected]>
> ---
>
> Notes:
> pass dt_binding_check
>
> make dt_binding_check DT_SCHEMA_FILES=fsl,dspi.yaml
> SCHEMA Documentation/devicetree/bindings/processed-schema.json
> CHKDT Documentation/devicetree/bindings
> LINT Documentation/devicetree/bindings
> DTEX Documentation/devicetree/bindings/spi/fsl,dspi.example.dts
> DTC_CHK Documentation/devicetree/bindings/spi/fsl,dspi.example.dtb
>
> .../devicetree/bindings/spi/fsl,dspi.yaml | 126 ++++++++++++++++++
> .../devicetree/bindings/spi/spi-fsl-dspi.txt | 65 ---------
> 2 files changed, 126 insertions(+), 65 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/spi/fsl,dspi.yaml
> delete mode 100644 Documentation/devicetree/bindings/spi/spi-fsl-dspi.txt
>
> diff --git a/Documentation/devicetree/bindings/spi/fsl,dspi.yaml b/Documentation/devicetree/bindings/spi/fsl,dspi.yaml
> new file mode 100644
> index 0000000000000..12a67b2cc25c8
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/fsl,dspi.yaml
> @@ -0,0 +1,126 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/fsl,dspi.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ARM Freescale DSPI controller
> +
> +maintainers:
> + - Frank Li <[email protected]>
> +
> +properties:
> + fsl,spi-cs-sck-delay:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description:
> + a delay in nanoseconds between activating chip
> + select and the start of clock signal, at the start of a transfer.
> + fsl,spi-sck-cs-delay:
> + $ref: /schemas/types.yaml#/definitions/uint32
> + description:
> + a delay in nanoseconds between stopping the clock
> + signal and deactivating chip select, at the end of a transfer.

Thanks for this patch and for picking up on this task.

But fsl,spi-cs-sck-delay and fsl,spi-sck-cs-delay are not controller
properties as this schema makes them appear, but rather, child node
properties.

Could you try and take a look at how the previous attempt went, and
incorporate some of its good parts?
https://lore.kernel.org/linux-spi/[email protected]/