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