blob: cfd7f7ed2a9f58c7a56b0851cda062d7ca6c6a7a [file] [log] [blame]
Angel Pons0612b272020-04-05 15:46:56 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Pratik Prajapati771d4832017-10-11 11:40:08 -07002
Michael Niewöhnerbc5f51f2021-10-18 19:54:21 +02003#if CONFIG(SOC_INTEL_COMMON_BLOCK_SGX_ENABLE)
Pratik Prajapati771d4832017-10-11 11:40:08 -07004Scope(\_SB)
5{
6 // Secure Enclave memory
7 Device (EPC)
8 {
Michael Niewöhnerb48caad2021-10-17 15:36:45 +02009 External (EPCS, IntObj)
10 External (EMNA, IntObj)
11 External (ELNG, IntObj)
Pratik Prajapati771d4832017-10-11 11:40:08 -070012 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 Buyanov03248032020-06-01 21:41:14 -070044 EMIN = EMNA
45 ELEN = ELNG
46 EMAX = EMNA + ELNG - 1
Pratik Prajapati771d4832017-10-11 11:40:08 -070047 Return (RBUF)
48 }
49
50 Method (_STA, 0x0, NotSerialized)
51 {
Alexey Buyanov03248032020-06-01 21:41:14 -070052 If (EPCS != 0)
Pratik Prajapati771d4832017-10-11 11:40:08 -070053 {
54 Return (0xF)
55 }
56 Return (0x0)
57 }
58
59 } // end EPC Device
60} // End of Scope(\_SB)
Michael Niewöhnerbc5f51f2021-10-18 19:54:21 +020061#endif