diff mbox series

[2/8] dt-bindings: nvmem: rockchip-otp: Add compatible for RK3588

Message ID 20230501084401.765169-3-cristian.ciocaltea@collabora.com (mailing list archive)
State New, archived
Headers show
Series Add RK3588 OTP memory support | expand

Commit Message

Cristian Ciocaltea May 1, 2023, 8:43 a.m. UTC
Document the OTP memory found on Rockchip RK3588 SoC.

Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
 .../bindings/nvmem/rockchip-otp.yaml          | 71 ++++++++++++++++---
 1 file changed, 60 insertions(+), 11 deletions(-)

Comments

Heiko Stuebner May 2, 2023, 8:42 a.m. UTC | #1
Hi,

Am Montag, 1. Mai 2023, 10:43:54 CEST schrieb Cristian Ciocaltea:
> Document the OTP memory found on Rockchip RK3588 SoC.

nit: I guess the changed clock and resets configuration for rk3588 variants
could be mentioned in the commit message.

Reviewed-by: Heiko Stuebner <heiko@sntech.de>

> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
>  .../bindings/nvmem/rockchip-otp.yaml          | 71 ++++++++++++++++---
>  1 file changed, 60 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml b/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml
> index 658ceed14ee2..84a11382c6e7 100644
> --- a/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml
> @@ -9,34 +9,31 @@ title: Rockchip internal OTP (One Time Programmable) memory
>  maintainers:
>    - Heiko Stuebner <heiko@sntech.de>
>  
> -allOf:
> -  - $ref: nvmem.yaml#
> -
>  properties:
>    compatible:
>      enum:
>        - rockchip,px30-otp
>        - rockchip,rk3308-otp
> +      - rockchip,rk3588-otp
>  
>    reg:
>      maxItems: 1
>  
>    clocks:
>      minItems: 3
> -    maxItems: 3
> +    maxItems: 4
>  
>    clock-names:
> -    items:
> -      - const: otp
> -      - const: apb_pclk
> -      - const: phy
> +    minItems: 3
> +    maxItems: 4
>  
>    resets:
> -    maxItems: 1
> +    minItems: 1
> +    maxItems: 3
>  
>    reset-names:
> -    items:
> -      - const: phy
> +    minItems: 1
> +    maxItems: 3
>  
>  required:
>    - compatible
> @@ -46,6 +43,58 @@ required:
>    - resets
>    - reset-names
>  
> +allOf:
> +  - $ref: nvmem.yaml#
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - rockchip,px30-otp
> +              - rockchip,rk3308-otp
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 3
> +          maxItems: 3
> +        clock-names:
> +          items:
> +            - const: otp
> +            - const: apb_pclk
> +            - const: phy
> +        resets:
> +          maxItems: 1
> +        reset-names:
> +          items:
> +            - const: phy
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - rockchip,rk3588-otp
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 4
> +          maxItems: 4
> +        clock-names:
> +          items:
> +            - const: otpc
> +            - const: apb
> +            - const: arb
> +            - const: phy
> +        resets:
> +          minItems: 1
> +          maxItems: 3
> +        reset-names:
> +          items:
> +            - const: otpc
> +            - const: apb
> +            - const: arb
> +
>  unevaluatedProperties: false
>  
>  examples:
>
Cristian Ciocaltea May 2, 2023, 12:46 p.m. UTC | #2
Hello Heiko,

On 5/2/23 11:42, Heiko Stübner wrote:
> Hi,
> 
> Am Montag, 1. Mai 2023, 10:43:54 CEST schrieb Cristian Ciocaltea:
>> Document the OTP memory found on Rockchip RK3588 SoC.
> 
> nit: I guess the changed clock and resets configuration for rk3588 variants
> could be mentioned in the commit message.

Sure, I will update the commit message if a new revision of the patch
series is required.

> Reviewed-by: Heiko Stuebner <heiko@sntech.de>

Thanks for reviewing!

