[v2] dt-bindings: ata: Add UniPhier controller binding

Message ID 20230213045432.32614-1-hayashi.kunihiko@socionext.com
State New
Headers
Series [v2] dt-bindings: ata: Add UniPhier controller binding |

Commit Message

Kunihiko Hayashi Feb. 13, 2023, 4:54 a.m. UTC
  Add UniPhier SATA controller compatible string to the platform binding.
This controller needs maximum three reset controls.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 .../devicetree/bindings/ata/ahci-platform.yaml  | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Changes since v1:
- Restrict resets property changes with compatible strings
- Fix maxItems from two to three
  

Comments

Krzysztof Kozlowski Feb. 13, 2023, 9:10 a.m. UTC | #1
On 13/02/2023 05:54, Kunihiko Hayashi wrote:
> Add UniPhier SATA controller compatible string to the platform binding.
> This controller needs maximum three reset controls.
> 
> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
> ---
>  .../devicetree/bindings/ata/ahci-platform.yaml  | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> Changes since v1:
> - Restrict resets property changes with compatible strings
> - Fix maxItems from two to three
> 
> diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.yaml b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
> index 7dc2a2e8f598..25dd5ffaa517 100644
> --- a/Documentation/devicetree/bindings/ata/ahci-platform.yaml
> +++ b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
> @@ -45,6 +45,9 @@ properties:
>                - marvell,armada-8k-ahci
>                - marvell,berlin2-ahci
>                - marvell,berlin2q-ahci
> +              - socionext,uniphier-pro4-ahci
> +              - socionext,uniphier-pxs2-ahci
> +              - socionext,uniphier-pxs3-ahci
>            - const: generic-ahci
>        - enum:

Top level is saying reset=1, so did you test your bindings?

>            - cavium,octeon-7130-ahci
> @@ -76,6 +79,20 @@ properties:
>    resets:
>      maxItems: 1
>  
> +if:
Keep it in allOf like in example-schema. Will save you one re-indent
pretty soon...


> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - socionext,uniphier-pro4-ahci
> +          - socionext,uniphier-pxs2-ahci
> +          - socionext,uniphier-pxs3-ahci
> +then:
> +  properties:
> +    resets:
> +      minItems: 1
> +      maxItems: 3

And entire allOf goes to the place like in example-schema.
> +
>  patternProperties:
>    "^sata-port@[0-9a-f]+$":
>      $ref: /schemas/ata/ahci-common.yaml#/$defs/ahci-port

Best regards,
Krzysztof
  
Kunihiko Hayashi Feb. 14, 2023, 9:33 a.m. UTC | #2
Hi Krzysztof,

On 2023/02/13 18:10, Krzysztof Kozlowski wrote:
> On 13/02/2023 05:54, Kunihiko Hayashi wrote:
>> Add UniPhier SATA controller compatible string to the platform binding.
>> This controller needs maximum three reset controls.
>>
>> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
>> ---
>>   .../devicetree/bindings/ata/ahci-platform.yaml  | 17 +++++++++++++++++
>>   1 file changed, 17 insertions(+)
>>
>> Changes since v1:
>> - Restrict resets property changes with compatible strings
>> - Fix maxItems from two to three
>>
>> diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>> b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>> index 7dc2a2e8f598..25dd5ffaa517 100644
>> --- a/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>> +++ b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>> @@ -45,6 +45,9 @@ properties:
>>                 - marvell,armada-8k-ahci
>>                 - marvell,berlin2-ahci
>>                 - marvell,berlin2q-ahci
>> +              - socionext,uniphier-pro4-ahci
>> +              - socionext,uniphier-pxs2-ahci
>> +              - socionext,uniphier-pxs3-ahci
>>             - const: generic-ahci
>>         - enum:
> 
> Top level is saying reset=1, so did you test your bindings?

Umm, I didn't see any errors on dt_binding_check, anyway I'll add
initial minItems:1 and maxItems:3 on top level first.

