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>
This commit is contained in:
Kapil Porwal
2022-11-28 18:53:40 +05:30
committed by Felix Held
parent 9b592f70d6
commit 65bcb57eea
3 changed files with 9 additions and 58 deletions

View File

@@ -11,15 +11,6 @@
#include <device/pci_ops.h>
#include "chip.h"
/*
* 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"
/*
* Writes the ACPI power resources for a PCI device so it can enter D3Cold.
*
@@ -81,7 +72,6 @@
*/
static void pcie_rtd3_device_acpi_fill_ssdt(const struct device *dev)
{
struct acpi_dp *dsd, *pkg;
const struct drivers_pcie_rtd3_device_config *config = config_of(dev);
/* Copy the GPIOs to avoid discards 'const' qualifier error */
struct acpi_gpio reset_gpio = config->reset_gpio;
@@ -114,11 +104,7 @@ static void pcie_rtd3_device_acpi_fill_ssdt(const struct device *dev)
/* Storage devices won't enter D3 without this property */
if ((dev->class >> 16) == PCI_BASE_CLASS_STORAGE) {
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);
printk(BIOS_INFO, "%s.%s: Added StorageD3Enable property\n", scope, name);
}