From: Zhaoyifeng Date: Fri, 10 Aug 2012 06:06:55 +0000 (+0800) Subject: add reboot cmd save in grf os reg. X-Git-Tag: firefly_0821_release~8912^2~17 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cc865eecde1edc66b3cb21607e0135590f860309;p=firefly-linux-kernel-4.4.55.git add reboot cmd save in grf os reg. --- diff --git a/arch/arm/mach-rk29/include/mach/loader.h b/arch/arm/mach-rk29/include/mach/loader.h old mode 100644 new mode 100755 diff --git a/arch/arm/mach-rk2928/include/mach/iomux.h b/arch/arm/mach-rk2928/include/mach/iomux.h index 6e7ab6a2fee9..b5a2eb40b08b 100755 --- a/arch/arm/mach-rk2928/include/mach/iomux.h +++ b/arch/arm/mach-rk2928/include/mach/iomux.h @@ -448,6 +448,10 @@ #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) \ { \ diff --git a/arch/arm/mach-rk2928/reset.c b/arch/arm/mach-rk2928/reset.c old mode 100644 new mode 100755 index 5a0fb4cd00ed..b851b92fa6b5 --- a/arch/arm/mach-rk2928/reset.c +++ b/arch/arm/mach-rk2928/reset.c @@ -1,10 +1,11 @@ #include #include +#include #include -#include #include #include -#include +#include +#include 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);