From 87e5a4f8c23236a559c63ca089c35d3e6066d3df Mon Sep 17 00:00:00 2001 From: BALATON Zoltan Date: Fri, 28 Oct 2022 13:56:25 +0200 Subject: [PATCH] hw/ppc/mac.h: Move grackle-pcihost type declaration out to a header Signed-off-by: BALATON Zoltan Reviewed-by: Mark Cave-Ayland Message-Id: Signed-off-by: Mark Cave-Ayland --- MAINTAINERS | 1 + hw/pci-host/grackle.c | 14 +-------- hw/ppc/mac.h | 3 -- hw/ppc/mac_oldworld.c | 1 + hw/ppc/mac.h => include/hw/pci-host/grackle.h | 42 +++++++++------------------ 5 files changed, 17 insertions(+), 44 deletions(-) copy hw/ppc/mac.h => include/hw/pci-host/grackle.h (61%) diff --git a/MAINTAINERS b/MAINTAINERS index c41d8d65e2..9f424bceb1 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1344,6 +1344,7 @@ F: hw/intc/heathrow_pic.c F: hw/input/adb* F: include/hw/intc/heathrow_pic.h F: include/hw/input/adb* +F: include/hw/pci-host/grackle.h F: pc-bios/qemu_vga.ndrv PReP diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index b05facf463..e4c7303859 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -24,7 +24,6 @@ */ #include "qemu/osdep.h" -#include "hw/pci/pci_host.h" #include "hw/ppc/mac.h" #include "hw/qdev-properties.h" #include "hw/pci/pci.h" @@ -33,18 +32,7 @@ #include "qemu/module.h" #include "trace.h" #include "qom/object.h" - -OBJECT_DECLARE_SIMPLE_TYPE(GrackleState, GRACKLE_PCI_HOST_BRIDGE) - -struct GrackleState { - PCIHostState parent_obj; - - uint32_t ofw_addr; - qemu_irq irqs[4]; - MemoryRegion pci_mmio; - MemoryRegion pci_hole; - MemoryRegion pci_io; -}; +#include "hw/pci-host/grackle.h" /* Don't know if this matches real hardware, but it agrees with OHW. */ static int pci_grackle_map_irq(PCIDevice *pci_dev, int irq_num) diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index 55cb02c990..fe77a6c6db 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -35,9 +35,6 @@ #define KERNEL_LOAD_ADDR 0x01000000 #define KERNEL_GAP 0x00100000 -/* Grackle PCI */ -#define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" - /* Mac NVRAM */ #define TYPE_MACIO_NVRAM "macio-nvram" OBJECT_DECLARE_SIMPLE_TYPE(MacIONVRAMState, MACIO_NVRAM) diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index f323a49d7a..47a1abf248 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -38,6 +38,7 @@ #include "hw/isa/isa.h" #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" +#include "hw/pci-host/grackle.h" #include "hw/nvram/fw_cfg.h" #include "hw/char/escc.h" #include "hw/misc/macio/macio.h" diff --git a/hw/ppc/mac.h b/include/hw/pci-host/grackle.h similarity index 61% copy from hw/ppc/mac.h copy to include/hw/pci-host/grackle.h index 55cb02c990..7ad3a779f0 100644 --- a/hw/ppc/mac.h +++ b/include/hw/pci-host/grackle.h @@ -1,7 +1,7 @@ /* - * QEMU PowerMac emulation shared definitions and prototypes + * QEMU Grackle PCI host (heathrow OldWorld PowerMac) * - * Copyright (c) 2004-2007 Fabrice Bellard + * Copyright (c) 2006-2007 Fabrice Bellard * Copyright (c) 2007 Jocelyn Mayer * * Permission is hereby granted, free of charge, to any person obtaining a copy @@ -23,36 +23,22 @@ * THE SOFTWARE. */ -#ifndef PPC_MAC_H -#define PPC_MAC_H +#ifndef GRACKLE_H +#define GRACKLE_H -#include "exec/memory.h" -#include "hw/sysbus.h" +#include "hw/pci/pci_host.h" -#define NVRAM_SIZE 0x2000 -#define PROM_FILENAME "openbios-ppc" - -#define KERNEL_LOAD_ADDR 0x01000000 -#define KERNEL_GAP 0x00100000 - -/* Grackle PCI */ #define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" +OBJECT_DECLARE_SIMPLE_TYPE(GrackleState, GRACKLE_PCI_HOST_BRIDGE) -/* Mac NVRAM */ -#define TYPE_MACIO_NVRAM "macio-nvram" -OBJECT_DECLARE_SIMPLE_TYPE(MacIONVRAMState, MACIO_NVRAM) - -struct MacIONVRAMState { - /*< private >*/ - SysBusDevice parent_obj; - /*< public >*/ - - uint32_t size; - uint32_t it_shift; +struct GrackleState { + PCIHostState parent_obj; - MemoryRegion mem; - uint8_t *data; + uint32_t ofw_addr; + qemu_irq irqs[4]; + MemoryRegion pci_mmio; + MemoryRegion pci_hole; + MemoryRegion pci_io; }; -void pmac_format_nvram_partition (MacIONVRAMState *nvr, int len); -#endif /* PPC_MAC_H */ +#endif -- 2.11.4.GIT