void spm_dpidle_after_wfi(void) { #ifdef CONFIG_SMP //if (gpt_check_irq(GPT4)) { if (gpt_check_and_ack_irq(GPT4)) { /* waked up by WAKEUP_GPT */ localtimer_set_next_event(1); } else { /* waked up by other wakeup source */ unsigned int cnt, cmp; gpt_get_cnt(GPT4, &cnt); gpt_get_cmp(GPT4, &cmp); if (unlikely(cmp < cnt)) { idle_err("[%s]GPT%d: counter = %10u, compare = %10u\n", __func__, GPT4 + 1, cnt, cmp); BUG(); } localtimer_set_next_event(cmp-cnt); stop_gpt(GPT4); //GPT_ClearCount(WAKEUP_GPT); free_gpt(GPT4); } #endif disable_clock(MT_CG_PMIC_SW_CG_AP, "DEEP_IDLE"); clkmux_sel(MT_CLKMUX_AUD_INTBUS_SEL,g_clk_aud_intbus_sel,"Deep_Idle"); dpidle_cnt[0]++; }
void spm_dpidle_after_wfi(void) { #ifdef CONFIG_SMP //if (gpt_check_irq(GPT4)) { if (gpt_check_and_ack_irq(idle_gpt)) { /* waked up by WAKEUP_GPT */ localtimer_set_next_event(1); } else { /* waked up by other wakeup source */ unsigned int cnt, cmp; gpt_get_cnt(idle_gpt, &cnt); gpt_get_cmp(idle_gpt, &cmp); if (unlikely(cmp < cnt)) { idle_err("[%s]GPT%d: counter = %10u, compare = %10u\n", __func__, idle_gpt + 1, cnt, cmp); BUG(); } localtimer_set_next_event(cmp-cnt); stop_gpt(idle_gpt); //GPT_ClearCount(WAKEUP_GPT); } #endif //clkmux_sel(MT_MUX_AUDINTBUS, 1, "Deepidle"); //mainpll clkmgr_faudintbus_sq2pll(); bus_dcm_disable(); dpidle_cnt[0]++; }
void mcidle_after_wfi(int cpu) { #ifdef CONFIG_SMP unsigned int id = mcidle_gpt_percpu[cpu]; //if (cpu != 0) { if (gpt_check_and_ack_irq(id)) { localtimer_set_next_event(1); } else { /* waked up by other wakeup source */ unsigned int cnt, cmp; gpt_get_cnt(id, &cnt); gpt_get_cmp(id, &cmp); if (unlikely(cmp < cnt)) { idle_err("[%s]GPT%d: counter = %10u, compare = %10u\n", __func__, id + 1, cnt, cmp); BUG(); } localtimer_set_next_event(cmp-cnt); stop_gpt(id); free_gpt(id); } //} #endif mcidle_cnt[cpu]++; }
void spm_dpidle_after_wfi(void) { #if 0 idle_info("[%s]timer_left=%u, timer_left2=%u, delta=%u\n", dpidle_timer_left, dpidle_timer_left2, dpidle_timer_left-dpidle_timer_left2); #endif //if (gpt_check_irq(GPT4)) { if (gpt_check_and_ack_irq(GPT4)) { /* waked up by WAKEUP_GPT */ localtimer_set_next_event(1); } else { /* waked up by other wakeup source */ unsigned int cnt, cmp; gpt_get_cnt(GPT4, &cnt); gpt_get_cmp(GPT4, &cmp); if (unlikely(cmp < cnt)) { idle_err("[%s]GPT%d: counter = %10u, compare = %10u\n", __func__, GPT4 + 1, cnt, cmp); BUG(); } localtimer_set_next_event(cmp-cnt); stop_gpt(GPT4); //GPT_ClearCount(WAKEUP_GPT); } faudintbus_sq2pll(); bus_dcm_disable(); dpidle_cnt[0]++; }
void spm_mcdi_after_wfi(int cpu) { unsigned int id = mcidle_gpt_percpu[cpu]; if (cpu != 0) { if (gpt_check_and_ack_irq(id)) { localtimer_set_next_event(1); } else { /* waked up by other wakeup source */ unsigned int cnt, cmp; gpt_get_cnt(id, &cnt); gpt_get_cmp(id, &cmp); if (unlikely(cmp < cnt)) { printk("[%s]GPT%d: counter = %10u, compare = %10u\n", __func__, id + 1, cnt, cmp); BUG(); } localtimer_set_next_event(cmp-cnt); stop_gpt(id); #ifdef SPM_SUSPEND_GPT_EN free_gpt(id); #endif } } }
int spm_wfi_for_sodi_test(void *sodi_data) { volatile u32 do_not_change_it; volatile u32 lo, hi, core_id; unsigned long flags; //u32 temp_address; preempt_disable(); do_not_change_it = 1; MCDI_Test_Mode = 1; while(do_not_change_it) { /* Mask ARM i bit */ local_irq_save(flags); core_id = (u32)smp_processor_id(); // set local timer & GPT ========================================= switch (core_id) { case 0 : read_cntp_cval(lo, hi); hi+=0xffffffff; // very very long write_cntp_cval(lo, hi); write_cntp_ctl(0x1); // CNTP_CTL_ENABLE break; case 1 : stop_gpt(GPT4); // disable GPT break; default : break; } spm_mcdi_wfi(); /* Un-Mask ARM i bit */ local_irq_restore(flags); } preempt_enable(); return 0; }
void soidle_after_wfi(bool sodi_en) { #ifdef CONFIG_SMP if (gpt_check_and_ack_irq(GPT4)) { localtimer_set_next_event(1); } else { /* waked up by other wakeup source */ unsigned int cnt, cmp; gpt_get_cnt(GPT4, &cnt); gpt_get_cmp(GPT4, &cmp); if (unlikely(cmp < cnt)) { idle_err("[%s]GPT%d: counter = %10u, compare = %10u\n", __func__, GPT4 + 1, cnt, cmp); BUG(); } localtimer_set_next_event(cmp-cnt); stop_gpt(GPT4); free_gpt(GPT4); } #endif if(sodi_en) soidle_cnt[0]++; }