diff --git a/plat/st/stm32mp1/bl2_plat_setup.c b/plat/st/stm32mp1/bl2_plat_setup.c index 4f04a6f03..87d2d39e1 100644 --- a/plat/st/stm32mp1/bl2_plat_setup.c +++ b/plat/st/stm32mp1/bl2_plat_setup.c @@ -543,20 +543,15 @@ int bl2_plat_handle_post_image_load(unsigned int image_id) void bl2_el3_plat_prepare_exit(void) { +#if STM32MP_UART_PROGRAMMER || STM32MP_USB_PROGRAMMER uint16_t boot_itf = stm32mp_get_boot_itf_selected(); - switch (boot_itf) { -#if STM32MP_UART_PROGRAMMER || STM32MP_USB_PROGRAMMER - case BOOT_API_CTX_BOOT_INTERFACE_SEL_SERIAL_UART: - case BOOT_API_CTX_BOOT_INTERFACE_SEL_SERIAL_USB: + if ((boot_itf == BOOT_API_CTX_BOOT_INTERFACE_SEL_SERIAL_UART) || + (boot_itf == BOOT_API_CTX_BOOT_INTERFACE_SEL_SERIAL_USB)) { /* Invalidate the downloaded buffer used with io_memmap */ inv_dcache_range(DWL_BUFFER_BASE, DWL_BUFFER_SIZE); - break; -#endif /* STM32MP_UART_PROGRAMMER || STM32MP_USB_PROGRAMMER */ - default: - /* Do nothing in default case */ - break; } +#endif /* STM32MP_UART_PROGRAMMER || STM32MP_USB_PROGRAMMER */ stm32mp1_security_setup(); }