new file mode 100644
@@ -0,0 +1,34 @@
+/*
+ * Algorithmics Bonito64 'north bridge' controller
+ *
+ * Copyright (c) 2008 yajin (yajin@vm-kernel.org)
+ * Copyright (c) 2010 Huacai Chen (zltjiangshi@gmail.com)
+ * Copyright (c) 2020 Philippe Mathieu-Daudé <f4bug@amsat.org>
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+#ifndef HW_PCI_HOST_BONITO_H
+#define HW_PCI_HOST_BONITO_H
+
+#include "exec/memory.h"
+#include "hw/pci/pci_host.h"
+#include "qom/object.h"
+
+typedef struct BonitoPciState BonitoPciState;
+
+#define TYPE_BONITO_PCI_HOST_BRIDGE "Bonito-pcihost"
+OBJECT_DECLARE_SIMPLE_TYPE(BonitoState, BONITO_PCI_HOST_BRIDGE)
+
+typedef struct BonitoState BonitoState;
+
+struct BonitoState {
+ /*< private >*/
+ PCIHostState parent_obj;
+ /*< public >*/
+ qemu_irq *pic;
+ BonitoPciState *pci_dev;
+ MemoryRegion pci_mem;
+ MemoryRegion pcimem_lo_alias[3];
+};
+
+#endif
@@ -45,6 +45,7 @@
#include "hw/pci/pci.h"
#include "hw/irq.h"
#include "hw/mips/mips.h"
+#include "hw/pci-host/bonito.h"
#include "hw/pci/pci_host.h"
#include "migration/vmstate.h"
#include "sysemu/reset.h"
@@ -198,8 +199,6 @@ FIELD(PCIMAP, 2G, 18, 1)
((((busno) << 16) & 0xff0000) + (((devno) << 11) & 0xf800) + \
(((funno) << 8) & 0x700) + (regno))
-typedef struct BonitoState BonitoState;
-
struct BonitoPciState {
PCIDevice dev;
@@ -227,20 +226,7 @@ struct BonitoPciState {
MemoryRegion iomem_cop;
MemoryRegion bonito_pciio;
MemoryRegion bonito_localio;
-
};
-typedef struct BonitoPciState BonitoPciState;
-
-struct BonitoState {
- PCIHostState parent_obj;
- qemu_irq *pic;
- BonitoPciState *pci_dev;
- MemoryRegion pci_mem;
- MemoryRegion pcimem_lo_alias[3];
-};
-
-#define TYPE_BONITO_PCI_HOST_BRIDGE "Bonito-pcihost"
-OBJECT_DECLARE_SIMPLE_TYPE(BonitoState, BONITO_PCI_HOST_BRIDGE)
#define TYPE_PCI_BONITO "Bonito"
OBJECT_DECLARE_SIMPLE_TYPE(BonitoPciState, PCI_BONITO)
@@ -1153,6 +1153,7 @@ F: hw/mips/fuloong2e.c
F: hw/isa/vt82c686.c
F: hw/pci-host/bonito.c
F: include/hw/isa/vt82c686.h
+F: include/hw/pci-host/bonito.h
Loongson-3 virtual platforms
M: Huacai Chen <chenhuacai@kernel.org>
Declare TYPE_BONITO_PCI_HOST_BRIDGE in the new "hw/pci-host/bonito.h" header, so we can inline the bonito_init() call in the next commit. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- include/hw/pci-host/bonito.h | 34 ++++++++++++++++++++++++++++++++++ hw/pci-host/bonito.c | 16 +--------------- MAINTAINERS | 1 + 3 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 include/hw/pci-host/bonito.h