Lines Matching refs:cluster
22 static void set_retention(int cluster, int tick) in set_retention() argument
26 if (cluster) in set_retention()
34 if (cluster) in set_retention()
40 void spm_enable_cpu_auto_off(int cluster, int cpu) in spm_enable_cpu_auto_off() argument
42 uintptr_t reg = per_cpu(cluster, cpu, MCUCFG_SPARK); in spm_enable_cpu_auto_off()
44 set_retention(cluster, 1); in spm_enable_cpu_auto_off()
48 void spm_disable_cpu_auto_off(int cluster, int cpu) in spm_disable_cpu_auto_off() argument
50 uintptr_t reg = per_cpu(cluster, cpu, MCUCFG_SPARK); in spm_disable_cpu_auto_off()
53 set_retention(cluster, 0); in spm_disable_cpu_auto_off()
56 void spm_set_cpu_power_off(int cluster, int cpu) in spm_set_cpu_power_off() argument
58 mmio_clrbits_32(per_cpu(cluster, cpu, SPM_CPU_PWR), PWRCTRL_PWR_ON); in spm_set_cpu_power_off()
61 void spm_enable_cluster_auto_off(int cluster) in spm_enable_cluster_auto_off() argument
63 assert(cluster); in spm_enable_cluster_auto_off()
70 mmio_clrbits_32(per_cluster(cluster, SPM_CLUSTER_PWR), PWRCTRL_PWR_ON); in spm_enable_cluster_auto_off()
73 void mcucfg_set_bootaddr(int cluster, int cpu, uintptr_t bootaddr) in mcucfg_set_bootaddr() argument
80 if (cluster) { in mcucfg_set_bootaddr()
84 reg = per_cpu(cluster, cpu, MCUCFG_BOOTADDR); in mcucfg_set_bootaddr()
90 uintptr_t mcucfg_get_bootaddr(int cluster, int cpu) in mcucfg_get_bootaddr() argument
97 if (cluster) { in mcucfg_get_bootaddr()
101 reg = per_cpu(cluster, cpu, MCUCFG_BOOTADDR); in mcucfg_get_bootaddr()
107 void mcucfg_init_archstate(int cluster, int cpu, int arm64) in mcucfg_init_archstate() argument
112 reg = per_cluster(cluster, MCUCFG_INITARCH); in mcucfg_init_archstate()
113 i = cluster ? 16 : 12; in mcucfg_init_archstate()
132 int spm_get_cluster_powerstate(int cluster) in spm_get_cluster_powerstate() argument
136 mask = cluster ? PWR_STATUS_MP1_CPUTOP : PWR_STATUS_MP0_CPUTOP; in spm_get_cluster_powerstate()
141 int spm_get_cpu_powerstate(int cluster, int cpu) in spm_get_cpu_powerstate() argument
150 i = (cluster) ? 16 : 9; in spm_get_cpu_powerstate()
203 void spm_poweron_cpu(int cluster, int cpu) in spm_poweron_cpu() argument
205 INFO("spmc: power on core %d.%d\n", cluster, cpu); in spm_poweron_cpu()
211 mmio_setbits_32(per_cpu(cluster, cpu, SPM_CPU_PWR), PWRCTRL_PWR_RST_B); in spm_poweron_cpu()
214 mmio_setbits_32(per_cpu(cluster, cpu, SPM_CPU_PWR), PWRCTRL_PWR_ON); in spm_poweron_cpu()
217 while (!spm_get_cpu_powerstate(cluster, cpu)) in spm_poweron_cpu()
221 INFO("spmc: power on core %d.%d successfully\n", cluster, cpu); in spm_poweron_cpu()
230 void spm_poweroff_cpu(int cluster, int cpu) in spm_poweroff_cpu() argument
232 INFO("spmc: power off core %d.%d\n", cluster, cpu); in spm_poweroff_cpu()
236 mmio_clrbits_32(per_cpu(cluster, cpu, SPM_CPU_PWR), PWRCTRL_PWR_ON_2ND); in spm_poweroff_cpu()
239 mmio_clrbits_32(per_cpu(cluster, cpu, SPM_CPU_PWR), PWRCTRL_PWR_ON); in spm_poweroff_cpu()
242 while (spm_get_cpu_powerstate(cluster, cpu)) in spm_poweroff_cpu()
246 mmio_clrbits_32(per_cpu(cluster, cpu, SPM_CPU_PWR), PWRCTRL_PWR_RST_B); in spm_poweroff_cpu()
249 INFO("spmc: power off core %d.%d successfully\n", cluster, cpu); in spm_poweroff_cpu()
257 void spm_poweroff_cluster(int cluster) in spm_poweroff_cluster() argument
262 INFO("spmc: power off cluster %d\n", cluster); in spm_poweroff_cluster()
266 mask = (cluster) ? MP1_CPUTOP_PROT_STEP1_0_MASK : in spm_poweroff_cluster()
274 mmio_clrbits_32(per_cluster(cluster, SPM_CLUSTER_PWR), in spm_poweroff_cluster()
278 mask = (cluster) ? MP1_SPMC_SRAM_DORMANT_EN : MP0_SPMC_SRAM_DORMANT_EN; in spm_poweroff_cluster()
282 mmio_clrbits_32(per_cluster(cluster, SPM_CLUSTER_PWR), PWRCTRL_PWR_ON); in spm_poweroff_cluster()
285 while (spm_get_cluster_powerstate(cluster)) in spm_poweroff_cluster()
292 if (cluster) { in spm_poweroff_cluster()
299 if (cluster) in spm_poweroff_cluster()
303 INFO("spmc: power off cluster %d successfully\n", cluster); in spm_poweroff_cluster()
311 void spm_poweron_cluster(int cluster) in spm_poweron_cluster() argument
316 INFO("spmc: power on cluster %d\n", cluster); in spm_poweron_cluster()
324 if (cluster) { in spm_poweron_cluster()
341 mmio_clrbits_32(per_cluster(cluster, SPM_CLUSTER_PWR), in spm_poweron_cluster()
345 mmio_setbits_32(per_cluster(cluster, SPM_CLUSTER_PWR), in spm_poweron_cluster()
349 mmio_clrbits_32(per_cluster(cluster, SPM_CLUSTER_PWR), in spm_poweron_cluster()
353 mmio_setbits_32(per_cluster(cluster, SPM_CLUSTER_PWR), PWRCTRL_PWR_ON); in spm_poweron_cluster()
356 while (!spm_get_cluster_powerstate(cluster)) in spm_poweron_cluster()
360 mask = (cluster) ? MP1_CPUTOP_PROT_STEP1_0_MASK : in spm_poweron_cluster()
365 INFO("spmc: power on cluster %d successfully\n", cluster); in spm_poweron_cluster()