/* * Resume from the hibernation image. * Due to the kernel heap / data restore, stack contents change underneath * and that would make function calls impossible; switch to a temporary * stack within the nosave region to avoid that problem. */ int swsusp_arch_resume(void) { extern void call_with_stack(void (*fn)(void *), void *arg, void *sp); call_with_stack(arch_restore_image, 0, resume_stack + ARRAY_SIZE(resume_stack)); return 0; }
/* * Resume from the hibernation image. * Due to the kernel heap / data restore, stack contents change underneath * and that would make function calls impossible; switch to a temporary * stack within the nosave region to avoid that problem. */ int __naked swsusp_arch_resume(void) { extern void call_with_stack(void (*fn)(void *), void *arg, void *sp); cpu_init(); /* get a clean PSR */ call_with_stack(__swsusp_arch_restore_image, 0, __swsusp_resume_stk + sizeof(__swsusp_resume_stk)); return 0; }
/* * Resume from the hibernation image. * Due to the kernel heap / data restore, stack contents change underneath * and that would make function calls impossible; switch to a temporary * stack within the nosave region to avoid that problem. */ int swsusp_arch_resume(void) { #ifdef CONFIG_MTK_HIBERNATION cpu_init(); /* get a clean PSR */ #endif call_with_stack(arch_restore_image, 0, resume_stack + ARRAY_SIZE(resume_stack)); return 0; }
void _soft_restart(unsigned long addr, bool disable_l2) { u64 *stack = soft_restart_stack + ARRAY_SIZE(soft_restart_stack); /* Disable interrupts first */ raw_local_irq_disable(); local_fiq_disable(); /* Disable the L2 if we're the last man standing. */ if (disable_l2) outer_disable(); /* Change to the new stack and continue with the reset. */ call_with_stack(__soft_restart, (void *)addr, (void *)stack); /* Should never get here. */ BUG(); }
/* * Resume from the hibernation image. * Due to the kernel heap / data restore, stack contents change underneath * and that would make function calls impossible; switch to a temporary * stack within the nosave region to avoid that problem. */ int swsusp_arch_resume(void) { call_with_stack(arch_restore_image, 0, resume_stack + ARRAY_SIZE(resume_stack)); return 0; }
static int rkpm_enter(suspend_state_t state) { //static u32 test_count=0; // printk(KERN_DEBUG"pm: "); printk("%s:\n",__FUNCTION__); //printk("pm test times=%d\n",++test_count); RKPM_DDR_FUN(prepare); rkpm_ctrbits_prepare(); // if(rkpm_chk_jdg_ctrbits(RKPM_CTR_RET_DIRT)) // return 0; rkpm_ddr_printch('0'); RKPM_BITCTR_DDR_FUN(PWR_DMNS,pwr_dmns); rkpm_ddr_printch('1'); local_fiq_disable(); RKPM_DDR_PFUN(save_setting,(rkpm_jdg_sram_ctrbits)); rkpm_ddr_printch('2'); RKPM_BITCTR_DDR_FUN(GTCLKS,gtclks); rkpm_ddr_printch('3'); RKPM_BITCTR_DDR_FUN(PLLS,plls); rkpm_ddr_printch('4'); RKPM_BITCTR_DDR_FUN(GPIOS,gpios); RKPM_DDR_FUN(regs_pread); rkpm_ddr_printch('5'); if(rkpm_chk_jdg_ctrbits(RKPM_CTRBITS_SOC_DLPMD)) { if(cpu_suspend(0,rk_lpmode_enter)==0) { RKPM_DDR_FUN(slp_re_first); rkpm_ddr_printch('D'); //rk_soc_pm_ctr_bits_prepare(); } rkpm_ddr_printch('d'); } else if(rkpm_chk_jdg_ctrbits(RKPM_CTR_IDLESRAM_MD)&&p_suspend_pie_cb) { call_with_stack(p_suspend_pie_cb,&rkpm_jdg_sram_ctrbits, rockchip_sram_stack); } else { dsb(); wfi(); } rkpm_ddr_printch('5'); RKPM_BITCTR_DDR_FUN(GPIOS,re_gpios); rkpm_ddr_printch('4'); RKPM_BITCTR_DDR_FUN(PLLS,re_plls); rkpm_ddr_printch('3'); RKPM_BITCTR_DDR_FUN(GTCLKS,re_gtclks); rkpm_ddr_printch('2'); RKPM_DDR_FUN(re_save_setting); local_fiq_enable(); rkpm_ddr_printch('1'); RKPM_BITCTR_DDR_FUN(PWR_DMNS,re_pwr_dmns); rkpm_ddr_printch('0'); rkpm_ddr_printch('\n'); RKPM_DDR_FUN(finish); return 0; }
static int rkpm_enter(suspend_state_t state) { printk("%s\n",__FUNCTION__); printk(KERN_DEBUG "pm: "); rkpm_ctrbits_prepare(); // if(rkpm_chk_jdg_ctrbit(RKPM_CTR_RET_DIRT)) // return 0; RKPM_DDR_FUN(prepare); rkpm_ddr_printch('0'); RKPM_BITCTR_DDR_FUN(PWR_DMNS,pwr_dmns); rkpm_ddr_printch('1'); local_fiq_disable(); RKPM_BITSCTR_DDR_FUN(RKPM_CTRBITS_SOC_DLPMD,slp_save); rkpm_ddr_printch('2'); RKPM_BITCTR_DDR_FUN(GTCLKS,gtclks); rkpm_ddr_printch('3'); RKPM_BITCTR_DDR_FUN(PLLS,plls); rkpm_ddr_printch('4'); RKPM_BITCTR_DDR_FUN(GPIOS,gpios); RKPM_DDR_FUN(regs_pread); rkpm_ddr_printch('5'); pm_log = false; if(rkpm_chk_jdg_ctrbits(RKPM_CTRBITS_SOC_DLPMD)) { if(cpu_suspend(0,rk_lpmode_enter)==0) { rkpm_ddr_printch('d'); RKPM_DDR_FUN(slp_re_first); //rk_soc_pm_ctr_bits_prepare(); } }else if(rkpm_chk_jdg_ctrbit(RKPM_CTR_IDLEAUTO_MD)) { RKPM_DDR_PFUN(slp_setting(rkpm_jdg_sram_ctrbits),slp_setting); rkpm_ddr_printch('a'); dsb(); wfi(); rkpm_ddr_printch('a'); } else if(rkpm_chk_jdg_ctrbit(RKPM_CTR_IDLESRAM_MD)&&p_suspend_pie_cb) { call_with_stack(p_suspend_pie_cb,&rkpm_jdg_sram_ctrbits, rockchip_sram_stack); } else { dsb(); wfi(); } pm_log = true; rkpm_ddr_printch('5'); RKPM_BITCTR_DDR_FUN(GPIOS,re_gpios); rkpm_ddr_printch('4'); RKPM_BITCTR_DDR_FUN(PLLS,re_plls); rkpm_ddr_printch('3'); RKPM_BITCTR_DDR_FUN(GTCLKS,re_gtclks); rkpm_ddr_printch('2'); RKPM_BITSCTR_DDR_FUN(RKPM_CTRBITS_SOC_DLPMD,slp_re_last); local_fiq_enable(); rkpm_ddr_printch('1'); RKPM_BITCTR_DDR_FUN(PWR_DMNS,re_pwr_dmns); rkpm_ddr_printch('0'); pm_log = false; printk(KERN_CONT "\n"); rkpm_ddr_printch('\n'); RKPM_DDR_FUN(finish); return 0; }