[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 13/35] ipmi: acpi: use relative path to resource source
From: |
Igor Mammedov |
Subject: |
[PATCH v2 13/35] ipmi: acpi: use relative path to resource source |
Date: |
Wed, 8 Jun 2022 09:53:18 -0400 |
smbus-ipmi AML description needs to specify a path to its parent
node in _CRS. The rest of IPMI inplementations (ISA based)
do not need path at all. Instead of passing through a full path
use relative path to point to smbus-ipmi's parent node, it will
let follow up patches to create IPMI device AML in a generic
way instead of current ad-hoc way. (i.e. AML will be generated
the same way it's done for other ISA device, and smbus will be
converted to generate AML for its slave devices the same way
as ISA)
expected AML change:
Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings
{
I2cSerialBusV2 (0x0000, ControllerInitiated, 0x000186A0,
- AddressingMode7Bit, "\\_SB.PCI0.SMB0",
+ AddressingMode7Bit, "^",
0x00, ResourceProducer, , Exclusive,
)
})
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
---
include/hw/acpi/ipmi.h | 2 +-
hw/acpi/ipmi-stub.c | 2 +-
hw/acpi/ipmi.c | 12 ++++++------
hw/i386/acpi-build.c | 4 ++--
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/include/hw/acpi/ipmi.h b/include/hw/acpi/ipmi.h
index c14ad682ac..c38483565c 100644
--- a/include/hw/acpi/ipmi.h
+++ b/include/hw/acpi/ipmi.h
@@ -16,6 +16,6 @@
* bus matches the given bus. The resource is the ACPI resource that
* contains the IPMI device, this is required for the I2C CRS.
*/
-void build_acpi_ipmi_devices(Aml *table, BusState *bus, const char *resource);
+void build_acpi_ipmi_devices(Aml *table, BusState *bus);
#endif /* HW_ACPI_IPMI_H */
diff --git a/hw/acpi/ipmi-stub.c b/hw/acpi/ipmi-stub.c
index 8634fb325c..f525f71c2d 100644
--- a/hw/acpi/ipmi-stub.c
+++ b/hw/acpi/ipmi-stub.c
@@ -10,6 +10,6 @@
#include "qemu/osdep.h"
#include "hw/acpi/ipmi.h"
-void build_acpi_ipmi_devices(Aml *table, BusState *bus, const char *resource)
+void build_acpi_ipmi_devices(Aml *table, BusState *bus)
{
}
diff --git a/hw/acpi/ipmi.c b/hw/acpi/ipmi.c
index 96e48eba15..c30b44fcf5 100644
--- a/hw/acpi/ipmi.c
+++ b/hw/acpi/ipmi.c
@@ -13,7 +13,7 @@
#include "hw/acpi/acpi.h"
#include "hw/acpi/ipmi.h"
-static Aml *aml_ipmi_crs(IPMIFwInfo *info, const char *resource)
+static Aml *aml_ipmi_crs(IPMIFwInfo *info)
{
Aml *crs = aml_resource_template();
@@ -49,7 +49,7 @@ static Aml *aml_ipmi_crs(IPMIFwInfo *info, const char
*resource)
break;
case IPMI_MEMSPACE_SMBUS:
aml_append(crs, aml_i2c_serial_bus_device(info->base_address,
- resource));
+ "^"));
break;
default:
abort();
@@ -62,7 +62,7 @@ static Aml *aml_ipmi_crs(IPMIFwInfo *info, const char
*resource)
return crs;
}
-static Aml *aml_ipmi_device(IPMIFwInfo *info, const char *resource)
+static Aml *aml_ipmi_device(IPMIFwInfo *info)
{
Aml *dev;
uint16_t version = ((info->ipmi_spec_major_revision << 8)
@@ -75,14 +75,14 @@ static Aml *aml_ipmi_device(IPMIFwInfo *info, const char
*resource)
aml_append(dev, aml_name_decl("_STR", aml_string("ipmi_%s",
info->interface_name)));
aml_append(dev, aml_name_decl("_UID", aml_int(info->uuid)));
- aml_append(dev, aml_name_decl("_CRS", aml_ipmi_crs(info, resource)));
+ aml_append(dev, aml_name_decl("_CRS", aml_ipmi_crs(info)));
aml_append(dev, aml_name_decl("_IFT", aml_int(info->interface_type)));
aml_append(dev, aml_name_decl("_SRV", aml_int(version)));
return dev;
}
-void build_acpi_ipmi_devices(Aml *scope, BusState *bus, const char *resource)
+void build_acpi_ipmi_devices(Aml *scope, BusState *bus)
{
BusChild *kid;
@@ -102,6 +102,6 @@ void build_acpi_ipmi_devices(Aml *scope, BusState *bus,
const char *resource)
iic = IPMI_INTERFACE_GET_CLASS(obj);
memset(&info, 0, sizeof(info));
iic->get_fwinfo(ii, &info);
- aml_append(scope, aml_ipmi_device(&info, resource));
+ aml_append(scope, aml_ipmi_device(&info));
}
}
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index 1449832aa9..88506d563f 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -873,7 +873,7 @@ static void build_isa_devices_aml(Aml *table)
assert(obj && !ambiguous);
scope = aml_scope("_SB.PCI0.ISA");
- build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA");
+ build_acpi_ipmi_devices(scope, BUS(obj));
isa_build_aml(ISA_BUS(obj), scope);
aml_append(table, scope);
@@ -1406,7 +1406,7 @@ static void build_smb0(Aml *table, I2CBus *smbus, int
devnr, int func)
Aml *dev = aml_device("SMB0");
aml_append(dev, aml_name_decl("_ADR", aml_int(devnr << 16 | func)));
- build_acpi_ipmi_devices(dev, BUS(smbus), "\\_SB.PCI0.SMB0");
+ build_acpi_ipmi_devices(dev, BUS(smbus));
aml_append(scope, dev);
aml_append(table, scope);
}
--
2.31.1
- [PATCH v2 03/35] acpi: fdc-isa: replace ISADeviceClass::build_aml with AcpiDevAmlIfClass:build_dev_aml, (continued)
- [PATCH v2 03/35] acpi: fdc-isa: replace ISADeviceClass::build_aml with AcpiDevAmlIfClass:build_dev_aml, Igor Mammedov, 2022/06/08
- [PATCH v2 04/35] acpi: parallel port: replace ISADeviceClass::build_aml with AcpiDevAmlIfClass:build_dev_aml, Igor Mammedov, 2022/06/08
- [PATCH v2 02/35] acpi: make isa_build_aml() support AcpiDevAmlIf interface, Igor Mammedov, 2022/06/08
- [PATCH v2 07/35] acpi: pckbd: replace ISADeviceClass::build_aml with AcpiDevAmlIfClass:build_dev_aml, Igor Mammedov, 2022/06/08
- [PATCH v2 08/35] isa-bus: drop no longer used ISADeviceClass::build_aml, Igor Mammedov, 2022/06/08
- [PATCH v2 09/35] tests: acpi: add and whitelist DSDT.ipmismbus expected blob, Igor Mammedov, 2022/06/08
- [PATCH v2 10/35] tests: acpi: q35: add test for smbus-ipmi device, Igor Mammedov, 2022/06/08
- [PATCH v2 11/35] tests: acpi: update expected blob DSDT.ipmismbus, Igor Mammedov, 2022/06/08
- [PATCH v2 12/35] tests: acpi: whitelist DSDT.ipmismbus expected blob, Igor Mammedov, 2022/06/08
- [PATCH v2 14/35] tests: acpi: update expected DSDT.ipmismbus blob, Igor Mammedov, 2022/06/08
- [PATCH v2 13/35] ipmi: acpi: use relative path to resource source,
Igor Mammedov <=
- [PATCH v2 05/35] acpi: serial-is: replace ISADeviceClass::build_aml with AcpiDevAmlIfClass:build_dev_aml, Igor Mammedov, 2022/06/08
- [PATCH v2 15/35] acpi: ich9-smb: add support for AcpiDevAmlIf interface, Igor Mammedov, 2022/06/08
- [PATCH v2 16/35] acpi: ipmi: use AcpiDevAmlIf interface to build IPMI device descriptors, Igor Mammedov, 2022/06/08
- [PATCH v2 18/35] tests: acpi: white-list to be re-factored pc/q35 DSDT, Igor Mammedov, 2022/06/08
- [PATCH v2 17/35] q35: acpi: drop not needed PCMachineClass::do_not_add_smb_acpi, Igor Mammedov, 2022/06/08
- [PATCH v2 06/35] acpi: mc146818rtc: replace ISADeviceClass::build_aml with AcpiDevAmlIfClass:build_dev_aml, Igor Mammedov, 2022/06/08
- [PATCH v2 19/35] acpi: pc: isa bridge: use AcpiDevAmlIf interface to build ISA device descriptors, Igor Mammedov, 2022/06/08
- [PATCH v2 20/35] acpi: q35: isa bridge: use AcpiDevAmlIf interface to build ISA device descriptors, Igor Mammedov, 2022/06/08
- [PATCH v2 22/35] tests: acpi: add and white-list DSDT.applesmc expected blob, Igor Mammedov, 2022/06/08