add reboot cmd save in grf os reg.
authorZhaoyifeng <zyf@rock-chips.com>
Fri, 10 Aug 2012 06:06:55 +0000 (14:06 +0800)
committerZhaoyifeng <zyf@rock-chips.com>
Fri, 10 Aug 2012 06:06:55 +0000 (14:06 +0800)
arch/arm/mach-rk29/include/mach/loader.h [changed mode: 0644->0755]
arch/arm/mach-rk2928/include/mach/iomux.h
arch/arm/mach-rk2928/reset.c [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 6e7ab6a2fee9c337c4aea0f5ebf3418a56b77985..b5a2eb40b08b867d3e9dbc96c154f71e48cac56f 100755 (executable)
 #define      GRF_OS_REG1                          0x01cc
 #define      GRF_OS_REG2                          0x01d0
 #define      GRF_OS_REG3                          0x01d4
+#define      GRF_OS_REG4                          0x01d8
+#define      GRF_OS_REG5                          0x01dc
+#define      GRF_OS_REG6                          0x01e0
+#define      GRF_OS_REG7                          0x01e4
 
 #define MUX_CFG(desc,reg,off,interl,mux_mode,bflags)   \
 {                                                      \
old mode 100644 (file)
new mode 100755 (executable)
index 5a0fb4c..b851b92
@@ -1,10 +1,11 @@
 #include <linux/io.h>
 #include <linux/kernel.h>
+#include <mach/system.h>
 #include <linux/string.h>
-#include <mach/board.h>
 #include <mach/cru.h>
 #include <mach/iomux.h>
-#include <mach/system.h>
+#include <mach/loader.h>
+#include <mach/board.h>
 
 static void rk2928_arch_reset(char mode, const char *cmd)
 {
@@ -12,13 +13,19 @@ static void rk2928_arch_reset(char mode, const char *cmd)
        u32 boot_mode = BOOT_MODE_REBOOT;
 
        if (cmd) {
-               if (!strcmp(cmd, "charge"))
+               if (!strcmp(cmd, "loader") || !strcmp(cmd, "bootloader")) 
+                       boot_flag = SYS_LOADER_REBOOT_FLAG + BOOT_LOADER;
+               else if(!strcmp(cmd, "recovery"))
+                       boot_flag = SYS_LOADER_REBOOT_FLAG + BOOT_RECOVER;
+               else if (!strcmp(cmd, "charge"))
                        boot_mode = BOOT_MODE_CHARGE;
        } else {
                if (system_state != SYSTEM_RESTART)
                        boot_mode = BOOT_MODE_PANIC;
        }
-       writel_relaxed(0xffff0000 | boot_mode, RK2928_GRF_BASE + GRF_OS_REG1);  // for linux
+       writel_relaxed(0xffff0000 | (boot_flag&0xFFFFuL), RK2928_GRF_BASE + GRF_OS_REG4);       // for loader
+       writel_relaxed(0xffff0000 | ((boot_flag>>16)&0xFFFFuL), RK2928_GRF_BASE + GRF_OS_REG5); // for loader
+       writel_relaxed(0xffff0000 | boot_mode, RK2928_GRF_BASE + GRF_OS_REG6);  // for linux
        dsb();
        /* disable remap */
        writel_relaxed(1 << (12 + 16), RK2928_GRF_BASE + GRF_SOC_CON0);