> 
>>             - cavium,octeon-7130-ahci
>> @@ -76,6 +79,20 @@ properties:
>>     resets:
>>       maxItems: 1
>>
>> +if:
> Keep it in allOf like in example-schema. Will save you one re-indent
> pretty soon...

I see. I'll move if clause into allOf, and also move the original allOf.

>> +  properties:
>> +    compatible:
>> +      contains:
>> +        enum:
>> +          - socionext,uniphier-pro4-ahci
>> +          - socionext,uniphier-pxs2-ahci
>> +          - socionext,uniphier-pxs3-ahci
>> +then:
>> +  properties:
>> +    resets:
>> +      minItems: 1
>> +      maxItems: 3
> 
> And entire allOf goes to the place like in example-schema.

I've got it. and I'll fix it (minItems:2).

Thank you,

---
Best Regards
Kunihiko Hayashi
  
Krzysztof Kozlowski Feb. 14, 2023, 9:42 a.m. UTC | #3
On 14/02/2023 10:33, Kunihiko Hayashi wrote:
> Hi Krzysztof,
> 
> On 2023/02/13 18:10, Krzysztof Kozlowski wrote:
>> On 13/02/2023 05:54, Kunihiko Hayashi wrote:
>>> Add UniPhier SATA controller compatible string to the platform binding.
>>> This controller needs maximum three reset controls.
>>>
>>> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
>>> ---
>>>   .../devicetree/bindings/ata/ahci-platform.yaml  | 17 +++++++++++++++++
>>>   1 file changed, 17 insertions(+)
>>>
>>> Changes since v1:
>>> - Restrict resets property changes with compatible strings
>>> - Fix maxItems from two to three
>>>
>>> diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>> b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>> index 7dc2a2e8f598..25dd5ffaa517 100644
>>> --- a/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>> +++ b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>> @@ -45,6 +45,9 @@ properties:
>>>                 - marvell,armada-8k-ahci
>>>                 - marvell,berlin2-ahci
>>>                 - marvell,berlin2q-ahci
>>> +              - socionext,uniphier-pro4-ahci
>>> +              - socionext,uniphier-pxs2-ahci
>>> +              - socionext,uniphier-pxs3-ahci
>>>             - const: generic-ahci
>>>         - enum:
>>
>> Top level is saying reset=1, so did you test your bindings?
> 
> Umm, I didn't see any errors on dt_binding_check, anyway I'll add
> initial minItems:1 and maxItems:3 on top level first.

You need to test also all DTS using these bindings. Yours and others.
If you tested the DTS (with proper binding, not one which is basically
noop):

uniphier-pro4-ace.dtb: sata@65600000: resets: [[27, 12], [27, 28], [37,
3]] is too long

BTW, the patch has other errors - just look at the beginning of the
file. I cannot see it here in the diff, but when you open the file you
should notice it.

Best regards,
Krzysztof
  
Kunihiko Hayashi Feb. 16, 2023, 5:23 p.m. UTC | #4
On 2023/02/14 18:42, Krzysztof Kozlowski wrote:
> On 14/02/2023 10:33, Kunihiko Hayashi wrote:
>> Hi Krzysztof,
>>
>> On 2023/02/13 18:10, Krzysztof Kozlowski wrote:
>>> On 13/02/2023 05:54, Kunihiko Hayashi wrote:
>>>> Add UniPhier SATA controller compatible string to the platform binding.
>>>> This controller needs maximum three reset controls.
>>>>
>>>> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
>>>> ---
>>>>    .../devicetree/bindings/ata/ahci-platform.yaml  | 17 +++++++++++++++++
>>>>    1 file changed, 17 insertions(+)
>>>>
>>>> Changes since v1:
>>>> - Restrict resets property changes with compatible strings
>>>> - Fix maxItems from two to three
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>>> b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>>> index 7dc2a2e8f598..25dd5ffaa517 100644
>>>> --- a/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>>> +++ b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>>> @@ -45,6 +45,9 @@ properties:
>>>>                  - marvell,armada-8k-ahci
>>>>                  - marvell,berlin2-ahci
>>>>                  - marvell,berlin2q-ahci
>>>> +              - socionext,uniphier-pro4-ahci
>>>> +              - socionext,uniphier-pxs2-ahci
>>>> +              - socionext,uniphier-pxs3-ahci
>>>>              - const: generic-ahci
>>>>          - enum:
>>>
>>> Top level is saying reset=1, so did you test your bindings?
>>
>> Umm, I didn't see any errors on dt_binding_check, anyway I'll add
>> initial minItems:1 and maxItems:3 on top level first.
> 
> You need to test also all DTS using these bindings. Yours and others.
> If you tested the DTS (with proper binding, not one which is basically
> noop):
> 
> uniphier-pro4-ace.dtb: sata@65600000: resets: [[27, 12], [27, 28], [37,
> 3]] is too long

