summaryrefslogtreecommitdiff
path: root/src/mainboard/google/brya/acpi/gpu_top.asl
blob: f3b348aba83595b2cbff1ecb11cc501efac1ffea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* SPDX-License-Identifier: GPL-2.0-or-later */

#include "gpu_defines.h"

Scope (\_SB.PCI0.PEG0)
{
	#include "peg.asl"

	Device (PEGP)
	{
		Name (_ADR, 0x0)
		OperationRegion (PCIC, PCI_Config, 0x00, 0x100)
		Field (PCIC, DWordAcc, NoLock, Preserve)
		{
			NVID,	16,
			NDID,	16,
			CMDR,	8,
			VGAR,	2008,			/* VGA Registers */
		}

		#include "utility.asl"
		#include "power.asl"
		#include "nvop.asl"
		#include "nvjt.asl"
		#include "nbci.asl"
		#include "nvpcf.asl"
		#include "gps.asl"

		Method (_DSM, 4, Serialized)
		{
			If (Arg0 == ToUUID (UUID_NVOP))
			{
				If (ToInteger(Arg1) >= REVISION_MIN_NVOP)
				{
					Return (NVOP (Arg2, Arg3))
				}
			}
			ElseIf (Arg0 == ToUUID (UUID_NVJT))
			{
				If (ToInteger (Arg1) >= REVISION_MIN_NVJT)
				{
					Return (NVJT (Arg2, Arg3))
				}
			}
			ElseIf (Arg0 == ToUUID (UUID_NBCI))
			{
				If (ToInteger (Arg1) >= REVISION_MIN_NBCI)
				{
					Return (NBCI (Arg2, Arg3))
				}
			}
			ElseIf (Arg0 == ToUUID (UUID_NVPCF))
			{
				If (ToInteger (Arg1) >= REVISION_MIN_NVPCF)
				{
					Return (NPCF (Arg2, Arg3))
				}
			}
			ElseIf (Arg0 == ToUUID (UUID_GPS))
			{
				If (ToInteger (Arg1) != REVISION_MIN_GPS)
				{
					Return (GPS (Arg2, Arg3))
				}
			}

			Return (NV_ERROR_UNSUPPORTED)
		}
	}
}