summaryrefslogtreecommitdiff
path: root/src/mainboard/google/brya
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/brya')
-rw-r--r--src/mainboard/google/brya/acpi/gpu_defines.h12
-rw-r--r--src/mainboard/google/brya/acpi/gpu_ec.asl13
-rw-r--r--src/mainboard/google/brya/acpi/gpu_top.asl27
3 files changed, 52 insertions, 0 deletions
diff --git a/src/mainboard/google/brya/acpi/gpu_defines.h b/src/mainboard/google/brya/acpi/gpu_defines.h
index ec17a1c452..1cb03145b0 100644
--- a/src/mainboard/google/brya/acpi/gpu_defines.h
+++ b/src/mainboard/google/brya/acpi/gpu_defines.h
@@ -46,3 +46,15 @@
#define REVISION_MIN_NBCI 0x102
#define REVISION_MIN_NVPCF 0x200
#define REVISION_MIN_GPS 0x200
+
+#define D1_EC 0
+#define D2_EC 1
+#define D3_EC 2
+#define D4_EC 3
+#define D5_EC 4
+
+#define D1_GPU 0xD1
+#define D2_GPU 0xD2
+#define D3_GPU 0xD3
+#define D4_GPU 0xD4
+#define D5_GPU 0xD5
diff --git a/src/mainboard/google/brya/acpi/gpu_ec.asl b/src/mainboard/google/brya/acpi/gpu_ec.asl
new file mode 100644
index 0000000000..998d9c0e6a
--- /dev/null
+++ b/src/mainboard/google/brya/acpi/gpu_ec.asl
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#define EC_D_NOTIFY_MASK 0x7
+
+Scope (\_SB.PCI0.LPCB.EC0)
+{
+ /* EC has data for GPU in memmap */
+ Method (_Q0C, 0, Serialized)
+ {
+ Local0 = ToInteger(GPUD) & EC_D_NOTIFY_MASK
+ \_SB.PCI0.PEG0.PEGP.DNOT (Local0)
+ }
+}
diff --git a/src/mainboard/google/brya/acpi/gpu_top.asl b/src/mainboard/google/brya/acpi/gpu_top.asl
index f3b348aba8..c98358ff8d 100644
--- a/src/mainboard/google/brya/acpi/gpu_top.asl
+++ b/src/mainboard/google/brya/acpi/gpu_top.asl
@@ -25,6 +25,33 @@ Scope (\_SB.PCI0.PEG0)
#include "nbci.asl"
#include "nvpcf.asl"
#include "gps.asl"
+ #include "gpu_ec.asl"
+
+ /* Convert D Notify from EC to GPU */
+ Method (CNVD, 1, NotSerialized)
+ {
+ Switch (ToInteger(Arg0)) {
+ Case (D1_EC) { Return (D1_GPU) }
+ Case (D2_EC) { Return (D2_GPU) }
+ Case (D3_EC) { Return (D3_GPU) }
+ Case (D4_EC) { Return (D4_GPU) }
+ Case (D5_EC) { Return (D5_GPU) }
+ Default { Return (D5_GPU) }
+ }
+ }
+
+ /* Current D Notify Value, defaults to D1 */
+ Name (CDNV, D1_EC)
+ Method (DNOT, 1, Serialized)
+ {
+ Printf ("EC: GPU D-Notify, %o", Arg0)
+ If (Arg0 != CDNV)
+ {
+ CDNV = Arg0
+ Local0 = CNVD (Arg0)
+ Notify (\_SB.PCI0.PEG0.PEGP, Local0)
+ }
+ }
Method (_DSM, 4, Serialized)
{