I've tried updating tools and doing dtbs_check, but I couldn't find this
error. It seems that this error can't be detected unless there is the
specified compatible in "select:".

> BTW, the patch has other errors - just look at the beginning of the
> file. I cannot see it here in the diff, but when you open the file you
> should notice it.

Sorry, but I cannot see anything wrong.
I'll check the header or something...

Thank you,

---
Best Regards
Kunihiko Hayashi
  
Krzysztof Kozlowski Feb. 17, 2023, 8:42 a.m. UTC | #5
On 16/02/2023 18:23, Kunihiko Hayashi wrote:
> On 2023/02/14 18:42, Krzysztof Kozlowski wrote:
>> On 14/02/2023 10:33, Kunihiko Hayashi wrote:
>>> Hi Krzysztof,
>>>
>>> On 2023/02/13 18:10, Krzysztof Kozlowski wrote:
>>>> On 13/02/2023 05:54, Kunihiko Hayashi wrote:
>>>>> Add UniPhier SATA controller compatible string to the platform binding.
>>>>> This controller needs maximum three reset controls.
>>>>>
>>>>> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
>>>>> ---
>>>>>    .../devicetree/bindings/ata/ahci-platform.yaml  | 17 +++++++++++++++++
>>>>>    1 file changed, 17 insertions(+)
>>>>>
>>>>> Changes since v1:
>>>>> - Restrict resets property changes with compatible strings
>>>>> - Fix maxItems from two to three
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>>>> b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>>>> index 7dc2a2e8f598..25dd5ffaa517 100644
>>>>> --- a/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>>>> +++ b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>>>> @@ -45,6 +45,9 @@ properties:
>>>>>                  - marvell,armada-8k-ahci
>>>>>                  - marvell,berlin2-ahci
>>>>>                  - marvell,berlin2q-ahci
>>>>> +              - socionext,uniphier-pro4-ahci
>>>>> +              - socionext,uniphier-pxs2-ahci
>>>>> +              - socionext,uniphier-pxs3-ahci
>>>>>              - const: generic-ahci
>>>>>          - enum:
>>>>
>>>> Top level is saying reset=1, so did you test your bindings?
>>>
>>> Umm, I didn't see any errors on dt_binding_check, anyway I'll add
>>> initial minItems:1 and maxItems:3 on top level first.
>>
>> You need to test also all DTS using these bindings. Yours and others.
>> If you tested the DTS (with proper binding, not one which is basically
>> noop):
>>
>> uniphier-pro4-ace.dtb: sata@65600000: resets: [[27, 12], [27, 28], [37,
>> 3]] is too long
> 
> I've tried updating tools and doing dtbs_check, but I couldn't find this
> error. It seems that this error can't be detected unless there is the
> specified compatible in "select:".
> 
>> BTW, the patch has other errors - just look at the beginning of the
>> file. I cannot see it here in the diff, but when you open the file you
>> should notice it.
> 
> Sorry, but I cannot see anything wrong.
> I'll check the header or something...

If you open the file, you will notice the same compatibles in two
places. In select and in properties. You added your compatibles only to
one place, so not symmetrically.

Best regards,
Krzysztof
  
