Received: from eggs.gnu.org ([2001:4830:134:3::10]:39668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4CkI-0000Qw-Pb for qemu-devel@nongnu.org; Wed, 02 Dec 2015 14:07:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a4CkD-0004vH-Q1 for qemu-devel@nongnu.org; Wed, 02 Dec 2015 14:07:18 -0500 Received: from zose-mta03.web4all.fr ([185.49.20.44]:60072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a4CkD-0004v8-Gk for qemu-devel@nongnu.org; Wed, 02 Dec 2015 14:07:13 -0500 References: <1447497668-1603-1-git-send-email-jcd@tribudubois.net> From: Jean-Christophe DUBOIS Message-ID: <565F415F.2010904@tribudubois.net> Date: Wed, 2 Dec 2015 20:07:11 +0100 MIME-Version: 1.0 In-Reply-To: <1447497668-1603-1-git-send-email-jcd@tribudubois.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] i.MX: add support for lower and upper interrupt in GPIO. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: qemu-devel@nongnu.org, crosthwaite.peter@gmail.com Hi Peter, Just curious if you are expecting any kind of update on this patch? JC Le 14/11/2015 11:41, Jean-Christophe Dubois a =E9crit : > The i.MX6 GPIO device supports 2 interrupts instead of one. > > * 1 for the lower 16 GPIOs. > * 1 for the upper 16 GPIOs. > > i.MX31 and i.MX25 only support 1 interrupt for the 32 GPIOs. > > So we add a property to turn the behavior on when required. > > Signed-off-by: Jean-Christophe Dubois > Reviewed-by: Peter Crosthwaite > --- > > Changes since v1: > * None. > > hw/gpio/imx_gpio.c | 12 ++++++++++-- > include/hw/gpio/imx_gpio.h | 3 ++- > 2 files changed, 12 insertions(+), 3 deletions(-) > > diff --git a/hw/gpio/imx_gpio.c b/hw/gpio/imx_gpio.c > index 3170585..a6d7cab 100644 > --- a/hw/gpio/imx_gpio.c > +++ b/hw/gpio/imx_gpio.c > @@ -62,7 +62,12 @@ static const char *imx_gpio_reg_name(uint32_t reg) > =20 > static void imx_gpio_update_int(IMXGPIOState *s) > { > - qemu_set_irq(s->irq, (s->isr & s->imr) ? 1 : 0); > + if (s->has_upper_pin_irq) { > + qemu_set_irq(s->irq[0], (s->isr & s->imr & 0x0000FFFF) ? 1 : 0= ); > + qemu_set_irq(s->irq[1], (s->isr & s->imr & 0xFFFF0000) ? 1 : 0= ); > + } else { > + qemu_set_irq(s->irq[0], (s->isr & s->imr) ? 1 : 0); > + } > } > =20 > static void imx_gpio_set_int_line(IMXGPIOState *s, int line, IMXGPIOL= evel level) > @@ -282,6 +287,8 @@ static const VMStateDescription vmstate_imx_gpio =3D= { > =20 > static Property imx_gpio_properties[] =3D { > DEFINE_PROP_BOOL("has-edge-sel", IMXGPIOState, has_edge_sel, true= ), > + DEFINE_PROP_BOOL("has-upper-pin-irq", IMXGPIOState, has_upper_pin_= irq, > + false), > DEFINE_PROP_END_OF_LIST(), > }; > =20 > @@ -311,7 +318,8 @@ static void imx_gpio_realize(DeviceState *dev, Erro= r **errp) > qdev_init_gpio_in(DEVICE(s), imx_gpio_set, IMX_GPIO_PIN_COUNT); > qdev_init_gpio_out(DEVICE(s), s->output, IMX_GPIO_PIN_COUNT); > =20 > - sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq); > + sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq[0]); > + sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq[1]); > sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem); > } > =20 > diff --git a/include/hw/gpio/imx_gpio.h b/include/hw/gpio/imx_gpio.h > index 517b261..b15a09f 100644 > --- a/include/hw/gpio/imx_gpio.h > +++ b/include/hw/gpio/imx_gpio.h > @@ -54,8 +54,9 @@ typedef struct IMXGPIOState { > uint32_t isr; > bool has_edge_sel; > uint32_t edge_sel; > + bool has_upper_pin_irq; > =20 > - qemu_irq irq; > + qemu_irq irq[2]; > qemu_irq output[IMX_GPIO_PIN_COUNT]; > } IMXGPIOState; > =20