[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 13/14] lsi53c895a: add optional external IRQ via qdev
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 13/14] lsi53c895a: add optional external IRQ via qdev |
Date: |
Tue, 25 Sep 2018 17:01:53 +1000 |
From: Mark Cave-Ayland <address@hidden>
On some early machines the on-board PCI devices IRQs are wired directly to
the interrupt controller instead of via the PCI host bridge.
Add an optional external IRQ that if wired up via qdev will replace the
in-built PCI IRQ.
Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: David Gibson <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Hervé Poussineau <address@hidden>
Tested-by: Hervé Poussineau <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/scsi/lsi53c895a.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index f5cbbf653c..996b40650d 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -207,6 +207,7 @@ typedef struct {
PCIDevice parent_obj;
/*< public >*/
+ qemu_irq ext_irq;
MemoryRegion mmio_io;
MemoryRegion ram_io;
MemoryRegion io_io;
@@ -443,9 +444,19 @@ static void lsi_stop_script(LSIState *s)
s->istat1 &= ~LSI_ISTAT1_SRUN;
}
-static void lsi_update_irq(LSIState *s)
+static void lsi_set_irq(LSIState *s, int level)
{
PCIDevice *d = PCI_DEVICE(s);
+
+ if (s->ext_irq) {
+ qemu_set_irq(s->ext_irq, level);
+ } else {
+ pci_set_irq(d, level);
+ }
+}
+
+static void lsi_update_irq(LSIState *s)
+{
int level;
static int last_level;
lsi_request *p;
@@ -477,7 +488,7 @@ static void lsi_update_irq(LSIState *s)
level, s->dstat, s->sist1, s->sist0);
last_level = level;
}
- pci_set_irq(d, level);
+ lsi_set_irq(s, level);
if (!level && lsi_irq_on_rsl(s) && !(s->scntl1 & LSI_SCNTL1_CON)) {
DPRINTF("Handled IRQs & disconnected, looking for pending "
@@ -2213,6 +2224,7 @@ static void lsi_scsi_realize(PCIDevice *dev, Error **errp)
"lsi-io", 256);
address_space_init(&s->pci_io_as, pci_address_space_io(dev), "lsi-pci-io");
+ qdev_init_gpio_out(d, &s->ext_irq, 1);
pci_register_bar(dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io_io);
pci_register_bar(dev, 1, PCI_BASE_ADDRESS_SPACE_MEMORY, &s->mmio_io);
--
2.17.1
- [Qemu-ppc] [PULL 05/14] 40p: use OR gate to wire up raven PCI interrupts, (continued)
- [Qemu-ppc] [PULL 05/14] 40p: use OR gate to wire up raven PCI interrupts, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 07/14] spapr: increase the size of the IRQ number space, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 04/14] raven: some minor IRQ-related tidy-ups, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 01/14] Record history of ppcemb target in common.json, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 12/14] scsi: remove unused lsi53c895a_create() and lsi53c810_create() functions, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 08/14] spapr_pci: add an extra 'nr_msis' argument to spapr_populate_pci_dt, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 09/14] sm501: Adjust endianness of pixel value in rectangle fill, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 14/14] 40p: add fixed IRQ routing for LSI SCSI device, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 11/14] scsi: move lsi53c8xx_create() callers to lsi53c8xx_handle_legacy_cmdline(), David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 10/14] scsi: add lsi53c8xx_handle_legacy_cmdline() function, David Gibson, 2018/09/25
- [Qemu-ppc] [PULL 13/14] lsi53c895a: add optional external IRQ via qdev,
David Gibson <=
- Re: [Qemu-ppc] [PULL 00/14] ppc-for-3.1 queue 20180925, Peter Maydell, 2018/09/25