Message ID | 20210718004125.733-1-a-nandan@ti.com |
---|---|
State | New |
Headers | show |
Series | dt-bindings: mtd: spi-nand: Convert to DT schema format | expand |
On Sun, 18 Jul 2021 00:41:25 +0000, Apurva Nandan wrote: > Convert spi-nand.txt binding to YAML format with an added example. > > Signed-off-by: Apurva Nandan <a-nandan@ti.com> > --- > .../devicetree/bindings/mtd/spi-nand.txt | 5 -- > .../devicetree/bindings/mtd/spi-nand.yaml | 74 +++++++++++++++++++ > 2 files changed, 74 insertions(+), 5 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.txt > create mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.yaml > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.example.dt.yaml: spi-flash@1: $nodename:0: 'spi-flash@1' does not match '^flash(@.*)?$' From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mtd/spi-nand.yaml /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.example.dt.yaml: spi-flash@1: 'rx-sample-delay-ns' does not match any of the regexes: '^otp(-[0-9]+)?$', '^partition@', 'pinctrl-[0-9]+' From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mtd/spi-nand.yaml \ndoc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/patch/1506558 This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1. 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.
On Sun, Jul 18, 2021 at 12:41:25AM +0000, Apurva Nandan wrote: > Convert spi-nand.txt binding to YAML format with an added example. > > Signed-off-by: Apurva Nandan <a-nandan@ti.com> > --- > .../devicetree/bindings/mtd/spi-nand.txt | 5 -- > .../devicetree/bindings/mtd/spi-nand.yaml | 74 +++++++++++++++++++ > 2 files changed, 74 insertions(+), 5 deletions(-) > delete mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.txt > create mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.yaml > > diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.txt b/Documentation/devicetree/bindings/mtd/spi-nand.txt > deleted file mode 100644 > index 8b51f3b6d55c..000000000000 > --- a/Documentation/devicetree/bindings/mtd/spi-nand.txt > +++ /dev/null > @@ -1,5 +0,0 @@ > -SPI NAND flash > - > -Required properties: > -- compatible: should be "spi-nand" > -- reg: should encode the chip-select line used to access the NAND chip > diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.yaml b/Documentation/devicetree/bindings/mtd/spi-nand.yaml > new file mode 100644 > index 000000000000..366b86e1b19c > --- /dev/null > +++ b/Documentation/devicetree/bindings/mtd/spi-nand.yaml > @@ -0,0 +1,74 @@ > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/mtd/spi-nand.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: SPI NAND flash > + > +maintainers: > + - Apurva Nandan <a-nandan@ti.com> > + > +allOf: > + - $ref: "mtd.yaml#" > + > +properties: > + compatible: > + oneOf: > + - const: spi-nand Drop 'oneOf' as there is only one. > + > + reg: > + items: > + description: > + should encode the chip-select line used to access the NAND chip Just: reg: maxItems: 1 > + > + spi-max-frequency: true > + spi-rx-bus-width: true > + spi-tx-bus-width: true > + > + partitions: > + type: object > + > + '#address-cells': true > + '#size-cells': true > + > +patternProperties: > + # Note: use 'partitions' node for new users > + '^partition@': > + type: object > + > + "^otp(-[0-9]+)?$": > + type: object > + > +additionalProperties: false Just do: additionalProperties: type: object and then drop partitions, partition@, and ^otp(-[0-9]+)?$. > + > +examples: > + - | > + spi { > + #address-cells = <1>; > + #size-cells = <0>; > + > + flash@6 { > + #address-cells = <1>; > + #size-cells = <1>; > + compatible = "spi-nand"; > + reg = <0x6>; > + spi-max-frequency = <42000000>; > + > + partitions { > + compatible = "fixed-partitions"; > + #address-cells = <1>; > + #size-cells = <1>; > + > + partition@0 { > + label = "boot"; > + reg = <0 0x200000>; > + }; > + > + partition@200000 { > + label = "rootfs"; > + reg = <0x200000 0xce0000>; > + }; > + }; > + }; > + }; > -- > 2.17.1 > >
On 19-Jul-21 7:17 PM, Rob Herring wrote: > On Sun, 18 Jul 2021 00:41:25 +0000, Apurva Nandan wrote: >> Convert spi-nand.txt binding to YAML format with an added example. >> >> Signed-off-by: Apurva Nandan <a-nandan@ti.com> >> --- >> .../devicetree/bindings/mtd/spi-nand.txt | 5 -- >> .../devicetree/bindings/mtd/spi-nand.yaml | 74 +++++++++++++++++++ >> 2 files changed, 74 insertions(+), 5 deletions(-) >> delete mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.txt >> create mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.yaml >> > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' > on your patch (DT_CHECKER_FLAGS is new in v5.13): > > yamllint warnings/errors: > > dtschema/dtc warnings/errors: > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.example.dt.yaml: spi-flash@1: $nodename:0: 'spi-flash@1' does not match '^flash(@.*)?$' I propose to change the nodename in snps,dw-apb-ssi.yaml from 'spi-flash@1' to 'flash@1', making it similar to the convention followed by jedec,spi-nor.yaml. Currently, there is no user of snps,dw-apb-ssi with a spi-nand as child node, so let's make the node name uniform across different types of flashes i.e. 'flash@*'. What do you suggest? > From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mtd/spi-nand.yaml > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.example.dt.yaml: spi-flash@1: 'rx-sample-delay-ns' does not match any of the regexes: '^otp(-[0-9]+)?$', '^partition@', 'pinctrl-[0-9]+' > From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/mtd/spi-nand.yaml > \ndoc reference errors (make refcheckdocs): > > See https://patchwork.ozlabs.org/patch/1506558 > > This check can fail if there are any dependencies. The base for a patch > series is generally the most recent rc1. > > 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. > Yes, yamllint was not installed. I will correct them and send as v2. Thanks, Apurva Nandan
On 19-Jul-21 8:54 PM, Rob Herring wrote: > On Sun, Jul 18, 2021 at 12:41:25AM +0000, Apurva Nandan wrote: >> Convert spi-nand.txt binding to YAML format with an added example. >> >> Signed-off-by: Apurva Nandan <a-nandan@ti.com> >> --- >> .../devicetree/bindings/mtd/spi-nand.txt | 5 -- >> .../devicetree/bindings/mtd/spi-nand.yaml | 74 +++++++++++++++++++ >> 2 files changed, 74 insertions(+), 5 deletions(-) >> delete mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.txt >> create mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.yaml >> >> diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.txt b/Documentation/devicetree/bindings/mtd/spi-nand.txt >> deleted file mode 100644 >> index 8b51f3b6d55c..000000000000 >> --- a/Documentation/devicetree/bindings/mtd/spi-nand.txt >> +++ /dev/null >> @@ -1,5 +0,0 @@ >> -SPI NAND flash >> - >> -Required properties: >> -- compatible: should be "spi-nand" >> -- reg: should encode the chip-select line used to access the NAND chip >> diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.yaml b/Documentation/devicetree/bindings/mtd/spi-nand.yaml >> new file mode 100644 >> index 000000000000..366b86e1b19c >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/mtd/spi-nand.yaml >> @@ -0,0 +1,74 @@ >> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) >> +%YAML 1.2 >> +--- >> +$id: http://devicetree.org/schemas/mtd/spi-nand.yaml# >> +$schema: http://devicetree.org/meta-schemas/core.yaml# >> + >> +title: SPI NAND flash >> + >> +maintainers: >> + - Apurva Nandan <a-nandan@ti.com> >> + >> +allOf: >> + - $ref: "mtd.yaml#" >> + >> +properties: >> + compatible: >> + oneOf: >> + - const: spi-nand > > Drop 'oneOf' as there is only one. > >> + >> + reg: >> + items: >> + description: >> + should encode the chip-select line used to access the NAND chip > > Just: > > reg: > maxItems: 1 > >> + >> + spi-max-frequency: true >> + spi-rx-bus-width: true >> + spi-tx-bus-width: true >> + >> + partitions: >> + type: object >> + >> + '#address-cells': true >> + '#size-cells': true >> + >> +patternProperties: >> + # Note: use 'partitions' node for new users >> + '^partition@': >> + type: object >> + >> + "^otp(-[0-9]+)?$": >> + type: object >> + >> +additionalProperties: false > > Just do: > > additionalProperties: > type: object > > and then drop partitions, partition@, and ^otp(-[0-9]+)?$. > >> + >> +examples: >> + - | >> + spi { >> + #address-cells = <1>; >> + #size-cells = <0>; >> + >> + flash@6 { >> + #address-cells = <1>; >> + #size-cells = <1>; >> + compatible = "spi-nand"; >> + reg = <0x6>; >> + spi-max-frequency = <42000000>; >> + >> + partitions { >> + compatible = "fixed-partitions"; >> + #address-cells = <1>; >> + #size-cells = <1>; >> + >> + partition@0 { >> + label = "boot"; >> + reg = <0 0x200000>; >> + }; >> + >> + partition@200000 { >> + label = "rootfs"; >> + reg = <0x200000 0xce0000>; >> + }; >> + }; >> + }; >> + }; >> -- >> 2.17.1 >> >> Agree with all the suggestions made, will correct and send v2. Thanks, Apurva Nandan
Hi Apurva, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on mtd/mtd/next] [also build test WARNING on mtd/mtd/fixes robh/for-next v5.14-rc2 next-20210720] [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] url: https://github.com/0day-ci/linux/commits/Apurva-Nandan/dt-bindings-mtd-spi-nand-Convert-to-DT-schema-format/20210718-103130 base: https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next compiler: arm-linux-gnueabi-gcc (GCC) 10.3.0 reproduce: make ARCH=arm dtbs_check If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@intel.com> dtcheck warnings: (new ones prefixed by >>) From schema: /usr/local/lib/python3.9/dist-packages/dtschema/schemas/simple-bus.yaml arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml: clock-controller@1800000: '#power-domain-cells' is a required property From schema: Documentation/devicetree/bindings/clock/qcom,gcc.yaml arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/rng@22000: failed to match any schema with compatible: ['qcom,prng'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/pinctrl@1000000: failed to match any schema with compatible: ['qcom,ipq4019-pinctrl'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml: usb-power: $nodename:0: 'usb-power' does not match '^(hog-[0-9]+|.+-hog(-[0-9]+)?)$' From schema: /usr/local/lib/python3.9/dist-packages/dtschema/schemas/gpio/gpio-hog.yaml arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/sdhci@7824900: failed to match any schema with compatible: ['qcom,sdhci-msm-v4'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/dma@7884000: failed to match any schema with compatible: ['qcom,bam-v1.7.0'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/spi@78b5000: failed to match any schema with compatible: ['qcom,spi-qup-v2.2.1'] >> arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml: nand@1: $nodename:0: 'nand@1' does not match '^flash(@.*)?$' From schema: Documentation/devicetree/bindings/mtd/spi-nand.yaml arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/spi@78b6000: failed to match any schema with compatible: ['qcom,spi-qup-v2.2.1'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/i2c@78b7000: failed to match any schema with compatible: ['qcom,i2c-qup-v2.2.1'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/i2c@78b8000: failed to match any schema with compatible: ['qcom,i2c-qup-v2.2.1'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/dma@8e04000: failed to match any schema with compatible: ['qcom,bam-v1.7.0'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/crypto@8e3a000: failed to match any schema with compatible: ['qcom,crypto-v5.1'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/clock-controller@b088000: failed to match any schema with compatible: ['qcom,kpss-acc-v2'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/clock-controller@b098000: failed to match any schema with compatible: ['qcom,kpss-acc-v2'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/clock-controller@b0a8000: failed to match any schema with compatible: ['qcom,kpss-acc-v2'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dt.yaml:0:0: /soc/clock-controller@b0b8000: failed to match any schema with compatible: ['qcom,kpss-acc-v2'] -- From schema: /usr/local/lib/python3.9/dist-packages/dtschema/schemas/simple-bus.yaml arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml: clock-controller@1800000: '#power-domain-cells' is a required property From schema: Documentation/devicetree/bindings/clock/qcom,gcc.yaml arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/rng@22000: failed to match any schema with compatible: ['qcom,prng'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/pinctrl@1000000: failed to match any schema with compatible: ['qcom,ipq4019-pinctrl'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml: usb-power: $nodename:0: 'usb-power' does not match '^(hog-[0-9]+|.+-hog(-[0-9]+)?)$' From schema: /usr/local/lib/python3.9/dist-packages/dtschema/schemas/gpio/gpio-hog.yaml arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/sdhci@7824900: failed to match any schema with compatible: ['qcom,sdhci-msm-v4'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/dma@7884000: failed to match any schema with compatible: ['qcom,bam-v1.7.0'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/spi@78b5000: failed to match any schema with compatible: ['qcom,spi-qup-v2.2.1'] >> arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml: nand@1: $nodename:0: 'nand@1' does not match '^flash(@.*)?$' From schema: Documentation/devicetree/bindings/mtd/spi-nand.yaml arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/spi@78b6000: failed to match any schema with compatible: ['qcom,spi-qup-v2.2.1'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/i2c@78b7000: failed to match any schema with compatible: ['qcom,i2c-qup-v2.2.1'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/i2c@78b8000: failed to match any schema with compatible: ['qcom,i2c-qup-v2.2.1'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/dma@8e04000: failed to match any schema with compatible: ['qcom,bam-v1.7.0'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/crypto@8e3a000: failed to match any schema with compatible: ['qcom,crypto-v5.1'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/clock-controller@b088000: failed to match any schema with compatible: ['qcom,kpss-acc-v2'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/clock-controller@b098000: failed to match any schema with compatible: ['qcom,kpss-acc-v2'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/clock-controller@b0a8000: failed to match any schema with compatible: ['qcom,kpss-acc-v2'] arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dt.yaml:0:0: /soc/clock-controller@b0b8000: failed to match any schema with compatible: ['qcom,kpss-acc-v2'] -- From schema: /usr/local/lib/python3.9/dist-packages/dtschema/schemas/reg.yaml arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml: soc: pci@40000000:reg:0: [1073741824, 3869, 1073745696, 168, 524288, 8192, 1074790400, 4096] is too long From schema: /usr/local/lib/python3.9/dist-packages/dtschema/schemas/simple-bus.yaml arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml: clock-controller@1800000: '#power-domain-cells' is a required property From schema: Documentation/devicetree/bindings/clock/qcom,gcc.yaml arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/rng@22000: failed to match any schema with compatible: ['qcom,prng'] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/pinctrl@1000000: failed to match any schema with compatible: ['qcom,ipq4019-pinctrl'] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/sdhci@7824900: failed to match any schema with compatible: ['qcom,sdhci-msm-v4'] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/dma@7884000: failed to match any schema with compatible: ['qcom,bam-v1.7.0'] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/spi@78b5000: failed to match any schema with compatible: ['qcom,spi-qup-v2.2.1'] >> arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml: spi-nand@1: $nodename:0: 'spi-nand@1' does not match '^flash(@.*)?$' From schema: Documentation/devicetree/bindings/mtd/spi-nand.yaml arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/spi@78b6000: failed to match any schema with compatible: ['qcom,spi-qup-v2.2.1'] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/i2c@78b7000: failed to match any schema with compatible: ['qcom,i2c-qup-v2.2.1'] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/i2c@78b8000: failed to match any schema with compatible: ['qcom,i2c-qup-v2.2.1'] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/dma@8e04000: failed to match any schema with compatible: ['qcom,bam-v1.7.0'] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/crypto@8e3a000: failed to match any schema with compatible: ['qcom,crypto-v5.1'] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/clock-controller@b088000: failed to match any schema with compatible: ['qcom,kpss-acc-v2'] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/clock-controller@b098000: failed to match any schema with compatible: ['qcom,kpss-acc-v2'] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/clock-controller@b0a8000: failed to match any schema with compatible: ['qcom,kpss-acc-v2'] arch/arm/boot/dts/qcom-ipq4018-jalapeno.dt.yaml:0:0: /soc/clock-controller@b0b8000: failed to match any schema with compatible: ['qcom,kpss-acc-v2'] --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.txt b/Documentation/devicetree/bindings/mtd/spi-nand.txt deleted file mode 100644 index 8b51f3b6d55c..000000000000 --- a/Documentation/devicetree/bindings/mtd/spi-nand.txt +++ /dev/null @@ -1,5 +0,0 @@ -SPI NAND flash - -Required properties: -- compatible: should be "spi-nand" -- reg: should encode the chip-select line used to access the NAND chip diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.yaml b/Documentation/devicetree/bindings/mtd/spi-nand.yaml new file mode 100644 index 000000000000..366b86e1b19c --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/spi-nand.yaml @@ -0,0 +1,74 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/spi-nand.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SPI NAND flash + +maintainers: + - Apurva Nandan <a-nandan@ti.com> + +allOf: + - $ref: "mtd.yaml#" + +properties: + compatible: + oneOf: + - const: spi-nand + + reg: + items: + description: + should encode the chip-select line used to access the NAND chip + + spi-max-frequency: true + spi-rx-bus-width: true + spi-tx-bus-width: true + + partitions: + type: object + + '#address-cells': true + '#size-cells': true + +patternProperties: + # Note: use 'partitions' node for new users + '^partition@': + type: object + + "^otp(-[0-9]+)?$": + type: object + +additionalProperties: false + +examples: + - | + spi { + #address-cells = <1>; + #size-cells = <0>; + + flash@6 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0x6>; + spi-max-frequency = <42000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "boot"; + reg = <0 0x200000>; + }; + + partition@200000 { + label = "rootfs"; + reg = <0x200000 0xce0000>; + }; + }; + }; + };
Convert spi-nand.txt binding to YAML format with an added example. Signed-off-by: Apurva Nandan <a-nandan@ti.com> --- .../devicetree/bindings/mtd/spi-nand.txt | 5 -- .../devicetree/bindings/mtd/spi-nand.yaml | 74 +++++++++++++++++++ 2 files changed, 74 insertions(+), 5 deletions(-) delete mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.txt create mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.yaml