Commit 47366cb1 authored by Marek Vasut's avatar Marek Vasut
Browse files

rcar_gen3: plat: Add missing cpu_on_check() implementation



The ATF code fails to build with PMIC_ROHM_BD9571=0, add the missing
function into the PWRC code.
Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
parent 2ec3221e
......@@ -768,3 +768,43 @@ count_ca57:
done:
return count;
}
int32_t rcar_pwrc_cpu_on_check(uint64_t mpidr)
{
uint64_t i;
uint64_t j;
uint64_t cpu_count;
uintptr_t reg_PSTR;
uint32_t status;
uint64_t my_cpu;
int32_t rtn;
uint32_t my_cluster_type;
const uint32_t cluster_type[PLATFORM_CLUSTER_COUNT] = {
RCAR_CLUSTER_CA53,
RCAR_CLUSTER_CA57
};
const uintptr_t registerPSTR[PLATFORM_CLUSTER_COUNT] = {
RCAR_CA53PSTR,
RCAR_CA57PSTR
};
my_cluster_type = rcar_pwrc_get_cluster();
rtn = 0;
my_cpu = mpidr & ((uint64_t)(MPIDR_CPU_MASK));
for (i = 0U; i < ((uint64_t)(PLATFORM_CLUSTER_COUNT)); i++) {
cpu_count = rcar_pwrc_get_cpu_num(cluster_type[i]);
reg_PSTR = registerPSTR[i];
for (j = 0U; j < cpu_count; j++) {
if ((my_cluster_type != cluster_type[i]) || (my_cpu != j)) {
status = mmio_read_32(reg_PSTR) >> (j * 4U);
if ((status & 0x00000003U) == 0U) {
rtn--;
}
}
}
}
return (rtn);
}
......@@ -44,6 +44,7 @@ void rcar_pwrc_enable_interrupt_wakeup(uint64_t mpidr);
void rcar_pwrc_clusteroff(uint64_t mpidr);
void rcar_pwrc_cpuoff(uint64_t mpidr);
void rcar_pwrc_cpuon(uint64_t mpidr);
int32_t rcar_pwrc_cpu_on_check(uint64_t mpidr);
void rcar_pwrc_setup(void);
uint32_t rcar_pwrc_get_cpu_wkr(uint64_t mpidr);
......
......@@ -175,7 +175,7 @@ static void __dead2 rcar_system_off(void)
uint64_t cpu = read_mpidr_el1() & 0x0000ffff;
int32_t rtn_on;
rtn_on = cpu_on_check(cpu);
rtn_on = rcar_pwrc_cpu_on_check(cpu);
if (cpu == rcar_boot_mpidr)
panic();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment