aboutsummaryrefslogtreecommitdiff
path: root/hw/i386
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2022-06-08 09:53:21 -0400
committerMichael S. Tsirkin <mst@redhat.com>2022-06-09 19:32:49 -0400
commit5876d9b53fee5fc5a341fad1618cf3a9731206da (patch)
treede6f81c2ca601533a3968a9157c1f9cfd05e829c /hw/i386
parent4b66ddcc4d2d690f11152aeed1097f44ecff1aa4 (diff)
downloadqemu-5876d9b53fee5fc5a341fad1618cf3a9731206da.zip
qemu-5876d9b53fee5fc5a341fad1618cf3a9731206da.tar.gz
qemu-5876d9b53fee5fc5a341fad1618cf3a9731206da.tar.bz2
acpi: ipmi: use AcpiDevAmlIf interface to build IPMI device descriptors
convert ad-hoc way we use to generate AML for ISA/SMB IPMI devices to a generic approach (i.e. make devices provide its own AML blobs like it is done with other ISA devices (ex. KBD)) Signed-off-by: Igor Mammedov <imammedo@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Message-Id: <20220608135340.3304695-17-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r--hw/i386/acpi-build.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 88506d5..5b963cc 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -39,6 +39,7 @@
#include "hw/nvram/fw_cfg.h"
#include "hw/acpi/bios-linker-loader.h"
#include "hw/isa/isa.h"
+#include "hw/acpi/acpi_aml_interface.h"
#include "hw/input/i8042.h"
#include "hw/acpi/memory_hotplug.h"
#include "sysemu/tpm.h"
@@ -73,7 +74,6 @@
#include "hw/i386/intel_iommu.h"
#include "hw/virtio/virtio-iommu.h"
-#include "hw/acpi/ipmi.h"
#include "hw/acpi/hmat.h"
#include "hw/acpi/viot.h"
#include "hw/acpi/cxl.h"
@@ -873,7 +873,6 @@ static void build_isa_devices_aml(Aml *table)
assert(obj && !ambiguous);
scope = aml_scope("_SB.PCI0.ISA");
- build_acpi_ipmi_devices(scope, BUS(obj));
isa_build_aml(ISA_BUS(obj), scope);
aml_append(table, scope);
@@ -1400,13 +1399,21 @@ static Aml *build_q35_osc_method(bool enable_native_pcie_hotplug)
return method;
}
-static void build_smb0(Aml *table, I2CBus *smbus, int devnr, int func)
+static void build_smb0(Aml *table, int devnr, int func)
{
Aml *scope = aml_scope("_SB.PCI0");
Aml *dev = aml_device("SMB0");
+ bool ambiguous;
+ Object *obj;
+ /*
+ * temporarily fish out device hosting SMBUS, build_smb0 will be gone once
+ * PCI enumeration will be switched to call_dev_aml_func()
+ */
+ obj = object_resolve_path_type("", TYPE_ICH9_SMB_DEVICE, &ambiguous);
+ assert(obj && !ambiguous);
aml_append(dev, aml_name_decl("_ADR", aml_int(devnr << 16 | func)));
- build_acpi_ipmi_devices(dev, BUS(smbus));
+ call_dev_aml_func(DEVICE(obj), dev);
aml_append(scope, dev);
aml_append(table, scope);
}
@@ -1524,7 +1531,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
}
build_q35_pci0_int(dsdt);
if (pcms->smbus && !pcmc->do_not_add_smb_acpi) {
- build_smb0(dsdt, pcms->smbus, ICH9_SMB_DEV, ICH9_SMB_FUNC);
+ build_smb0(dsdt, ICH9_SMB_DEV, ICH9_SMB_FUNC);
}
}