diff options
-rw-r--r-- | src/mainboard/google/brya/acpi/gpu_defines.h | 2 | ||||
-rw-r--r-- | src/mainboard/google/brya/acpi/gpu_top.asl | 8 | ||||
-rw-r--r-- | src/mainboard/google/brya/acpi/nvpcf.asl | 65 |
3 files changed, 75 insertions, 0 deletions
diff --git a/src/mainboard/google/brya/acpi/gpu_defines.h b/src/mainboard/google/brya/acpi/gpu_defines.h index 65a8ee942e..ec79f81b7d 100644 --- a/src/mainboard/google/brya/acpi/gpu_defines.h +++ b/src/mainboard/google/brya/acpi/gpu_defines.h @@ -38,7 +38,9 @@ #define UUID_NVOP "a486d8f8-0bda-471b-a72b-6042a6b5bee0" #define UUID_NVJT "cbeca351-067b-4924-9cbd-b46b00b86f34" #define UUID_NBCI "d4a50b75-65c7-46f7-bfb7-41514cea0244" +#define UUID_NVPCF "36b49710-2483-11e7-9598-0800200c9a66" #define REVISION_MIN_NVOP 0x100 #define REVISION_MIN_NVJT 0x100 #define REVISION_MIN_NBCI 0x102 +#define REVISION_MIN_NVPCF 0x200 diff --git a/src/mainboard/google/brya/acpi/gpu_top.asl b/src/mainboard/google/brya/acpi/gpu_top.asl index b7e90335b6..6b492231e3 100644 --- a/src/mainboard/google/brya/acpi/gpu_top.asl +++ b/src/mainboard/google/brya/acpi/gpu_top.asl @@ -23,6 +23,7 @@ Scope (\_SB.PCI0.PEG0) #include "nvop.asl" #include "nvjt.asl" #include "nbci.asl" + #include "nvpcf.asl" Method (_DSM, 4, Serialized) { @@ -47,6 +48,13 @@ Scope (\_SB.PCI0.PEG0) Return (NBCI (Arg2, Arg3)) } } + ElseIf (Arg0 == ToUUID (UUID_NVPCF)) + { + If (ToInteger (Arg1) >= REVISION_MIN_NVPCF) + { + Return (NPCF (Arg2, Arg3)) + } + } Return (NV_ERROR_UNSUPPORTED) } diff --git a/src/mainboard/google/brya/acpi/nvpcf.asl b/src/mainboard/google/brya/acpi/nvpcf.asl new file mode 100644 index 0000000000..019a5c1742 --- /dev/null +++ b/src/mainboard/google/brya/acpi/nvpcf.asl @@ -0,0 +1,65 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#define NVPCF_FUNC_SUPPORT 0 +#define NVPCF_FUNC_GET_STATIC_CONFIG_TABLES 1 +#define NVPCF_FUNC_UPDATE_DYNAMIC_PARAMS 2 + +Method (NPCF, 2, Serialized) +{ + Switch (ToInteger (Arg0)) + { + Case (NVPCF_FUNC_SUPPORT) + { + Return (ITOB( + (1 << NVPCF_FUNC_SUPPORT) | + (1 << NVPCF_FUNC_GET_STATIC_CONFIG_TABLES) | + (1 << NVPCF_FUNC_UPDATE_DYNAMIC_PARAMS))) + } + Case (NVPCF_FUNC_GET_STATIC_CONFIG_TABLES) + { + Return (Buffer () { + /* System Device Table Header (v2.0) */ + 0x20, 0x03, 0x01, + + /* System Device Table Entries */ + 0x00, /* [3:0] CPU type (0=Intel, 1=AMD), + [7:4] GPU type (0=Nvidia) */ + + /* System Controller Table Header (v2.2), 1 controller entry */ + 0x22, 0x04, 0x05, 0x01, + + /* Controller #1 Flags */ + 0x01, /* [3:0] Controller class + 0=Disabled, 1=Dynamic Boost, + 2=CTGP-only. + [7:4] Reserved. Set to 0. */ + /* Controller #1 Params */ + 0x00, /* Class = Dynamic Boost + [0:0] DC support + 0=Not supported, 1=Supported + [31:1] Reserved. Set to 0. */ + 0x00, 0x00, 0x00, 0x00, + + /* Twos-complement checksum */ + 0xad + }) + } + Case (NVPCF_FUNC_UPDATE_DYNAMIC_PARAMS) + { + Local0 = Buffer (0x31) { + /* Dynamic Params Table Header (1 controller entry, 0x1c bytes) */ + 0x22, 0x05, 0x10, 0x1c, 0x01 } + + CreateWordField (Local0, 0x05, TGPA) + CreateDWordField (Local0, 0x15, CEO0) + + TGPA = 0x50 /* TGP on AC = 10W in 1/8-Watt increments */ + CEO0 = 0x200 /* [7:0] Controller index + [8:8] Disable controller on AC + [9:9] Disable controller on DC */ + Return (Local0) + } + } + + Return (NV_ERROR_UNSUPPORTED) +} |