diff options
| author | Vladimir Kondratiev <vladimir.kondratiev@mobileye.com> | 2026-02-23 16:54:44 +0200 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2026-02-25 18:49:03 +0530 |
| commit | 6545b78bcd82dabf07a14c65fce32e6fcd85394b (patch) | |
| tree | a3ee082a480b46ac5b0c7d27a032a2822a0242c6 | |
| parent | 698ea046e25c93b63d1688eb303e9fdcc2767172 (diff) | |
| download | opensbi-6545b78bcd82dabf07a14c65fce32e6fcd85394b.tar.gz opensbi-6545b78bcd82dabf07a14c65fce32e6fcd85394b.tar.bz2 opensbi-6545b78bcd82dabf07a14c65fce32e6fcd85394b.zip | |
platform: generic: mips p8700: fix powering up other cluster
While powering up cluster, only indication is bit in cluster
power control.
It used to wait for CORE0 in that cluster reach U5 state
(non-coherent execution), this won't happen when only CM
powered up without booting any core
Signed-off-by: Vladimir Kondratiev <vladimir.kondratiev@mobileye.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260223-for-upstream-eyeq7h-v3-5-621d004d1a21@mobileye.com
Signed-off-by: Anup Patel <anup@brainfault.org>
| -rw-r--r-- | platform/generic/mips/p8700.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/platform/generic/mips/p8700.c b/platform/generic/mips/p8700.c index 07cea604..48fce1d8 100644 --- a/platform/generic/mips/p8700.c +++ b/platform/generic/mips/p8700.c @@ -12,6 +12,7 @@ #include <sbi/sbi_error.h> #include <sbi/sbi_hsm.h> #include <sbi/sbi_timer.h> +#include <sbi/riscv_barrier.h> #include <sbi_utils/fdt/fdt_helper.h> #include <mips/p8700.h> #include <mips/mips-cm.h> @@ -42,32 +43,22 @@ static void mips_p8700_pmp_set(unsigned int n, unsigned long flags, static void power_up_other_cluster(u32 hartid) { - unsigned int stat; - unsigned int timeout; - bool local_p = (cpu_cluster(current_hartid()) == cpu_cluster(hartid)); + unsigned int cl = cpu_cluster(hartid); + bool local_p = (cpu_cluster(current_hartid()) == cl); - /* Power up cluster cl core 0 hart 0 */ + /* Power up CM in cluster */ write_cpc_pwrup_ctl(hartid, 1, local_p); /* Wait for the CM to start up */ - timeout = 100; - while (true) { - stat = read_cpc_cm_stat_conf(hartid, local_p); + for (int i = 100; i > 0; i--) { + u32 stat = read_cpc_cm_stat_conf(hartid, local_p); + stat = EXT(stat, CPC_Cx_STAT_CONF_SEQ_STATE); if (stat == CPC_Cx_STAT_CONF_SEQ_STATE_U5) - break; - - /* Delay a little while before we start warning */ - if (timeout) { - sbi_dprintf("Delay a little while before we start warning\n"); - timeout--; - } - else { - sbi_printf("Waiting for cluster %u CM to power up... STAT_CONF=0x%x\n", - cpu_cluster(hartid), stat); - break; - } + return; + cpu_relax(); } + sbi_printf("ERROR: Fail to power up cluster %u\n", cl); } static int mips_hart_start(u32 hartid, ulong saddr) |
