tizen: tm1: provide the reboot download 84/60084/2 accepted/tizen/mobile/20160412.063948 submit/tizen/20160412.023908
authorJaehoon Chung <jh80.chung@samsung.com>
Tue, 23 Feb 2016 08:07:56 +0000 (17:07 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Tue, 23 Feb 2016 08:25:11 +0000 (17:25 +0900)
Provide the reboot download mode for thor.

Change-Id: Ie5b3cc5a3d0a56c74537300258461011b6219d76
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
arch/arm/cpu/armv7/sc8830/misc.c
include/configs/tizen_tm1.h
property/cmd_cboot.c

index 983c99d..b7a86e6 100755 (executable)
@@ -423,6 +423,23 @@ void pmic_init(void)
 #endif
 }
 
+#ifdef CONFIG_TIZEN
+#define REBOOT_MODE_MASK       (0xFFFFFFF0)
+#define REBOOT_MODE_PREFIX     (0x12345670)
+#define REBOOT_THOR_DOWNLOAD           (0x1)
+int tizen_reboot_check(void)
+{
+       int inform3 = readl(INFORM3);
+
+       if ((inform3 & REBOOT_MODE_MASK) == REBOOT_MODE_PREFIX) {
+               if ((inform3 & 0xf) == REBOOT_THOR_DOWNLOAD)
+                       return 1;
+       }
+
+       return 0;
+}
+#endif
+
 #define REG32(x)                                    (*((volatile uint32 *)(x)))
 void gpu_clk_auto_gate_disable()
 {
index 70f7019..f4fadaa 100644 (file)
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_SYS_LONGHELP
 
+/* INFORM3 */
+#define INFORM3        0xf90
+
 /* support OS choose */
 #undef CONFIG_BOOTM_NETBSD
 #undef CONFIG_BOOTM_RTEMS
index 1e398fb..7b4260b 100755 (executable)
@@ -228,6 +228,10 @@ boot_mode_enum_type  get_mode_from_gpio_extend(void){
     }
 }
 
+#ifdef CONFIG_TIZEN
+extern int tizen_reboot_check(void);
+#endif
+
 int do_cboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
     volatile int i;
@@ -280,8 +284,14 @@ int do_cboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
     DBG("do_cboot:boot mode is %d\n",bootmode);
 
 #ifdef CONFIG_TIZEN
-       if (bootmode == CMD_NONE)
+       if (bootmode == CMD_NONE) {
                bootmode = CMD_NORMAL_MODE;
+               if (tizen_reboot_check()) {
+                       bootmode = CMD_THOR_MODE;
+                       DBG("do_cboot:boot mode is %d\n",bootmode);
+               }
+
+       }
 #endif
 
 #ifdef CONFIG_LCD_LOGO