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:
parent
9b592f70d6
commit
65bcb57eea
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue