summaryrefslogtreecommitdiff
path: root/src/mainboard/google/skyrim/variants/whiterun/include
diff options
context:
space:
mode:
authorIsaac Lee <isaaclee@google.com>2023-01-26 16:06:19 -0800
committerFelix Held <felix-coreboot@felixheld.de>2023-02-14 18:04:39 +0000
commitaf69de494e2c32140ce5e00a1562c2845345b1bf (patch)
tree2a598a0dc58cd63f13a107a3412731dd9daf1394 /src/mainboard/google/skyrim/variants/whiterun/include
parent728cf8a8304ccbcb225a9acc3e20c93ba892db9e (diff)
mb/google/skyrim: Create whiterun variant
Create the whiterun variant of the skyrim reference board by copying the winterhold files to a new directory named for the variant. BUG=b:265955979 BRANCH=None TEST=emerge-skyrim coreboot and boot up on Whiterun Change-Id: I3539f84e79c05936fe006bfe9d08743d6a9a6ba7 Signed-off-by: Isaac Lee <isaaclee@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/72483 Reviewed-by: Martin L Roth <gaumless@gmail.com> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/skyrim/variants/whiterun/include')
-rw-r--r--src/mainboard/google/skyrim/variants/whiterun/include/variant/acpi/dtts.asl116
-rw-r--r--src/mainboard/google/skyrim/variants/whiterun/include/variant/ec.h3
2 files changed, 119 insertions, 0 deletions
diff --git a/src/mainboard/google/skyrim/variants/whiterun/include/variant/acpi/dtts.asl b/src/mainboard/google/skyrim/variants/whiterun/include/variant/acpi/dtts.asl
new file mode 100644
index 0000000000..9bac487cd7
--- /dev/null
+++ b/src/mainboard/google/skyrim/variants/whiterun/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()
+ \_SB.PRTN = 0
+ Return (0)
+ }
+
+ 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()
+ \_SB.PRTN = 1
+ Return (0)
+ }
+ // AMB sensor release point
+ If ((\_SB.PCI0.LPCB.EC0.TIN4 <= 118)) {
+ \_SB.DDEF()
+ \_SB.PRTN = 0
+ Return (0)
+ }
+ // Keep tht previous thermal table
+ Return (0)
+ } Else {
+ If (\_SB.PRTN == 3 || \_SB.PRTN == 5) {
+ \_SB.DTTB()
+ \_SB.PRTN = 1
+ Return (0)
+ } Else {
+ \_SB.DDEF()
+ \_SB.PRTN = 0
+ Return (0)
+ }
+ }
+ } Else { // Lid-close
+ // Table C/D
+ If (\_SB.PRTN == 2 || \_SB.PRTN == 3) {
+ If (\_SB.PCI0.LPCB.EC0.TIN4 >= 128) {
+ \_SB.DTTD()
+ \_SB.PRTN = 3
+ Return (0)
+ }
+ If(\_SB.PCI0.LPCB.EC0.TIN4 <= 123) {
+ \_SB.DTTC()
+ \_SB.PRTN = 2
+ Return (0)
+ }
+ // Keep tht previous thermal table
+ Return (0)
+ } Else {
+ If (\_SB.PRTN == 1 || \_SB.PRTN == 5) {
+ \_SB.DTTD()
+ \_SB.PRTN = 3
+ Return (0)
+ } Else {
+ \_SB.DTTC()
+ \_SB.PRTN = 2
+ Return (0)
+ }
+ }
+ }
+ } 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()
+ \_SB.PRTN = 5
+ Return (0)
+ }
+ // AMB sensor release point
+ If ((\_SB.PCI0.LPCB.EC0.TIN4 <= 113)) {
+ \_SB.DTTE()
+ \_SB.PRTN = 4
+ Return (0)
+ }
+ // Keep tht previous thermal table
+ Return (0)
+ } Else {
+ If (\_SB.PRTN == 1 || \_SB.PRTN == 3) {
+ \_SB.DTTF()
+ \_SB.PRTN = 5
+ Return (0)
+ } Else {
+ \_SB.DTTE()
+ \_SB.PRTN = 4
+ Return (0)
+ }
+ }
+ } // Desktop/Laptop End
+ }
+}
diff --git a/src/mainboard/google/skyrim/variants/whiterun/include/variant/ec.h b/src/mainboard/google/skyrim/variants/whiterun/include/variant/ec.h
new file mode 100644
index 0000000000..9e61a440cf
--- /dev/null
+++ b/src/mainboard/google/skyrim/variants/whiterun/include/variant/ec.h
@@ -0,0 +1,3 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <baseboard/ec.h>