[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 11/49] mac_oldworld: remove pics IRQ array and wire up
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 11/49] mac_oldworld: remove pics IRQ array and wire up macio to heathrow directly |
Date: |
Fri, 27 Apr 2018 19:20:48 +1000 |
From: Mark Cave-Ayland <address@hidden>
Introduce constants for the pre-defined Old World IRQs to help keep things
readable.
Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/mac.h | 8 ++++++++
hw/ppc/mac_oldworld.c | 27 ++++++++++++++-------------
2 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h
index 93f25d7acb..c5a33e96cb 100644
--- a/hw/ppc/mac.h
+++ b/hw/ppc/mac.h
@@ -47,6 +47,14 @@
#define ESCC_CLOCK 3686400
+/* Old World IRQs */
+#define OLDWORLD_CUDA_IRQ 0x12
+#define OLDWORLD_ESCCB_IRQ 0x10
+#define OLDWORLD_ESCCA_IRQ 0xf
+#define OLDWORLD_IDE0_IRQ 0xd
+#define OLDWORLD_IDE0_DMA_IRQ 0x2
+#define OLDWORLD_IDE1_IRQ 0xe
+#define OLDWORLD_IDE1_DMA_IRQ 0x3
/* MacIO */
#define TYPE_MACIO_IDE "macio-ide"
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index f9e63b8d83..2bbcefa076 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -87,7 +87,6 @@ static void ppc_heathrow_init(MachineState *machine)
PowerPCCPU *cpu = NULL;
CPUPPCState *env = NULL;
char *filename;
- qemu_irq *pic;
int linux_boot, i;
MemoryRegion *ram = g_new(MemoryRegion, 1);
MemoryRegion *bios = g_new(MemoryRegion, 1);
@@ -241,11 +240,6 @@ static void ppc_heathrow_init(MachineState *machine)
}
}
- pic = g_new0(qemu_irq, HEATHROW_NUM_IRQS);
- for (i = 0; i < HEATHROW_NUM_IRQS; i++) {
- pic[i] = qdev_get_gpio_in(pic_dev, i);
- }
-
/* Timebase Frequency */
if (kvm_enabled()) {
tbfreq = kvmppc_get_tbfreq();
@@ -287,13 +281,20 @@ static void ppc_heathrow_init(MachineState *machine)
/* MacIO */
macio = OLDWORLD_MACIO(pci_create(pci_bus, -1, TYPE_OLDWORLD_MACIO));
dev = DEVICE(macio);
- qdev_connect_gpio_out(dev, 0, pic[0x12]); /* CUDA */
- qdev_connect_gpio_out(dev, 1, pic[0x10]); /* ESCC-B */
- qdev_connect_gpio_out(dev, 2, pic[0x0F]); /* ESCC-A */
- qdev_connect_gpio_out(dev, 3, pic[0x0D]); /* IDE-0 */
- qdev_connect_gpio_out(dev, 4, pic[0x02]); /* IDE-0 DMA */
- qdev_connect_gpio_out(dev, 5, pic[0x0E]); /* IDE-1 */
- qdev_connect_gpio_out(dev, 6, pic[0x03]); /* IDE-1 DMA */
+ qdev_connect_gpio_out(dev, 0,
+ qdev_get_gpio_in(pic_dev, OLDWORLD_CUDA_IRQ));
+ qdev_connect_gpio_out(dev, 1,
+ qdev_get_gpio_in(pic_dev, OLDWORLD_ESCCB_IRQ));
+ qdev_connect_gpio_out(dev, 2,
+ qdev_get_gpio_in(pic_dev, OLDWORLD_ESCCA_IRQ));
+ qdev_connect_gpio_out(dev, 3,
+ qdev_get_gpio_in(pic_dev, OLDWORLD_IDE0_IRQ));
+ qdev_connect_gpio_out(dev, 4,
+ qdev_get_gpio_in(pic_dev, OLDWORLD_IDE0_DMA_IRQ));
+ qdev_connect_gpio_out(dev, 5,
+ qdev_get_gpio_in(pic_dev, OLDWORLD_IDE1_IRQ));
+ qdev_connect_gpio_out(dev, 6,
+ qdev_get_gpio_in(pic_dev, OLDWORLD_IDE1_DMA_IRQ));
qdev_prop_set_uint64(dev, "frequency", tbfreq);
object_property_set_link(OBJECT(macio), OBJECT(pic_dev), "pic",
&error_abort);
--
2.14.3
- [Qemu-ppc] [PULL 00/49] ppc-for-2.13 queue 20180427, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 04/49] uninorth: remove stray PCIBus realize from mac_newworld.c, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 01/49] uninorth: trivial style fixups, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 02/49] uninorth: remove second set of uninorth token registers, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 03/49] uninorth: QOMify PCI and AGP host bridges, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 09/49] grackle: remove deprecated pci_grackle_init() function, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 07/49] heathrow: remove obsolete heathow_init() function, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 08/49] grackle: general tidy-up and QOMify, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 11/49] mac_oldworld: remove pics IRQ array and wire up macio to heathrow directly,
David Gibson <=
- [Qemu-ppc] [PULL 14/49] uninorth: introduce temporary pic_irqs device property, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 10/49] grackle: move PCI IO (ISA) memory region into the grackle device, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 12/49] mac_oldworld: move wiring of macio IRQs to macio_oldworld_realize(), David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 16/49] uninorth: fix PCI and AGP bus mixup, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 13/49] uninorth: move PCI mmio memory region initialisation into init function, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 06/49] uninorth: alter pci_pmac_init() and pci_pmac_u3_init() to return uninorth device, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 05/49] uninorth: move uninorth definitions into uninorth.h, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 19/49] uninorth: remove obsolete pci_pmac_u3_init() function, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 17/49] uninorth: enable internal PCI host bridge, David Gibson, 2018/04/27
- [Qemu-ppc] [PULL 24/49] target/ppc: Fix reserved bit mask of dstst instruction, David Gibson, 2018/04/27