mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
pcihp: drop pcihp_bridge_en dependency when composing PCNT method
.. and use only BSEL presence to decide on how PCNT should be composed. That simplifies possible combinations to consider, but mainly it makes PCIHP AML be governed only by BSEL, which is property of PCIBus (aka part of bridge) and as result it opens possibility to convert build_append_pci_bus_devices() into AcpiDevAmlIf::build_dev_aml callback to make bridges self describing. PS: used approach leaves unused PCNT, when ACPI hotplug is completely disabled but that's harmless and followup commits will get rid of it later. Scope (PCI0) ... Method (PCNT, 0, NotSerialized) { } ... } Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <20230112140312.3096331-19-imammedo@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
54836748fc
commit
19f5052ceb
1 changed files with 24 additions and 29 deletions
|
@ -494,39 +494,34 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
|
||||||
aml_append(parent_scope, notify_method);
|
aml_append(parent_scope, notify_method);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Append PCNT method to notify about events on local and child buses.
|
/*
|
||||||
* Add this method for root bus only when hotplug is enabled since DSDT
|
* Append PCNT method to notify about events on local and child buses.
|
||||||
* expects it.
|
|
||||||
*/
|
*/
|
||||||
if (bsel || pcihp_bridge_en) {
|
method = aml_method("PCNT", 0, AML_NOTSERIALIZED);
|
||||||
method = aml_method("PCNT", 0, AML_NOTSERIALIZED);
|
|
||||||
|
|
||||||
/* If bus supports hotplug select it and notify about local events */
|
/* If bus supports hotplug select it and notify about local events */
|
||||||
if (bsel) {
|
if (bsel) {
|
||||||
uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
|
uint64_t bsel_val = qnum_get_uint(qobject_to(QNum, bsel));
|
||||||
|
|
||||||
aml_append(method, aml_store(aml_int(bsel_val), aml_name("BNUM")));
|
aml_append(method, aml_store(aml_int(bsel_val), aml_name("BNUM")));
|
||||||
aml_append(method, aml_call2("DVNT", aml_name("PCIU"),
|
aml_append(method, aml_call2("DVNT", aml_name("PCIU"),
|
||||||
aml_int(1))); /* Device Check */
|
aml_int(1))); /* Device Check */
|
||||||
aml_append(method, aml_call2("DVNT", aml_name("PCID"),
|
aml_append(method, aml_call2("DVNT", aml_name("PCID"),
|
||||||
aml_int(3))); /* Eject Request */
|
aml_int(3))); /* Eject Request */
|
||||||
}
|
|
||||||
|
|
||||||
/* Notify about child bus events in any case */
|
|
||||||
if (pcihp_bridge_en) {
|
|
||||||
QLIST_FOREACH(sec, &bus->child, sibling) {
|
|
||||||
if (pci_bus_is_root(sec) ||
|
|
||||||
!object_property_find(OBJECT(sec), ACPI_PCIHP_PROP_BSEL)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
aml_append(method, aml_name("^S%.02X.PCNT",
|
|
||||||
sec->parent_dev->devfn));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
aml_append(parent_scope, method);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Notify about child bus events in any case */
|
||||||
|
QLIST_FOREACH(sec, &bus->child, sibling) {
|
||||||
|
if (pci_bus_is_root(sec) ||
|
||||||
|
!object_property_find(OBJECT(sec), ACPI_PCIHP_PROP_BSEL)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
aml_append(method, aml_name("^S%.02X.PCNT", sec->parent_dev->devfn));
|
||||||
|
}
|
||||||
|
|
||||||
|
aml_append(parent_scope, method);
|
||||||
|
|
||||||
qobject_unref(bsel);
|
qobject_unref(bsel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue