blob: 096444859312ba3015e81bac9e28ed38e06fad7d [file] [log] [blame]
Saurabh Satijacbaa2ab2016-03-08 17:33:29 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2016 Intel Corporation.
5 * Copyright (C) 2016 Google Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 */
17
18/* Audio Controller - Device 14, Function 0 */
19
20Device (HDAS)
21{
22 Name (_ADR, 0x000E0000)
23 Name (_DDN, "Audio Controller")
24 Name (UUID, ToUUID("A69F886E-6CEB-4594-A41F-7B5DCE24C553"))
25
26 /* Device is D3 wake capable */
27 Name (_S0W, 3)
28
29 /* NHLT Table Address populated from GNVS values */
30 Name (NBUF, ResourceTemplate() {
31 QWordMemory (ResourceConsumer, PosDecode, MinFixed,
32 MaxFixed, Cacheable, ReadOnly,
33 0, 0, 0, 0, 1,,, NHLT, AddressRangeACPI)
34 }
35 )
36
Hannah Williamscbae0cc2017-11-21 17:27:08 -080037 /* can wake up from S3 state */
38 Name (_PRW, Package() { GPE0A_AVS_PME_STS, 3 })
39
Saurabh Satijacbaa2ab2016-03-08 17:33:29 -080040 /*
41 * Device Specific Method
42 * Arg0 - UUID
43 * Arg1 - Revision
44 * Arg2 - Function Index
45 */
46 Method (_DSM, 4) {
47 If (LEqual (Arg0, ^UUID)) {
48 /*
49 * Function 0: Function Support Query
50 * Returns a bitmask of functions supported.
51 */
52 If (LEqual (Arg2, Zero)) {
53 /*
54 * NHLT Query only supported for revision 1 and
55 * if NHLT address and length are set in NVS.
56 */
57 If (LAnd (LEqual (Arg1, One),
58 LAnd (LNotEqual (NHLA, Zero),
59 LNotEqual (NHLL, Zero)))) {
60 Return (Buffer (One) { 0x03 })
61 }
62 Else {
63 Return (Buffer (One) { 0x01 })
64 }
65 }
66
67 /*
68 * Function 1: Query NHLT memory address used by
69 * Intel Offload Engine Driver to discover any non-HDA
70 * devices that are supported by the DSP.
71 *
72 * Returns a pointer to NHLT table in memory.
73 */
74 If (LEqual (Arg2, One)) {
75 CreateQWordField (NBUF, ^NHLT._MIN, NBAS)
76 CreateQWordField (NBUF, ^NHLT._MAX, NMAS)
77 CreateQWordField (NBUF, ^NHLT._LEN, NLEN)
78 Store (NHLA, NBAS)
79 Store (NHLA, NMAS)
80 Store (NHLL, NLEN)
81 Return (NBUF)
82 }
83 }
84
85 Return (Buffer (One) { 0x00 })
86 }
87}