Regards,
Cristian
Krzysztof Kozlowski May 3, 2023, 6:28 a.m. UTC | #3
On 01/05/2023 10:43, Cristian Ciocaltea wrote:
> Document the OTP memory found on Rockchip RK3588 SoC.
> 
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
>  .../bindings/nvmem/rockchip-otp.yaml          | 71 ++++++++++++++++---
>  1 file changed, 60 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml b/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml
> index 658ceed14ee2..84a11382c6e7 100644
> --- a/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml
> +++ b/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml
> @@ -9,34 +9,31 @@ title: Rockchip internal OTP (One Time Programmable) memory
>  maintainers:
>    - Heiko Stuebner <heiko@sntech.de>
>  
> -allOf:
> -  - $ref: nvmem.yaml#
> -
>  properties:
>    compatible:
>      enum:
>        - rockchip,px30-otp
>        - rockchip,rk3308-otp
> +      - rockchip,rk3588-otp
>  
>    reg:
>      maxItems: 1
>  
>    clocks:
>      minItems: 3
> -    maxItems: 3
> +    maxItems: 4
>  
>    clock-names:
> -    items:
> -      - const: otp
> -      - const: apb_pclk
> -      - const: phy
> +    minItems: 3
> +    maxItems: 4
>  
>    resets:
> -    maxItems: 1
> +    minItems: 1
> +    maxItems: 3
>  
>    reset-names:
> -    items:
> -      - const: phy
> +    minItems: 1
> +    maxItems: 3
>  
>  required:
>    - compatible
> @@ -46,6 +43,58 @@ required:
>    - resets
>    - reset-names
>  
> +allOf:
> +  - $ref: nvmem.yaml#
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - rockchip,px30-otp
> +              - rockchip,rk3308-otp
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 3
> +          maxItems: 3
> +        clock-names:
> +          items:
> +            - const: otp
> +            - const: apb_pclk
> +            - const: phy
> +        resets:
> +          maxItems: 1
> +        reset-names:
> +          items:
> +            - const: phy
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - rockchip,rk3588-otp
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 4
> +          maxItems: 4
> +        clock-names:
> +          items:
> +            - const: otpc
> +            - const: apb
> +            - const: arb
> +            - const: phy

Keep the same order of clocks as in older variants, so you can keep the
list in top-level place and here only minItems: 4.

> +        resets:
> +          minItems: 1
> +          maxItems: 3
> +        reset-names:
> +          items:
> +            - const: otpc

Shouldn't this be phy?



Best regards,
Krzysztof
Cristian Ciocaltea May 4, 2023, 2:14 p.m. UTC | #4
On 5/3/23 09:28, Krzysztof Kozlowski wrote:
> On 01/05/2023 10:43, Cristian Ciocaltea wrote:
>> Document the OTP memory found on Rockchip RK3588 SoC.
>>
>> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
>> ---
>>  .../bindings/nvmem/rockchip-otp.yaml          | 71 ++++++++++++++++---
>>  1 file changed, 60 insertions(+), 11 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml b/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml
>> index 658ceed14ee2..84a11382c6e7 100644
>> --- a/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml
>> +++ b/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml
>> @@ -9,34 +9,31 @@ title: Rockchip internal OTP (One Time Programmable) memory
>>  maintainers:
>>    - Heiko Stuebner <heiko@sntech.de>
>>  
>> -allOf:
>> -  - $ref: nvmem.yaml#
>> -
>>  properties:
>>    compatible:
>>      enum:
>>        - rockchip,px30-otp
>>        - rockchip,rk3308-otp
>> +      - rockchip,rk3588-otp
>>  
>>    reg:
>>      maxItems: 1
>>  
>>    clocks:
>>      minItems: 3
>> -    maxItems: 3
>> +    maxItems: 4
>>  
>>    clock-names:
>> -    items:
>> -      - const: otp
>> -      - const: apb_pclk
>> -      - const: phy
>> +    minItems: 3
>> +    maxItems: 4
>>  
>>    resets:
>> -    maxItems: 1
>> +    minItems: 1
>> +    maxItems: 3
>>  
>>    reset-names:
>> -    items:
>> -      - const: phy
>> +    minItems: 1
>> +    maxItems: 3
>>  
>>  required:
>>    - compatible
>> @@ -46,6 +43,58 @@ required:
>>    - resets
>>    - reset-names
>>  
>> +allOf:
>> +  - $ref: nvmem.yaml#
>> +
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            enum:
>> +              - rockchip,px30-otp
>> +              - rockchip,rk3308-otp
>> +    then:
>> +      properties:
>> +        clocks:
>> +          minItems: 3
>> +          maxItems: 3
>> +        clock-names:
>> +          items:
>> +            - const: otp
>> +            - const: apb_pclk
>> +            - const: phy
>> +        resets:
>> +          maxItems: 1
>> +        reset-names:
>> +          items:
>> +            - const: phy
>> +
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            enum:
>> +              - rockchip,rk3588-otp
>> +    then:
>> +      properties:
>> +        clocks:
>> +          minItems: 4
>> +          maxItems: 4
>> +        clock-names:
>> +          items:
>> +            - const: otpc
>> +            - const: apb
>> +            - const: arb
>> +            - const: phy
> 
> Keep the same order of clocks as in older variants, so you can keep the
> list in top-level place and here only minItems: 4.
> 
>> +        resets:
>> +          minItems: 1
>> +          maxItems: 3
>> +        reset-names:
>> +          items:
>> +            - const: otpc
> 
> Shouldn't this be phy?

