Skip to content

Commit

Permalink
drivers: stm32_rng: embed ETZPC functions when CFG_STM32_ETZPC is set
Browse files Browse the repository at this point in the history
On platforms when CFG_STM32_ETZPC is disabled, ETZPC cannot be
interrogated to get decprot attributes. Therefore do not embed ETZPC
related code.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Fixes: d773ec0 ("drivers: stm32_rng: update clock and power management")
  • Loading branch information
GseoC committed Oct 10, 2024
1 parent aaa707b commit 92b8975
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/drivers/stm32_rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,13 +670,13 @@ static TEE_Result stm32_rng_probe(const void *fdt, int offs,
if (res)
goto err;

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

/* Power management implementation expects both or none are set */
assert(stm32_rng->ddata->has_power_optim ==
Expand Down

0 comments on commit 92b8975

Please sign in to comment.