Angel Pons | 0612b27 | 2020-04-05 15:46:56 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Pratik Prajapati | 771d483 | 2017-10-11 11:40:08 -0700 | [diff] [blame] | 2 | |
Michael Niewöhner | bc5f51f | 2021-10-18 19:54:21 +0200 | [diff] [blame] | 3 | #if CONFIG(SOC_INTEL_COMMON_BLOCK_SGX_ENABLE) |
Pratik Prajapati | 771d483 | 2017-10-11 11:40:08 -0700 | [diff] [blame] | 4 | Scope(\_SB) |
| 5 | { |
| 6 | // Secure Enclave memory |
| 7 | Device (EPC) |
| 8 | { |
Michael Niewöhner | b48caad | 2021-10-17 15:36:45 +0200 | [diff] [blame^] | 9 | External (EPCS, IntObj) |
| 10 | External (EMNA, IntObj) |
| 11 | External (ELNG, IntObj) |
Pratik Prajapati | 771d483 | 2017-10-11 11:40:08 -0700 | [diff] [blame] | 12 | Name (_HID, EISAID ("INT0E0C")) |
| 13 | Name (_STR, Unicode ("Enclave Page Cache 1.0")) |
| 14 | Name (_MLS, Package () { |
| 15 | Package (2) { "en", Unicode ("Enclave Page Cache 1.0") } |
| 16 | }) |
| 17 | |
| 18 | Name (RBUF, ResourceTemplate () |
| 19 | { |
| 20 | // _MIN, _MAX and _LEN get patched runtime |
| 21 | QWordMemory ( |
| 22 | ResourceConsumer, // ResourceUsage |
| 23 | PosDecode, // Decode _DEC |
| 24 | MinNotFixed, // IsMinFixed _MIF |
| 25 | MaxNotFixed, // IsMaxFixed _MAF |
| 26 | NonCacheable, // Cacheable _MEM |
| 27 | ReadWrite, // ReadAndWrite _RW |
| 28 | 0, // AddressGranularity _GRA |
| 29 | 0, // AddressMinimum _MIN |
| 30 | 0, // AddressMaximum _MAX |
| 31 | 0, // AddressTranslation _TRA |
| 32 | 1, // RangeLength _LEN |
| 33 | , // ResourceSourceIndex |
| 34 | , // ResourceSource |
| 35 | BAR0 // DescriptorName |
| 36 | ) |
| 37 | }) |
| 38 | |
| 39 | Method (_CRS, 0x0, NotSerialized) |
| 40 | { |
| 41 | CreateQwordField (RBUF, ^BAR0._MIN, EMIN) |
| 42 | CreateQwordField (RBUF, ^BAR0._MAX, EMAX) |
| 43 | CreateQwordField (RBUF, ^BAR0._LEN, ELEN) |
Alexey Buyanov | 0324803 | 2020-06-01 21:41:14 -0700 | [diff] [blame] | 44 | EMIN = EMNA |
| 45 | ELEN = ELNG |
| 46 | EMAX = EMNA + ELNG - 1 |
Pratik Prajapati | 771d483 | 2017-10-11 11:40:08 -0700 | [diff] [blame] | 47 | Return (RBUF) |
| 48 | } |
| 49 | |
| 50 | Method (_STA, 0x0, NotSerialized) |
| 51 | { |
Alexey Buyanov | 0324803 | 2020-06-01 21:41:14 -0700 | [diff] [blame] | 52 | If (EPCS != 0) |
Pratik Prajapati | 771d483 | 2017-10-11 11:40:08 -0700 | [diff] [blame] | 53 | { |
| 54 | Return (0xF) |
| 55 | } |
| 56 | Return (0x0) |
| 57 | } |
| 58 | |
| 59 | } // end EPC Device |
| 60 | } // End of Scope(\_SB) |
Michael Niewöhner | bc5f51f | 2021-10-18 19:54:21 +0200 | [diff] [blame] | 61 | #endif |