[PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550

Neil Armstrong posted 2 patches 2 years, 3 months ago
There is a newer version of this series
[PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by Neil Armstrong 2 years, 3 months ago
Document SM8550 compatible for Pseudo Random Generator,
like SM8450 doesn't require clocks setup done by the secure
firmware.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 Documentation/devicetree/bindings/crypto/qcom,prng.yaml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/crypto/qcom,prng.yaml b/Documentation/devicetree/bindings/crypto/qcom,prng.yaml
index 36b0ebd9a44b..60fc9f261b83 100644
--- a/Documentation/devicetree/bindings/crypto/qcom,prng.yaml
+++ b/Documentation/devicetree/bindings/crypto/qcom,prng.yaml
@@ -16,7 +16,9 @@ properties:
           - qcom,prng  # 8916 etc.
           - qcom,prng-ee  # 8996 and later using EE
       - items:
-          - const: qcom,sm8450-prng-ee
+          - enum:
+              - qcom,sm8450-prng-ee
+              - qcom,sm8550-prng-ee
           - const: qcom,prng-ee
 
   reg:
@@ -39,7 +41,9 @@ allOf:
         properties:
           compatible:
             contains:
-              const: qcom,sm8450-prng-ee
+              enum:
+                - qcom,sm8450-prng-ee
+                - qcom,sm8550-prng-ee
     then:
       required:
         - clocks

-- 
2.34.1
Re: [PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by Om Prakash Singh 2 years, 3 months ago

On 8/22/2023 7:41 PM, Neil Armstrong wrote:
> Document SM8550 compatible for Pseudo Random Generator,
> like SM8450 doesn't require clocks setup done by the secure
> firmware.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
Acked-by: Om Prakash Singh <quic_omprsing@quicinc.com>
>   Documentation/devicetree/bindings/crypto/qcom,prng.yaml | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/crypto/qcom,prng.yaml b/Documentation/devicetree/bindings/crypto/qcom,prng.yaml
> index 36b0ebd9a44b..60fc9f261b83 100644
> --- a/Documentation/devicetree/bindings/crypto/qcom,prng.yaml
> +++ b/Documentation/devicetree/bindings/crypto/qcom,prng.yaml
> @@ -16,7 +16,9 @@ properties:
>             - qcom,prng  # 8916 etc.
>             - qcom,prng-ee  # 8996 and later using EE
>         - items:
> -          - const: qcom,sm8450-prng-ee
> +          - enum:
> +              - qcom,sm8450-prng-ee
> +              - qcom,sm8550-prng-ee
>             - const: qcom,prng-ee
>   
>     reg:
> @@ -39,7 +41,9 @@ allOf:
>           properties:
>             compatible:
>               contains:
> -              const: qcom,sm8450-prng-ee
> +              enum:
> +                - qcom,sm8450-prng-ee
> +                - qcom,sm8550-prng-ee
>       then:
>         required:
>           - clocks
>
Re: [PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by Konrad Dybcio 2 years, 3 months ago
On 22.08.2023 16:11, Neil Armstrong wrote:
> Document SM8550 compatible for Pseudo Random Generator,
> like SM8450 doesn't require clocks setup done by the secure
> firmware.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
+ CC Om

As mentioned in [1], perhaps we should rethink the compatible as
it may be a TRNG and not a PRNG?

Konrad

[1] https://lore.kernel.org/linux-arm-msm/d93902ee-c305-42cb-9d0d-1f0971ab3a70@quicinc.com/
Re: [PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by Om Prakash Singh 2 years, 3 months ago
PRNG Block on most of newer target from Qualcomm have some configuration 
where clock is configured by security firmware.

Adding separate compatible string for each platform is overhead.

We need to introduce common compatible string that can be used for all 
platforms with same configuration.

I would suggest to use "qcom,rng-ee" for newer platform, dropping "p" 
also signifies it is not a Pseudo Random Number Generator.

On 8/22/2023 7:58 PM, Konrad Dybcio wrote:
> On 22.08.2023 16:11, Neil Armstrong wrote:
>> Document SM8550 compatible for Pseudo Random Generator,
>> like SM8450 doesn't require clocks setup done by the secure
>> firmware.
>>
>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>> ---
> + CC Om
> 
> As mentioned in [1], perhaps we should rethink the compatible as
> it may be a TRNG and not a PRNG?
> 
> Konrad
> 
> [1] https://lore.kernel.org/linux-arm-msm/d93902ee-c305-42cb-9d0d-1f0971ab3a70@quicinc.com/
Re: [PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by Konrad Dybcio 2 years, 3 months ago
On 22.08.2023 16:54, Om Prakash Singh wrote:
> PRNG Block on most of newer target from Qualcomm have some configuration where clock is configured by security firmware.
> 
> Adding separate compatible string for each platform is overhead.
> 
> We need to introduce common compatible string that can be used for all platforms with same configuration.
> 
> I would suggest to use "qcom,rng-ee" for newer platform, dropping "p" also signifies it is not a Pseudo Random Number Generator.
Please reply inline and don't top-post.


Is this what you're trying to say?

1. sort out the clock requirements for designs where Linux manages it
   vs where the FW does so

2. introduce a new compatible for SoCs implementing a TRNG

3. for SoCs in 2., register the TRNG as a hwrng device


?

Konrad
Re: [PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by Om Prakash Singh 2 years, 3 months ago

On 8/22/2023 9:34 PM, Konrad Dybcio wrote:
> On 22.08.2023 16:54, Om Prakash Singh wrote:
>> PRNG Block on most of newer target from Qualcomm have some configuration where clock is configured by security firmware.
>>
>> Adding separate compatible string for each platform is overhead.
>>
>> We need to introduce common compatible string that can be used for all platforms with same configuration.
>>
>> I would suggest to use "qcom,rng-ee" for newer platform, dropping "p" also signifies it is not a Pseudo Random Number Generator.
> Please reply inline and don't top-post.
> 
> 
> Is this what you're trying to say?
> 
> 1. sort out the clock requirements for designs where Linux manages it
>     vs where the FW does so >
> 2. introduce a new compatible for SoCs implementing a TRNG
> 
> 3. for SoCs in 2., register the TRNG as a hwrng device

Yes to all

> 
> 
> ?
> 
> Konrad

Thanks,
Om
Re: [PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by Neil Armstrong 2 years, 3 months ago
Hi,

On 23/08/2023 02:10, Om Prakash Singh wrote:
> 
> 
> On 8/22/2023 9:34 PM, Konrad Dybcio wrote:
>> On 22.08.2023 16:54, Om Prakash Singh wrote:
>>> PRNG Block on most of newer target from Qualcomm have some configuration where clock is configured by security firmware.
>>>
>>> Adding separate compatible string for each platform is overhead.
>>>
>>> We need to introduce common compatible string that can be used for all platforms with same configuration.
>>>
>>> I would suggest to use "qcom,rng-ee" for newer platform, dropping "p" also signifies it is not a Pseudo Random Number Generator.
>> Please reply inline and don't top-post.
>>
>>
>> Is this what you're trying to say?
>>
>> 1. sort out the clock requirements for designs where Linux manages it
>>     vs where the FW does so >
>> 2. introduce a new compatible for SoCs implementing a TRNG
>>
>> 3. for SoCs in 2., register the TRNG as a hwrng device
> 
> Yes to all

I can send a proposal, but that means writing a new driver for this compatible in drivers/char/hw_random/ right ?

Neil

> 
>>
>>
>> ?
>>
>> Konrad
> 
> Thanks,
> Om

Re: [PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by Om Prakash Singh 2 years, 3 months ago

On 8/23/2023 1:25 PM, Neil Armstrong wrote:
> Hi,
> 
> On 23/08/2023 02:10, Om Prakash Singh wrote:
>>
>>
>> On 8/22/2023 9:34 PM, Konrad Dybcio wrote:
>>> On 22.08.2023 16:54, Om Prakash Singh wrote:
>>>> PRNG Block on most of newer target from Qualcomm have some 
>>>> configuration where clock is configured by security firmware.
>>>>
>>>> Adding separate compatible string for each platform is overhead.
>>>>
>>>> We need to introduce common compatible string that can be used for 
>>>> all platforms with same configuration.
>>>>
>>>> I would suggest to use "qcom,rng-ee" for newer platform, dropping 
>>>> "p" also signifies it is not a Pseudo Random Number Generator.
>>> Please reply inline and don't top-post.
>>>
>>>
>>> Is this what you're trying to say?
>>>
>>> 1. sort out the clock requirements for designs where Linux manages it
>>>     vs where the FW does so >
>>> 2. introduce a new compatible for SoCs implementing a TRNG
>>>
>>> 3. for SoCs in 2., register the TRNG as a hwrng device
>>
>> Yes to all
> 
> I can send a proposal, but that means writing a new driver for this 
> compatible in drivers/char/hw_random/ right ?

We can add hwrng support in same driver like 
drivers/crypto/hisilicon/trng/trng.c

As Krzysztof is suggesting we need to have platform specific compatible 
string, we can go with your change. for hwrng support I will send 
separate patches.

> 
> Neil
> 
>>
>>>
>>>
>>> ?
>>>
>>> Konrad
>>
>> Thanks,
>> Om
> 
Re: [PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by Krzysztof Kozlowski 2 years, 3 months ago
On 24/08/2023 01:32, Om Prakash Singh wrote:
> 
> 
> On 8/23/2023 1:25 PM, Neil Armstrong wrote:
>> Hi,
>>
>> On 23/08/2023 02:10, Om Prakash Singh wrote:
>>>
>>>
>>> On 8/22/2023 9:34 PM, Konrad Dybcio wrote:
>>>> On 22.08.2023 16:54, Om Prakash Singh wrote:
>>>>> PRNG Block on most of newer target from Qualcomm have some 
>>>>> configuration where clock is configured by security firmware.
>>>>>
>>>>> Adding separate compatible string for each platform is overhead.
>>>>>
>>>>> We need to introduce common compatible string that can be used for 
>>>>> all platforms with same configuration.
>>>>>
>>>>> I would suggest to use "qcom,rng-ee" for newer platform, dropping 
>>>>> "p" also signifies it is not a Pseudo Random Number Generator.
>>>> Please reply inline and don't top-post.
>>>>
>>>>
>>>> Is this what you're trying to say?
>>>>
>>>> 1. sort out the clock requirements for designs where Linux manages it
>>>>     vs where the FW does so >
>>>> 2. introduce a new compatible for SoCs implementing a TRNG
>>>>
>>>> 3. for SoCs in 2., register the TRNG as a hwrng device
>>>
>>> Yes to all
>>
>> I can send a proposal, but that means writing a new driver for this 
>> compatible in drivers/char/hw_random/ right ?
> 
> We can add hwrng support in same driver like 
> drivers/crypto/hisilicon/trng/trng.c
> 
> As Krzysztof is suggesting we need to have platform specific compatible 

That's independent question

> string, we can go with your change. for hwrng support I will send 
> separate patches.

Any bindings decision should be made now. We don't produce knowingly
incomplete bindings just to change them later. Therefore now you need to
decide whether you call it prng-ee or something else.


Best regards,
Krzysztof

Re: [PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by Konrad Dybcio 2 years, 3 months ago
On 24.08.2023 08:37, Krzysztof Kozlowski wrote:
> On 24/08/2023 01:32, Om Prakash Singh wrote:
>>
>>
>> On 8/23/2023 1:25 PM, Neil Armstrong wrote:
>>> Hi,
>>>
>>> On 23/08/2023 02:10, Om Prakash Singh wrote:
>>>>
>>>>
>>>> On 8/22/2023 9:34 PM, Konrad Dybcio wrote:
>>>>> On 22.08.2023 16:54, Om Prakash Singh wrote:
>>>>>> PRNG Block on most of newer target from Qualcomm have some 
>>>>>> configuration where clock is configured by security firmware.
>>>>>>
>>>>>> Adding separate compatible string for each platform is overhead.
>>>>>>
>>>>>> We need to introduce common compatible string that can be used for 
>>>>>> all platforms with same configuration.
>>>>>>
>>>>>> I would suggest to use "qcom,rng-ee" for newer platform, dropping 
>>>>>> "p" also signifies it is not a Pseudo Random Number Generator.
>>>>> Please reply inline and don't top-post.
>>>>>
>>>>>
>>>>> Is this what you're trying to say?
>>>>>
>>>>> 1. sort out the clock requirements for designs where Linux manages it
>>>>>     vs where the FW does so >
>>>>> 2. introduce a new compatible for SoCs implementing a TRNG
>>>>>
>>>>> 3. for SoCs in 2., register the TRNG as a hwrng device
>>>>
>>>> Yes to all
>>>
>>> I can send a proposal, but that means writing a new driver for this 
>>> compatible in drivers/char/hw_random/ right ?
>>
>> We can add hwrng support in same driver like 
>> drivers/crypto/hisilicon/trng/trng.c
>>
>> As Krzysztof is suggesting we need to have platform specific compatible 
> 
> That's independent question
> 
>> string, we can go with your change. for hwrng support I will send 
>> separate patches.
> 
> Any bindings decision should be made now. We don't produce knowingly
> incomplete bindings just to change them later. Therefore now you need to
> decide whether you call it prng-ee or something else.
Herbert already picked up the 8450 compatible last week or so.
If we decide quickly, perhaps it can be reverted and substituted
with the non-*P*RNG one. It would theoretically be an ABI break,
but:

a) it would be very very prompt
b) the dts patch hasn't been merged so there are no users

I'd be fine with that, not sure about the rest of you guys.

Konrad
Re: [PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by neil.armstrong@linaro.org 2 years, 3 months ago
On 24/08/2023 10:40, Konrad Dybcio wrote:
> On 24.08.2023 08:37, Krzysztof Kozlowski wrote:
>> On 24/08/2023 01:32, Om Prakash Singh wrote:
>>>
>>>
>>> On 8/23/2023 1:25 PM, Neil Armstrong wrote:
>>>> Hi,
>>>>
>>>> On 23/08/2023 02:10, Om Prakash Singh wrote:
>>>>>
>>>>>
>>>>> On 8/22/2023 9:34 PM, Konrad Dybcio wrote:
>>>>>> On 22.08.2023 16:54, Om Prakash Singh wrote:
>>>>>>> PRNG Block on most of newer target from Qualcomm have some
>>>>>>> configuration where clock is configured by security firmware.
>>>>>>>
>>>>>>> Adding separate compatible string for each platform is overhead.
>>>>>>>
>>>>>>> We need to introduce common compatible string that can be used for
>>>>>>> all platforms with same configuration.
>>>>>>>
>>>>>>> I would suggest to use "qcom,rng-ee" for newer platform, dropping
>>>>>>> "p" also signifies it is not a Pseudo Random Number Generator.
>>>>>> Please reply inline and don't top-post.
>>>>>>
>>>>>>
>>>>>> Is this what you're trying to say?
>>>>>>
>>>>>> 1. sort out the clock requirements for designs where Linux manages it
>>>>>>      vs where the FW does so >
>>>>>> 2. introduce a new compatible for SoCs implementing a TRNG
>>>>>>
>>>>>> 3. for SoCs in 2., register the TRNG as a hwrng device
>>>>>
>>>>> Yes to all
>>>>
>>>> I can send a proposal, but that means writing a new driver for this
>>>> compatible in drivers/char/hw_random/ right ?
>>>
>>> We can add hwrng support in same driver like
>>> drivers/crypto/hisilicon/trng/trng.c
>>>
>>> As Krzysztof is suggesting we need to have platform specific compatible
>>
>> That's independent question
>>
>>> string, we can go with your change. for hwrng support I will send
>>> separate patches.
>>
>> Any bindings decision should be made now. We don't produce knowingly
>> incomplete bindings just to change them later. Therefore now you need to
>> decide whether you call it prng-ee or something else.
> Herbert already picked up the 8450 compatible last week or so.
> If we decide quickly, perhaps it can be reverted and substituted
> with the non-*P*RNG one. It would theoretically be an ABI break,
> but:
> 
> a) it would be very very prompt
> b) the dts patch hasn't been merged so there are no users
> 
> I'd be fine with that, not sure about the rest of you guys.

I'm fine for that aswell, this can be done quickly without the
hwrng part

I can quickly refresh this serie with :
1) introduce a new "qcom,trng" and move "qcom,sm8450-prng-ee" to "qcom,sm8450-trng"
2) add qcom,sm8550-prng-ee
3) add "qcom,trng"  to the driver compatible list

then afterwards, the hwrng part can be added in a separate serie.

Neil

> 
> Konrad

Re: [PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by Krzysztof Kozlowski 2 years, 3 months ago
On 22/08/2023 16:54, Om Prakash Singh wrote:
> PRNG Block on most of newer target from Qualcomm have some configuration 
> where clock is configured by security firmware.
> 
> Adding separate compatible string for each platform is overhead.

I don't think PRNG is here different than others and for all others we
expect it. I understand that this is an overhead, like every work is
overhead.

> 
> We need to introduce common compatible string that can be used for all 
> platforms with same configuration.

It is already introduced, isn't it?

> 
> I would suggest to use "qcom,rng-ee" for newer platform, dropping "p" 
> also signifies it is not a Pseudo Random Number Generator.
> 

Best regards,
Krzysztof
Re: [PATCH 1/2] dt-bindings: crypto: qcom,prng: document SM8550
Posted by Krzysztof Kozlowski 2 years, 3 months ago
On 22/08/2023 16:11, Neil Armstrong wrote:
> Document SM8550 compatible for Pseudo Random Generator,
> like SM8450 doesn't require clocks setup done by the secure
> firmware.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof