summaryrefslogtreecommitdiff
path: root/src/mainboard/google/skyrim
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/skyrim')
-rw-r--r--src/mainboard/google/skyrim/dsdt.asl3
-rw-r--r--src/mainboard/google/skyrim/variants/winterhold/include/variant/acpi/dtts.asl116
2 files changed, 119 insertions, 0 deletions
diff --git a/src/mainboard/google/skyrim/dsdt.asl b/src/mainboard/google/skyrim/dsdt.asl
index 39399d8eb7..7293683705 100644
--- a/src/mainboard/google/skyrim/dsdt.asl
+++ b/src/mainboard/google/skyrim/dsdt.asl
@@ -14,6 +14,9 @@ DefinitionBlock (
{
#include <acpi/dsdt_top.asl>
#include <soc.asl>
+#if CONFIG(FEATURE_DYNAMIC_DPTC)
+ #include <variant/acpi/dtts.asl>
+#endif
/* ChromeOS Embedded Controller */
Scope (\_SB.PCI0.LPCB)
diff --git a/src/mainboard/google/skyrim/variants/winterhold/include/variant/acpi/dtts.asl b/src/mainboard/google/skyrim/variants/winterhold/include/variant/acpi/dtts.asl
new file mode 100644
index 0000000000..733af28943
--- /dev/null
+++ b/src/mainboard/google/skyrim/variants/winterhold/include/variant/acpi/dtts.asl
@@ -0,0 +1,116 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+External(\_SB.DTTB, MethodObj)
+External(\_SB.DTTC, MethodObj)
+External(\_SB.DTTD, MethodObj)
+External(\_SB.DTTE, MethodObj)
+External(\_SB.DTTF, MethodObj)
+
+Scope (\_SB)
+{
+ //---------------------------------------------
+ // Table | A | B | C | D | E | F | First boot |
+ //---------------------------------------------
+ // PRTN | 0 | 1 | 2 | 3 | 4 | 5 | 7 |
+ //---------------------------------------------
+ Name (PRTN, 7)
+
+ Method (DTTS, 0, Serialized)
+ {
+ // Set table A as default table after power on device
+ If (\_SB.PRTN == 7)
+ {
+ \_SB.DDEF()
+ Store (0, \_SB.PRTN)
+ Return (Zero)
+ }
+
+ If (\_SB.PCI0.LPCB.EC0.STTB == 0) { // Desktop
+ If (\_SB.PCI0.LPCB.EC0.LIDS == 1) { // Lid-open
+ // Table A/B
+ If ((\_SB.PRTN == 0) || (\_SB.PRTN == 1)) {
+ // AMB sensor trigger point
+ // 50C will store 123(0x7B) in mapped memory
+ // 50C=323K, 323-200(offset)=123(0x7B)
+ If (\_SB.PCI0.LPCB.EC0.TIN4 >= 123) {
+ \_SB.DTTB()
+ Store (1, \_SB.PRTN)
+ Return (Zero)
+ }
+ // AMB sensor release point
+ If ((\_SB.PCI0.LPCB.EC0.TIN4 <= 118)) {
+ \_SB.DDEF()
+ Store (0, \_SB.PRTN)
+ Return (Zero)
+ }
+ // Keep tht previous thermal table
+ Return (Zero)
+ } Else {
+ If (\_SB.PRTN == 3 || \_SB.PRTN == 5) {
+ \_SB.DTTB()
+ Store (1, \_SB.PRTN)
+ Return (Zero)
+ } Else {
+ \_SB.DDEF()
+ Store (0, \_SB.PRTN)
+ Return (Zero)
+ }
+ }
+ } Else { // Lid-close
+ // Table C/D
+ If (\_SB.PRTN == 2 || \_SB.PRTN == 3) {
+ If (\_SB.PCI0.LPCB.EC0.TIN4 >= 128) {
+ \_SB.DTTD()
+ Store (3, \_SB.PRTN)
+ Return (Zero)
+ }
+ If(\_SB.PCI0.LPCB.EC0.TIN4 <= 123) {
+ \_SB.DTTC()
+ Store (2, \_SB.PRTN)
+ Return (Zero)
+ }
+ // Keep tht previous thermal table
+ Return (Zero)
+ } Else {
+ If (\_SB.PRTN == 1 || \_SB.PRTN == 5) {
+ \_SB.DTTD()
+ Store (3, \_SB.PRTN)
+ Return (Zero)
+ } Else {
+ \_SB.DTTC()
+ Store (2, \_SB.PRTN)
+ Return (Zero)
+ }
+ }
+ }
+ } Else { // Laptop
+ // Table E/F
+ If (\_SB.PRTN == 4 || \_SB.PRTN == 5) {
+ // AMB sensor trigger point
+ If (\_SB.PCI0.LPCB.EC0.TIN4 >= 118) {
+ \_SB.DTTF()
+ Store (5, \_SB.PRTN)
+ Return (Zero)
+ }
+ // AMB sensor release point
+ If ((\_SB.PCI0.LPCB.EC0.TIN4 <= 113)) {
+ \_SB.DTTE()
+ Store (4, \_SB.PRTN)
+ Return (Zero)
+ }
+ // Keep tht previous thermal table
+ Return (Zero)
+ } Else {
+ If (\_SB.PRTN == 1 || \_SB.PRTN == 3) {
+ \_SB.DTTF()
+ Store (5, \_SB.PRTN)
+ Return (Zero)
+ } Else {
+ \_SB.DTTE()
+ Store (4, \_SB.PRTN)
+ Return (Zero)
+ }
+ }
+ } // Desktop/Laptop End
+ }
+}