drivers/wifi/generic: Fix properties in generic-under-PCI device case
In the devicetree case where a generic device underneath the Intel PCI CNVi device carries the device properties, the incorrect device was passed to wifi_ssdt_write_properties. Also while here, update the UUID for `DmaProperty` to match what Microsoft defined here: https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports BUG=b:215424986, b:220639445 TEST=dump SSDT and see that _PRW for CNVi device is no longer garbage, but contains the value from the devicetree (GPE0_PME_B0). Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Change-Id: Iafd86458d2f65ccb7e74d1308d37fd3ebbf7f520 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62746 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: YH Lin <yueherngl@google.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Varshit B Pandya <varshit.b.pandya@intel.com>
This commit is contained in:
parent
dc27d807ba
commit
5e6fd360de
|
@ -26,8 +26,8 @@
|
|||
/* Unique ID for the WIFI _DSM */
|
||||
#define ACPI_DSM_OEM_WIFI_UUID "F21202BF-8F78-4DC6-A5B3-1F738E285ADE"
|
||||
|
||||
/* Unique ID for the Wifi _DSD */
|
||||
#define ACPI_DSD_UNTRUSTED_UUID "88566a92-1a61-466d-949a-6d12809d480c"
|
||||
/* ID for the Wifi DmaProperty _DSD */
|
||||
#define ACPI_DSD_DMA_PROPERTY_UUID "70D24161-6DD5-4C9E-8070-705531292865"
|
||||
|
||||
__weak int get_wifi_sar_limits(union wifi_sar_limits *sar_limits)
|
||||
{
|
||||
|
@ -506,11 +506,11 @@ static void wifi_ssdt_write_device(const struct device *dev, const char *path)
|
|||
|
||||
static void wifi_ssdt_write_properties(const struct device *dev, const char *scope)
|
||||
{
|
||||
const struct drivers_wifi_generic_config *config = dev->chip_info;
|
||||
|
||||
/* Scope */
|
||||
acpigen_write_scope(scope);
|
||||
|
||||
if (dev->path.type == DEVICE_PATH_GENERIC) {
|
||||
const struct drivers_wifi_generic_config *config = dev->chip_info;
|
||||
if (config) {
|
||||
/* Wake capabilities */
|
||||
acpigen_write_PRW(config->wake, ACPI_S3);
|
||||
|
@ -520,12 +520,13 @@ static void wifi_ssdt_write_properties(const struct device *dev, const char *sco
|
|||
struct acpi_dp *dsd, *pkg;
|
||||
|
||||
dsd = acpi_dp_new_table("_DSD");
|
||||
pkg = acpi_dp_new_table(ACPI_DSD_UNTRUSTED_UUID);
|
||||
pkg = acpi_dp_new_table(ACPI_DSD_DMA_PROPERTY_UUID);
|
||||
acpi_dp_add_integer(pkg, "DmaProperty", 1);
|
||||
acpi_dp_add_package(dsd, pkg);
|
||||
acpi_dp_write(dsd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Fill regulatory domain structure */
|
||||
if (CONFIG(HAVE_REGULATORY_DOMAIN)) {
|
||||
|
@ -567,7 +568,9 @@ void wifi_pcie_fill_ssdt(const struct device *dev)
|
|||
return;
|
||||
|
||||
wifi_ssdt_write_device(dev, path);
|
||||
wifi_ssdt_write_properties(dev, path);
|
||||
const struct device *child = dev->link_list->children;
|
||||
if (child && child->path.type == DEVICE_PATH_GENERIC)
|
||||
wifi_ssdt_write_properties(child, path);
|
||||
}
|
||||
|
||||
const char *wifi_pcie_acpi_name(const struct device *dev)
|
||||
|
|
|
@ -21,6 +21,7 @@ struct device_operations wifi_pcie_ops = {
|
|||
.enable_resources = pci_dev_enable_resources,
|
||||
.init = wifi_pci_dev_init,
|
||||
.ops_pci = &pci_dev_ops_pci,
|
||||
.scan_bus = scan_static_bus,
|
||||
#if CONFIG(HAVE_ACPI_TABLES)
|
||||
.acpi_name = wifi_pcie_acpi_name,
|
||||
.acpi_fill_ssdt = wifi_pcie_fill_ssdt,
|
||||
|
@ -41,6 +42,11 @@ struct device_operations wifi_cnvi_ops = {
|
|||
#endif
|
||||
};
|
||||
|
||||
struct device_operations wifi_generic_ops = {
|
||||
.read_resources = noop_read_resources,
|
||||
.set_resources = noop_set_resources,
|
||||
};
|
||||
|
||||
static bool is_cnvi(const struct device *dev)
|
||||
{
|
||||
return dev && dev->path.type != DEVICE_PATH_PCI;
|
||||
|
@ -59,16 +65,12 @@ bool wifi_generic_cnvi_ddr_rfim_enabled(const struct device *dev)
|
|||
|
||||
static void wifi_generic_enable(struct device *dev)
|
||||
{
|
||||
DEVTREE_CONST struct drivers_wifi_generic_config *config = dev ? dev->chip_info : NULL;
|
||||
|
||||
if (!config)
|
||||
return;
|
||||
|
||||
#if !DEVTREE_EARLY
|
||||
if (is_cnvi(dev))
|
||||
dev->ops = &wifi_cnvi_ops;
|
||||
const struct device *parent = dev->bus->dev;
|
||||
if (parent && parent->ops == &wifi_pcie_ops)
|
||||
dev->ops = &wifi_generic_ops;
|
||||
else
|
||||
dev->ops = &wifi_pcie_ops;
|
||||
dev->ops = &wifi_cnvi_ops;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue