Skip to contentSkip to conversation

hw/arm: versal: Correct number of IRQs in GIC setup

PATCH Applied Edgar E. Iglesias 4 participants 11 messages Nov 29, 2018 – Dec 3, 2018

lore
Share & tools
lore
#0 lore raw

cover hw/arm: versal: Correct number of IRQs in GIC setup

From: "Edgar E. Iglesias" <[email protected]>

The Versal GIC has 192 IRQs not 256 as we previously had setup. This series fixes the setup and moves the virtio-mmio nodes to use other reserved interrupts.

Since we don't have 32 reserved lines, we also reduce the number of virtio-mmio regions to 8 (we do have some more lines free but let's leave some for future use).

Cheers,
Edgar

Edgar E. Iglesias (4):
hw/arm: versal: Remove bogus virtio-mmio creation hw/arm: versal: Reduce number of virtio-mmio instances hw/arm: versal: Use IRQs 111 - 118 for virtio-mmio hw/arm: versal: Correct the nr of IRQs to 192

 hw/arm/xlnx-versal-virt.c    | 7 +++----
 include/hw/arm/xlnx-versal.h | 8 ++++----
 2 files changed, 7 insertions(+), 8 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/4 hw/arm: versal: Remove bogus virtio-mmio creation

From: "Edgar E. Iglesias" <[email protected]>

Remove bogus virtio-mmio creation. This was an accidental left-over an experiment.

---
 hw/arm/xlnx-versal-virt.c | 1 -
 1 file changed, 1 deletion(-)
hw/arm/xlnx-versal-virt.c +0 -1
index 1e31a3f442..41b8d801c8 100644
@@ -364,7 +364,6 @@ static void create_virtio_regions(VersalVirt *s)
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic_irq);
         mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
         memory_region_add_subregion(&s->soc.mr_ps, base, mr);
-        sysbus_create_simple("virtio-mmio", base, pic_irq);
     }
 
     for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
Signature · 1 line
2.17.1
Reviewed-by on v1 1/4
#2 lore raw

Re: [Qemu-devel] [PATCH v1 1/4] hw/arm: versal: Remove bogus virtio-mmio creation

Quoted 7 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Remove bogus virtio-mmio creation. This was an accidental left-over an experiment.

Alistair

Quoted 20 lines
---
 hw/arm/xlnx-versal-virt.c | 1 -
 1 file changed, 1 deletion(-)
hw/arm/xlnx-versal-virt.c +0 -2
index 1e31a3f442..41b8d801c8 100644
@@ -364,7 +364,6 @@ static void create_virtio_regions(VersalVirt *s)
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic_irq);
         mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
         memory_region_add_subregion(&s->soc.mr_ps, base, mr);
-        sysbus_create_simple("virtio-mmio", base, pic_irq);
     }
 
     for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
--

2.17.1

Reviewed-by on v1 1/4
#3 lore raw

Re: [Qemu-arm] [PATCH v1 1/4] hw/arm: versal: Remove bogus virtio-mmio creation

In reply to Edgar E. Iglesias
Quoted 6 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Remove bogus virtio-mmio creation. This was an accidental left-over an experiment.

Luc

Quoted 17 lines
---
 hw/arm/xlnx-versal-virt.c | 1 -
 1 file changed, 1 deletion(-)
hw/arm/xlnx-versal-virt.c +0 -1
index 1e31a3f442..41b8d801c8 100644
@@ -364,7 +364,6 @@ static void create_virtio_regions(VersalVirt *s)
         sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic_irq);
         mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
         memory_region_add_subregion(&s->soc.mr_ps, base, mr);
-        sysbus_create_simple("virtio-mmio", base, pic_irq);
     }
 
     for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
#4 lore raw

PATCH 2/4 hw/arm: versal: Reduce number of virtio-mmio instances

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Reduce number of virtio-mmio instances. This is in preparation for correcting the interrupt setup for Versal.

---
 hw/arm/xlnx-versal-virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/xlnx-versal-virt.c +1 -1
index 41b8d801c8..2ed6ee9934 100644
@@ -342,7 +342,7 @@ static void *versal_virt_get_dtb(const struct arm_boot_info *binfo,
     return board->fdt;
 }
 
-#define NUM_VIRTIO_TRANSPORT 32
+#define NUM_VIRTIO_TRANSPORT 8
 static void create_virtio_regions(VersalVirt *s)
 {
     int virtio_mmio_size = 0x200;
Signature · 1 line
2.17.1
Reviewed-by on v1 2/4
#5 lore raw

Re: [Qemu-arm] [Qemu-devel] [PATCH v1 2/4] hw/arm: versal: Reduce number of virtio-mmio instances

Quoted 7 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Reduce number of virtio-mmio instances. This is in preparation for correcting the interrupt setup for Versal.

Alistair

Quoted 21 lines
---
 hw/arm/xlnx-versal-virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/xlnx-versal-virt.c +1 -2
index 41b8d801c8..2ed6ee9934 100644
@@ -342,7 +342,7 @@ static void *versal_virt_get_dtb(const struct arm_boot_info *binfo,
     return board->fdt;
 }
 
-#define NUM_VIRTIO_TRANSPORT 32
+#define NUM_VIRTIO_TRANSPORT 8
 static void create_virtio_regions(VersalVirt *s)
 {
     int virtio_mmio_size = 0x200;
--

2.17.1

#6 lore raw

PATCH 3/4 hw/arm: versal: Use IRQs 111 - 118 for virtio-mmio

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Use IRQs 111 - 118 for virtio-mmio. The interrupts we're currently using 160+ are not available in the Versal GIC.

---
 hw/arm/xlnx-versal-virt.c    | 4 ++--
 include/hw/arm/xlnx-versal.h | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
hw/arm/xlnx-versal-virt.c +2 -2
index 2ed6ee9934..c6feeac532 100644
@@ -351,7 +351,7 @@ static void create_virtio_regions(VersalVirt *s)
     for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
         char *name = g_strdup_printf("virtio%d", i);;
         hwaddr base = MM_TOP_RSVD + i * virtio_mmio_size;
-        int irq = VERSAL_RSVD_HIGH_IRQ_FIRST + i;
+        int irq = VERSAL_RSVD_IRQ_FIRST + i;
         MemoryRegion *mr;
         DeviceState *dev;
         qemu_irq pic_irq;
@@ -368,7 +368,7 @@ static void create_virtio_regions(VersalVirt *s)
 
     for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
         hwaddr base = MM_TOP_RSVD + i * virtio_mmio_size;
-        int irq = VERSAL_RSVD_HIGH_IRQ_FIRST + i;
+        int irq = VERSAL_RSVD_IRQ_FIRST + i;
         char *name = g_strdup_printf("/virtio_mmio@%" PRIx64, base);
 
         qemu_fdt_add_subnode(s->fdt, name);
include/hw/arm/xlnx-versal.h +3 -3
index 9da621e4b6..76fb9de391 100644
@@ -75,9 +75,9 @@ typedef struct Versal {
 #define VERSAL_GEM1_IRQ_0          58
 #define VERSAL_GEM1_WAKE_IRQ_0     59
 
-/* Architecturally eserved IRQs suitable for virtualization.  */
-#define VERSAL_RSVD_HIGH_IRQ_FIRST 160
-#define VERSAL_RSVD_HIGH_IRQ_LAST  255
+/* Architecturally reserved IRQs suitable for virtualization.  */
+#define VERSAL_RSVD_IRQ_FIRST 111
+#define VERSAL_RSVD_IRQ_LAST  118
 
 #define MM_TOP_RSVD                 0xa0000000U
 #define MM_TOP_RSVD_SIZE            0x4000000
Signature · 1 line
2.17.1
Reviewed-by on v1 3/4
#7 lore raw

Re: [Qemu-arm] [Qemu-devel] [PATCH v1 3/4] hw/arm: versal: Use IRQs 111 - 118 for virtio-mmio

Quoted 7 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Use IRQs 111 - 118 for virtio-mmio. The interrupts we're currently using 160+ are not available in the Versal GIC.

Alistair

Quoted 48 lines
---
 hw/arm/xlnx-versal-virt.c    | 4 ++--
 include/hw/arm/xlnx-versal.h | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
hw/arm/xlnx-versal-virt.c +2 -2
index 2ed6ee9934..c6feeac532 100644
@@ -351,7 +351,7 @@ static void create_virtio_regions(VersalVirt *s)
     for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
         char *name = g_strdup_printf("virtio%d", i);;
         hwaddr base = MM_TOP_RSVD + i * virtio_mmio_size;
-        int irq = VERSAL_RSVD_HIGH_IRQ_FIRST + i;
+        int irq = VERSAL_RSVD_IRQ_FIRST + i;
         MemoryRegion *mr;
         DeviceState *dev;
         qemu_irq pic_irq;
@@ -368,7 +368,7 @@ static void create_virtio_regions(VersalVirt *s)
 
     for (i = 0; i < NUM_VIRTIO_TRANSPORT; i++) {
         hwaddr base = MM_TOP_RSVD + i * virtio_mmio_size;
-        int irq = VERSAL_RSVD_HIGH_IRQ_FIRST + i;
+        int irq = VERSAL_RSVD_IRQ_FIRST + i;
         char *name = g_strdup_printf("/virtio_mmio@%" PRIx64, base);
 
         qemu_fdt_add_subnode(s->fdt, name);
include/hw/arm/xlnx-versal.h +3 -4
index 9da621e4b6..76fb9de391 100644
@@ -75,9 +75,9 @@ typedef struct Versal {
 #define VERSAL_GEM1_IRQ_0          58
 #define VERSAL_GEM1_WAKE_IRQ_0     59
 
-/* Architecturally eserved IRQs suitable for virtualization.  */
-#define VERSAL_RSVD_HIGH_IRQ_FIRST 160
-#define VERSAL_RSVD_HIGH_IRQ_LAST  255
+/* Architecturally reserved IRQs suitable for virtualization.  */
+#define VERSAL_RSVD_IRQ_FIRST 111
+#define VERSAL_RSVD_IRQ_LAST  118
 
 #define MM_TOP_RSVD                 0xa0000000U
 #define MM_TOP_RSVD_SIZE            0x4000000
--

2.17.1

#8 lore raw

PATCH 4/4 hw/arm: versal: Correct the nr of IRQs to 192

In reply to Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Correct the nr of IRQs to 192.

---
 include/hw/arm/xlnx-versal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/arm/xlnx-versal.h +1 -1
index 76fb9de391..ec7c859d08 100644
@@ -22,7 +22,7 @@
 #define XLNX_VERSAL_NR_ACPUS   2
 #define XLNX_VERSAL_NR_UARTS   2
 #define XLNX_VERSAL_NR_GEMS    2
-#define XLNX_VERSAL_NR_IRQS    256
+#define XLNX_VERSAL_NR_IRQS    192
 
 typedef struct Versal {
     /*< private >*/
Signature · 1 line
2.17.1
Reviewed-by on v1 4/4
#9 lore raw

Re: [Qemu-arm] [Qemu-devel] [PATCH v1 4/4] hw/arm: versal: Correct the nr of IRQs to 192

Quoted 6 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

Correct the nr of IRQs to 192.

Alistair

Quoted 21 lines
---
 include/hw/arm/xlnx-versal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/hw/arm/xlnx-versal.h +1 -2
index 76fb9de391..ec7c859d08 100644
@@ -22,7 +22,7 @@
 #define XLNX_VERSAL_NR_ACPUS   2
 #define XLNX_VERSAL_NR_UARTS   2
 #define XLNX_VERSAL_NR_GEMS    2
-#define XLNX_VERSAL_NR_IRQS    256
+#define XLNX_VERSAL_NR_IRQS    192
 
 typedef struct Versal {
     /*< private >*/
--

2.17.1

#10 lore raw
In reply to Edgar E. Iglesias
Quoted 11 lines · Edgar E. Iglesias

From: "Edgar E. Iglesias" <[email protected]>

The Versal GIC has 192 IRQs not 256 as we previously had setup. This series fixes the setup and moves the virtio-mmio nodes to use other reserved interrupts.

Since we don't have 32 reserved lines, we also reduce the number of virtio-mmio regions to 8 (we do have some more lines free but let's leave some for future use).

Quoted 8 lines

Cheers,
Edgar

Edgar E. Iglesias (4):
hw/arm: versal: Remove bogus virtio-mmio creation hw/arm: versal: Reduce number of virtio-mmio instances hw/arm: versal: Use IRQs 111 - 118 for virtio-mmio hw/arm: versal: Correct the nr of IRQs to 192

Applied to target-arm.next for 4.0, thanks.

-- PMM