Lines Matching refs:cluster
40 #define CPUIDLE_FLAG_REG(cluster) \ argument
41 ((cluster == 0) ? REG_SCBAKDATA8_OFFSET : \
95 static void hisi_cpuhotplug_lock(unsigned int cluster, unsigned int core) in hisi_cpuhotplug_lock() argument
99 lock_id = (cluster << 2) + core; in hisi_cpuhotplug_lock()
104 static void hisi_cpuhotplug_unlock(unsigned int cluster, unsigned int core) in hisi_cpuhotplug_unlock() argument
108 lock_id = (cluster << 2) + core; in hisi_cpuhotplug_unlock()
114 void hisi_cpuidle_lock(unsigned int cluster, unsigned int core) in hisi_cpuidle_lock() argument
116 unsigned int offset = (cluster == 0 ? RES0_LOCK_BASE : RES1_LOCK_BASE); in hisi_cpuidle_lock()
122 void hisi_cpuidle_unlock(unsigned int cluster, unsigned int core) in hisi_cpuidle_unlock() argument
124 unsigned int offset = (cluster == 0 ? RES0_LOCK_BASE : RES1_LOCK_BASE); in hisi_cpuidle_unlock()
129 unsigned int hisi_get_cpuidle_flag(unsigned int cluster) in hisi_get_cpuidle_flag() argument
133 val = mmio_read_32(CPUIDLE_FLAG_REG(cluster)); in hisi_get_cpuidle_flag()
139 void hisi_set_cpuidle_flag(unsigned int cluster, unsigned int core) in hisi_set_cpuidle_flag() argument
141 mmio_setbits_32(CPUIDLE_FLAG_REG(cluster), BIT(core)); in hisi_set_cpuidle_flag()
144 void hisi_clear_cpuidle_flag(unsigned int cluster, unsigned int core) in hisi_clear_cpuidle_flag() argument
146 mmio_clrbits_32(CPUIDLE_FLAG_REG(cluster), BIT(core)); in hisi_clear_cpuidle_flag()
165 void hisi_set_cluster_pwdn_flag(unsigned int cluster, in hisi_set_cluster_pwdn_flag() argument
170 hisi_cpuhotplug_lock(cluster, core); in hisi_set_cluster_pwdn_flag()
173 val &= ~(0x3U << ((2 * cluster) + 28)); in hisi_set_cluster_pwdn_flag()
174 val |= (value << (2 * cluster)); in hisi_set_cluster_pwdn_flag()
177 hisi_cpuhotplug_unlock(cluster, core); in hisi_set_cluster_pwdn_flag()
180 unsigned int hisi_get_cpu_boot_flag(unsigned int cluster, unsigned int core) in hisi_get_cpu_boot_flag() argument
184 hisi_cpuhotplug_lock(cluster, core); in hisi_get_cpu_boot_flag()
186 val = val >> (16 + (cluster << 2)); in hisi_get_cpu_boot_flag()
188 hisi_cpuhotplug_unlock(cluster, core); in hisi_get_cpu_boot_flag()
193 unsigned int hisi_test_cpu_down(unsigned int cluster, unsigned int core) in hisi_test_cpu_down() argument
197 hisi_cpuhotplug_lock(cluster, core); in hisi_test_cpu_down()
199 val = val >> (16 + (cluster << 2)); in hisi_test_cpu_down()
201 hisi_cpuhotplug_unlock(cluster, core); in hisi_test_cpu_down()
209 void hisi_set_cpu_boot_flag(unsigned int cluster, unsigned int core) in hisi_set_cpu_boot_flag() argument
211 unsigned int flag = BIT((cluster<<2) + core + 16); in hisi_set_cpu_boot_flag()
213 hisi_cpuhotplug_lock(cluster, core); in hisi_set_cpu_boot_flag()
217 hisi_cpuhotplug_unlock(cluster, core); in hisi_set_cpu_boot_flag()
220 void hisi_clear_cpu_boot_flag(unsigned int cluster, unsigned int core) in hisi_clear_cpu_boot_flag() argument
222 unsigned int flag = BIT((cluster<<2) + core + 16); in hisi_clear_cpu_boot_flag()
224 hisi_cpuhotplug_lock(cluster, core); in hisi_clear_cpu_boot_flag()
228 hisi_cpuhotplug_unlock(cluster, core); in hisi_clear_cpu_boot_flag()
231 int cluster_is_powered_on(unsigned int cluster) in cluster_is_powered_on() argument
236 if (cluster == 0) in cluster_is_powered_on()
244 static void *hisi_get_pdc_addr(unsigned int cluster) in hisi_get_pdc_addr() argument
249 if (cluster == 0) in hisi_get_pdc_addr()
258 static unsigned int hisi_get_pdc_stat(unsigned int cluster) in hisi_get_pdc_stat() argument
260 void *pdc_base_addr = hisi_get_pdc_addr(cluster); in hisi_get_pdc_stat()
268 static int check_hotplug(unsigned int cluster, unsigned int boot_flag) in check_hotplug() argument
279 int hisi_test_pwrdn_allcores(unsigned int cluster, unsigned int core) in hisi_test_pwrdn_allcores() argument
282 unsigned int pdc_stat = hisi_get_pdc_stat(cluster); in hisi_test_pwrdn_allcores()
283 unsigned int boot_flag = hisi_get_cpu_boot_flag(cluster, core); in hisi_test_pwrdn_allcores()
284 unsigned int cpuidle_flag = hisi_get_cpuidle_flag(cluster); in hisi_test_pwrdn_allcores()
290 check_hotplug(cluster, boot_flag)) in hisi_test_pwrdn_allcores()
296 void hisi_disable_pdc(unsigned int cluster) in hisi_disable_pdc() argument
298 void *pdc_base_addr = hisi_get_pdc_addr(cluster); in hisi_disable_pdc()
303 void hisi_enable_pdc(unsigned int cluster) in hisi_enable_pdc() argument
305 void *pdc_base_addr = hisi_get_pdc_addr(cluster); in hisi_enable_pdc()
340 void hisi_pdc_mask_cluster_wakeirq(unsigned int cluster) in hisi_pdc_mask_cluster_wakeirq() argument
343 void *pdc_base_addr = hisi_get_pdc_addr(cluster); in hisi_pdc_mask_cluster_wakeirq()
349 static void hisi_pdc_powerup_core(unsigned int cluster, unsigned int core, in hisi_pdc_powerup_core() argument
353 void *pdc_base_addr = hisi_get_pdc_addr(cluster); in hisi_pdc_powerup_core()
359 static void hisi_pdc_powerdn_core(unsigned int cluster, unsigned int core, in hisi_pdc_powerdn_core() argument
363 void *pdc_base_addr = hisi_get_pdc_addr(cluster); in hisi_pdc_powerdn_core()
369 void hisi_powerup_core(unsigned int cluster, unsigned int core) in hisi_powerup_core() argument
371 hisi_pdc_powerup_core(cluster, core, PDC_MASK_GIC_WAKE_IRQ, in hisi_powerup_core()
375 void hisi_powerdn_core(unsigned int cluster, unsigned int core) in hisi_powerdn_core() argument
377 hisi_pdc_powerdn_core(cluster, core, PDC_MASK_GIC_WAKE_IRQ, in hisi_powerdn_core()
381 void hisi_powerup_cluster(unsigned int cluster, unsigned int core) in hisi_powerup_cluster() argument
383 hisi_ipc_pm_on_off(core, cluster, PM_ON); in hisi_powerup_cluster()
386 void hisi_powerdn_cluster(unsigned int cluster, unsigned int core) in hisi_powerdn_cluster() argument
388 void *pdc_base_addr = hisi_get_pdc_addr(cluster); in hisi_powerdn_cluster()
390 hisi_set_cluster_pwdn_flag(cluster, core, CLUSTER_PWDN_HOTPLUG); in hisi_powerdn_cluster()
397 void hisi_enter_core_idle(unsigned int cluster, unsigned int core) in hisi_enter_core_idle() argument
399 hisi_pdc_powerdn_core(cluster, core, PDC_UNMASK_GIC_WAKE_IRQ, in hisi_enter_core_idle()
403 void hisi_enter_cluster_idle(unsigned int cluster, unsigned int core) in hisi_enter_cluster_idle() argument
405 void *pdc_base_addr = hisi_get_pdc_addr(cluster); in hisi_enter_cluster_idle()
407 hisi_set_cluster_pwdn_flag(cluster, core, CLUSTER_PWDN_IDLE); in hisi_enter_cluster_idle()
414 void hisi_enter_ap_suspend(unsigned int cluster, unsigned int core) in hisi_enter_ap_suspend() argument
416 hisi_ipc_pm_suspend(core, cluster, 0x3); in hisi_enter_ap_suspend()