From e24d9d6b45e9e106539ad60d4584ef1b1b9075e1 Mon Sep 17 00:00:00 2001 From: Sean Rhodes Date: Mon, 17 Apr 2023 20:42:47 +0100 Subject: soc/intel/meteorlake: Don't offer D3Cold when it's disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use D3COLD_SUPPORT Kconfig option to adjust the maximum supported sleep state in ACPI. Signed-off-by: Sean Rhodes Change-Id: Ifa55a19727e6adb6864158c2c323d08a0c22b996 Reviewed-on: https://review.coreboot.org/c/coreboot/+/74479 Tested-by: build bot (Jenkins) Reviewed-by: Michael Niewöhner --- src/soc/intel/meteorlake/acpi/tcss.asl | 2 ++ src/soc/intel/meteorlake/acpi/tcss_dma.asl | 20 ++++++++++++++++++++ src/soc/intel/meteorlake/acpi/tcss_pcierp.asl | 20 ++++++++++++++++++++ src/soc/intel/meteorlake/acpi/tcss_xhci.asl | 6 ++++++ 4 files changed, 48 insertions(+) diff --git a/src/soc/intel/meteorlake/acpi/tcss.asl b/src/soc/intel/meteorlake/acpi/tcss.asl index c1360489ea..1d562c9a2e 100644 --- a/src/soc/intel/meteorlake/acpi/tcss.asl +++ b/src/soc/intel/meteorlake/acpi/tcss.asl @@ -657,6 +657,7 @@ Scope (\_SB.PCI0) } } +#if CONFIG(D3COLD_SUPPORT) Method (TCON, 0) { /* Reset IOM D3 cold bit if it is in D3 cold now. */ @@ -763,6 +764,7 @@ Scope (\_SB.PCI0) STAT = 0 } } +#endif // D3COLD_SUPPORT /* * TCSS xHCI device diff --git a/src/soc/intel/meteorlake/acpi/tcss_dma.asl b/src/soc/intel/meteorlake/acpi/tcss_dma.asl index d00f79432d..94678fcd00 100644 --- a/src/soc/intel/meteorlake/acpi/tcss_dma.asl +++ b/src/soc/intel/meteorlake/acpi/tcss_dma.asl @@ -27,25 +27,45 @@ Name (STAT, 0x1) /* Variable to save power state 1 - D0, 0 - D3C */ Method (_S0W, 0x0) { +#if CONFIG(D3COLD_SUPPORT) Return (0x4) +#else + Return (0x3) +#endif // D3COLD_SUPPORT } Method (_PR0) { +#if CONFIG(D3COLD_SUPPORT) If (DUID == 0) { Return (Package() { \_SB.PCI0.D3C, \_SB.PCI0.TBT0 }) } Else { Return (Package() { \_SB.PCI0.D3C, \_SB.PCI0.TBT1 }) } +#else + If (DUID == 0) { + Return (Package() { \_SB.PCI0.TBT0 }) + } Else { + Return (Package() { \_SB.PCI0.TBT1 }) + } +#endif // D3COLD_SUPPORT } Method (_PR3) { +#if CONFIG(D3COLD_SUPPORT) If (DUID == 0) { Return (Package() { \_SB.PCI0.D3C, \_SB.PCI0.TBT0 }) } Else { Return (Package() { \_SB.PCI0.D3C, \_SB.PCI0.TBT1 }) } +#else + If (DUID == 0) { + Return (Package() { \_SB.PCI0.TBT0 }) + } Else { + Return (Package() { \_SB.PCI0.TBT1 }) + } +#endif // D3COLD_SUPPORT } /* diff --git a/src/soc/intel/meteorlake/acpi/tcss_pcierp.asl b/src/soc/intel/meteorlake/acpi/tcss_pcierp.asl index 48b8c739c5..6dbde46f49 100644 --- a/src/soc/intel/meteorlake/acpi/tcss_pcierp.asl +++ b/src/soc/intel/meteorlake/acpi/tcss_pcierp.asl @@ -247,25 +247,45 @@ Method (_PS3, 0, Serialized) Method (_S0W, 0x0, NotSerialized) { +#if CONFIG(D3COLD_SUPPORT) Return (0x4) +#else + Return (0x3) +#endif // D3COLD_SUPPORT } Method (_PR0) { +#if CONFIG(D3COLD_SUPPORT) If ((TUID == 0) || (TUID == 1)) { Return (Package() { \_SB.PCI0.D3C, \_SB.PCI0.TBT0 }) } Else { Return (Package() { \_SB.PCI0.D3C, \_SB.PCI0.TBT1 }) } +#else + If ((TUID == 0) || (TUID == 1)) { + Return (Package() { \_SB.PCI0.TBT0 }) + } Else { + Return (Package() { \_SB.PCI0.TBT1 }) + } +#endif // D3COLD_SUPPORT } Method (_PR3) { +#if CONFIG(D3COLD_SUPPORT) If ((TUID == 0) || (TUID == 1)) { Return (Package() { \_SB.PCI0.D3C, \_SB.PCI0.TBT0 }) } Else { Return (Package() { \_SB.PCI0.D3C, \_SB.PCI0.TBT1 }) } +#else + If ((TUID == 0) || (TUID == 1)) { + Return (Package() { \_SB.PCI0.TBT0 }) + } Else { + Return (Package() { \_SB.PCI0.TBT1 }) + } +#endif // D3COLD_SUPPORT } /* diff --git a/src/soc/intel/meteorlake/acpi/tcss_xhci.asl b/src/soc/intel/meteorlake/acpi/tcss_xhci.asl index 422e6f7f45..ddc5a6665d 100644 --- a/src/soc/intel/meteorlake/acpi/tcss_xhci.asl +++ b/src/soc/intel/meteorlake/acpi/tcss_xhci.asl @@ -30,7 +30,11 @@ Method (_PS3, 0, Serialized) Method (_S0W, 0x0, NotSerialized) { +#if CONFIG(D3COLD_SUPPORT) Return (0x4) +#else + Return (0x3) +#endif // D3COLD_SUPPORT } /* @@ -39,6 +43,7 @@ Method (_S0W, 0x0, NotSerialized) */ Name (SD3C, 0) +#if CONFIG(D3COLD_SUPPORT) Method (_PR0) { Return (Package () { \_SB.PCI0.D3C }) @@ -48,6 +53,7 @@ Method (_PR3) { Return (Package () { \_SB.PCI0.D3C }) } +#endif // D3COLD_SUPPORT /* * XHCI controller _DSM method -- cgit v1.2.3