From fc0aa10a2cd3cab887a8baa602891d1f45db2537 Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Tue, 11 Aug 2020 14:21:41 +0200 Subject: [PATCH] feat(st-gpio): do not apply secure config in BL2 At boot, the devices under ETZPC control are secured, so should be their GPIOs. As securable GPIOs are secured by default, keep the reset values in BL2. Change-Id: I9e560d936f8e8fda0f96f6299bb0c3b35ba9b71f Signed-off-by: Yann Gautier --- drivers/st/gpio/stm32_gpio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/st/gpio/stm32_gpio.c b/drivers/st/gpio/stm32_gpio.c index 527f90fe3..708989f70 100644 --- a/drivers/st/gpio/stm32_gpio.c +++ b/drivers/st/gpio/stm32_gpio.c @@ -284,11 +284,15 @@ static void set_gpio(uint32_t bank, uint32_t pin, uint32_t mode, uint32_t type, if (status == DT_SECURE) { stm32mp_register_secure_gpio(bank, pin); +#if !IMAGE_BL2 set_gpio_secure_cfg(bank, pin, true); +#endif } else { stm32mp_register_non_secure_gpio(bank, pin); +#if !IMAGE_BL2 set_gpio_secure_cfg(bank, pin, false); +#endif } }