blob: a071e0861d16e8e8b4a78941a42780ec32ca5b90 [file] [log] [blame]
Angel Ponsba38f372020-04-05 15:46:45 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Lee Leahy77ff0b12015-05-05 15:07:29 -07002
3Device (EMMC)
4{
5 Name (_HID, "80860F14")
6 Name (_CID, "PNP0D40")
7 Name (_UID, 1)
8 Name (_DDN, "eMMC Controller 4.5")
9
10 Name (RBUF, ResourceTemplate()
11 {
12 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
13 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
14 {
15 SCC_EMMC_IRQ
16 }
17 })
18
19 Method (_CRS)
20 {
21 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +010022 RBAS = \C0B0
Lee Leahy77ff0b12015-05-05 15:07:29 -070023 Return (^RBUF)
24 }
25
26 Method (_STA)
27 {
Felix Singeredec4d92022-12-11 21:25:32 +010028 If (\C0EN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -070029 Return (0xF)
30 } Else {
31 Return (0x0)
32 }
33 }
34
35 OperationRegion (KEYS, SystemMemory, C0B1, 0x100)
36 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
37 {
38 Offset (0x84),
39 PSAT, 32,
40 }
41
42 Method (_PS3)
43 {
Felix Singer86bc2e72022-12-16 04:40:39 +010044 PSAT |= 3
45 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -070046 }
47
48 Method (_PS0)
49 {
Felix Singer35e65a82022-12-16 07:11:17 +010050 PSAT &= 0xfffffffc
Felix Singer86bc2e72022-12-16 04:40:39 +010051 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -070052 }
53
54 Device (EM45)
55 {
56 /* Slot 0, Function 8 */
57 Name (_ADR, 0x8)
58
59 Method (_RMV, 0, NotSerialized)
60 {
61 Return (0)
62 }
63 }
64}
65
Matt DeVillier62bef5a2018-01-21 18:28:38 -060066Device (PEMC)
67{
68 Name (_ADR, 0x00100000) // _ADR: Address
69
70 OperationRegion (SDIO, PCI_Config, 0x84, 0x04)
71 Field (SDIO, WordAcc, NoLock, Preserve)
72 {
73 Offset (0x01),
74 PMEE, 1,
75 , 6,
76 PMES, 1
77 }
78
79 Method (_STA, 0, NotSerialized)
80 {
Felix Singeredec4d92022-12-11 21:25:32 +010081 If (\C0EN == 1) {
Matt DeVillier62bef5a2018-01-21 18:28:38 -060082 Return (0x0)
83 }
84 Else
85 {
86 Return (0xF)
87 }
88 }
89
90 Method (_DSW, 3, NotSerialized)
91 {
92 }
93
94 Device (CARD)
95 {
96 Name (_ADR, 0x08)
97 Method (_RMV, 0, NotSerialized)
98 {
Felix Singer9df60d32022-12-26 09:43:07 +010099 Return (0)
Matt DeVillier62bef5a2018-01-21 18:28:38 -0600100 }
101 }
102}
103
Lee Leahy77ff0b12015-05-05 15:07:29 -0700104Device (SDIO)
105{
106 Name (_HID, "INT33BB")
107 Name (_CID, "PNP0D40")
108 Name (_UID, 2)
109 Name (_DDN, "SDIO Controller")
110
111 Name (RBUF, ResourceTemplate()
112 {
113 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
114 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
115 {
116 SCC_SDIO_IRQ
117 }
118 })
119
120 Method (_CRS)
121 {
122 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +0100123 RBAS = \C1B0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700124 Return (^RBUF)
125 }
126
127 Method (_STA)
128 {
Felix Singeredec4d92022-12-11 21:25:32 +0100129 If (\C1EN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700130 Return (0xF)
131 } Else {
132 Return (0x0)
133 }
134 }
135
136 OperationRegion (KEYS, SystemMemory, C1B1, 0x100)
137 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
138 {
139 Offset (0x84),
140 PSAT, 32,
141 }
142
143 Method (_PS3)
144 {
Felix Singer86bc2e72022-12-16 04:40:39 +0100145 PSAT |= 3
146 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700147 }
148
149 Method (_PS0)
150 {
Felix Singer35e65a82022-12-16 07:11:17 +0100151 PSAT &= 0xfffffffc
Felix Singer86bc2e72022-12-16 04:40:39 +0100152 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700153 }
154}
155
156Device (SDCD)
157{
Lee Leahy32471722015-04-20 15:20:28 -0700158 Name (_HID, "INT33BB")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700159 Name (_CID, "PNP0D40")
160 Name (_UID, 3)
161 Name (_DDN, "SD Card Controller")
162
163 Name (RBUF, ResourceTemplate()
164 {
Lee Leahy32471722015-04-20 15:20:28 -0700165 Memory32Fixed (ReadWrite, 0x00000000, 0x00001000, BAR0)
166 Interrupt(ResourceConsumer, Level, ActiveLow, Exclusive, , , )
167 {SCC_SD_IRQ} /* SD Card IRQ */
168 GpioInt(Edge, ActiveBoth, SharedAndWake, PullNone, 10000, "\\_SB.GPSE", 0, ResourceConsumer, , )
169 {SDCARD_CD} /* SE81 */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700170 })
171
172 Method (_CRS)
173 {
174 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
Felix Singer84e61232022-12-12 07:39:15 +0100175 RBAS = \C2B0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700176 Return (^RBUF)
177 }
178
179 Method (_STA)
180 {
Felix Singeredec4d92022-12-11 21:25:32 +0100181 If (\C2EN == 1) {
Lee Leahy77ff0b12015-05-05 15:07:29 -0700182 Return (0xF)
183 } Else {
184 Return (0x0)
185 }
186 }
187
188 OperationRegion (KEYS, SystemMemory, C2B1, 0x100)
189 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
190 {
191 Offset (0x84),
192 PSAT, 32,
193 }
194
195 Method (_PS3)
196 {
Felix Singer86bc2e72022-12-16 04:40:39 +0100197 PSAT |= 3
198 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700199 }
200
201 Method (_PS0)
202 {
Felix Singer35e65a82022-12-16 07:11:17 +0100203 PSAT &= 0xfffffffc
Felix Singer86bc2e72022-12-16 04:40:39 +0100204 PSAT |= 0
Lee Leahy77ff0b12015-05-05 15:07:29 -0700205 }
206}