* [PATCH v2] hw/arm/xlnx: Connect secondary CGEM IRQs
@ 2023-06-16 14:38 Kinsey Moore
2023-06-16 20:25 ` Francisco Iglesias
2023-06-17 22:50 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 6+ messages in thread
From: Kinsey Moore @ 2023-06-16 14:38 UTC (permalink / raw)
To: qemu-devel; +Cc: Kinsey Moore
The Cadence GEM peripherals as configured for Zynq MPSoC and Versal
platforms have two priority queues with separate interrupt sources for
each. If the interrupt source for the second priority queue is not
connected, they work in polling mode only. This change connects the
second interrupt source for platforms where it is available. This patch
has been tested using the lwIP stack with a Xilinx-supplied driver from
their embeddedsw repository.
Signed-off-by: Kinsey Moore <kinsey.moore@oarcorp.com>
---
hw/arm/xlnx-versal.c | 12 +++++++++++-
hw/arm/xlnx-zynqmp.c | 11 ++++++++++-
include/hw/arm/xlnx-versal.h | 1 +
include/hw/arm/xlnx-zynqmp.h | 1 +
4 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
index 60bf5fe657..cb79b855fd 100644
--- a/hw/arm/xlnx-versal.c
+++ b/hw/arm/xlnx-versal.c
@@ -252,9 +252,13 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
NICInfo *nd = &nd_table[i];
DeviceState *dev;
MemoryRegion *mr;
+ OrIRQState *or_irq;
object_initialize_child(OBJECT(s), name, &s->lpd.iou.gem[i],
TYPE_CADENCE_GEM);
+ or_irq = &s->lpd.iou.gem_irq_orgate[i];
+ object_initialize_child(OBJECT(s), "gem-irq-orgate[*]",
+ or_irq, TYPE_OR_IRQ);
dev = DEVICE(&s->lpd.iou.gem[i]);
/* FIXME use qdev NIC properties instead of nd_table[] */
if (nd->used) {
@@ -264,6 +268,11 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
object_property_set_int(OBJECT(dev), "phy-addr", 23, &error_abort);
object_property_set_int(OBJECT(dev), "num-priority-queues", 2,
&error_abort);
+ object_property_set_int(OBJECT(or_irq),
+ "num-lines", 2, &error_fatal);
+ qdev_realize(DEVICE(or_irq), NULL, &error_fatal);
+ qdev_connect_gpio_out(DEVICE(or_irq), 0, pic[irqs[i]]);
+
object_property_set_link(OBJECT(dev), "dma", OBJECT(&s->mr_ps),
&error_abort);
sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
@@ -271,7 +280,8 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
memory_region_add_subregion(&s->mr_ps, addrs[i], mr);
- sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[irqs[i]]);
+ sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, qdev_get_gpio_in(DEVICE(or_irq), 0));
+ sysbus_connect_irq(SYS_BUS_DEVICE(dev), 1, qdev_get_gpio_in(DEVICE(or_irq), 1));
g_free(name);
}
}
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 5905a33015..f7158e4fd3 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -392,6 +392,8 @@ static void xlnx_zynqmp_init(Object *obj)
for (i = 0; i < XLNX_ZYNQMP_NUM_GEMS; i++) {
object_initialize_child(obj, "gem[*]", &s->gem[i], TYPE_CADENCE_GEM);
+ object_initialize_child(obj, "gem-irq-orgate[*]",
+ &s->gem_irq_orgate[i], TYPE_OR_IRQ);
}
for (i = 0; i < XLNX_ZYNQMP_NUM_UARTS; i++) {
@@ -629,12 +631,19 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
&error_abort);
object_property_set_int(OBJECT(&s->gem[i]), "num-priority-queues", 2,
&error_abort);
+ object_property_set_int(OBJECT(&s->gem_irq_orgate[i]),
+ "num-lines", 2, &error_fatal);
+ qdev_realize(DEVICE(&s->gem_irq_orgate[i]), NULL, &error_fatal);
+ qdev_connect_gpio_out(DEVICE(&s->gem_irq_orgate[i]), 0, gic_spi[gem_intr[i]]);
+
if (!sysbus_realize(SYS_BUS_DEVICE(&s->gem[i]), errp)) {
return;
}
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gem[i]), 0, gem_addr[i]);
sysbus_connect_irq(SYS_BUS_DEVICE(&s->gem[i]), 0,
- gic_spi[gem_intr[i]]);
+ qdev_get_gpio_in(DEVICE(&s->gem_irq_orgate[i]), 0));
+ sysbus_connect_irq(SYS_BUS_DEVICE(&s->gem[i]), 1,
+ qdev_get_gpio_in(DEVICE(&s->gem_irq_orgate[i]), 1));
}
for (i = 0; i < XLNX_ZYNQMP_NUM_UARTS; i++) {
diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h
index 39ee31185c..d34c763329 100644
--- a/include/hw/arm/xlnx-versal.h
+++ b/include/hw/arm/xlnx-versal.h
@@ -74,6 +74,7 @@ struct Versal {
struct {
PL011State uart[XLNX_VERSAL_NR_UARTS];
CadenceGEMState gem[XLNX_VERSAL_NR_GEMS];
+ OrIRQState gem_irq_orgate[XLNX_VERSAL_NR_GEMS];
XlnxZDMA adma[XLNX_VERSAL_NR_ADMAS];
VersalUsb2 usb;
CanBusState *canbus[XLNX_VERSAL_NR_CANFD];
diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h
index 687c75e3b0..7e5abce467 100644
--- a/include/hw/arm/xlnx-zynqmp.h
+++ b/include/hw/arm/xlnx-zynqmp.h
@@ -117,6 +117,7 @@ struct XlnxZynqMPState {
MemoryRegion mr_unimp[XLNX_ZYNQMP_NUM_UNIMP_AREAS];
CadenceGEMState gem[XLNX_ZYNQMP_NUM_GEMS];
+ OrIRQState gem_irq_orgate[XLNX_ZYNQMP_NUM_GEMS];
CadenceUARTState uart[XLNX_ZYNQMP_NUM_UARTS];
XlnxZynqMPCANState can[XLNX_ZYNQMP_NUM_CAN];
SysbusAHCIState sata;
--
2.30.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] hw/arm/xlnx: Connect secondary CGEM IRQs
2023-06-16 14:38 [PATCH v2] hw/arm/xlnx: Connect secondary CGEM IRQs Kinsey Moore
@ 2023-06-16 20:25 ` Francisco Iglesias
2023-06-17 22:50 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 6+ messages in thread
From: Francisco Iglesias @ 2023-06-16 20:25 UTC (permalink / raw)
To: Kinsey Moore; +Cc: qemu-devel
On [2023 Jun 16] Fri 09:38:03, Kinsey Moore wrote:
> The Cadence GEM peripherals as configured for Zynq MPSoC and Versal
> platforms have two priority queues with separate interrupt sources for
> each. If the interrupt source for the second priority queue is not
> connected, they work in polling mode only. This change connects the
> second interrupt source for platforms where it is available. This patch
> has been tested using the lwIP stack with a Xilinx-supplied driver from
> their embeddedsw repository.
>
> Signed-off-by: Kinsey Moore <kinsey.moore@oarcorp.com>
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
> ---
> hw/arm/xlnx-versal.c | 12 +++++++++++-
> hw/arm/xlnx-zynqmp.c | 11 ++++++++++-
> include/hw/arm/xlnx-versal.h | 1 +
> include/hw/arm/xlnx-zynqmp.h | 1 +
> 4 files changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/xlnx-versal.c b/hw/arm/xlnx-versal.c
> index 60bf5fe657..cb79b855fd 100644
> --- a/hw/arm/xlnx-versal.c
> +++ b/hw/arm/xlnx-versal.c
> @@ -252,9 +252,13 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
> NICInfo *nd = &nd_table[i];
> DeviceState *dev;
> MemoryRegion *mr;
> + OrIRQState *or_irq;
>
> object_initialize_child(OBJECT(s), name, &s->lpd.iou.gem[i],
> TYPE_CADENCE_GEM);
> + or_irq = &s->lpd.iou.gem_irq_orgate[i];
> + object_initialize_child(OBJECT(s), "gem-irq-orgate[*]",
> + or_irq, TYPE_OR_IRQ);
> dev = DEVICE(&s->lpd.iou.gem[i]);
> /* FIXME use qdev NIC properties instead of nd_table[] */
> if (nd->used) {
> @@ -264,6 +268,11 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
> object_property_set_int(OBJECT(dev), "phy-addr", 23, &error_abort);
> object_property_set_int(OBJECT(dev), "num-priority-queues", 2,
> &error_abort);
> + object_property_set_int(OBJECT(or_irq),
> + "num-lines", 2, &error_fatal);
> + qdev_realize(DEVICE(or_irq), NULL, &error_fatal);
> + qdev_connect_gpio_out(DEVICE(or_irq), 0, pic[irqs[i]]);
> +
> object_property_set_link(OBJECT(dev), "dma", OBJECT(&s->mr_ps),
> &error_abort);
> sysbus_realize(SYS_BUS_DEVICE(dev), &error_fatal);
> @@ -271,7 +280,8 @@ static void versal_create_gems(Versal *s, qemu_irq *pic)
> mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
> memory_region_add_subregion(&s->mr_ps, addrs[i], mr);
>
> - sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic[irqs[i]]);
> + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, qdev_get_gpio_in(DEVICE(or_irq), 0));
> + sysbus_connect_irq(SYS_BUS_DEVICE(dev), 1, qdev_get_gpio_in(DEVICE(or_irq), 1));
> g_free(name);
> }
> }
> diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
> index 5905a33015..f7158e4fd3 100644
> --- a/hw/arm/xlnx-zynqmp.c
> +++ b/hw/arm/xlnx-zynqmp.c
> @@ -392,6 +392,8 @@ static void xlnx_zynqmp_init(Object *obj)
>
> for (i = 0; i < XLNX_ZYNQMP_NUM_GEMS; i++) {
> object_initialize_child(obj, "gem[*]", &s->gem[i], TYPE_CADENCE_GEM);
> + object_initialize_child(obj, "gem-irq-orgate[*]",
> + &s->gem_irq_orgate[i], TYPE_OR_IRQ);
> }
>
> for (i = 0; i < XLNX_ZYNQMP_NUM_UARTS; i++) {
> @@ -629,12 +631,19 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
> &error_abort);
> object_property_set_int(OBJECT(&s->gem[i]), "num-priority-queues", 2,
> &error_abort);
> + object_property_set_int(OBJECT(&s->gem_irq_orgate[i]),
> + "num-lines", 2, &error_fatal);
> + qdev_realize(DEVICE(&s->gem_irq_orgate[i]), NULL, &error_fatal);
> + qdev_connect_gpio_out(DEVICE(&s->gem_irq_orgate[i]), 0, gic_spi[gem_intr[i]]);
> +
> if (!sysbus_realize(SYS_BUS_DEVICE(&s->gem[i]), errp)) {
> return;
> }
> sysbus_mmio_map(SYS_BUS_DEVICE(&s->gem[i]), 0, gem_addr[i]);
> sysbus_connect_irq(SYS_BUS_DEVICE(&s->gem[i]), 0,
> - gic_spi[gem_intr[i]]);
> + qdev_get_gpio_in(DEVICE(&s->gem_irq_orgate[i]), 0));
> + sysbus_connect_irq(SYS_BUS_DEVICE(&s->gem[i]), 1,
> + qdev_get_gpio_in(DEVICE(&s->gem_irq_orgate[i]), 1));
> }
>
> for (i = 0; i < XLNX_ZYNQMP_NUM_UARTS; i++) {
> diff --git a/include/hw/arm/xlnx-versal.h b/include/hw/arm/xlnx-versal.h
> index 39ee31185c..d34c763329 100644
> --- a/include/hw/arm/xlnx-versal.h
> +++ b/include/hw/arm/xlnx-versal.h
> @@ -74,6 +74,7 @@ struct Versal {
> struct {
> PL011State uart[XLNX_VERSAL_NR_UARTS];
> CadenceGEMState gem[XLNX_VERSAL_NR_GEMS];
> + OrIRQState gem_irq_orgate[XLNX_VERSAL_NR_GEMS];
> XlnxZDMA adma[XLNX_VERSAL_NR_ADMAS];
> VersalUsb2 usb;
> CanBusState *canbus[XLNX_VERSAL_NR_CANFD];
> diff --git a/include/hw/arm/xlnx-zynqmp.h b/include/hw/arm/xlnx-zynqmp.h
> index 687c75e3b0..7e5abce467 100644
> --- a/include/hw/arm/xlnx-zynqmp.h
> +++ b/include/hw/arm/xlnx-zynqmp.h
> @@ -117,6 +117,7 @@ struct XlnxZynqMPState {
> MemoryRegion mr_unimp[XLNX_ZYNQMP_NUM_UNIMP_AREAS];
>
> CadenceGEMState gem[XLNX_ZYNQMP_NUM_GEMS];
> + OrIRQState gem_irq_orgate[XLNX_ZYNQMP_NUM_GEMS];
> CadenceUARTState uart[XLNX_ZYNQMP_NUM_UARTS];
> XlnxZynqMPCANState can[XLNX_ZYNQMP_NUM_CAN];
> SysbusAHCIState sata;
> --
> 2.30.2
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] hw/arm/xlnx: Connect secondary CGEM IRQs
2023-06-16 14:38 [PATCH v2] hw/arm/xlnx: Connect secondary CGEM IRQs Kinsey Moore
2023-06-16 20:25 ` Francisco Iglesias
@ 2023-06-17 22:50 ` Philippe Mathieu-Daudé
2023-07-10 14:09 ` Francisco Iglesias
1 sibling, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-06-17 22:50 UTC (permalink / raw)
To: Kinsey Moore, qemu-devel
On 16/6/23 16:38, Kinsey Moore wrote:
> The Cadence GEM peripherals as configured for Zynq MPSoC and Versal
> platforms have two priority queues with separate interrupt sources for
> each. If the interrupt source for the second priority queue is not
> connected, they work in polling mode only. This change connects the
> second interrupt source for platforms where it is available. This patch
> has been tested using the lwIP stack with a Xilinx-supplied driver from
> their embeddedsw repository.
>
> Signed-off-by: Kinsey Moore <kinsey.moore@oarcorp.com>
> ---
> hw/arm/xlnx-versal.c | 12 +++++++++++-
> hw/arm/xlnx-zynqmp.c | 11 ++++++++++-
> include/hw/arm/xlnx-versal.h | 1 +
> include/hw/arm/xlnx-zynqmp.h | 1 +
> 4 files changed, 23 insertions(+), 2 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] hw/arm/xlnx: Connect secondary CGEM IRQs
2023-06-17 22:50 ` Philippe Mathieu-Daudé
@ 2023-07-10 14:09 ` Francisco Iglesias
2024-09-25 19:34 ` Kinsey Moore
0 siblings, 1 reply; 6+ messages in thread
From: Francisco Iglesias @ 2023-07-10 14:09 UTC (permalink / raw)
To: peter.maydell; +Cc: Kinsey Moore, qemu-devel, philmd
+PMM (I think this one might have fallen throught the cracks)
Best regards,
Francisco Iglesias
On [2023 Jun 18] Sun 00:50:47, Philippe Mathieu-Daudé wrote:
> On 16/6/23 16:38, Kinsey Moore wrote:
> > The Cadence GEM peripherals as configured for Zynq MPSoC and Versal
> > platforms have two priority queues with separate interrupt sources for
> > each. If the interrupt source for the second priority queue is not
> > connected, they work in polling mode only. This change connects the
> > second interrupt source for platforms where it is available. This patch
> > has been tested using the lwIP stack with a Xilinx-supplied driver from
> > their embeddedsw repository.
> >
> > Signed-off-by: Kinsey Moore <kinsey.moore@oarcorp.com>
> > ---
> > hw/arm/xlnx-versal.c | 12 +++++++++++-
> > hw/arm/xlnx-zynqmp.c | 11 ++++++++++-
> > include/hw/arm/xlnx-versal.h | 1 +
> > include/hw/arm/xlnx-zynqmp.h | 1 +
> > 4 files changed, 23 insertions(+), 2 deletions(-)
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH v2] hw/arm/xlnx: Connect secondary CGEM IRQs
2023-07-10 14:09 ` Francisco Iglesias
@ 2024-09-25 19:34 ` Kinsey Moore
2024-09-27 16:48 ` Peter Maydell
0 siblings, 1 reply; 6+ messages in thread
From: Kinsey Moore @ 2024-09-25 19:34 UTC (permalink / raw)
To: Francisco Iglesias, peter.maydell@linaro.org
Cc: qemu-devel@nongnu.org, philmd@linaro.org
Hey,
I just wanted to check on the status of this patch since it's been sitting for a bit now and I noticed it hasn't gone into any branches. Is this waiting on something from me?
Thanks,
Kinsey
-----Original Message-----
From: Francisco Iglesias <frasse.iglesias@gmail.com>
Sent: Monday, July 10, 2023 09:10
To: peter.maydell@linaro.org
Cc: Kinsey Moore <kinsey.moore@oarcorp.com>; qemu-devel@nongnu.org; philmd@linaro.org
Subject: Re: [PATCH v2] hw/arm/xlnx: Connect secondary CGEM IRQs
+PMM (I think this one might have fallen throught the cracks)
Best regards,
Francisco Iglesias
On [2023 Jun 18] Sun 00:50:47, Philippe Mathieu-Daudé wrote:
> On 16/6/23 16:38, Kinsey Moore wrote:
> > The Cadence GEM peripherals as configured for Zynq MPSoC and Versal
> > platforms have two priority queues with separate interrupt sources for
> > each. If the interrupt source for the second priority queue is not
> > connected, they work in polling mode only. This change connects the
> > second interrupt source for platforms where it is available. This patch
> > has been tested using the lwIP stack with a Xilinx-supplied driver from
> > their embeddedsw repository.
> >
> > Signed-off-by: Kinsey Moore <kinsey.moore@oarcorp.com>
> > ---
> > hw/arm/xlnx-versal.c | 12 +++++++++++-
> > hw/arm/xlnx-zynqmp.c | 11 ++++++++++-
> > include/hw/arm/xlnx-versal.h | 1 +
> > include/hw/arm/xlnx-zynqmp.h | 1 +
> > 4 files changed, 23 insertions(+), 2 deletions(-)
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] hw/arm/xlnx: Connect secondary CGEM IRQs
2024-09-25 19:34 ` Kinsey Moore
@ 2024-09-27 16:48 ` Peter Maydell
0 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2024-09-27 16:48 UTC (permalink / raw)
To: Kinsey Moore; +Cc: Francisco Iglesias, qemu-devel@nongnu.org, philmd@linaro.org
On Wed, 25 Sept 2024 at 20:34, Kinsey Moore <kinsey.moore@oarcorp.com> wrote:
>
> Hey,
> I just wanted to check on the status of this patch since it's been sitting for a bit now and I noticed it hasn't gone into any branches. Is this waiting on something from me?
No, I'm afraid I just hadn't noticed it to pick it up.
I've applied it to target-arm.next now; sorry about the delay.
(Generally if nothing seems to have happened to a patch
you can 'ping' it on the mailing list after a couple of weeks
to get somebody's attention on it.)
thanks
-- PMM
> Thanks,
> Kinsey
>
> -----Original Message-----
> From: Francisco Iglesias <frasse.iglesias@gmail.com>
> Sent: Monday, July 10, 2023 09:10
> To: peter.maydell@linaro.org
> Cc: Kinsey Moore <kinsey.moore@oarcorp.com>; qemu-devel@nongnu.org; philmd@linaro.org
> Subject: Re: [PATCH v2] hw/arm/xlnx: Connect secondary CGEM IRQs
>
>
> +PMM (I think this one might have fallen throught the cracks)
>
> Best regards,
> Francisco Iglesias
>
> On [2023 Jun 18] Sun 00:50:47, Philippe Mathieu-Daudé wrote:
> > On 16/6/23 16:38, Kinsey Moore wrote:
> > > The Cadence GEM peripherals as configured for Zynq MPSoC and Versal
> > > platforms have two priority queues with separate interrupt sources for
> > > each. If the interrupt source for the second priority queue is not
> > > connected, they work in polling mode only. This change connects the
> > > second interrupt source for platforms where it is available. This patch
> > > has been tested using the lwIP stack with a Xilinx-supplied driver from
> > > their embeddedsw repository.
> > >
> > > Signed-off-by: Kinsey Moore <kinsey.moore@oarcorp.com>
> > > ---
> > > hw/arm/xlnx-versal.c | 12 +++++++++++-
> > > hw/arm/xlnx-zynqmp.c | 11 ++++++++++-
> > > include/hw/arm/xlnx-versal.h | 1 +
> > > include/hw/arm/xlnx-zynqmp.h | 1 +
> > > 4 files changed, 23 insertions(+), 2 deletions(-)
> >
> > Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> >
> >
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-09-27 16:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-16 14:38 [PATCH v2] hw/arm/xlnx: Connect secondary CGEM IRQs Kinsey Moore
2023-06-16 20:25 ` Francisco Iglesias
2023-06-17 22:50 ` Philippe Mathieu-Daudé
2023-07-10 14:09 ` Francisco Iglesias
2024-09-25 19:34 ` Kinsey Moore
2024-09-27 16:48 ` Peter Maydell
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).