[PATCH 1/6] dt-bindings: mtd: qcom,nandc: Document the SDX75 NAND

Kaushal Kumar posted 6 patches 9 months, 1 week ago
There is a newer version of this series
[PATCH 1/6] dt-bindings: mtd: qcom,nandc: Document the SDX75 NAND
Posted by Kaushal Kumar 9 months, 1 week ago
Document the QPIC NAND controller v2.1.1 being used in
SDX75 SoC and it uses BAM DMA.

SDX75 NAND controller has DMA-coherent and iommu support
so define them in the properties section, without which
'dtbs_check' reports the following error:

  nand-controller@1cc8000: Unevaluated properties are not
  allowed ('dma-coherent', 'iommus' were unexpected)

Signed-off-by: Kaushal Kumar <quic_kaushalk@quicinc.com>
---
 .../devicetree/bindings/mtd/qcom,nandc.yaml   | 23 ++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml b/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
index 35b4206ea918..8b77e8837205 100644
--- a/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
+++ b/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
@@ -11,12 +11,17 @@ maintainers:
 
 properties:
   compatible:
-    enum:
-      - qcom,ipq806x-nand
-      - qcom,ipq4019-nand
-      - qcom,ipq6018-nand
-      - qcom,ipq8074-nand
-      - qcom,sdx55-nand
+    OneOf:
+      - items:
+          - enum:
+              - qcom,sdx75-nand
+          - const: qcom,sdx55-nand
+      - items:
+          - const: qcom,ipq806x-nand
+          - const: qcom,ipq4019-nand
+          - const: qcom,ipq6018-nand
+          - const: qcom,ipq8074-nand
+          - const: qcom,sdx55-nand
 
   reg:
     maxItems: 1
@@ -31,6 +36,12 @@ properties:
       - const: core
       - const: aon
 
+  dma-coherent: true
+
+  iommus:
+    minItems: 1
+    maxItems: 3
+
   qcom,cmd-crci:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
-- 
2.17.1
Re: [PATCH 1/6] dt-bindings: mtd: qcom,nandc: Document the SDX75 NAND
Posted by Krzysztof Kozlowski 9 months, 1 week ago
On 13/03/2025 14:09, Kaushal Kumar wrote:
> Document the QPIC NAND controller v2.1.1 being used in
> SDX75 SoC and it uses BAM DMA.

Please wrap commit message according to Linux coding style / submission
process (neither too early nor over the limit):
https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597

> 
> SDX75 NAND controller has DMA-coherent and iommu support
> so define them in the properties section, without which
> 'dtbs_check' reports the following error:
> 
>   nand-controller@1cc8000: Unevaluated properties are not
>   allowed ('dma-coherent', 'iommus' were unexpected)

That's a new compatible, so how can you have existing errors? Looks not
related.

> 
> Signed-off-by: Kaushal Kumar <quic_kaushalk@quicinc.com>
> ---
>  .../devicetree/bindings/mtd/qcom,nandc.yaml   | 23 ++++++++++++++-----
>  1 file changed, 17 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml b/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
> index 35b4206ea918..8b77e8837205 100644
> --- a/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
> +++ b/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
> @@ -11,12 +11,17 @@ maintainers:
>  
>  properties:
>    compatible:
> -    enum:
> -      - qcom,ipq806x-nand
> -      - qcom,ipq4019-nand
> -      - qcom,ipq6018-nand
> -      - qcom,ipq8074-nand
> -      - qcom,sdx55-nand
> +    OneOf:

Testing patches before sending is still on todo list for Qualcomm :/.

> +      - items:
> +          - enum:
> +              - qcom,sdx75-nand
> +          - const: qcom,sdx55-nand
> +      - items:
> +          - const: qcom,ipq806x-nand
> +          - const: qcom,ipq4019-nand
> +          - const: qcom,ipq6018-nand
> +          - const: qcom,ipq8074-nand
> +          - const: qcom,sdx55-nand
>  
>    reg:
>      maxItems: 1
> @@ -31,6 +36,12 @@ properties:
>        - const: core
>        - const: aon
>  
> +  dma-coherent: true

Which controllers are DMA coherent?

> +
> +  iommus:
> +    minItems: 1
> +    maxItems: 3

You need to list the items. Why is this flexible?

> +
>    qcom,cmd-crci:
>      $ref: /schemas/types.yaml#/definitions/uint32
>      description:


