[PATCH] bsps/raspberrypi: Add SEV instruction to Pi SMP

Joel Sherrill joel at rtems.org
Fri Aug 6 19:37:25 UTC 2021


On Fri, Aug 6, 2021 at 1:19 PM Pranav Dangi <dangipranav at gmail.com> wrote:
>
> The Pi firmware added a wfe(wait for event) so now, the cores 1-3 wait
> for the start address being written to the mailbox register, followed
> by a SEV that acts as a poke to the mailbox, or in other words, a wfe
> wake-up event. I've added the SEV correspondingly here. So, would 'Add
> SEV instruction' be the right way to say it? Or should I change the
> subject.

I think changing the subject and adding that explanation or similar
as a comment in the code would be great. The current title is essentially
the English version of the method name. :) It needs more purpose/rationale.

--joel

>
> Thanks,
> pranav
>
>
> On Fri, Aug 6, 2021 at 7:24 PM Joel Sherrill <joel at rtems.org> wrote:
> >
> > On Fri, Aug 6, 2021 at 5:11 AM pranav <dangipranav at gmail.com> wrote:
> > >
> > > Add Send Event instruction to get the SMP working on the Pi. Patch
> > > doesn't work for SMP on Pi 2 v1.1
> > > ---
> > >  bsps/arm/raspberrypi/include/bsp/irq.h | 1 +
> > >  bsps/arm/raspberrypi/start/bspsmp.c    | 1 +
> > >  2 files changed, 2 insertions(+)
> > >
> > > diff --git a/bsps/arm/raspberrypi/include/bsp/irq.h b/bsps/arm/raspberrypi/include/bsp/irq.h
> > > index a363e7ce90..2c0d0d82b2 100644
> > > --- a/bsps/arm/raspberrypi/include/bsp/irq.h
> > > +++ b/bsps/arm/raspberrypi/include/bsp/irq.h
> > > @@ -24,6 +24,7 @@
> > >  #include <rtems.h>
> > >  #include <rtems/irq.h>
> > >  #include <rtems/irq-extension.h>
> > > +#include <dev/irq/arm-gic-irq.h>
> > >
> > >  /**
> > >   * @defgroup raspberrypi_interrupt Interrrupt Support
> > > diff --git a/bsps/arm/raspberrypi/start/bspsmp.c b/bsps/arm/raspberrypi/start/bspsmp.c
> > > index 44f7a1d376..9dcfb0fb03 100644
> > > --- a/bsps/arm/raspberrypi/start/bspsmp.c
> > > +++ b/bsps/arm/raspberrypi/start/bspsmp.c
> > > @@ -42,6 +42,7 @@ bool _CPU_SMP_Start_processor( uint32_t cpu_index )
> > >    if (cpu_index != cpu_index_self) {
> > >
> > >      BCM2835_REG(BCM2836_MAILBOX_3_WRITE_SET_BASE + 0x10 * cpu_index) = (uint32_t)_start;
> > > +    _ARM_Send_event();
> >
> > Perhaps a bit pedantic but you didn't add an SEV instruction directly.
> > You added a call to send an event which is implemented (I guess) as an
> > SEV instruction.
> >
> > Subject of patch might be better as something like "add sending event to ..."
> > and maybe add a comment as to what the send event is intended to convey.
> > >
> > >      /*
> > >       * Wait for secondary processor to complete its basic initialization so
> > > --
> > > 2.30.2
> > >
> > > _______________________________________________
> > > devel mailing list
> > > devel at rtems.org
> > > http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list