[PATCH v2 10/10] ARM: dts: stm32: add RNG node for STM32MP13x platforms

Gatien Chevallier posted 10 patches 1 year, 8 months ago
There is a newer version of this series
[PATCH v2 10/10] ARM: dts: stm32: add RNG node for STM32MP13x platforms
Posted by Gatien Chevallier 1 year, 8 months ago
The RNG on STM32MP13 offers upgrades like customization of its
configuration and the conditional reset.

The hardware RNG should be managed in the secure world for but it
is supported on Linux. Therefore, is it not default enabled.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
---
 arch/arm/boot/dts/st/stm32mp131.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/st/stm32mp131.dtsi b/arch/arm/boot/dts/st/stm32mp131.dtsi
index ac90fcbf0c09..39db82b782eb 100644
--- a/arch/arm/boot/dts/st/stm32mp131.dtsi
+++ b/arch/arm/boot/dts/st/stm32mp131.dtsi
@@ -1220,6 +1220,14 @@ mdma: dma-controller@58000000 {
 			dma-requests = <48>;
 		};
 
+		rng: rng@54004000 {
+			compatible = "st,stm32mp13-rng";
+			reg = <0x54004000 0x400>;
+			clocks = <&rcc RNG1_K>;
+			resets = <&rcc RNG1_R>;
+			status = "disabled";
+		};
+
 		fmc: memory-controller@58002000 {
 			compatible = "st,stm32mp1-fmc2-ebi";
 			reg = <0x58002000 0x1000>;
-- 
2.25.1
Re: [PATCH v2 10/10] ARM: dts: stm32: add RNG node for STM32MP13x platforms
Posted by Krzysztof Kozlowski 1 year, 7 months ago
On 11/09/2023 14:02, Gatien Chevallier wrote:
> The RNG on STM32MP13 offers upgrades like customization of its
> configuration and the conditional reset.
> 
> The hardware RNG should be managed in the secure world for but it
> is supported on Linux. Therefore, is it not default enabled.
> 
> Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
> ---
>  arch/arm/boot/dts/st/stm32mp131.dtsi | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/st/stm32mp131.dtsi b/arch/arm/boot/dts/st/stm32mp131.dtsi
> index ac90fcbf0c09..39db82b782eb 100644
> --- a/arch/arm/boot/dts/st/stm32mp131.dtsi
> +++ b/arch/arm/boot/dts/st/stm32mp131.dtsi
> @@ -1220,6 +1220,14 @@ mdma: dma-controller@58000000 {
>  			dma-requests = <48>;
>  		};
>  
> +		rng: rng@54004000 {
> +			compatible = "st,stm32mp13-rng";
> +			reg = <0x54004000 0x400>;
> +			clocks = <&rcc RNG1_K>;
> +			resets = <&rcc RNG1_R>;
> +			status = "disabled";

Why? What other resources are missing?

Best regards,
Krzysztof
Re: [PATCH v2 10/10] ARM: dts: stm32: add RNG node for STM32MP13x platforms
Posted by Gatien CHEVALLIER 1 year, 7 months ago
On 9/12/23 16:38, Krzysztof Kozlowski wrote:
> On 11/09/2023 14:02, Gatien Chevallier wrote:
>> The RNG on STM32MP13 offers upgrades like customization of its
>> configuration and the conditional reset.
>>
>> The hardware RNG should be managed in the secure world for but it
>> is supported on Linux. Therefore, is it not default enabled.
>>
>> Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
>> ---
>>   arch/arm/boot/dts/st/stm32mp131.dtsi | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/st/stm32mp131.dtsi b/arch/arm/boot/dts/st/stm32mp131.dtsi
>> index ac90fcbf0c09..39db82b782eb 100644
>> --- a/arch/arm/boot/dts/st/stm32mp131.dtsi
>> +++ b/arch/arm/boot/dts/st/stm32mp131.dtsi
>> @@ -1220,6 +1220,14 @@ mdma: dma-controller@58000000 {
>>   			dma-requests = <48>;
>>   		};
>>   
>> +		rng: rng@54004000 {
>> +			compatible = "st,stm32mp13-rng";
>> +			reg = <0x54004000 0x400>;
>> +			clocks = <&rcc RNG1_K>;
>> +			resets = <&rcc RNG1_R>;
>> +			status = "disabled";
> 
> Why? What other resources are missing?
> 
> Best regards,
> Krzysztof
> 

Hello Krzysztof,

Our default implementation is to handle the RNG in OP-TEE for
these platforms. Therefore, it goes through optee-rng driver.
The RNG services are exposed by a PTA (Pseudo Trusted Application)
in OP-TEE. In this case, there's no need to enable the RNG node
in the Linux Kernel.

Best regards,
Gatien