diff mbox series

[v2,1/2] dt-bindings: firmware: arm,scmi: support parameter passing in smc/hvc

Message ID 20230410182058.8949-2-quic_nkela@quicinc.com
State Changes Requested, archived
Headers show
Series Allow parameter in smc/hvc calls | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Nikunj Kela April 10, 2023, 6:20 p.m. UTC
Currently, smc/hvc calls are made with smc-id only. The parameters are
all set to zeros. This patch defines two optional device tree bindings,
that can be used to pass parameters in smc/hvc calls.

This is useful when multiple scmi instances are used with common smc-id.

Signed-off-by: Nikunj Kela <quic_nkela@quicinc.com>
---
 .../devicetree/bindings/firmware/arm,scmi.yaml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Sudeep Holla April 11, 2023, 12:54 p.m. UTC | #1
On Mon, Apr 10, 2023 at 11:20:57AM -0700, Nikunj Kela wrote:
> Currently, smc/hvc calls are made with smc-id only. The parameters are
> all set to zeros. This patch defines two optional device tree bindings,
> that can be used to pass parameters in smc/hvc calls.
>

Why 2 values ?

> This is useful when multiple scmi instances are used with common smc-id.
>

I really would like to avoid this binding. Because of lack of standard
SMC/HVC FID for SCMI we had to add this binding. Extending for newer use
case like this in a vendor specific way is something I would like to avoid.

> Signed-off-by: Nikunj Kela <quic_nkela@quicinc.com>
> ---
>  .../devicetree/bindings/firmware/arm,scmi.yaml | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> index 5824c43e9893..ecf76b763c8c 100644
> --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
> @@ -115,6 +115,23 @@ properties:
>      description:
>        SMC id required when using smc or hvc transports
>  
> +  arm,smc32-params:
> +    $ref: /schemas/types.yaml#/definitions/uint32-array
> +    description:
> +      An optional parameter list passed in smc32 or hvc32 calls
> +    default: 0
> +    minItems: 1
> +    maxItems: 6
> +
> +  arm,smc64-params:
> +    $ref: /schemas/types.yaml#/definitions/uint64-array
> +    description:
> +      An optional parameter list passed in smc64 or hvc64 calls.
> +      This is valid only on ARM64 machines.
> +    default: 0
> +    minItems: 1
> +    maxItems: 6
> +

Even if we end up adding(which I would very much like to avoid), I don't see
the need for 32 and 64 bit params like this. There must be ways to avoid that
used by some property in some other binding(I will look for one if we choose
this path)
Nikunj Kela April 11, 2023, 2:46 p.m. UTC | #2
On 4/11/2023 5:54 AM, Sudeep Holla wrote:
> On Mon, Apr 10, 2023 at 11:20:57AM -0700, Nikunj Kela wrote:
>> Currently, smc/hvc calls are made with smc-id only. The parameters are
>> all set to zeros. This patch defines two optional device tree bindings,
>> that can be used to pass parameters in smc/hvc calls.
>>
> Why 2 values ?

I can do with one property if you prefer that. Its just I wanted to 
ensure that whosoever is setting

the parameter list, is mindful of 32bit vs 64bit convention. If we use 
one property, do you propose to add a new property like width to specify 
if the  parameter list is for 32bit vs 64bit?

>> This is useful when multiple scmi instances are used with common smc-id.
>>
> I really would like to avoid this binding. Because of lack of standard
> SMC/HVC FID for SCMI we had to add this binding. Extending for newer use
> case like this in a vendor specific way is something I would like to avoid.
If you have a solution to get rid of FID from DTB node, I will follow 
the same however until that happens, my view is that we put the 
parameters in dtb.
>
>> Signed-off-by: Nikunj Kela <quic_nkela@quicinc.com>
>> ---
>>   .../devicetree/bindings/firmware/arm,scmi.yaml | 18 ++++++++++++++++++
>>   1 file changed, 18 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
>> index 5824c43e9893..ecf76b763c8c 100644
>> --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
>> +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
>> @@ -115,6 +115,23 @@ properties:
>>       description:
>>         SMC id required when using smc or hvc transports
>>   
>> +  arm,smc32-params:
>> +    $ref: /schemas/types.yaml#/definitions/uint32-array
>> +    description:
>> +      An optional parameter list passed in smc32 or hvc32 calls
>> +    default: 0
>> +    minItems: 1
>> +    maxItems: 6
>> +
>> +  arm,smc64-params:
>> +    $ref: /schemas/types.yaml#/definitions/uint64-array
>> +    description:
>> +      An optional parameter list passed in smc64 or hvc64 calls.
>> +      This is valid only on ARM64 machines.
>> +    default: 0
>> +    minItems: 1
>> +    maxItems: 6
>> +
> Even if we end up adding(which I would very much like to avoid), I don't see
> the need for 32 and 64 bit params like this. There must be ways to avoid that
> used by some property in some other binding(I will look for one if we choose
> this path)
>
Krzysztof Kozlowski April 11, 2023, 5:18 p.m. UTC | #3
On 10/04/2023 20:20, Nikunj Kela wrote:
> Currently, smc/hvc calls are made with smc-id only. The parameters are
> all set to zeros. This patch defines two optional device tree bindings,
> that can be used to pass parameters in smc/hvc calls.
> 
> This is useful when multiple scmi instances are used with common smc-id.
> 
> Signed-off-by: Nikunj Kela <quic_nkela@quicinc.com>

Since you sent v2 before our discussion finished, let me answer here:
this does not look like property for DT. Do not send new patches without
giving reviewers chance to respond.

Best regards,
Krzysztof
Nikunj Kela April 11, 2023, 5:25 p.m. UTC | #4
On 4/11/2023 10:18 AM, Krzysztof Kozlowski wrote:
> On 10/04/2023 20:20, Nikunj Kela wrote:
>> Currently, smc/hvc calls are made with smc-id only. The parameters are
>> all set to zeros. This patch defines two optional device tree bindings,
>> that can be used to pass parameters in smc/hvc calls.
>>
>> This is useful when multiple scmi instances are used with common smc-id.
>>
>> Signed-off-by: Nikunj Kela <quic_nkela@quicinc.com>
> Since you sent v2 before our discussion finished, let me answer here:
> this does not look like property for DT. Do not send new patches without
> giving reviewers chance to respond.
Ok. My rationale on that is, if we allow smc-id which goes in r0/w0/x0 
registers in smc/hvc call to be part of dtb, then we should allow 
parameters which go in r1/w1/x1 to r6/w6/x6 register to be part of dtb. 
If you have an alternative suggestion, I am all ears!
> Best regards,
> Krzysztof
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
index 5824c43e9893..ecf76b763c8c 100644
--- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
+++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml
@@ -115,6 +115,23 @@  properties:
     description:
       SMC id required when using smc or hvc transports
 
+  arm,smc32-params:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description:
+      An optional parameter list passed in smc32 or hvc32 calls
+    default: 0
+    minItems: 1
+    maxItems: 6
+
+  arm,smc64-params:
+    $ref: /schemas/types.yaml#/definitions/uint64-array
+    description:
+      An optional parameter list passed in smc64 or hvc64 calls.
+      This is valid only on ARM64 machines.
+    default: 0
+    minItems: 1
+    maxItems: 6
+
   linaro,optee-channel-id:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
@@ -427,6 +444,7 @@  examples:
             compatible = "arm,scmi-smc";
             shmem = <&cpu_scp_lpri0>, <&cpu_scp_lpri1>;
             arm,smc-id = <0xc3000001>;
+            arm,smc64-params = <0xcd974d6c 0x5ed97289>;
 
             #address-cells = <1>;
             #size-cells = <0>;