[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 04/11] hw/ide/via: Set the ISA-bus QOM link
From: |
Philippe Mathieu-Daudé |
Subject: |
[RFC PATCH 04/11] hw/ide/via: Set the ISA-bus QOM link |
Date: |
Tue, 18 May 2021 23:55:38 +0200 |
Set the ISA Bus link property on the VIA IDE object from the
two unique users, the Fuloong and Pegasos machines.
Add a check in via_ide_realize() to be sure this property is set.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/ide/via.c | 5 +++++
hw/mips/fuloong2e.c | 4 ++++
hw/ppc/pegasos2.c | 4 ++++
3 files changed, 13 insertions(+)
diff --git a/hw/ide/via.c b/hw/ide/via.c
index 65fdca6dcf4..654e15edfed 100644
--- a/hw/ide/via.c
+++ b/hw/ide/via.c
@@ -165,6 +165,11 @@ static void via_ide_realize(PCIDevice *dev, Error **errp)
uint8_t *pci_conf = dev->config;
int i;
+ if (!d->isa_bus) {
+ error_setg(errp, "via-ide: 'isa-bus' link not set");
+ return;
+ }
+
pci_config_set_prog_interface(pci_conf, 0x8a); /* legacy mode */
pci_set_long(pci_conf + PCI_CAPABILITY_LIST, 0x000000c0);
dev->wmask[PCI_INTERRUPT_LINE] = 0;
diff --git a/hw/mips/fuloong2e.c b/hw/mips/fuloong2e.c
index 40e9a645e1b..7e644a701bc 100644
--- a/hw/mips/fuloong2e.c
+++ b/hw/mips/fuloong2e.c
@@ -201,12 +201,16 @@ static void vt82c686b_southbridge_init(PCIBus *pci_bus,
int slot, qemu_irq intc,
I2CBus **i2c_bus)
{
PCIDevice *dev;
+ BusState *isa_bus;
dev = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(slot, 0), true,
TYPE_VT82C686B_ISA);
+ isa_bus = qdev_get_child_bus(DEVICE(dev), "isa.0");
qdev_connect_gpio_out(DEVICE(dev), 0, intc);
dev = pci_new(PCI_DEVFN(slot, 1), "via-ide");
+ object_property_set_link(OBJECT(dev), "isa-bus",
+ OBJECT(isa_bus), &error_abort);
pci_realize_and_unref(dev, pci_bus, &error_abort);
pci_ide_create_devs(dev);
diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c
index 8486a2eb8c6..ed6ddc3569b 100644
--- a/hw/ppc/pegasos2.c
+++ b/hw/ppc/pegasos2.c
@@ -57,6 +57,7 @@ static void pegasos2_init(MachineState *machine)
PCIBus *pci_bus;
PCIDevice *dev;
I2CBus *i2c_bus;
+ BusState *isa_bus;
const char *fwname = machine->firmware ?: PROM_FILENAME;
char *filename;
int sz;
@@ -104,11 +105,14 @@ static void pegasos2_init(MachineState *machine)
/* VT8231 function 0: PCI-to-ISA Bridge */
dev = pci_create_simple_multifunction(pci_bus, PCI_DEVFN(12, 0), true,
TYPE_VT8231_ISA);
+ isa_bus = qdev_get_child_bus(DEVICE(dev), "isa.0");
qdev_connect_gpio_out(DEVICE(dev), 0,
qdev_get_gpio_in_named(mv, "gpp", 31));
/* VT8231 function 1: IDE Controller */
dev = pci_new(PCI_DEVFN(12, 1), "via-ide");
+ object_property_set_link(OBJECT(dev), "isa-bus",
+ OBJECT(isa_bus), &error_abort);
pci_realize_and_unref(dev, pci_bus, &error_abort);
pci_ide_create_devs(dev);
--
2.26.3
- Re: [RFC PATCH 02/11] hw/ide: Add PCIIDEState::isa_bus link, (continued)
- 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
[RFC PATCH 04/11] hw/ide/via: Set the ISA-bus QOM link,
Philippe Mathieu-Daudé <=
[RFC PATCH 05/11] hw/isa: Extract isa_bus_get_irq() from isa_get_irq(), Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 06/11] hw/ide: Replace isa_get_irq() by isa_bus_get_irq(), Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 07/11] hw/isa: Simplify isa_get_irq(), Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 09/11] hw/ide: Let ide_init_ioport() take an ISA bus argument instead of device, Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 08/11] hw/isa: Extract bus part from isa_register_portio_list(), Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 10/11] hw/isa: Remove use of global isa bus, Philippe Mathieu-Daudé, 2021/05/18
[RFC PATCH 11/11] hw/isa: Rename isabus singleton as 'g_isabus', Philippe Mathieu-Daudé, 2021/05/18