[PATCH v1] generic: mips: support harts to boot from mips_warm_boot
Chao-ying Fu
icebergfu at gmail.com
Wed Jul 16 16:17:38 PDT 2025
On Thu, Jul 10, 2025 at 9:34 PM Jessica Clarke <jrtc27 at jrtc27.com> wrote:
>
> 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?
My intention is to have a minimum change, as there is only one file
modified in the patch.
Either writing assembly code or writing C code for mips_warm_boot is
fine or equivalent.
To have assembly code, we will need to modify Makefile and create a
new assembly file in the patch.
Thanks a lot!
Regards,
Chao-ying
More information about the opensbi
mailing list