]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - arch/arm/cpu/armv7/ls102xa/cpu.c
ls102xa: Fix reset hang
[people/ms/u-boot.git] / arch / arm / cpu / armv7 / ls102xa / cpu.c
index 1a640bbb9c2c642a4ad11ca8e5400e5263f6c266..e2eb5f383a4a34b6de8bc665f98f676a107ca0da 100644 (file)
@@ -13,6 +13,8 @@
 #include <tsec.h>
 #include <netdev.h>
 #include <fsl_esdhc.h>
+#include <config.h>
+#include <fsl_wdog.h>
 
 #include "fsl_epu.h"
 
@@ -329,7 +331,7 @@ int arch_cpu_init(void)
        return 0;
 }
 
-#if defined(CONFIG_ARMV7_NONSEC) || defined(CONFIG_ARMV7_VIRT)
+#ifdef CONFIG_ARMV7_NONSEC
 /* Set the address at which the secondary core starts from.*/
 void smp_set_core_boot_addr(unsigned long addr, int corenr)
 {
@@ -344,5 +346,26 @@ void smp_kick_all_cpus(void)
        struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
 
        out_be32(&gur->brrl, 0x2);
+
+       /*
+        * LS1 STANDBYWFE is not captured outside the ARM module in the soc.
+        * So add a delay to wait bootrom execute WFE.
+        */
+       udelay(1);
+
+       asm volatile("sev");
 }
 #endif
+
+void reset_cpu(ulong addr)
+{
+       struct watchdog_regs *wdog = (struct watchdog_regs *)WDOG1_BASE_ADDR;
+
+       clrbits_be16(&wdog->wcr, WCR_SRS);
+
+       while (1) {
+               /*
+                * Let the watchdog trigger
+                */
+       }
+}