Skip to content

Commit

Permalink
drivers: stm32_rng: MP15 RNG is non-secure when PRNG is enable
Browse files Browse the repository at this point in the history
Register stm32_rng device as non-secure when software PRNG is enabled
instead of testing the firewall configuration that is applied from
stm32mp1_init_final_shres() at driver_init_late initcall level, far
after RNG initialization.

Fixes: d773ec0 ("drivers: stm32_rng: update clock and power management")
Signed-off-by: Etienne Carriere <[email protected]>
Acked-by: Gatien Chevallier <[email protected]>
  • Loading branch information
etienne-lms authored and jforissier committed Oct 16, 2024
1 parent 136cc65 commit 326382a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/drivers/stm32_rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ static TEE_Result stm32_rng_probe(const void *fdt, int offs,

#if defined(CFG_STM32MP15)
/* Only STM32MP15 requires a software registering of RNG secure state */
if (etzpc_get_decprot(STM32MP1_ETZPC_RNG1_ID) == ETZPC_DECPROT_NS_RW)
if (IS_ENABLED(CFG_WITH_SOFTWARE_PRNG))
stm32mp_register_non_secure_periph_iomem(stm32_rng->base.pa);
else
stm32mp_register_secure_periph_iomem(stm32_rng->base.pa);
Expand Down

0 comments on commit 326382a

Please sign in to comment.