diff mbox series

[18/22] dt-bindings: spi: document support for SA8255p

Message ID 20240828203721.2751904-19-quic_nkela@quicinc.com (mailing list archive)
State Not Applicable
Headers show
Series arm64: qcom: Introduce SA8255p Ride platform | expand

Commit Message

Nikunj Kela Aug. 28, 2024, 8:37 p.m. UTC
Add compatible representing spi support on SA8255p.

Clocks and interconnects are being configured in firmware VM
on SA8255p platform, therefore making them optional.

CC: Praveen Talari <quic_ptalari@quicinc.com>
Signed-off-by: Nikunj Kela <quic_nkela@quicinc.com>
---
 .../bindings/spi/qcom,spi-geni-qcom.yaml      | 64 +++++++++++++++----
 1 file changed, 53 insertions(+), 11 deletions(-)

Comments

Rob Herring Aug. 28, 2024, 11:45 p.m. UTC | #1
On Wed, 28 Aug 2024 13:37:17 -0700, Nikunj Kela wrote:
> Add compatible representing spi support on SA8255p.
> 
> Clocks and interconnects are being configured in firmware VM
> on SA8255p platform, therefore making them optional.
> 
> CC: Praveen Talari <quic_ptalari@quicinc.com>
> Signed-off-by: Nikunj Kela <quic_nkela@quicinc.com>
> ---
>  .../bindings/spi/qcom,spi-geni-qcom.yaml      | 64 +++++++++++++++----
>  1 file changed, 53 insertions(+), 11 deletions(-)
> 

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

yamllint warnings/errors:
./Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml:90:11: [error] string value is redundantly quoted with any quotes (quoted-strings)

dtschema/dtc warnings/errors:

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240828203721.2751904-19-quic_nkela@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.
Rob Herring Aug. 29, 2024, 3:06 a.m. UTC | #2
On Wed, Aug 28, 2024 at 01:37:17PM -0700, Nikunj Kela wrote:
> Add compatible representing spi support on SA8255p.
> 
> Clocks and interconnects are being configured in firmware VM
> on SA8255p platform, therefore making them optional.
> 
> CC: Praveen Talari <quic_ptalari@quicinc.com>
> Signed-off-by: Nikunj Kela <quic_nkela@quicinc.com>
> ---
>  .../bindings/spi/qcom,spi-geni-qcom.yaml      | 64 +++++++++++++++----
>  1 file changed, 53 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml b/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
> index 2e20ca313ec1..74ea7c4f2451 100644
> --- a/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
> +++ b/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
> @@ -25,10 +25,41 @@ description:
>  
>  allOf:
>    - $ref: /schemas/spi/spi-controller.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: qcom,sa8255p-geni-spi
> +    then:
> +      required:
> +        - power-domains
> +        - power-domain-names

blank line

> +      properties:
> +        power-domains:
> +          minItems: 2
> +          maxItems: 2

Drop maxItems as 2 is already the max (with my change below).

Add blank line here.

> +    else:
> +      required:
> +        - clocks
> +        - clock-names

blank line

> +      properties:
> +        power-domains:
> +          maxItems: 1

blank line

> +        interconnects:
> +          minItems: 2
> +          maxItems: 3

blank line

> +        interconnect-names:
> +          minItems: 2
> +          items:
> +            - const: qup-core
> +            - const: qup-config
> +            - const: qup-memory
>  
>  properties:
>    compatible:
> -    const: qcom,geni-spi
> +    enum:
> +      - qcom,geni-spi
> +      - qcom,sa8255p-geni-spi
>  
>    clocks:
>      maxItems: 1
> @@ -45,15 +76,10 @@ properties:
>        - const: rx
>  
>    interconnects:
> -    minItems: 2
> -    maxItems: 3
> +    description: phandles of interconnect bw provider
>  
>    interconnect-names:
> -    minItems: 2
> -    items:
> -      - const: qup-core
> -      - const: qup-config
> -      - const: qup-memory
> +    description: names of interconnects

No, keep all properties defined at the top-level and then add 
constraints in if/then schemas.

>  
>    interrupts:
>      maxItems: 1
> @@ -61,15 +87,18 @@ properties:
>    operating-points-v2: true
>  
>    power-domains:
> -    maxItems: 1
> +    $ref: "/schemas/power/power-domain.yaml#/properties/power-domains"

Do you see an example of this anywhere else? No. You need:

minItems: 1
maxItems: 2

> +
> +  power-domain-names:
> +    items:
> +      - const: power
> +      - const: perf
>  
>    reg:
>      maxItems: 1
>  
>  required:
>    - compatible
> -  - clocks
> -  - clock-names
>    - interrupts
>    - reg
>  
> @@ -116,3 +145,16 @@ examples:
>          #address-cells = <1>;
>          #size-cells = <0>;
>      };
> +
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    spi@888000 {
> +        compatible = "qcom,sa8255p-geni-spi";
> +        reg = <0x888000 0x4000>;
> +        interrupts = <GIC_SPI 584 IRQ_TYPE_LEVEL_HIGH>;
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        power-domains = <&scmi10_pd 16>, <&scmi10_dvfs 16>;
> +        power-domain-names = "power", "perf";
> +    };
> -- 
> 2.34.1
>
Nikunj Kela Aug. 29, 2024, 2:28 p.m. UTC | #3
On 8/28/2024 8:06 PM, Rob Herring wrote:
> On Wed, Aug 28, 2024 at 01:37:17PM -0700, Nikunj Kela wrote:
>> Add compatible representing spi support on SA8255p.
>>
>> Clocks and interconnects are being configured in firmware VM
>> on SA8255p platform, therefore making them optional.
>>
>> CC: Praveen Talari <quic_ptalari@quicinc.com>
>> Signed-off-by: Nikunj Kela <quic_nkela@quicinc.com>
>> ---
>>  .../bindings/spi/qcom,spi-geni-qcom.yaml      | 64 +++++++++++++++----
>>  1 file changed, 53 insertions(+), 11 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml b/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
>> index 2e20ca313ec1..74ea7c4f2451 100644
>> --- a/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
>> +++ b/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
>> @@ -25,10 +25,41 @@ description:
>>  
>>  allOf:
>>    - $ref: /schemas/spi/spi-controller.yaml#
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            const: qcom,sa8255p-geni-spi
>> +    then:
>> +      required:
>> +        - power-domains
>> +        - power-domain-names
> blank line
>
>> +      properties:
>> +        power-domains:
>> +          minItems: 2
>> +          maxItems: 2
> Drop maxItems as 2 is already the max (with my change below).
>
> Add blank line here.
>
>> +    else:
>> +      required:
>> +        - clocks
>> +        - clock-names
> blank line
>
>> +      properties:
>> +        power-domains:
>> +          maxItems: 1
> blank line
>
>> +        interconnects:
>> +          minItems: 2
>> +          maxItems: 3
> blank line
>
>> +        interconnect-names:
>> +          minItems: 2
>> +          items:
>> +            - const: qup-core
>> +            - const: qup-config
>> +            - const: qup-memory
>>  
>>  properties:
>>    compatible:
>> -    const: qcom,geni-spi
>> +    enum:
>> +      - qcom,geni-spi
>> +      - qcom,sa8255p-geni-spi
>>  
>>    clocks:
>>      maxItems: 1
>> @@ -45,15 +76,10 @@ properties:
>>        - const: rx
>>  
>>    interconnects:
>> -    minItems: 2
>> -    maxItems: 3
>> +    description: phandles of interconnect bw provider
>>  
>>    interconnect-names:
>> -    minItems: 2
>> -    items:
>> -      - const: qup-core
>> -      - const: qup-config
>> -      - const: qup-memory
>> +    description: names of interconnects
> No, keep all properties defined at the top-level and then add 
> constraints in if/then schemas.
>
>>  
>>    interrupts:
>>      maxItems: 1
>> @@ -61,15 +87,18 @@ properties:
>>    operating-points-v2: true
>>  
>>    power-domains:
>> -    maxItems: 1
>> +    $ref: "/schemas/power/power-domain.yaml#/properties/power-domains"
> Do you see an example of this anywhere else? No. You need:
>
> minItems: 1
> maxItems: 2

