#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) \
{ \
#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)
{
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);