Best regards,
Krzysztof
Re: [PATCH 1/6] dt-bindings: mtd: qcom,nandc: Document the SDX75 NAND
Posted by Kaushal Kumar 8 months, 3 weeks ago
On 3/13/2025 8:18 PM, Krzysztof Kozlowski wrote:
> On 13/03/2025 14:09, Kaushal Kumar wrote:
>> Document the QPIC NAND controller v2.1.1 being used in
>> SDX75 SoC and it uses BAM DMA.
> Please wrap commit message according to Linux coding style / submission
> process (neither too early nor over the limit):
> https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597
Sure, will update in v2.
>> SDX75 NAND controller has DMA-coherent and iommu support
>> so define them in the properties section, without which
>> 'dtbs_check' reports the following error:
>>
>>    nand-controller@1cc8000: Unevaluated properties are not
>>    allowed ('dma-coherent', 'iommus' were unexpected)
> That's a new compatible, so how can you have existing errors? Looks not
> related.
It is not an existing error. It is the error that would come unless the 
new properties are updated. Anyhow sorry for the confusion, will remove 
this in v2.
>> Signed-off-by: Kaushal Kumar <quic_kaushalk@quicinc.com>
>> ---
>>   .../devicetree/bindings/mtd/qcom,nandc.yaml   | 23 ++++++++++++++-----
>>   1 file changed, 17 insertions(+), 6 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml b/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
>> index 35b4206ea918..8b77e8837205 100644
>> --- a/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
>> +++ b/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml
>> @@ -11,12 +11,17 @@ maintainers:
>>   
>>   properties:
>>     compatible:
>> -    enum:
>> -      - qcom,ipq806x-nand
>> -      - qcom,ipq4019-nand
>> -      - qcom,ipq6018-nand
>> -      - qcom,ipq8074-nand
>> -      - qcom,sdx55-nand
>> +    OneOf:
> Testing patches before sending is still on todo list for Qualcomm :/.
I had run the "make dt_binding_check". Possibly due to my older version 
of dtschema , it did not get caught. After the schema update, now it is 
getting caught. Will update in v2.
>> +      - items:
>> +          - enum:
>> +              - qcom,sdx75-nand
>> +          - const: qcom,sdx55-nand
>> +      - items:
>> +          - const: qcom,ipq806x-nand
>> +          - const: qcom,ipq4019-nand
>> +          - const: qcom,ipq6018-nand
>> +          - const: qcom,ipq8074-nand
>> +          - const: qcom,sdx55-nand
>>   
>>     reg:
>>       maxItems: 1
>> @@ -31,6 +36,12 @@ properties:
>>         - const: core
>>         - const: aon
>>   
>> +  dma-coherent: true
> Which controllers are DMA coherent?
I will add it under a sdx75 check since it is applicable to sdx75 only.
>
>> +
>> +  iommus:
>> +    minItems: 1
>> +    maxItems: 3
> You need to list the items. Why is this flexible?
Agree, this need not be flexible. Will update in v2.
>
>> +
>>     qcom,cmd-crci:
>>       $ref: /schemas/types.yaml#/definitions/uint32
>>       description:
>
> Best regards,
> Krzysztof
Re: [PATCH 1/6] dt-bindings: mtd: qcom,nandc: Document the SDX75 NAND
Posted by Rob Herring (Arm) 9 months, 1 week ago
On Thu, 13 Mar 2025 18:39:13 +0530, Kaushal Kumar wrote:
> Document the QPIC NAND controller v2.1.1 being used in
> SDX75 SoC and it uses BAM DMA.
> 
> SDX75 NAND controller has DMA-coherent and iommu support
> so define them in the properties section, without which
> 'dtbs_check' reports the following error:
> 
>   nand-controller@1cc8000: Unevaluated properties are not
>   allowed ('dma-coherent', 'iommus' were unexpected)
> 
> Signed-off-by: Kaushal Kumar <quic_kaushalk@quicinc.com>
> ---
>  .../devicetree/bindings/mtd/qcom,nandc.yaml   | 23 ++++++++++++++-----
>  1 file changed, 17 insertions(+), 6 deletions(-)
> 

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

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml: properties:compatible: 'anyOf' conditional failed, one must be fixed:
	'OneOf' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'dependentRequired', 'dependentSchemas', 'deprecated', 'description', 'else', 'enum', 'exclusiveMaximum', 'exclusiveMinimum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'multipleOf', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'typeSize', 'unevaluatedProperties', 'uniqueItems']
	'type' was expected
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mtd/qcom,nandc.yaml: properties:compatible: Additional properties are not allowed ('OneOf' was unexpected)
	from schema $id: http://devicetree.org/meta-schemas/string-array.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250313130918.4238-2-quic_kaushalk@quicinc.com

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.