Thanks Rob for reviewing the patch. Will take care of your comments in
next version.


>> +
>> +  power-domain-names:
>> +    items:
>> +      - const: power
>> +      - const: perf
>>  
>>    reg:
>>      maxItems: 1
>>  
>>  required:
>>    - compatible
>> -  - clocks
>> -  - clock-names
>>    - interrupts
>>    - reg
>>  
>> @@ -116,3 +145,16 @@ examples:
>>          #address-cells = <1>;
>>          #size-cells = <0>;
>>      };
>> +
>> +  - |
>> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
>> +
>> +    spi@888000 {
>> +        compatible = "qcom,sa8255p-geni-spi";
>> +        reg = <0x888000 0x4000>;
>> +        interrupts = <GIC_SPI 584 IRQ_TYPE_LEVEL_HIGH>;
>> +        #address-cells = <1>;
>> +        #size-cells = <0>;
>> +        power-domains = <&scmi10_pd 16>, <&scmi10_dvfs 16>;
>> +        power-domain-names = "power", "perf";
>> +    };
>> -- 
>> 2.34.1
>>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml b/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
index 2e20ca313ec1..74ea7c4f2451 100644
--- a/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
+++ b/Documentation/devicetree/bindings/spi/qcom,spi-geni-qcom.yaml
@@ -25,10 +25,41 @@  description:
 
 allOf:
   - $ref: /schemas/spi/spi-controller.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: qcom,sa8255p-geni-spi
+    then:
+      required:
+        - power-domains
+        - power-domain-names
+      properties:
+        power-domains:
+          minItems: 2
+          maxItems: 2
+    else:
+      required:
+        - clocks
+        - clock-names
+      properties:
+        power-domains:
+          maxItems: 1
+        interconnects:
+          minItems: 2
+          maxItems: 3
+        interconnect-names:
+          minItems: 2
+          items:
+            - const: qup-core
+            - const: qup-config
+            - const: qup-memory
 
 properties:
   compatible:
-    const: qcom,geni-spi
+    enum:
+      - qcom,geni-spi
+      - qcom,sa8255p-geni-spi
 
   clocks:
     maxItems: 1
@@ -45,15 +76,10 @@  properties:
       - const: rx
 
   interconnects:
-    minItems: 2
-    maxItems: 3
+    description: phandles of interconnect bw provider
 
   interconnect-names:
-    minItems: 2
-    items:
-      - const: qup-core
-      - const: qup-config
-      - const: qup-memory
+    description: names of interconnects
 
   interrupts:
     maxItems: 1
@@ -61,15 +87,18 @@  properties:
   operating-points-v2: true
 
   power-domains:
-    maxItems: 1
+    $ref: "/schemas/power/power-domain.yaml#/properties/power-domains"
+
+  power-domain-names:
+    items:
+      - const: power
+      - const: perf
 
   reg:
     maxItems: 1
 
 required:
   - compatible
-  - clocks
-  - clock-names
   - interrupts
   - reg
 
@@ -116,3 +145,16 @@  examples:
         #address-cells = <1>;
         #size-cells = <0>;
     };
+
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    spi@888000 {
+        compatible = "qcom,sa8255p-geni-spi";
+        reg = <0x888000 0x4000>;
+        interrupts = <GIC_SPI 584 IRQ_TYPE_LEVEL_HIGH>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+        power-domains = <&scmi10_pd 16>, <&scmi10_dvfs 16>;
+        power-domain-names = "power", "perf";
+    };