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