drivers/pcie/generic: Clean up driver

This removes unneeded and unused functionality in the driver as part of
an effort to make the driver more generic and useful. The things that
have been removed are: `DmaProperty` and its associated `is_untrusted`
config, `_DSD` generation, and the companion device functionality. This
driver isn't currently used anywhere so there won't be any issues from
removing the above functionality.

BUG=b:237682766
TEST=Built and booted coreboot on Skyrim device

Change-Id: I0abd9148ab66ea9426069102ecc8c2fa77fea98e
Signed-off-by: Robert Zieba <robertzieba@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/65797
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Robert Zieba 2022-07-11 10:50:25 -06:00 committed by Martin L Roth
parent 65f558f576
commit 5609f7a684
2 changed files with 7 additions and 29 deletions

View File

@ -6,15 +6,6 @@
#include <types.h> #include <types.h>
struct drivers_pcie_generic_config { struct drivers_pcie_generic_config {
bool is_untrusted;
/*
* This needs to be pointed to the device instance in the device tree when
* there is already a device with the root port so that the ACPI code to be
* generated will be added to that existing device.
* By default, an ACPI device named 'DEV0' is created under the root port if
* this does not reference to a device.
*/
DEVTREE_CONST struct device *companion_dev;
}; };
#endif /* _PCIE_GENERIC_H_ */ #endif /* _PCIE_GENERIC_H_ */

View File

@ -9,17 +9,12 @@
static const char *pcie_generic_acpi_name(const struct device *dev) static const char *pcie_generic_acpi_name(const struct device *dev)
{ {
struct drivers_pcie_generic_config *config = dev->chip_info;
if (config->companion_dev)
return acpi_device_name(config->companion_dev);
return "DEV0"; return "DEV0";
} }
static void pcie_generic_fill_ssdt(const struct device *dev) static void pcie_generic_fill_ssdt(const struct device *dev)
{ {
struct drivers_pcie_generic_config *config; struct drivers_pcie_generic_config *config;
struct acpi_dp *dsd;
if (!is_dev_enabled(dev)) if (!is_dev_enabled(dev))
return; return;
@ -27,27 +22,19 @@ static void pcie_generic_fill_ssdt(const struct device *dev)
pci_rom_ssdt(dev); pci_rom_ssdt(dev);
config = dev->chip_info; config = dev->chip_info;
if (!config || !config->is_untrusted || !dev->bus || !dev->bus->dev) if (!config || !dev->bus || !dev->bus->dev)
return; return;
const char *scope; const char *scope;
const char *name; const char *name;
/* Code will be generated under companion device instead if present. */
if (config->companion_dev)
scope = acpi_device_path(config->companion_dev);
else
scope = acpi_device_path(dev->bus->dev); scope = acpi_device_path(dev->bus->dev);
name = acpi_device_name(dev); name = acpi_device_name(dev);
acpigen_write_scope(scope); acpigen_write_scope(scope);
if (!config->companion_dev) {
acpigen_write_device(name); acpigen_write_device(name);
acpigen_write_ADR_pci_device(dev); acpigen_write_ADR_pci_device(dev);
}
dsd = acpi_dp_new_table("_DSD");
acpi_dp_add_integer(dsd, "DmaProperty", 1);
acpi_dp_write(dsd);
if (!config->companion_dev)
acpigen_write_device_end(); acpigen_write_device_end();
acpigen_write_scope_end(); acpigen_write_scope_end();