drivers: usb: host: Add BRCM xHCI driver
[oweals/u-boot.git] / arch / arm / mach-stm32mp / cpu.c
index a46e8438f7c2bf91ae0cc65bed98bfaf1d7941bf..ea0bd94605b77eac27a2045bfd5ca0403e2046fe 100644 (file)
@@ -4,6 +4,7 @@
  */
 #include <common.h>
 #include <clk.h>
+#include <cpu_func.h>
 #include <debug_uart.h>
 #include <env.h>
 #include <misc.h>
@@ -34,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)
@@ -205,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();
@@ -334,6 +342,9 @@ int print_cpuinfo(void)
        case CPU_REVB:
                cpu_r = "B";
                break;
+       case CPU_REVZ:
+               cpu_r = "Z";
+               break;
        default:
                cpu_r = "?";
                break;
@@ -448,7 +459,7 @@ static void setup_boot_mode(void)
  * If there is no MAC address in the environment, then it will be initialized
  * (silently) from the value in the OTP.
  */
-static int setup_mac_address(void)
+__weak int setup_mac_address(void)
 {
 #if defined(CONFIG_NET)
        int ret;