Kunihiko Hayashi Feb. 17, 2023, 11:14 a.m. UTC | #6
On 2023/02/17 17:42, Krzysztof Kozlowski wrote:
> On 16/02/2023 18:23, Kunihiko Hayashi wrote:
>> On 2023/02/14 18:42, Krzysztof Kozlowski wrote:
>>> On 14/02/2023 10:33, Kunihiko Hayashi wrote:
>>>> Hi Krzysztof,
>>>>
>>>> On 2023/02/13 18:10, Krzysztof Kozlowski wrote:
>>>>> On 13/02/2023 05:54, Kunihiko Hayashi wrote:
>>>>>> Add UniPhier SATA controller compatible string to the platform
>>>>>> binding.
>>>>>> This controller needs maximum three reset controls.
>>>>>>
>>>>>> Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
>>>>>> ---
>>>>>>     .../devicetree/bindings/ata/ahci-platform.yaml  | 17
>>>>>> +++++++++++++++++
>>>>>>     1 file changed, 17 insertions(+)
>>>>>>
>>>>>> Changes since v1:
>>>>>> - Restrict resets property changes with compatible strings
>>>>>> - Fix maxItems from two to three
>>>>>>
>>>>>> diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>>>>> b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>>>>> index 7dc2a2e8f598..25dd5ffaa517 100644
>>>>>> --- a/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>>>>> +++ b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
>>>>>> @@ -45,6 +45,9 @@ properties:
>>>>>>                   - marvell,armada-8k-ahci
>>>>>>                   - marvell,berlin2-ahci
>>>>>>                   - marvell,berlin2q-ahci
>>>>>> +              - socionext,uniphier-pro4-ahci
>>>>>> +              - socionext,uniphier-pxs2-ahci
>>>>>> +              - socionext,uniphier-pxs3-ahci
>>>>>>               - const: generic-ahci
>>>>>>           - enum:
>>>>>
>>>>> Top level is saying reset=1, so did you test your bindings?
>>>>
>>>> Umm, I didn't see any errors on dt_binding_check, anyway I'll add
>>>> initial minItems:1 and maxItems:3 on top level first.
>>>
>>> You need to test also all DTS using these bindings. Yours and others.
>>> If you tested the DTS (with proper binding, not one which is basically
>>> noop):
>>>
>>> uniphier-pro4-ace.dtb: sata@65600000: resets: [[27, 12], [27, 28], [37,
>>> 3]] is too long
>>
>> I've tried updating tools and doing dtbs_check, but I couldn't find this
>> error. It seems that this error can't be detected unless there is the
>> specified compatible in "select:".
>>
>>> BTW, the patch has other errors - just look at the beginning of the
>>> file. I cannot see it here in the diff, but when you open the file you
>>> should notice it.
>>
>> Sorry, but I cannot see anything wrong.
>> I'll check the header or something...
> 
> If you open the file, you will notice the same compatibles in two
> places. In select and in properties. You added your compatibles only to
> one place, so not symmetrically.

OK, I understand. I'll add them in both.

Thank you,

---
Best Regards
Kunihiko Hayashi
  

Patch

diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.yaml b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
index 7dc2a2e8f598..25dd5ffaa517 100644
--- a/Documentation/devicetree/bindings/ata/ahci-platform.yaml
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.yaml
@@ -45,6 +45,9 @@  properties:
               - marvell,armada-8k-ahci
               - marvell,berlin2-ahci
               - marvell,berlin2q-ahci
+              - socionext,uniphier-pro4-ahci
+              - socionext,uniphier-pxs2-ahci
+              - socionext,uniphier-pxs3-ahci
           - const: generic-ahci
       - enum:
           - cavium,octeon-7130-ahci
@@ -76,6 +79,20 @@  properties:
   resets:
     maxItems: 1
 
+if:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - socionext,uniphier-pro4-ahci
+          - socionext,uniphier-pxs2-ahci
+          - socionext,uniphier-pxs3-ahci
+then:
+  properties:
+    resets:
+      minItems: 1
+      maxItems: 3
+
 patternProperties:
   "^sata-port@[0-9a-f]+$":
     $ref: /schemas/ata/ahci-common.yaml#/$defs/ahci-port