[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link |
Date: |
Tue, 18 May 2021 23:55:36 +0200 |
IDE bus depends on ISA bus for IRQ/DMA.
Add an ISABus reference in PCIIDEState, and add link properties
to it in the PIIX and VIA objects (which inherit PCI_IDE).
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
include/hw/ide/pci.h | 1 +
hw/ide/piix.c | 11 ++++++++++-
hw/ide/via.c | 10 +++++++++-
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/include/hw/ide/pci.h b/include/hw/ide/pci.h
index d8384e1c422..e790722ed14 100644
--- a/include/hw/ide/pci.h
+++ b/include/hw/ide/pci.h
@@ -47,6 +47,7 @@ struct PCIIDEState {
PCIDevice parent_obj;
/*< public >*/
+ ISABus *isa_bus;
IDEBus bus[2];
BMDMAState bmdma[2];
uint32_t secondary; /* used only for cmd646 */
diff --git a/hw/ide/piix.c b/hw/ide/piix.c
index b9860e35a5c..48da68da37f 100644
--- a/hw/ide/piix.c
+++ b/hw/ide/piix.c
@@ -30,8 +30,9 @@
#include "sysemu/block-backend.h"
#include "sysemu/blockdev.h"
#include "sysemu/dma.h"
-
+#include "qapi/error.h"
#include "hw/ide/pci.h"
+#include "hw/isa/isa.h"
#include "trace.h"
static uint64_t bmdma_read(void *opaque, hwaddr addr, unsigned size)
@@ -207,6 +208,12 @@ static void pci_piix_ide_exitfn(PCIDevice *dev)
}
}
+static Property piix_ide_properties[] = {
+ DEFINE_PROP_LINK("isa-bus", PCIIDEState, isa_bus,
+ TYPE_ISA_BUS, ISABus *),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
/* NOTE: for the PIIX3, the IRQs and IOports are hardcoded */
static void piix3_ide_class_init(ObjectClass *klass, void *data)
{
@@ -221,6 +228,7 @@ static void piix3_ide_class_init(ObjectClass *klass, void
*data)
k->class_id = PCI_CLASS_STORAGE_IDE;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
dc->hotpluggable = false;
+ device_class_set_props(dc, piix_ide_properties);
}
static const TypeInfo piix3_ide_info = {
@@ -249,6 +257,7 @@ static void piix4_ide_class_init(ObjectClass *klass, void
*data)
k->class_id = PCI_CLASS_STORAGE_IDE;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
dc->hotpluggable = false;
+ device_class_set_props(dc, piix_ide_properties);
}
static const TypeInfo piix4_ide_info = {
diff --git a/hw/ide/via.c b/hw/ide/via.c
index be09912b334..65fdca6dcf4 100644
--- a/hw/ide/via.c
+++ b/hw/ide/via.c
@@ -28,8 +28,9 @@
#include "hw/pci/pci.h"
#include "migration/vmstate.h"
#include "qemu/module.h"
+#include "qapi/error.h"
#include "sysemu/dma.h"
-
+#include "hw/isa/isa.h"
#include "hw/ide/pci.h"
#include "trace.h"
@@ -210,6 +211,12 @@ static void via_ide_exitfn(PCIDevice *dev)
}
}
+static Property via_ide_properties[] = {
+ DEFINE_PROP_LINK("isa-bus", PCIIDEState, isa_bus,
+ TYPE_ISA_BUS, ISABus *),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
static void via_ide_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -224,6 +231,7 @@ static void via_ide_class_init(ObjectClass *klass, void
*data)
k->revision = 0x06;
k->class_id = PCI_CLASS_STORAGE_IDE;
set_bit(DEVICE_CATEGORY_STORAGE, dc->categories);
+ device_class_set_props(dc, via_ide_properties);
}
static const TypeInfo via_ide_info = {
--
2.26.3
- [RFC PATCH 00/11] hw/isa: Remove dependencies on ISA bus singleton, Philippe Mathieu-Daudé, 2021/05/18
- [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link,
Philippe Mathieu-Daudé <=
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, BALATON Zoltan, 2021/05/18
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, John Snow, 2021/05/19
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, BALATON Zoltan, 2021/05/19
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, Stefan Hajnoczi, 2021/05/20
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, Mark Cave-Ayland, 2021/05/20
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, BALATON Zoltan, 2021/05/20
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, Mark Cave-Ayland, 2021/05/20
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, Mark Cave-Ayland, 2021/05/20
[RFC PATCH 03/11] hw/ide/piix: Set the ISA-bus QOM link, Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 01/11] hw/isa: Explode pci_create_simple() calls, Philippe Mathieu-Daudé, 2021/05/18