]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
stm32mp1: reset coprocessor status at cold boot
authorFabien Dessenne <fabien.dessenne@st.com>
Wed, 30 Oct 2019 13:38:30 +0000 (14:38 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 7 Jan 2020 16:13:25 +0000 (11:13 -0500)
Reset ResourceTableAddress and CoprocessorState at cold boot, preserve
these values at standby wakeup.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Patrick Delaunay <patrick.delaunay@st.com>
arch/arm/mach-stm32mp/cpu.c

index ed7d9f61dcd571386ef3bfd753c0dfe246d96f39..6a71465494b39e3bd9d4a80500cb0f33a245a922 100644 (file)
@@ -35,7 +35,9 @@
 #define TAMP_CR1               (STM32_TAMP_BASE + 0x00)
 
 #define PWR_CR1                        (STM32_PWR_BASE + 0x00)
+#define PWR_MCUCR              (STM32_PWR_BASE + 0x14)
 #define PWR_CR1_DBP            BIT(8)
+#define PWR_MCUCR_SBF          BIT(6)
 
 /* DBGMCU register */
 #define DBGMCU_IDC             (STM32_DBGMCU_BASE + 0x00)
@@ -206,6 +208,11 @@ int arch_cpu_init(void)
        security_init();
        update_bootmode();
 #endif
+       /* Reset Coprocessor state unless it wakes up from Standby power mode */
+       if (!(readl(PWR_MCUCR) & PWR_MCUCR_SBF)) {
+               writel(TAMP_COPRO_STATE_OFF, TAMP_COPRO_STATE);
+               writel(0, TAMP_COPRO_RSC_TBL_ADDRESS);
+       }
 #endif
 
        boot_mode = get_bootmode();