diff options
author | Robert Zieba <robertzieba@google.com> | 2022-07-12 13:18:06 -0600 |
---|---|---|
committer | Martin L Roth <gaumless@tutanota.com> | 2022-07-20 22:24:51 +0000 |
commit | 23e94a4e2353162eb19a26626e197c6dcd1f8df5 (patch) | |
tree | d2e5db66196f6ed5e67a7edd5cabaf3beb37eafe | |
parent | 5609f7a684c698fff9da764c1868f97f4ee2ba33 (diff) |
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 <robertzieba@google.com>
Change-Id: Ie40a335e35b8ac83658e67d7cfba0750dd4784ad
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65798
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r-- | src/drivers/pcie/generic/chip.h | 1 | ||||
-rw-r--r-- | src/drivers/pcie/generic/generic.c | 7 |
2 files changed, 7 insertions, 1 deletions
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 <types.h> 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) |