Lines Matching refs:cpu
112 #define CPU_IDX(cluster, cpu) ((cluster << 2) + cpu) argument
136 static bool clst_single_pwr(int cluster, int cpu) in clst_single_pwr() argument
140 int my_idx = (cluster << 2) + cpu; in clst_single_pwr()
146 static bool clst_single_on(int cluster, int cpu) in clst_single_on() argument
149 int my_idx = (cluster << 2) + cpu; in clst_single_on()
212 static void mcdi_ctrl_before_hotplug_on(int cluster, int cpu) in mcdi_ctrl_before_hotplug_on() argument
215 mcdi_pause_clr(cluster, CPU_IDX(cluster, cpu), OFF); in mcdi_ctrl_before_hotplug_on()
216 mcdi_pause_set(cluster, CPU_IDX(cluster, cpu), ON); in mcdi_ctrl_before_hotplug_on()
220 static void mcdi_ctrl_before_hotplug_off(int cluster, int cpu, bool cluster_off) in mcdi_ctrl_before_hotplug_off() argument
224 CPU_IDX(cluster, cpu), OFF); in mcdi_ctrl_before_hotplug_off()
227 static void mcdi_ctrl_cluster_cpu_off(int cluster, int cpu, bool cluster_off) in mcdi_ctrl_cluster_cpu_off() argument
232 sspm_standbywfi_irq_enable(CPU_IDX(cluster, cpu)); in mcdi_ctrl_cluster_cpu_off()
253 static void hotplug_ctrl_cluster_on(int cluster, int cpu) in hotplug_ctrl_cluster_on() argument
256 mcdi_hotplug_clr(cluster, CPU_IDX(cluster, cpu), OFF); in hotplug_ctrl_cluster_on()
266 static void hotplug_ctrl_cpu_on(int cluster, int cpu) in hotplug_ctrl_cpu_on() argument
269 mcdi_hotplug_set(cluster, CPU_IDX(cluster, cpu), ON); in hotplug_ctrl_cpu_on()
271 spm_poweron_cpu(cluster, cpu); in hotplug_ctrl_cpu_on()
274 static void hotplug_ctrl_cpu_on_finish(int cluster, int cpu) in hotplug_ctrl_cpu_on_finish() argument
276 spm_disable_cpu_auto_off(cluster, cpu); in hotplug_ctrl_cpu_on_finish()
279 mcdi_hotplug_clr(cluster, CPU_IDX(cluster, cpu), ON); in hotplug_ctrl_cpu_on_finish()
281 mcdi_pause_clr(cluster, CPU_IDX(cluster, cpu), ON); in hotplug_ctrl_cpu_on_finish()
283 mcdi_avail_cpu_mask_set(BIT(CPU_IDX(cluster, cpu))); in hotplug_ctrl_cpu_on_finish()
286 static void hotplug_ctrl_cluster_cpu_off(int cluster, int cpu, bool cluster_off) in hotplug_ctrl_cluster_cpu_off() argument
288 mcdi_avail_cpu_mask_clr(BIT(CPU_IDX(cluster, cpu))); in hotplug_ctrl_cluster_cpu_off()
292 CPU_IDX(cluster, cpu), OFF); in hotplug_ctrl_cluster_cpu_off()
294 spm_enable_cpu_auto_off(cluster, cpu); in hotplug_ctrl_cluster_cpu_off()
299 spm_set_cpu_power_off(cluster, cpu); in hotplug_ctrl_cluster_cpu_off()
305 int cpu = MPIDR_AFFLVL0_VAL(mpidr); in plat_mtk_power_domain_on() local
310 mcdi_ctrl_before_hotplug_on(cluster, cpu); in plat_mtk_power_domain_on()
311 hotplug_ctrl_cluster_on(cluster, cpu); in plat_mtk_power_domain_on()
321 hotplug_ctrl_cpu_on(cluster, cpu); in plat_mtk_power_domain_on()
329 int cpu = MPIDR_AFFLVL0_VAL(mpidr); in plat_mtk_power_domain_off() local
334 clst_single_on(cluster, cpu)); in plat_mtk_power_domain_off()
341 mcdi_ctrl_before_hotplug_off(cluster, cpu, cluster_off); in plat_mtk_power_domain_off()
342 hotplug_ctrl_cluster_cpu_off(cluster, cpu, cluster_off); in plat_mtk_power_domain_off()
348 int cpu = MPIDR_AFFLVL0_VAL(mpidr); in plat_mtk_power_domain_on_finish() local
358 hotplug_ctrl_cpu_on_finish(cluster, cpu); in plat_mtk_power_domain_on_finish()
364 int cpu = MPIDR_AFFLVL0_VAL(mpidr); in plat_mtk_power_domain_suspend() local
369 bool cluster_off = MCDI_C2 && afflvl1 && clst_single_pwr(cluster, cpu); in plat_mtk_power_domain_suspend()
398 mcdi_ctrl_cluster_cpu_off(cluster, cpu, cluster_off); in plat_mtk_power_domain_suspend()