cLK/patches/kernel_reboot_reason.patch
Arif Ali 6092922424 1.3.2: updated
* ROMHDR base addr is spl virtual 0x80000000 = 11800000 physical, LK will relocate to correct address (MEMBASE)
* save reboot reason at 0x2FFB0000 (ramconsole - 0x1000 (PAGE_SIZE)) and @0x2FFB0004 XOR 0x004b4c63 (cLK signature)
* added oem cmd to fastboot and oemcmd.bat for PC
2011-11-07 00:03:59 +00:00

34 lines
1.0 KiB
Diff

diff --git a/arch/arm/mach-msm/pm.c b/arch/arm/mach-msm/pm.c
index 56ccb2a..f3b17f2 100644
--- a/arch/arm/mach-msm/pm.c
+++ b/arch/arm/mach-msm/pm.c
@@ -714,10 +714,28 @@ void msm_pm_flush_console(void)
release_console_sem();
}
+#if defined(CONFIG_MACH_HTCLEO)
+static void htcleo_save_reset_reason()
+{
+ /* save restart_reason to be accesible in bootloader @ ramconsole - 0x1000*/
+ uint32_t *bootloader_reset_reason = ioremap(0x2FFB0000, PAGE_SIZE);
+ if(bootloader_reset_reason!=NULL)
+ {
+ printk(KERN_INFO "msm_restart saving reason %x @ 0x2FFB0000 \n", restart_reason);
+ bootloader_reset_reason[0]=restart_reason;
+ bootloader_reset_reason[1]=restart_reason^0x004b4c63; //XOR with cLK signature so we know is not trash
+ }
+}
+#endif
+
static void msm_pm_restart(char str)
{
msm_pm_flush_console();
+#if defined(CONFIG_MACH_HTCLEO)
+ htcleo_save_reset_reason();
+#endif
+
/* always reboot device through proc comm */
if (restart_reason == 0x6f656d99)
msm_proc_comm(PCOM_RESET_CHIP_IMM, &restart_reason, 0);