#define REBOOT_MODE_MASK (0xFFFFFFF0)
#define REBOOT_MODE_PREFIX (0x12345670)
#define REBOOT_THOR_DOWNLOAD (0x1)
+#define REBOOT_RECOVERY (0x4)
int tizen_reboot_check(void)
{
int inform3 = readl(INFORM3);
return 0;
}
+
+int tizen_reboot_recovery_check(void)
+{
+ int inform3 = readl(INFORM3);
+
+ if ((inform3 & REBOOT_MODE_MASK) == REBOOT_MODE_PREFIX) {
+ if ((inform3 & 0xf) == REBOOT_RECOVERY) {
+ writel(0, INFORM3);
+ return 1;
+ }
+ }
+
+ return 0;
+}
#endif
#define REG32(x) (*((volatile uint32 *)(x)))
void vlx_entry();
extern char* get_product_sn(void);
extern char *calibration_cmd_buf;
+void set_recovery_mode(unsigned int recovery_mode);
MODE_REGIST(CMD_NORMAL_MODE, normal_mode);\r
MODE_REGIST(CMD_CHARGE_MODE, charge_mode);\r
MODE_REGIST(CMD_THOR_MODE, thor_mode);\r
-#ifndef CONFIG_TIZEN\r
MODE_REGIST(CMD_RECOVERY_MODE, recovery_mode);\r
+#ifndef CONFIG_TIZEN\r
MODE_REGIST(CMD_FACTORYTEST_MODE,factorytest_mode);\r
MODE_REGIST(CMD_FASTBOOT_MODE, fastboot_mode);\r
MODE_REGIST(CMD_WATCHDOG_REBOOT, watchdog_mode);\r
#ifdef CONFIG_TIZEN
extern int tizen_reboot_check(void);
+extern int tizen_reboot_recovery_check(void);
#endif
int do_cboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
if (tizen_reboot_check()) {
bootmode = CMD_THOR_MODE;
DBG("do_cboot:boot mode is %d\n",bootmode);
+ } else if (tizen_reboot_recovery_check()) {
+#ifdef CONFIG_RAMDISK_BOOT
+ bootmode = CMD_RECOVERY_MODE;
+#else
+ bootmode = CMD_NORMAL_MODE;
+#endif
+ DBG("do_cboot:boot mode is %d\n",bootmode);
}
}
if (0 == memcmp(bootmode, RECOVERY_PART, strlen(RECOVERY_PART))) {
partition = L"recovery";
debugf("enter recovery mode!\n");
+ set_recovery_mode(1);
} else {
partition = L""BOOT_PART;
debugf("Enter boot mode (partition name: %s)\n", w2c(partition));
#ifdef CONFIG_TIZEN
#ifdef CONFIG_RAMDISK_BOOT
{
- load_ramdisk(PARTS_RAMDISK, RAMDISK_ADR, RAMDISK_SIZE_MB * 1024 * 1024);
+ char *ramdisk_part;
+ if (0 == memcmp(bootmode, RECOVERY_PART, strlen(RECOVERY_PART)))
+ ramdisk_part = PARTS_RAMDISK2;
+ else
+ ramdisk_part = PARTS_RAMDISK;
+ load_ramdisk(ramdisk_part, RAMDISK_ADR, RAMDISK_SIZE_MB * 1024 * 1024);
}
#endif /* CONFIG_RAMDISK_BOOT */
#else /* CONFIG_TIZEN */
unsigned char raw_header[8192];
const int SP09_MAX_PHASE_BUFF_SIZE = sizeof(SP09_PHASE_CHECK_T);
unsigned int g_charger_mode = 0;
+unsigned int g_recovery_mode = 0;
char serial_number_to_transfer[SP09_MAX_SN_LEN];
extern int charger_connected(void);
ptr += sprintf(ptr, CMDLINE_DEFAULT_TIZEN);
#ifdef CONFIG_RAMDISK_BOOT
+ if (g_recovery_mode)
+ ptr += sprintf(ptr, " bootmode=recovery");
+
ptr += sprintf(ptr, " root=/dev/ram0 rw initrd=0x%x,%dM",
RAMDISK_ADR, RAMDISK_SIZE_MB);
#else
break;
case PM_STATE_NORMAL:
default:
+ if (!g_recovery_mode) {
#ifdef CONFIG_RAMDISK_BOOT
- ptr += sprintf(ptr, " bootmode=ramdisk");
+ ptr += sprintf(ptr, " bootmode=ramdisk");
#else
- ptr += sprintf(ptr, " bootmode=normal");
+ ptr += sprintf(ptr, " bootmode=normal");
#endif
+ }
}
thor_save_env("normal");
return 0;
}
+void set_recovery_mode(unsigned int recovery_mode)
+{
+ g_recovery_mode = recovery_mode;
+}
+
void lcd_display_logo(int backlight_set, ulong bmp_img, size_t size)
{
#define mdelay(t) ({unsigned long msec=(t); while (msec--) { udelay(1000);}}) //LiWei add