From 038cb087d11284ea97fba7fe25ce8c8a858fdbfa Mon Sep 17 00:00:00 2001 From: tytung Date: Wed, 16 Mar 2011 21:09:18 +0800 Subject: [PATCH] cLK: kernel patch to save reboot reason so is available on bootloader By Cedesmith. http://forum.xda-developers.com/showpost.php?p=10837322&postcount=2 --- arch/arm/mach-msm/pm.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm/mach-msm/pm.c b/arch/arm/mach-msm/pm.c index 56ccb2a7..f3b17f22 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);