summaryrefslogtreecommitdiff
path: root/src/mainboard/google/skyrim/variants
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/skyrim/variants')
-rw-r--r--src/mainboard/google/skyrim/variants/winterhold/include/variant/acpi/dtts.asl116
1 files changed, 116 insertions, 0 deletions
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
+ }
+}