Debian Codegraph @

src/soc/intel/skylake/acpi/scs.asl

raw
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 /* Intel Storage Controllers */
4
5 Device (EMMC)
6 {
7 Name (_ADR, 0x001E0004)
8 Name (_DDN, "eMMC Controller")
9 Name (UUID, ToUUID ("E5C937D0-3553-4D7A-9117-EA4D19C3434D"))
10 Name (TEMP, 0)
11
12 OperationRegion (EMCR, PCI_Config, 0x00, 0x100)
13 Field (EMCR, WordAcc, NoLock, Preserve)
14 {
15 Offset (0x84), /* PMECTRLSTATUS */
16 PMCR, 16,
17 Offset (0xa2), /* PG_CONFIG */
18 , 2,
19 PGEN, 1, /* PG_ENABLE */
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 (Arg0 == ^UUID) {
31 /*
32 * Function 9: Device Readiness Durations
33 * Returns a package of five integers covering
34 * various device related delay in PCIe Base Spec.
35 */
36 If (Arg2 == 9) {
37 /*
38 * Function 9 support for revision 3.
39 * ECN link for function definitions
40 * [https://pcisig.com/sites/default/files/
41 * specification_documents/
42 * ECN_fw_latency_optimization_final.pdf]
43 */
44 If (Arg1 == 3) {
45 /*
46 * Integer 0: FW reset time.
47 * Integer 1: FW data link up time.
48 * Integer 2: FW functional level reset
49 * time.
50 * Integer 3: FW D3 hot to D0 time.
51 * Integer 4: FW VF enable time.
52 * set ACPI constant Ones for elements
53 * where overriding the default value
54 * is not desired.
55 */
56 Return (Package (5) {0, Ones, Ones,
57 Ones, Ones})
58 }
59 }
60 }
61 Return (Buffer() { 0x00 })
62 }
63
64 Method (_PS0, 0, Serialized)
65 {
66 /* Disable Power Gate */
67 ^PGEN = 0
68
69 /* Clear bits 31, 6, 2, 0 */
70 ^^PCRA (PID_SCS, 0x600, 0x7FFFFFBA)
71 Sleep (2)
72
73 /* Set bits 31, 6, 2, 0 */
74 ^^PCRO (PID_SCS, 0x600, 0x80000045)
75
76 /* Set Power State to D0 */
77 PMCR &= 0xFFFC
78 ^TEMP = PMCR
79 }
80
81 Method (_PS3, 0, Serialized)
82 {
83 /* Enable Power Gate */
84 ^PGEN = 1
85
86 /* Set Power State to D3 */
87 PMCR |= 0x0003
88 ^TEMP = PMCR
89 }
90
91 Device (CARD)
92 {
93 Name (_ADR, 0x00000008)
94 Method (_RMV, 0, NotSerialized)
95 {
96 Return (0)
97 }
98 }
99 }
100
101 #if !CONFIG(EXCLUDE_NATIVE_SD_INTERFACE)
102 Device (SDXC)
103 {
104 Name (_ADR, 0x001E0006)
105 Name (_DDN, "SD Controller")
106 Name (TEMP, 0)
107
108 OperationRegion (SDCR, PCI_Config, 0x00, 0x100)
109 Field (SDCR, WordAcc, NoLock, Preserve)
110 {
111 Offset (0x84), /* PMECTRLSTATUS */
112 PMCR, 16,
113 Offset (0xa2), /* PG_CONFIG */
114 , 2,
115 PGEN, 1, /* PG_ENABLE */
116 }
117
118 Method (_PS0, 0, Serialized)
119 {
120 /* Disable 20K pull-down on CLK, CMD and DAT lines */
121 ^^PCRA (PID_GPIOCOM3, 0x4c4, 0xFFFFEFFF)
122 ^^PCRA (PID_GPIOCOM3, 0x4cc, 0xFFFFEFFF)
123 ^^PCRA (PID_GPIOCOM3, 0x4d4, 0xFFFFEFFF)
124 ^^PCRA (PID_GPIOCOM3, 0x4dc, 0xFFFFEFFF)
125 ^^PCRA (PID_GPIOCOM3, 0x4e4, 0xFFFFEFFF)
126 ^^PCRA (PID_GPIOCOM3, 0x4f4, 0xFFFFEFFF)
127
128 /* Disable Power Gate */
129 ^PGEN = 0
130
131 /* Clear bits 8, 7, 2, 0 */
132 ^^PCRA (PID_SCS, 0x600, 0xFFFFFE7A)
133 Sleep (2)
134
135 /* Set bits 8, 7, 2, 0 */
136 ^^PCRO (PID_SCS, 0x600, 0x00000185)
137
138 /* Set Power State to D0 */
139 PMCR &= 0xFFFC
140 ^TEMP = PMCR
141 }
142
143 Method (_PS3, 0, Serialized)
144 {
145 /* Enable Power Gate */
146 ^PGEN = 1
147
148 /* Set Power State to D3 */
149 PMCR |= 0x0003
150 ^TEMP = PMCR
151
152 /* Enable 20K pull-down on CLK, CMD and DAT lines */
153 ^^PCRO (PID_GPIOCOM3, 0x4c4, 0x00001000)
154 ^^PCRO (PID_GPIOCOM3, 0x4cc, 0x00001000)
155 ^^PCRO (PID_GPIOCOM3, 0x4d4, 0x00001000)
156 ^^PCRO (PID_GPIOCOM3, 0x4dc, 0x00001000)
157 ^^PCRO (PID_GPIOCOM3, 0x4e4, 0x00001000)
158 ^^PCRO (PID_GPIOCOM3, 0x4f4, 0x00001000)
159 }
160
161 Device (CARD)
162 {
163 Name (_ADR, 0x00000008)
164 Method (_RMV, 0, NotSerialized)
165 {
166 Return (1)
167 }
168 }
169 }
170 #endif