Message ID | 20240103155337.2026946-3-sam@rfc1149.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Add "num-prio-bits" property for Cortex-M devices | expand |
On Wed, 3 Jan 2024 at 15:53, Samuel Tardieu <sam@rfc1149.net> wrote: > > A SoC will not have a direct access to the NVIC embedded in its ARM > core. By aliasing the "num-prio-bits" property similarly to what is > done for the "num-irq" one, a SoC can easily configure it on its > armv7m instance. > > Signed-off-by: Samuel Tardieu <sam@rfc1149.net> > --- > hw/arm/armv7m.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c > index d10abb36a8..4fda2d1d47 100644 > --- a/hw/arm/armv7m.c > +++ b/hw/arm/armv7m.c > @@ -256,6 +256,8 @@ static void armv7m_instance_init(Object *obj) > object_initialize_child(obj, "nvic", &s->nvic, TYPE_NVIC); > object_property_add_alias(obj, "num-irq", > OBJECT(&s->nvic), "num-irq"); > + object_property_add_alias(obj, "num-prio-bits", > + OBJECT(&s->nvic), "num-prio-bits"); > > object_initialize_child(obj, "systick-reg-ns", &s->systick[M_REG_NS], > TYPE_SYSTICK); There's a comment in include/hw/arm/armv7m.h which documents all the GPIO inputs, QOM properties, etc, that this device has -- that also needs a line adding to it for this property. Otherwise Reviewed-by: Peter Maydell <peter.maydell@linaro.org> thanks -- PMM
Peter Maydell <peter.maydell@linaro.org> writes: > There's a comment in include/hw/arm/armv7m.h which documents > all the GPIO inputs, QOM properties, etc, that this device > has -- that also needs a line adding to it for this property. Thanks Peter for your review. I'll send a v3 containing the requested change after Inès has submitted an updated version of her "Add minimal support for the B-L475E-IOT01A board" serie on which this one is based. Best. Sam
diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index d10abb36a8..4fda2d1d47 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -256,6 +256,8 @@ static void armv7m_instance_init(Object *obj) object_initialize_child(obj, "nvic", &s->nvic, TYPE_NVIC); object_property_add_alias(obj, "num-irq", OBJECT(&s->nvic), "num-irq"); + object_property_add_alias(obj, "num-prio-bits", + OBJECT(&s->nvic), "num-prio-bits"); object_initialize_child(obj, "systick-reg-ns", &s->systick[M_REG_NS], TYPE_SYSTICK);
A SoC will not have a direct access to the NVIC embedded in its ARM core. By aliasing the "num-prio-bits" property similarly to what is done for the "num-irq" one, a SoC can easily configure it on its armv7m instance. Signed-off-by: Samuel Tardieu <sam@rfc1149.net> --- hw/arm/armv7m.c | 2 ++ 1 file changed, 2 insertions(+)