diff --git a/plat/st/stm32mp1/include/stm32mp1_private.h b/plat/st/stm32mp1/include/stm32mp1_private.h index 7bdb36def..23934e92f 100644 --- a/plat/st/stm32mp1/include/stm32mp1_private.h +++ b/plat/st/stm32mp1/include/stm32mp1_private.h @@ -23,6 +23,14 @@ void stm32mp1_syscfg_enable_io_compensation_finish(void); void stm32mp1_syscfg_disable_io_compensation(void); uint32_t stm32mp1_syscfg_get_chip_version(void); uint32_t stm32mp1_syscfg_get_chip_dev_id(void); +#if STM32MP13 +void stm32mp1_syscfg_boot_mode_enable(void); +void stm32mp1_syscfg_boot_mode_disable(void); +#endif +#if STM32MP15 +static inline void stm32mp1_syscfg_boot_mode_enable(void){} +static inline void stm32mp1_syscfg_boot_mode_disable(void){} +#endif void stm32mp1_deconfigure_uart_pins(void); diff --git a/plat/st/stm32mp1/stm32mp1_syscfg.c b/plat/st/stm32mp1/stm32mp1_syscfg.c index 39ad90b7e..ff79428a6 100644 --- a/plat/st/stm32mp1/stm32mp1_syscfg.c +++ b/plat/st/stm32mp1/stm32mp1_syscfg.c @@ -24,6 +24,7 @@ * SYSCFG REGISTER OFFSET (base relative) */ #define SYSCFG_BOOTR 0x00U +#define SYSCFG_BOOTCR 0x0CU #if STM32MP15 #define SYSCFG_IOCTRLSETR 0x18U #define SYSCFG_ICNR 0x1CU @@ -54,6 +55,11 @@ #define SYSCFG_BOOTR_BOOTPD_SHIFT 4 #endif +/* + * SYSCFG_BOOTCR Register + */ +#define SYSCFG_BOOTCR_BMEN BIT(0) + /* * SYSCFG_IOCTRLSETR Register */ @@ -391,3 +397,15 @@ uint32_t stm32mp1_syscfg_get_chip_dev_id(void) { return mmio_read_32(SYSCFG_BASE + SYSCFG_IDC) & SYSCFG_IDC_DEV_ID_MASK; } + +#if STM32MP13 +void stm32mp1_syscfg_boot_mode_enable(void) +{ + mmio_setbits_32(SYSCFG_BASE + SYSCFG_BOOTCR, SYSCFG_BOOTCR_BMEN); +} + +void stm32mp1_syscfg_boot_mode_disable(void) +{ + mmio_clrbits_32(SYSCFG_BASE + SYSCFG_BOOTCR, SYSCFG_BOOTCR_BMEN); +} +#endif