It seems there is no reset for PHY, or at least I couldn't find any
reference in the RK3588 TRM, nor in the downstream driver implementation.

Thanks for reviewing! I will prepare v2 with all the requested changes.

Kind regards,
Cristian
Krzysztof Kozlowski May 4, 2023, 2:39 p.m. UTC | #5
On 04/05/2023 16:14, Cristian Ciocaltea wrote:
>>> +        reset-names:
>>> +          items:
>>> +            - const: phy
>>> +
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          contains:
>>> +            enum:
>>> +              - rockchip,rk3588-otp
>>> +    then:
>>> +      properties:
>>> +        clocks:
>>> +          minItems: 4
>>> +          maxItems: 4
>>> +        clock-names:
>>> +          items:
>>> +            - const: otpc
>>> +            - const: apb
>>> +            - const: arb
>>> +            - const: phy
>>
>> Keep the same order of clocks as in older variants, so you can keep the
>> list in top-level place and here only minItems: 4.
>>
>>> +        resets:
>>> +          minItems: 1
>>> +          maxItems: 3
>>> +        reset-names:
>>> +          items:
>>> +            - const: otpc
>>
>> Shouldn't this be phy?
> 
> It seems there is no reset for PHY, or at least I couldn't find any
> reference in the RK3588 TRM, nor in the downstream driver implementation.

OK, just to be sure that this is not the same reset as rk3308 just
differently named in consumer.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml b/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml
index 658ceed14ee2..84a11382c6e7 100644
--- a/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml
+++ b/Documentation/devicetree/bindings/nvmem/rockchip-otp.yaml
@@ -9,34 +9,31 @@  title: Rockchip internal OTP (One Time Programmable) memory
 maintainers:
   - Heiko Stuebner <heiko@sntech.de>
 
-allOf:
-  - $ref: nvmem.yaml#
-
 properties:
   compatible:
     enum:
       - rockchip,px30-otp
       - rockchip,rk3308-otp
+      - rockchip,rk3588-otp
 
   reg:
     maxItems: 1
 
   clocks:
     minItems: 3
-    maxItems: 3
+    maxItems: 4
 
   clock-names:
-    items:
-      - const: otp
-      - const: apb_pclk
-      - const: phy
+    minItems: 3
+    maxItems: 4
 
   resets:
-    maxItems: 1
+    minItems: 1
+    maxItems: 3
 
   reset-names:
-    items:
-      - const: phy
+    minItems: 1
+    maxItems: 3
 
 required:
   - compatible
@@ -46,6 +43,58 @@  required:
   - resets
   - reset-names
 
+allOf:
+  - $ref: nvmem.yaml#
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - rockchip,px30-otp
+              - rockchip,rk3308-otp
+    then:
+      properties:
+        clocks:
+          minItems: 3
+          maxItems: 3
+        clock-names:
+          items:
+            - const: otp
+            - const: apb_pclk
+            - const: phy
+        resets:
+          maxItems: 1
+        reset-names:
+          items:
+            - const: phy
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - rockchip,rk3588-otp
+    then:
+      properties:
+        clocks:
+          minItems: 4
+          maxItems: 4
+        clock-names:
+          items:
+            - const: otpc
+            - const: apb
+            - const: arb
+            - const: phy
+        resets:
+          minItems: 1
+          maxItems: 3
+        reset-names:
+          items:
+            - const: otpc
+            - const: apb
+            - const: arb
+
 unevaluatedProperties: false
 
 examples: