From d1446674eb642e39dae8342e40030bebe449057c Mon Sep 17 00:00:00 2001 From: tytung Date: Tue, 8 Mar 2011 00:08:16 +0800 Subject: [PATCH] cLK: cLK_power_clllapse patch adds detection of cLK to kernel and puts the reset vector at 0x11800000 where cLK will jump (+4) at power_collapse_exit By cedesmith. http://forum.xda-developers.com/showpost.php?p=10837322&postcount=2 --- arch/arm/mach-msm/board-htcleo.c | 1 + arch/arm/mach-msm/pm.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/mach-msm/board-htcleo.c b/arch/arm/mach-msm/board-htcleo.c index bdacc205..a462b580 100644 --- a/arch/arm/mach-msm/board-htcleo.c +++ b/arch/arm/mach-msm/board-htcleo.c @@ -87,6 +87,7 @@ static int __init parse_tag_nand_boot(const struct tag *tag) { struct tag_magldr_entry *mentry = (struct tag_magldr_entry *)(&tag->u); nand_boot = !(unsigned int)mentry->fNoNandBoot; + if(*((unsigned*)&tag->u)==0x004b4c63) nand_boot = 2; // cLK signature pr_info("Nand Boot: %d\n", nand_boot); return 0; } diff --git a/arch/arm/mach-msm/pm.c b/arch/arm/mach-msm/pm.c index 87661749..56ccb2a7 100644 --- a/arch/arm/mach-msm/pm.c +++ b/arch/arm/mach-msm/pm.c @@ -892,6 +892,15 @@ static int __init msm_pm_init(void) register_reboot_notifier(&msm_reboot_notifier); msm_pm_reset_vector = ioremap(0x0, PAGE_SIZE); +#if defined(CONFIG_MACH_HTCLEO) + // if cLK is bootloader 0x0 is protected and not writtable but cLK changed reset vecotr to jump at address stored at 0x11800004 + if(htcleo_is_nand_boot()==2){ + pr_info("msm_pm: 0x00000000: %x\n", msm_pm_reset_vector[0]); + pr_info("msm_pm: 0x00000004: %x\n", msm_pm_reset_vector[1]); + msm_pm_reset_vector = ioremap(0x11800000, PAGE_SIZE); + } +#endif + if (msm_pm_reset_vector == NULL) { printk(KERN_ERR "msm_pm_init: failed to map reset vector\n"); return -ENODEV;