[PATCH v2] generic: mips: support harts to boot from mips_warm_boot
Chao-ying Fu
icebergfu at gmail.com
Tue Jul 22 16:04:14 PDT 2025
We program reset base for harts (other than hart 0) to boot at
mips_warm_boot that jumps to _start_warm. This helps to skip some code
sequence to speed up.
Signed-off-by: Chao-ying Fu <cfu at mips.com>
---
platform/generic/mips/p8700.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/platform/generic/mips/p8700.c b/platform/generic/mips/p8700.c
index 888a45c..8c93ebf 100644
--- a/platform/generic/mips/p8700.c
+++ b/platform/generic/mips/p8700.c
@@ -140,6 +140,20 @@ static void power_up_other_cluster(u32 hartid)
}
#endif
+static void __attribute__((naked,no_instrument_function,aligned(4096)))
+mips_warm_boot(void)
+{
+ __asm__ __volatile__(
+ " j _start_warm\n"
+ " .align 2\n"
+ " j _start_warm\n"
+ " .align 2\n"
+ " j _start_warm\n"
+ " .align 2\n"
+ " j _start_warm\n"
+ );
+}
+
static int mips_hart_start(u32 hartid, ulong saddr)
{
unsigned int stat;
@@ -150,6 +164,9 @@ static int mips_hart_start(u32 hartid, ulong saddr)
if (hartid == 0)
return SBI_ENOTSUPP;
+ /* Change reset base to mips_warm_boot */
+ write_gcr_co_reset_base(hartid, (unsigned long)mips_warm_boot, local_p);
+
if (cpu_hart(hartid) == 0) {
/* Ensure its coherency is disabled */
write_gcr_co_coherence(hartid, 0, local_p);
--
2.47.1
More information about the opensbi
mailing list