From 0f4b5415c31ed1fee02f5826fe0d2d585806fa95 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Tue, 6 Mar 2018 20:30:50 +0000 Subject: uninorth: alter pci_pmac_init() and pci_pmac_u3_init() to return uninorth device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is in preparation for moving the device wiring into the New World machine. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Gibson --- hw/ppc/mac.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'hw/ppc/mac.h') diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index a02f797598..fcf13cb757 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -31,6 +31,8 @@ #include "hw/ide/internal.h" #include "hw/input/adb.h" #include "hw/misc/mos6522.h" +#include "hw/pci/pci_host.h" +#include "hw/pci-host/uninorth.h" /* SMP is not enabled, for now */ #define MAX_CPUS 1 @@ -86,12 +88,12 @@ PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic, MemoryRegion *address_space_io); /* UniNorth PCI */ -PCIBus *pci_pmac_init(qemu_irq *pic, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io); -PCIBus *pci_pmac_u3_init(qemu_irq *pic, +UNINState *pci_pmac_init(qemu_irq *pic, MemoryRegion *address_space_mem, MemoryRegion *address_space_io); +UNINState *pci_pmac_u3_init(qemu_irq *pic, + MemoryRegion *address_space_mem, + MemoryRegion *address_space_io); /* Mac NVRAM */ #define TYPE_MACIO_NVRAM "macio-nvram" -- cgit v1.2.3 From a5ed75fe2e6625b2ab9ed0694d7a5c95a74b84f7 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Tue, 6 Mar 2018 22:01:54 +0000 Subject: heathrow: remove obsolete heathow_init() function Instead wire up heathrow to the CPU and grackle PCI host using qdev GPIOs. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/ppc/mac.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'hw/ppc/mac.h') diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index fcf13cb757..d661515e9d 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -77,10 +77,6 @@ void macio_ide_register_dma(MACIOIDEState *ide); void macio_init(PCIDevice *dev, MemoryRegion *pic_mem); -/* Heathrow PIC */ -DeviceState *heathrow_pic_init(int nb_cpus, qemu_irq **irqs, - qemu_irq **pic_irqs); - /* Grackle PCI */ #define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic, -- cgit v1.2.3 From b0318ec10b2a97cac0cdce50a693a11f882c8549 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Tue, 6 Mar 2018 22:01:55 +0000 Subject: grackle: general tidy-up and QOMify This is the first step towards removing the old-style pci_grackle_init() function. Following on from the previous commit we can now pass the heathrow device as an object link and wire up the heathrow IRQs via qdev GPIOs. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/ppc/mac.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/ppc/mac.h') diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index d661515e9d..695557b8bf 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -79,7 +79,7 @@ void macio_init(PCIDevice *dev, /* Grackle PCI */ #define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" -PCIBus *pci_grackle_init(uint32_t base, qemu_irq *pic, +PCIBus *pci_grackle_init(uint32_t base, DeviceState *pic_dev, MemoryRegion *address_space_mem, MemoryRegion *address_space_io); -- cgit v1.2.3 From a773e64a8fd2a3ef97d6e405dbfb28c17660136d Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Tue, 6 Mar 2018 22:01:56 +0000 Subject: grackle: remove deprecated pci_grackle_init() function Instead wire up the grackle device inside the Mac Old World machine. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/ppc/mac.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'hw/ppc/mac.h') diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index 695557b8bf..93f25d7acb 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -79,9 +79,6 @@ void macio_init(PCIDevice *dev, /* Grackle PCI */ #define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" -PCIBus *pci_grackle_init(uint32_t base, DeviceState *pic_dev, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io); /* UniNorth PCI */ UNINState *pci_pmac_init(qemu_irq *pic, -- cgit v1.2.3 From ab1244b53d8781e1f2c3dcbdd890afe1b817ca02 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Tue, 6 Mar 2018 22:01:58 +0000 Subject: mac_oldworld: remove pics IRQ array and wire up macio to heathrow directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce constants for the pre-defined Old World IRQs to help keep things readable. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Gibson --- hw/ppc/mac.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'hw/ppc/mac.h') 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" -- cgit v1.2.3 From 32cde6154cd252bfa23d05f43a165797e2430ff4 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Tue, 6 Mar 2018 20:30:53 +0000 Subject: uninorth: move PCI host bridge bus initialisation into device realize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the IO address space is fixed to use the standard system IO address space then we can also use the opportunity to remove the address_space_io parameter from pci_pmac_init() and pci_pmac_u3_init(). Note we also move the default mac99 PCI bus to the end of the initialisation list so that it becomes the default destination for any devices specified via -device without an explicit PCI bus provided. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Gibson --- hw/ppc/mac.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'hw/ppc/mac.h') diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index c5a33e96cb..1ab2a3b354 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -90,11 +90,9 @@ void macio_init(PCIDevice *dev, /* UniNorth PCI */ UNINState *pci_pmac_init(qemu_irq *pic, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io); + MemoryRegion *address_space_mem); UNINState *pci_pmac_u3_init(qemu_irq *pic, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io); + MemoryRegion *address_space_mem); /* Mac NVRAM */ #define TYPE_MACIO_NVRAM "macio-nvram" -- cgit v1.2.3 From c90c393c2dca764bf2a062b3769ac0de32f5fe28 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Tue, 6 Mar 2018 20:31:00 +0000 Subject: uninorth: rename UNINState to UNINHostState MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The existing UNINState actually represents the PCI/AGP host bridge stage so rename it accordingly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Gibson --- hw/ppc/mac.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hw/ppc/mac.h') diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index 1ab2a3b354..892dd03789 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -89,10 +89,10 @@ void macio_init(PCIDevice *dev, #define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" /* UniNorth PCI */ -UNINState *pci_pmac_init(qemu_irq *pic, - MemoryRegion *address_space_mem); -UNINState *pci_pmac_u3_init(qemu_irq *pic, - MemoryRegion *address_space_mem); +UNINHostState *pci_pmac_init(qemu_irq *pic, + MemoryRegion *address_space_mem); +UNINHostState *pci_pmac_u3_init(qemu_irq *pic, + MemoryRegion *address_space_mem); /* Mac NVRAM */ #define TYPE_MACIO_NVRAM "macio-nvram" -- cgit v1.2.3