drivers/wifi/generic: Add support for UntrustedDevice ACPI property

The Linux kernel has the idea of an "untrusted" PCI device, which may
have limited I/O and memory access permissions, depending on which IOMMU
domains it may be a part of.

https://crrev.com/c/3406512 is a backport to the ChromiumOS kernel which
checks for this property.

BUG=b:215424986
TEST=dump SSDT on google/redrix, verify it contains the expected
UntrustedDevice property

Change-Id: I1a02ca7c5f717097ec97cf6373b9e0b81a13e05d
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61384
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Kangheui Won <khwon@chromium.org>
This commit is contained in:
Tim Wawrzynczak 2022-01-25 14:05:20 -07:00 committed by Felix Held
parent 3623eca525
commit 3babc8e12c
2 changed files with 20 additions and 2 deletions

View File

@ -26,6 +26,9 @@
/* Unique ID for the WIFI _DSM */ /* Unique ID for the WIFI _DSM */
#define ACPI_DSM_OEM_WIFI_UUID "F21202BF-8F78-4DC6-A5B3-1F738E285ADE" #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"
__weak int get_wifi_sar_limits(union wifi_sar_limits *sar_limits) __weak int get_wifi_sar_limits(union wifi_sar_limits *sar_limits)
{ {
return -1; return -1;
@ -508,10 +511,22 @@ static void wifi_ssdt_write_properties(const struct device *dev, const char *sco
/* Scope */ /* Scope */
acpigen_write_scope(scope); acpigen_write_scope(scope);
/* Wake capabilities */ if (config) {
if (config) /* Wake capabilities */
acpigen_write_PRW(config->wake, ACPI_S3); acpigen_write_PRW(config->wake, ACPI_S3);
/* Add _DSD for UntrustedDevice property. */
if (config->is_untrusted) {
struct acpi_dp *dsd, *pkg;
dsd = acpi_dp_new_table("_DSD");
pkg = acpi_dp_new_table(ACPI_DSD_UNTRUSTED_UUID);
acpi_dp_add_integer(pkg, "UntrustedDevice", 1);
acpi_dp_add_package(dsd, pkg);
acpi_dp_write(dsd);
}
}
/* Fill regulatory domain structure */ /* Fill regulatory domain structure */
if (CONFIG(HAVE_REGULATORY_DOMAIN)) { if (CONFIG(HAVE_REGULATORY_DOMAIN)) {
/* /*

View File

@ -9,6 +9,9 @@
*/ */
struct drivers_wifi_generic_config { struct drivers_wifi_generic_config {
unsigned int wake; unsigned int wake;
/* When set to true, this will add a _DSD which contains a single
property, `UntrustedDevice`, set to 1, to the ACPI Device. */
bool is_untrusted;
}; };
#endif /* _GENERIC_WIFI_H_ */ #endif /* _GENERIC_WIFI_H_ */