summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorKapil Porwal <kapilporwal@google.com>2022-11-28 18:53:40 +0530
committerFelix Held <felix-coreboot@felixheld.de>2022-12-05 14:32:04 +0000
commit65bcb57eea2c1c0a482f2678185920e24513b303 (patch)
tree3a31c9ab5cca65a786b51ad35dd7b9326aa300e3 /src/soc
parent9b592f70d68575a4bb982bf3885ec034fa58e518 (diff)
soc/intel/cmn/block/{pcie/rtd3,usb4}: Use helper functions for _DSD
BUG=b:259716145 TEST=Verified SSDT on google/rex. Signed-off-by: Kapil Porwal <kapilporwal@google.com> Change-Id: Ib57dea9b16e4590ca2d75ac1512fdaf773ec50f6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/70065 Reviewed-by: Tarun Tuli <taruntuli@google.com> Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/intel/common/block/pcie/rtd3/rtd3.c38
-rw-r--r--src/soc/intel/common/block/usb4/pcie.c13
2 files changed, 8 insertions, 43 deletions
diff --git a/src/soc/intel/common/block/pcie/rtd3/rtd3.c b/src/soc/intel/common/block/pcie/rtd3/rtd3.c
index 2c60eff069..f9b587df3a 100644
--- a/src/soc/intel/common/block/pcie/rtd3/rtd3.c
+++ b/src/soc/intel/common/block/pcie/rtd3/rtd3.c
@@ -13,25 +13,6 @@
#include <soc/iomap.h>
#include "chip.h"
-/*
- * The "ExternalFacingPort" and "HotPlugSupportInD3" properties are defined at
- * https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports
- */
-#define PCIE_EXTERNAL_PORT_UUID "EFCC06CC-73AC-4BC3-BFF0-76143807C389"
-#define PCIE_EXTERNAL_PORT_PROPERTY "ExternalFacingPort"
-
-#define PCIE_HOTPLUG_IN_D3_UUID "6211E2C0-58A3-4AF3-90E1-927A4E0C55A4"
-#define PCIE_HOTPLUG_IN_D3_PROPERTY "HotPlugSupportInD3"
-
-/*
- * This UUID and the resulting ACPI Device Property is defined by the
- * Power Management for Storage Hardware Devices:
- *
- * https://docs.microsoft.com/en-us/windows-hardware/design/component-guidelines/power-management-for-storage-hardware-devices-intro
- */
-#define PCIE_RTD3_STORAGE_UUID "5025030F-842F-4AB4-A561-99A5189762D0"
-#define PCIE_RTD3_STORAGE_PROPERTY "StorageD3Enable"
-
/* PCIe Root Port registers for link status and L23 control. */
#define PCH_PCIE_CFG_LSTS 0x52 /* Link Status Register */
#define PCH_PCIE_CFG_SPR 0xe0 /* Scratchpad */
@@ -367,7 +348,7 @@ static void pcie_rtd3_acpi_fill_ssdt(const struct device *dev)
FIELDLIST_NAMESTR(ACPI_REG_PCI_L23_RDY_DETECT, 1),
};
int pcie_rp;
- struct acpi_dp *dsd, *pkg;
+ struct acpi_dp *dsd;
if (!is_dev_enabled(parent)) {
printk(BIOS_ERR, "%s: root port not enabled\n", __func__);
@@ -474,16 +455,11 @@ static void pcie_rtd3_acpi_fill_ssdt(const struct device *dev)
/* Indicate to the OS that device supports hotplug in D3. */
dsd = acpi_dp_new_table("_DSD");
- pkg = acpi_dp_new_table(PCIE_HOTPLUG_IN_D3_UUID);
- acpi_dp_add_integer(pkg, PCIE_HOTPLUG_IN_D3_PROPERTY, 1);
- acpi_dp_add_package(dsd, pkg);
+ acpi_device_add_hotplug_support_in_d3(dsd);
/* Indicate to the OS if the device provides an External facing port. */
- if (config->add_acpi_external_facing_port) {
- pkg = acpi_dp_new_table(PCIE_EXTERNAL_PORT_UUID);
- acpi_dp_add_integer(pkg, PCIE_EXTERNAL_PORT_PROPERTY, 1);
- acpi_dp_add_package(dsd, pkg);
- }
+ if (config->add_acpi_external_facing_port)
+ acpi_device_add_external_facing_port(dsd);
/* Indicate to the OS if the device has DMA property. */
if (config->add_acpi_dma_property)
@@ -502,11 +478,7 @@ static void pcie_rtd3_acpi_fill_ssdt(const struct device *dev)
acpigen_write_STA(ACPI_STATUS_DEVICE_ALL_ON);
acpigen_write_name_integer("_S0W", ACPI_DEVICE_SLEEP_D3_COLD);
- dsd = acpi_dp_new_table("_DSD");
- pkg = acpi_dp_new_table(PCIE_RTD3_STORAGE_UUID);
- acpi_dp_add_integer(pkg, PCIE_RTD3_STORAGE_PROPERTY, 1);
- acpi_dp_add_package(dsd, pkg);
- acpi_dp_write(dsd);
+ acpi_device_add_storage_d3_enable(NULL);
acpigen_pop_len(); /* Device */
diff --git a/src/soc/intel/common/block/usb4/pcie.c b/src/soc/intel/common/block/usb4/pcie.c
index 85292e228f..0139647949 100644
--- a/src/soc/intel/common/block/usb4/pcie.c
+++ b/src/soc/intel/common/block/usb4/pcie.c
@@ -9,15 +9,12 @@
#include "chip.h"
-#define PCI_HOTPLUG_IN_D3_UUID "6211E2C0-58A3-4AF3-90E1-927A4E0C55A4"
-#define PCI_EXTERNAL_PORT_UUID "EFCC06CC-73AC-4BC3-BFF0-76143807C389"
-
#if CONFIG(HAVE_ACPI_TABLES)
static void usb4_pcie_acpi_fill_ssdt(const struct device *dev)
{
const struct soc_intel_common_block_usb4_config *config;
const struct device *parent;
- struct acpi_dp *dsd, *pkg;
+ struct acpi_dp *dsd;
const char *usb4_path;
int port_id;
@@ -56,15 +53,11 @@ static void usb4_pcie_acpi_fill_ssdt(const struct device *dev)
acpi_dp_add_integer(dsd, "usb4-port-number", port_id);
/* Indicate that device supports hotplug in D3. */
- pkg = acpi_dp_new_table(PCI_HOTPLUG_IN_D3_UUID);
- acpi_dp_add_integer(pkg, "HotPlugSupportInD3", 1);
- acpi_dp_add_package(dsd, pkg);
+ acpi_device_add_hotplug_support_in_d3(dsd);
/* Indicate that port is external. */
- pkg = acpi_dp_new_table(PCI_EXTERNAL_PORT_UUID);
- acpi_dp_add_integer(pkg, "ExternalFacingPort", 1);
+ acpi_device_add_external_facing_port(dsd);
- acpi_dp_add_package(dsd, pkg);
acpi_dp_write(dsd);
acpigen_pop_len(); /* Scope */