diff mbox series

[v3,1/3] dt-bindings: reserved-memory: rmtfs: Make qcom,vmid an array

Message ID 20230109093947.83394-1-konrad.dybcio@linaro.org (mailing list archive)
State Superseded
Headers show
Series [v3,1/3] dt-bindings: reserved-memory: rmtfs: Make qcom,vmid an array | expand

Commit Message

Konrad Dybcio Jan. 9, 2023, 9:39 a.m. UTC
Some SoCs mandate that the RMTFS is also assigned to the NAV VM, while
others really don't want that. Since it has to be conditional, turn
qcom,vmid into an u32 array so that we can handle the NAV case, as
well as other similar ones if they pop up in the future.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
v2 -> v3:
Rewrite to accomodate for changes, don't pick up tags

 .../devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Krzysztof Kozlowski Jan. 9, 2023, 9:51 a.m. UTC | #1
On 09/01/2023 10:39, Konrad Dybcio wrote:
> Some SoCs mandate that the RMTFS is also assigned to the NAV VM, while
> others really don't want that. Since it has to be conditional, turn
> qcom,vmid into an u32 array so that we can handle the NAV case, as
> well as other similar ones if they pop up in the future.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> ---
> v2 -> v3:
> Rewrite to accomodate for changes, don't pick up tags
> 
>  .../devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml   | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
> index 2998f1c8f0db..cfc2fda30eba 100644
> --- a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
> +++ b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
> @@ -27,9 +27,9 @@ properties:
>        identifier of the client to use this region for buffers
>  
>    qcom,vmid:
> -    $ref: /schemas/types.yaml#/definitions/uint32
> +    $ref: /schemas/types.yaml#/definitions/uint32-array
>      description: >
> -      vmid of the remote processor, to set up memory protection
> +      Array of vmids of the remote processors, to set up memory protection

You need now min and maxItems.

Best regards,
Krzysztof
Konrad Dybcio Jan. 9, 2023, 11:41 a.m. UTC | #2
On 9.01.2023 10:51, Krzysztof Kozlowski wrote:
> On 09/01/2023 10:39, Konrad Dybcio wrote:
>> Some SoCs mandate that the RMTFS is also assigned to the NAV VM, while
>> others really don't want that. Since it has to be conditional, turn
>> qcom,vmid into an u32 array so that we can handle the NAV case, as
>> well as other similar ones if they pop up in the future.
>>
>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>> ---
>> v2 -> v3:
>> Rewrite to accomodate for changes, don't pick up tags
>>
>>  .../devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml   | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
>> index 2998f1c8f0db..cfc2fda30eba 100644
>> --- a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
>> +++ b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
>> @@ -27,9 +27,9 @@ properties:
>>        identifier of the client to use this region for buffers
>>  
>>    qcom,vmid:
>> -    $ref: /schemas/types.yaml#/definitions/uint32
>> +    $ref: /schemas/types.yaml#/definitions/uint32-array
>>      description: >
>> -      vmid of the remote processor, to set up memory protection
>> +      Array of vmids of the remote processors, to set up memory protection
> 
> You need now min and maxItems.
Hm, I tested it with and without:

minItems: 1
maxItems: 2

on DTs with either one or two VMIDs defined and neither complains..

Konrad
> 
> Best regards,
> Krzysztof
>
Krzysztof Kozlowski Jan. 9, 2023, 12:13 p.m. UTC | #3
On 09/01/2023 12:41, Konrad Dybcio wrote:
> 
> 
> On 9.01.2023 10:51, Krzysztof Kozlowski wrote:
>> On 09/01/2023 10:39, Konrad Dybcio wrote:
>>> Some SoCs mandate that the RMTFS is also assigned to the NAV VM, while
>>> others really don't want that. Since it has to be conditional, turn
>>> qcom,vmid into an u32 array so that we can handle the NAV case, as
>>> well as other similar ones if they pop up in the future.
>>>
>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
>>> ---
>>> v2 -> v3:
>>> Rewrite to accomodate for changes, don't pick up tags
>>>
>>>  .../devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml   | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
>>> index 2998f1c8f0db..cfc2fda30eba 100644
>>> --- a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
>>> +++ b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
>>> @@ -27,9 +27,9 @@ properties:
>>>        identifier of the client to use this region for buffers
>>>  
>>>    qcom,vmid:
>>> -    $ref: /schemas/types.yaml#/definitions/uint32
>>> +    $ref: /schemas/types.yaml#/definitions/uint32-array
>>>      description: >
>>> -      vmid of the remote processor, to set up memory protection
>>> +      Array of vmids of the remote processors, to set up memory protection
>>
>> You need now min and maxItems.
> Hm, I tested it with and without:
> 
> minItems: 1
> maxItems: 2
> 
> on DTs with either one or two VMIDs defined and neither complains..

You can also make a property like:

	qcom,vmid: true

which will accept anything but it won't be correct approach. Properties
should have some reasonable constraints. Otherwise binding is not really
specific and is describing the interface in a very relaxed way.

Best regards,
Krzysztof
Marijn Suijten Jan. 9, 2023, 5:14 p.m. UTC | #4
On 2023-01-09 12:41:00, Konrad Dybcio wrote:
> 
> 
> On 9.01.2023 10:51, Krzysztof Kozlowski wrote:
> > On 09/01/2023 10:39, Konrad Dybcio wrote:
> >> Some SoCs mandate that the RMTFS is also assigned to the NAV VM, while
> >> others really don't want that. Since it has to be conditional, turn
> >> qcom,vmid into an u32 array so that we can handle the NAV case, as
> >> well as other similar ones if they pop up in the future.
> >>
> >> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
> >> ---
> >> v2 -> v3:
> >> Rewrite to accomodate for changes, don't pick up tags
> >>
> >>  .../devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml   | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
> >> index 2998f1c8f0db..cfc2fda30eba 100644
> >> --- a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
> >> +++ b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
> >> @@ -27,9 +27,9 @@ properties:
> >>        identifier of the client to use this region for buffers
> >>  
> >>    qcom,vmid:
> >> -    $ref: /schemas/types.yaml#/definitions/uint32
> >> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> >>      description: >
> >> -      vmid of the remote processor, to set up memory protection
> >> +      Array of vmids of the remote processors, to set up memory protection
> > 
> > You need now min and maxItems.
> Hm, I tested it with and without:
> 
> minItems: 1
> maxItems: 2
> 
> on DTs with either one or two VMIDs defined and neither complains..

This sounds like a constraint, so it'd only fail on DTs with zero or
more than two VMIDs (when min/maxItems is present, no complaints
otherwise).

- Marijn
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
index 2998f1c8f0db..cfc2fda30eba 100644
--- a/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
+++ b/Documentation/devicetree/bindings/reserved-memory/qcom,rmtfs-mem.yaml
@@ -27,9 +27,9 @@  properties:
       identifier of the client to use this region for buffers
 
   qcom,vmid:
-    $ref: /schemas/types.yaml#/definitions/uint32
+    $ref: /schemas/types.yaml#/definitions/uint32-array
     description: >
-      vmid of the remote processor, to set up memory protection
+      Array of vmids of the remote processors, to set up memory protection
 
 required:
   - qcom,client-id