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
This commit is contained in:
tytung 2011-03-08 00:08:16 +08:00
parent 765f3a9d95
commit d1446674eb
2 changed files with 10 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;