qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] mps2-an511: Fix wiring of UART overflow interrupt lines
@ 2017-09-12 16:13 Peter Maydell
  2017-09-12 16:22 ` Philippe Mathieu-Daudé
  2017-09-12 23:55 ` Alistair Francis
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Maydell @ 2017-09-12 16:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches, qemu-stable

Fix an error that meant we were wiring every UART's overflow
interrupts into the same inputs 0 and 1 of the OR gate,
rather than giving each its own input.

Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/mps2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
index abb0ab6..769cff8 100644
--- a/hw/arm/mps2.c
+++ b/hw/arm/mps2.c
@@ -287,8 +287,8 @@ static void mps2_common_init(MachineState *machine)
             cmsdk_apb_uart_create(uartbase[i],
                                   qdev_get_gpio_in(txrx_orgate_dev, 0),
                                   qdev_get_gpio_in(txrx_orgate_dev, 1),
-                                  qdev_get_gpio_in(orgate_dev, 0),
-                                  qdev_get_gpio_in(orgate_dev, 1),
+                                  qdev_get_gpio_in(orgate_dev, i * 2),
+                                  qdev_get_gpio_in(orgate_dev, i * 2 + 1),
                                   NULL,
                                   uartchr, SYSCLK_FRQ);
         }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] mps2-an511: Fix wiring of UART overflow interrupt lines
  2017-09-12 16:13 [Qemu-devel] [PATCH] mps2-an511: Fix wiring of UART overflow interrupt lines Peter Maydell
@ 2017-09-12 16:22 ` Philippe Mathieu-Daudé
  2017-09-12 16:40   ` Peter Maydell
  2017-09-12 23:55 ` Alistair Francis
  1 sibling, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2017-09-12 16:22 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: qemu-stable, patches, qemu-arm

(CC'ed qemu-arm)

Hi Peter,

On 09/12/2017 01:13 PM, Peter Maydell wrote:
> Fix an error that meant we were wiring every UART's overflow
> interrupts into the same inputs 0 and 1 of the OR gate,
> rather than giving each its own input.

oops tricky to catch

> 
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   hw/arm/mps2.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
> index abb0ab6..769cff8 100644
> --- a/hw/arm/mps2.c
> +++ b/hw/arm/mps2.c

         /* The overflow IRQs for all UARTs are ORed together.
          * Tx and Rx IRQs for each UART are ORed together.
          */

can you update this comment?

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> @@ -287,8 +287,8 @@ static void mps2_common_init(MachineState *machine)
>               cmsdk_apb_uart_create(uartbase[i],
>                                     qdev_get_gpio_in(txrx_orgate_dev, 0),
>                                     qdev_get_gpio_in(txrx_orgate_dev, 1),
> -                                  qdev_get_gpio_in(orgate_dev, 0),
> -                                  qdev_get_gpio_in(orgate_dev, 1),
> +                                  qdev_get_gpio_in(orgate_dev, i * 2),
> +                                  qdev_get_gpio_in(orgate_dev, i * 2 + 1),
>                                     NULL,
>                                     uartchr, SYSCLK_FRQ);
>           }
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] mps2-an511: Fix wiring of UART overflow interrupt lines
  2017-09-12 16:22 ` Philippe Mathieu-Daudé
@ 2017-09-12 16:40   ` Peter Maydell
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2017-09-12 16:40 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: QEMU Developers, qemu-stable, patches@linaro.org, qemu-arm

On 12 September 2017 at 17:22, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> (CC'ed qemu-arm)
>
> Hi Peter,
>
> On 09/12/2017 01:13 PM, Peter Maydell wrote:
>>
>> Fix an error that meant we were wiring every UART's overflow
>> interrupts into the same inputs 0 and 1 of the OR gate,
>> rather than giving each its own input.
>
>
> oops tricky to catch
>
>>
>> Cc: qemu-stable@nongnu.org
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>>   hw/arm/mps2.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
>> index abb0ab6..769cff8 100644
>> --- a/hw/arm/mps2.c
>> +++ b/hw/arm/mps2.c
>
>
>         /* The overflow IRQs for all UARTs are ORed together.
>          * Tx and Rx IRQs for each UART are ORed together.
>          */
>
> can you update this comment?

The comment is correct. "txrx_orgate_dev" is a 2-input OR gate,
which we create one of per UART. It ORs together the TX IRQ
and the RX IRQ. "orgate_dev" is a 10-input OR gate, which ORs
together the TX overflow IRQ and the RX overflow IRQ from each
UART. The bug here is just that we were using the wrong input
pins on orgate_dev.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] mps2-an511: Fix wiring of UART overflow interrupt lines
  2017-09-12 16:13 [Qemu-devel] [PATCH] mps2-an511: Fix wiring of UART overflow interrupt lines Peter Maydell
  2017-09-12 16:22 ` Philippe Mathieu-Daudé
@ 2017-09-12 23:55 ` Alistair Francis
  1 sibling, 0 replies; 4+ messages in thread
From: Alistair Francis @ 2017-09-12 23:55 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-devel@nongnu.org Developers, qemu-stable, Patch Tracking

On Tue, Sep 12, 2017 at 9:13 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> Fix an error that meant we were wiring every UART's overflow
> interrupts into the same inputs 0 and 1 of the OR gate,
> rather than giving each its own input.
>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>

Thanks,
Alistair

> ---
>  hw/arm/mps2.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
> index abb0ab6..769cff8 100644
> --- a/hw/arm/mps2.c
> +++ b/hw/arm/mps2.c
> @@ -287,8 +287,8 @@ static void mps2_common_init(MachineState *machine)
>              cmsdk_apb_uart_create(uartbase[i],
>                                    qdev_get_gpio_in(txrx_orgate_dev, 0),
>                                    qdev_get_gpio_in(txrx_orgate_dev, 1),
> -                                  qdev_get_gpio_in(orgate_dev, 0),
> -                                  qdev_get_gpio_in(orgate_dev, 1),
> +                                  qdev_get_gpio_in(orgate_dev, i * 2),
> +                                  qdev_get_gpio_in(orgate_dev, i * 2 + 1),
>                                    NULL,
>                                    uartchr, SYSCLK_FRQ);
>          }
> --
> 2.7.4
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-12 23:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-12 16:13 [Qemu-devel] [PATCH] mps2-an511: Fix wiring of UART overflow interrupt lines Peter Maydell
2017-09-12 16:22 ` Philippe Mathieu-Daudé
2017-09-12 16:40   ` Peter Maydell
2017-09-12 23:55 ` Alistair Francis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).