Angel Pons | 32abdd6 | 2020-04-05 15:47:03 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Aamir Bohra | 3ee54bb | 2018-10-17 11:55:01 +0530 | [diff] [blame] | 3 | |
| 4 | /* Audio Controller - Device 31, Function 3 */ |
| 5 | |
| 6 | Device (HDAS) |
| 7 | { |
| 8 | Name (_ADR, 0x001f0003) |
| 9 | Name (_DDN, "Audio Controller") |
| 10 | Name (UUID, ToUUID ("A69F886E-6CEB-4594-A41F-7B5DCE24C553")) |
| 11 | |
| 12 | /* Device is D3 wake capable */ |
| 13 | Name (_S0W, 3) |
| 14 | |
| 15 | /* NHLT Table Address populated from GNVS values */ |
| 16 | Name (NBUF, ResourceTemplate () { |
| 17 | QWordMemory (ResourceConsumer, PosDecode, MinFixed, |
| 18 | MaxFixed, NonCacheable, ReadOnly, |
| 19 | 0, 0, 0, 0, 1,,, NHLT, AddressRangeACPI) |
| 20 | }) |
| 21 | |
| 22 | /* |
| 23 | * Device Specific Method |
| 24 | * Arg0 - UUID |
| 25 | * Arg1 - Revision |
| 26 | * Arg2 - Function Index |
| 27 | */ |
| 28 | Method (_DSM, 4) |
| 29 | { |
| 30 | If (LEqual (Arg0, ^UUID)) { |
| 31 | /* |
| 32 | * Function 0: Function Support Query |
| 33 | * Returns a bitmask of functions supported. |
| 34 | */ |
| 35 | If (LEqual (Arg2, Zero)) { |
| 36 | /* |
| 37 | * NHLT Query only supported for revision 1 and |
| 38 | * if NHLT address and length are set in NVS. |
| 39 | */ |
| 40 | If (LAnd (LEqual (Arg1, One), |
| 41 | LAnd (LNotEqual (NHLA, Zero), |
| 42 | LNotEqual (NHLL, Zero)))) { |
| 43 | Return (Buffer (One) { 0x03 }) |
| 44 | } Else { |
| 45 | Return (Buffer (One) { 0x01 }) |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | /* |
| 50 | * Function 1: Query NHLT memory address used by |
| 51 | * Intel Offload Engine Driver to discover any non-HDA |
| 52 | * devices that are supported by the DSP. |
| 53 | * |
| 54 | * Returns a pointer to NHLT table in memory. |
| 55 | */ |
| 56 | If (LEqual (Arg2, One)) { |
| 57 | CreateQWordField (NBUF, ^NHLT._MIN, NBAS) |
| 58 | CreateQWordField (NBUF, ^NHLT._MAX, NMAS) |
| 59 | CreateQWordField (NBUF, ^NHLT._LEN, NLEN) |
| 60 | |
| 61 | Store (NHLA, NBAS) |
| 62 | Store (NHLA, NMAS) |
| 63 | Store (NHLL, NLEN) |
| 64 | |
| 65 | Return (NBUF) |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | Return (Buffer (One) { 0x00 }) |
| 70 | } |
| 71 | } |