From c24827582bdb681c2fc0a9dfeefaf099472d79f0 Mon Sep 17 00:00:00 2001 From: Gatien Chevallier Date: Tue, 8 Oct 2024 18:12:28 +0200 Subject: [PATCH] drivers: stm32_rng: embed ETZPC functions when CFG_STM32_ETZPC is set 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 Fixes: d773ec0baf4c ("drivers: stm32_rng: update clock and power management") --- core/drivers/stm32_rng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/drivers/stm32_rng.c b/core/drivers/stm32_rng.c index 9115c7f52d7..0b19d9d8eb5 100644 --- a/core/drivers/stm32_rng.c +++ b/core/drivers/stm32_rng.c @@ -671,13 +671,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 ==