Debian Codegraph @

src/mainboard/google/brya/acpi/gpu_top.asl

raw
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include "gpu_defines.h"
4
5 Scope (\_SB.PCI0.PEG0)
6 {
7 #include "peg.asl"
8
9 Device (PEGP)
10 {
11 Name (_ADR, 0x0)
12 OperationRegion (PCIC, PCI_Config, 0x00, 0x100)
13 Field (PCIC, DWordAcc, NoLock, Preserve)
14 {
15 NVID, 16,
16 NDID, 16,
17 CMDR, 8,
18 VGAR, 2008, /* VGA Registers */
19 }
20
21 #include "utility.asl"
22 #include "power.asl"
23 #include "nvop.asl"
24 #include "nvjt.asl"
25 #include "nbci.asl"
26 #include "nvpcf.asl"
27 #include "gps.asl"
28 #include "gpu_ec.asl"
29
30 /* Convert D Notify from EC to GPU */
31 Method (CNVD, 1, NotSerialized)
32 {
33 Switch (ToInteger(Arg0)) {
34 Case (D1_EC) { Return (D1_GPU) }
35 Case (D2_EC) { Return (D2_GPU) }
36 Case (D3_EC) { Return (D3_GPU) }
37 Case (D4_EC) { Return (D4_GPU) }
38 Case (D5_EC) { Return (D5_GPU) }
39 Default { Return (D5_GPU) }
40 }
41 }
42
43 /* Current D Notify Value, defaults to D1
44 * Arg0 == Shared value
45 * Arg1 == force notification if no change (0 or 1)
46 */
47 Name (CDNV, D1_EC)
48 Method (DNOT, 2, Serialized)
49 {
50 Printf ("EC: GPU D-Notify, %o", Arg0)
51 If ((Arg0 != CDNV) || (Arg1 == 1))
52 {
53 CDNV = Arg0
54 Local0 = CNVD (Arg0)
55 Notify (\_SB.PCI0.PEG0.PEGP, Local0)
56 }
57 }
58
59 Method (_DSM, 4, Serialized)
60 {
61 If (Arg0 == ToUUID (UUID_NVOP))
62 {
63 If (ToInteger(Arg1) >= REVISION_MIN_NVOP)
64 {
65 Return (NVOP (Arg2, Arg3))
66 }
67 }
68 ElseIf (Arg0 == ToUUID (UUID_NVJT))
69 {
70 If (ToInteger (Arg1) >= REVISION_MIN_NVJT)
71 {
72 Return (NVJT (Arg2, Arg3))
73 }
74 }
75 ElseIf (Arg0 == ToUUID (UUID_NBCI))
76 {
77 If (ToInteger (Arg1) >= REVISION_MIN_NBCI)
78 {
79 Return (NBCI (Arg2, Arg3))
80 }
81 }
82 ElseIf (Arg0 == ToUUID (UUID_NVPCF))
83 {
84 If (ToInteger (Arg1) >= REVISION_MIN_NVPCF)
85 {
86 Return (NPCF (Arg2, Arg3))
87 }
88 }
89 ElseIf (Arg0 == ToUUID (UUID_GPS))
90 {
91 If (ToInteger (Arg1) >= REVISION_MIN_GPS)
92 {
93 Return (GPS (Arg2, Arg3))
94 }
95 }
96
97 Return (NV_ERROR_UNSUPPORTED)
98 }
99 }
100 }