From 5d71a5aabb8a47a9f6d559391f16a93e5d5edd72 Mon Sep 17 00:00:00 2001 From: Mark Hasemeyer Date: Tue, 9 May 2023 22:48:27 -0600 Subject: drivers/pcie/generic: Add DmaProperty to config Adds the option to set the 'DmaProperty' in the device's _DSD. This can be done by setting "add_acpi_dma_property"="true". If not set (or set to false), the device descriptor generation behavior will remain unchanged. The naming convention for the config option was chosen to match that of other drivers. This partially reverts commit 5609f7a684c6 ("drivers/pcie/generic: Clean up driver") as the driver is now used on a couple mainboards which need the DmaProperty. Change-Id: I996fe4923948d13a20bf8b6b1a93dab0866d0fd4 Signed-off-by: Mark Hasemeyer Reviewed-on: https://review.coreboot.org/c/coreboot/+/75094 Tested-by: build bot (Jenkins) Reviewed-by: Jan Samek Reviewed-by: Karthik Ramasubramanian --- src/drivers/pcie/generic/chip.h | 4 ++++ src/drivers/pcie/generic/generic.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/drivers/pcie/generic/chip.h b/src/drivers/pcie/generic/chip.h index 78285b9693..a5f261b842 100644 --- a/src/drivers/pcie/generic/chip.h +++ b/src/drivers/pcie/generic/chip.h @@ -9,6 +9,10 @@ struct drivers_pcie_generic_config { const char *name; unsigned int wake_gpe; unsigned int wake_deepest; + /* When set to true, this will add a _DSD which contains a single + property, `DmaProperty`, set to 1, under the ACPI Device. */ + bool add_acpi_dma_property; + }; #endif /* _PCIE_GENERIC_H_ */ diff --git a/src/drivers/pcie/generic/generic.c b/src/drivers/pcie/generic/generic.c index 8b073405fd..1873e65895 100644 --- a/src/drivers/pcie/generic/generic.c +++ b/src/drivers/pcie/generic/generic.c @@ -42,6 +42,8 @@ static void pcie_generic_fill_ssdt(const struct device *dev) if (config->wake_gpe) acpigen_write_PRW(config->wake_gpe, config->wake_deepest); + if (config->add_acpi_dma_property) + acpi_device_add_dma_property(NULL); acpigen_write_device_end(); acpigen_write_scope_end(); -- cgit v1.2.3