diff mbox

[3/3] arm_gic: Do not force PPIs to edge-triggered mode

Message ID 1408218501-22326-4-git-send-email-adam@os.inf.tu-dresden.de
State New
Headers show

Commit Message

Adam Lackorzynski Aug. 16, 2014, 7:48 p.m. UTC
Only SGIs must be WI, done by forcing them to their default
(edge-triggered).

Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
---
 hw/intc/arm_gic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Christoffer Dall Aug. 18, 2014, 12:48 p.m. UTC | #1
On Sat, Aug 16, 2014 at 09:48:21PM +0200, Adam Lackorzynski wrote:
> Only SGIs must be WI, done by forcing them to their default
> (edge-triggered).
> 
> Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
> ---
>  hw/intc/arm_gic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
> index e546647..55019c9 100644
> --- a/hw/intc/arm_gic.c
> +++ b/hw/intc/arm_gic.c
> @@ -558,7 +558,7 @@ static void gic_dist_writeb(void *opaque, hwaddr offset,
>          irq = (offset - 0xc00) * 4 + GIC_BASE_IRQ;
>          if (irq >= s->num_irq)
>              goto bad_reg;
> -        if (irq < GIC_INTERNAL)
> +        if (irq < GIC_NR_SGIS)
>              value |= 0xaa;
>          for (i = 0; i < 4; i++) {
>              if (s->revision == REV_11MPCORE || s->revision == REV_NVIC) {
> -- 
> 2.1.0.rc1
> 

where do we ensure that the SGIs are actually configured as
edge-triggered when creating the gic?

-Christoffer
Adam Lackorzynski Aug. 18, 2014, 12:52 p.m. UTC | #2
On Mon Aug 18, 2014 at 14:48:15 +0200, Christoffer Dall wrote:
> On Sat, Aug 16, 2014 at 09:48:21PM +0200, Adam Lackorzynski wrote:
> > Only SGIs must be WI, done by forcing them to their default
> > (edge-triggered).
> > 
> > Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
> > ---
> >  hw/intc/arm_gic.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
> > index e546647..55019c9 100644
> > --- a/hw/intc/arm_gic.c
> > +++ b/hw/intc/arm_gic.c
> > @@ -558,7 +558,7 @@ static void gic_dist_writeb(void *opaque, hwaddr offset,
> >          irq = (offset - 0xc00) * 4 + GIC_BASE_IRQ;
> >          if (irq >= s->num_irq)
> >              goto bad_reg;
> > -        if (irq < GIC_INTERNAL)
> > +        if (irq < GIC_NR_SGIS)
> >              value |= 0xaa;
> >          for (i = 0; i < 4; i++) {
> >              if (s->revision == REV_11MPCORE || s->revision == REV_NVIC) {
> > -- 
> > 2.1.0.rc1
> > 
> 
> where do we ensure that the SGIs are actually configured as
> edge-triggered when creating the gic?

It's setup in arm_gic_common_reset() in arm_gic_common.c.
(Looks like I should add another change to use GIC_NR_SGIS there too.)



Adam
Christoffer Dall Aug. 18, 2014, 1:01 p.m. UTC | #3
On Mon, Aug 18, 2014 at 02:52:47PM +0200, Adam Lackorzynski wrote:
> On Mon Aug 18, 2014 at 14:48:15 +0200, Christoffer Dall wrote:
> > On Sat, Aug 16, 2014 at 09:48:21PM +0200, Adam Lackorzynski wrote:
> > > Only SGIs must be WI, done by forcing them to their default
> > > (edge-triggered).
> > > 
> > > Signed-off-by: Adam Lackorzynski <adam@os.inf.tu-dresden.de>
> > > ---
> > >  hw/intc/arm_gic.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
> > > index e546647..55019c9 100644
> > > --- a/hw/intc/arm_gic.c
> > > +++ b/hw/intc/arm_gic.c
> > > @@ -558,7 +558,7 @@ static void gic_dist_writeb(void *opaque, hwaddr offset,
> > >          irq = (offset - 0xc00) * 4 + GIC_BASE_IRQ;
> > >          if (irq >= s->num_irq)
> > >              goto bad_reg;
> > > -        if (irq < GIC_INTERNAL)
> > > +        if (irq < GIC_NR_SGIS)
> > >              value |= 0xaa;
> > >          for (i = 0; i < 4; i++) {
> > >              if (s->revision == REV_11MPCORE || s->revision == REV_NVIC) {
> > > -- 
> > > 2.1.0.rc1
> > > 
> > 
> > where do we ensure that the SGIs are actually configured as
> > edge-triggered when creating the gic?
> 
> It's setup in arm_gic_common_reset() in arm_gic_common.c.
> (Looks like I should add another change to use GIC_NR_SGIS there too.)
> 
That would be good, for this patch:

Acked-by: Christoffer Dall <christoffer.dall@linaro.org>


Thanks!
diff mbox

Patch

diff --git a/hw/intc/arm_gic.c b/hw/intc/arm_gic.c
index e546647..55019c9 100644
--- a/hw/intc/arm_gic.c
+++ b/hw/intc/arm_gic.c
@@ -558,7 +558,7 @@  static void gic_dist_writeb(void *opaque, hwaddr offset,
         irq = (offset - 0xc00) * 4 + GIC_BASE_IRQ;
         if (irq >= s->num_irq)
             goto bad_reg;
-        if (irq < GIC_INTERNAL)
+        if (irq < GIC_NR_SGIS)
             value |= 0xaa;
         for (i = 0; i < 4; i++) {
             if (s->revision == REV_11MPCORE || s->revision == REV_NVIC) {