omap4: Check warm reset for reboot mode validity
authorPaul Kocialkowski <contact@paulk.fr>
Sat, 27 Feb 2016 18:19:08 +0000 (19:19 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 15 Mar 2016 19:12:54 +0000 (15:12 -0400)
Since the SAR registers are filled with garbage on cold reset, this checks for a
warm reset to assert the validity of reboot mode.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
arch/arm/cpu/armv7/omap4/boot.c

index bae49f4..7f5791e 100644 (file)
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/omap_common.h>
+#include <asm/arch/sys_proto.h>
 #include <spl.h>
 
 static u32 boot_devices[] = {
@@ -67,6 +68,9 @@ int omap_reboot_mode(char *mode, unsigned int length)
        if (length < 2)
                return -1;
 
+       if (!warm_reset())
+               return -1;
+
        limit = (length < OMAP_REBOOT_REASON_SIZE) ? length :
                OMAP_REBOOT_REASON_SIZE;