From 23e94a4e2353162eb19a26626e197c6dcd1f8df5 Mon Sep 17 00:00:00 2001 From: Robert Zieba Date: Tue, 12 Jul 2022 13:18:06 -0600 Subject: [PATCH] drivers/pcie/generic: Add support for custom ACPI name This commit adds code to allow the driver to use an ACPI device name that is set in the device tree. BUG=b:237682766 TEST=Boot changes on Skyrim device, dumped SSDT Signed-off-by: Robert Zieba Change-Id: Ie40a335e35b8ac83658e67d7cfba0750dd4784ad Reviewed-on: https://review.coreboot.org/c/coreboot/+/65798 Reviewed-by: Raul Rangel Tested-by: build bot (Jenkins) --- src/drivers/pcie/generic/chip.h | 1 + src/drivers/pcie/generic/generic.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/drivers/pcie/generic/chip.h b/src/drivers/pcie/generic/chip.h index 1d9f0a62ed..e5b2876766 100644 --- a/src/drivers/pcie/generic/chip.h +++ b/src/drivers/pcie/generic/chip.h @@ -6,6 +6,7 @@ #include struct drivers_pcie_generic_config { + const char *name; }; #endif /* _PCIE_GENERIC_H_ */ diff --git a/src/drivers/pcie/generic/generic.c b/src/drivers/pcie/generic/generic.c index a8dd1d9745..a26c37b543 100644 --- a/src/drivers/pcie/generic/generic.c +++ b/src/drivers/pcie/generic/generic.c @@ -9,7 +9,12 @@ static const char *pcie_generic_acpi_name(const struct device *dev) { - return "DEV0"; + struct drivers_pcie_generic_config *config = dev->chip_info; + + if (!config || !config->name) + return "DEV0"; + + return config->name; } static void pcie_generic_fill_ssdt(const struct device *dev)