[PATCH v1] generic: mips: support harts to boot from mips_warm_boot
Jessica Clarke
jrtc27 at jrtc27.com
Thu Jul 10 21:33:55 PDT 2025
On 11 Jul 2025, at 00:17, Chao-ying Fu <icebergfu at gmail.com> wrote:
>
> 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 | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/platform/generic/mips/p8700.c b/platform/generic/mips/p8700.c
> index 888a45c..687912a 100644
> --- a/platform/generic/mips/p8700.c
> +++ b/platform/generic/mips/p8700.c
> @@ -140,6 +140,22 @@ 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 1f\n"
> + " .align 2\n"
> + " j 1f\n"
> + " .align 2\n"
> + " j 1f\n"
> + " .align 2\n"
> + " j 1f\n"
> + "1: lla t0, _start_warm\n"
> + " jr t0\n"
> + );
> +}
What is the point of writing this as a C function if it’s going to be
entirely assembly? Just write an assembly function?
Jess
More information about the opensbi
mailing list