hw/acpi/pcihp: Remove root arg in acpi_pcihp_init
Let pass the root bus to ich9 and piix4 through a property link instead of through an argument passed to acpi_pcihp_init(). Also make sure the root bus is set at the entry of acpi_pcihp_init(). The rationale of that change is to be consistent with the forecoming ARM implementation where the machine passes the root bus (steming from GPEX) to the GED device through a link property. Signed-off-by: Eric Auger <eric.auger@redhat.com> Suggested-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20250714080639.2525563-28-eric.auger@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
8c58dc0531
commit
b8c7ebbb70
5 changed files with 14 additions and 6 deletions
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
const VMStateDescription vmstate_acpi_pcihp_pci_status;
|
||||
|
||||
void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus,
|
||||
void acpi_pcihp_init(Object *owner, AcpiPciHpState *s,
|
||||
MemoryRegion *address_space_io, uint16_t io_base)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -322,9 +322,10 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm, qemu_irq sci_irq)
|
|||
}
|
||||
|
||||
if (pm->acpi_pci_hotplug.use_acpi_hotplug_bridge) {
|
||||
object_property_set_link(OBJECT(lpc_pci), "bus",
|
||||
OBJECT(pci_get_bus(lpc_pci)), &error_abort);
|
||||
acpi_pcihp_init(OBJECT(lpc_pci),
|
||||
&pm->acpi_pci_hotplug,
|
||||
pci_get_bus(lpc_pci),
|
||||
pci_address_space_io(lpc_pci),
|
||||
ACPI_PCIHP_ADDR_ICH9);
|
||||
|
||||
|
|
@ -428,6 +429,10 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
|
|||
|
||||
object_property_add_uint32_ptr(obj, ACPI_PM_PROP_PM_IO_BASE,
|
||||
&pm->pm_io_base, OBJ_PROP_FLAG_READ);
|
||||
object_property_add_link(obj, "bus", TYPE_PCI_BUS,
|
||||
(Object **)&pm->acpi_pci_hotplug.root,
|
||||
object_property_allow_set_link,
|
||||
OBJ_PROP_LINK_STRONG);
|
||||
object_property_add(obj, ACPI_PM_PROP_GPE0_BLK, "uint32",
|
||||
ich9_pm_get_gpe0_blk,
|
||||
NULL, NULL, pm);
|
||||
|
|
|
|||
|
|
@ -493,13 +493,13 @@ static const MemoryRegionOps acpi_pcihp_io_ops = {
|
|||
},
|
||||
};
|
||||
|
||||
void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus,
|
||||
void acpi_pcihp_init(Object *owner, AcpiPciHpState *s,
|
||||
MemoryRegion *io, uint16_t io_base)
|
||||
{
|
||||
s->io_len = ACPI_PCIHP_SIZE;
|
||||
s->io_base = io_base;
|
||||
|
||||
s->root = root_bus;
|
||||
assert(s->root);
|
||||
|
||||
memory_region_init_io(&s->io, owner, &acpi_pcihp_io_ops, s,
|
||||
"acpi-pci-hotplug", s->io_len);
|
||||
|
|
|
|||
|
|
@ -567,7 +567,8 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
|
|||
|
||||
if (s->acpi_pci_hotplug.use_acpi_hotplug_bridge ||
|
||||
s->acpi_pci_hotplug.use_acpi_root_pci_hotplug) {
|
||||
acpi_pcihp_init(OBJECT(s), &s->acpi_pci_hotplug, bus, parent,
|
||||
object_property_set_link(OBJECT(s), "bus", OBJECT(bus), &error_abort);
|
||||
acpi_pcihp_init(OBJECT(s), &s->acpi_pci_hotplug, parent,
|
||||
ACPI_PCIHP_ADDR_PIIX4);
|
||||
qbus_set_hotplug_handler(BUS(pci_get_bus(PCI_DEVICE(s))), OBJECT(s));
|
||||
}
|
||||
|
|
@ -611,6 +612,8 @@ static const Property piix4_pm_properties[] = {
|
|||
acpi_pci_hotplug.use_acpi_hotplug_bridge, true),
|
||||
DEFINE_PROP_BOOL(ACPI_PM_PROP_ACPI_PCI_ROOTHP, PIIX4PMState,
|
||||
acpi_pci_hotplug.use_acpi_root_pci_hotplug, true),
|
||||
DEFINE_PROP_LINK("bus", PIIX4PMState, acpi_pci_hotplug.root,
|
||||
TYPE_PCI_BUS, PCIBus *),
|
||||
DEFINE_PROP_BOOL("memory-hotplug-support", PIIX4PMState,
|
||||
acpi_memory_hotplug.is_enabled, true),
|
||||
DEFINE_PROP_BOOL("smm-compat", PIIX4PMState, smm_compat, false),
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ typedef struct AcpiPciHpState {
|
|||
bool use_acpi_root_pci_hotplug;
|
||||
} AcpiPciHpState;
|
||||
|
||||
void acpi_pcihp_init(Object *owner, AcpiPciHpState *, PCIBus *root,
|
||||
void acpi_pcihp_init(Object *owner, AcpiPciHpState *,
|
||||
MemoryRegion *io, uint16_t io_base);
|
||||
|
||||
bool acpi_pcihp_is_hotpluggable_bus(AcpiPciHpState *s, BusState *bus);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue