blob: 128edc55d6109cca8c1e49ca0ad91b0879429e7b [file] [log] [blame]
Lee Leahy77ff0b12015-05-05 15:07:29 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2013 Google Inc.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; version 2 of
9 * the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
Lee Leahy77ff0b12015-05-05 15:07:29 -070015 */
16
17Device (EMMC)
18{
19 Name (_HID, "80860F14")
20 Name (_CID, "PNP0D40")
21 Name (_UID, 1)
22 Name (_DDN, "eMMC Controller 4.5")
23
24 Name (RBUF, ResourceTemplate()
25 {
26 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
27 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
28 {
29 SCC_EMMC_IRQ
30 }
31 })
32
33 Method (_CRS)
34 {
35 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
36 Store (\C0B0, RBAS)
37 Return (^RBUF)
38 }
39
40 Method (_STA)
41 {
42 If (LEqual (\C0EN, 1)) {
43 Return (0xF)
44 } Else {
45 Return (0x0)
46 }
47 }
48
49 OperationRegion (KEYS, SystemMemory, C0B1, 0x100)
50 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
51 {
52 Offset (0x84),
53 PSAT, 32,
54 }
55
56 Method (_PS3)
57 {
58 Or (PSAT, 0x00000003, PSAT)
59 Or (PSAT, 0x00000000, PSAT)
60 }
61
62 Method (_PS0)
63 {
64 And (PSAT, 0xfffffffc, PSAT)
65 Or (PSAT, 0x00000000, PSAT)
66 }
67
68 Device (EM45)
69 {
70 /* Slot 0, Function 8 */
71 Name (_ADR, 0x8)
72
73 Method (_RMV, 0, NotSerialized)
74 {
75 Return (0)
76 }
77 }
78}
79
Matt DeVillier62bef5a2018-01-21 18:28:38 -060080Device (PEMC)
81{
82 Name (_ADR, 0x00100000) // _ADR: Address
83
84 OperationRegion (SDIO, PCI_Config, 0x84, 0x04)
85 Field (SDIO, WordAcc, NoLock, Preserve)
86 {
87 Offset (0x01),
88 PMEE, 1,
89 , 6,
90 PMES, 1
91 }
92
93 Method (_STA, 0, NotSerialized)
94 {
95 If (LEqual (\C0EN, 1)) {
96 Return (0x0)
97 }
98 Else
99 {
100 Return (0xF)
101 }
102 }
103
104 Method (_DSW, 3, NotSerialized)
105 {
106 }
107
108 Device (CARD)
109 {
110 Name (_ADR, 0x08)
111 Method (_RMV, 0, NotSerialized)
112 {
113 Return (Zero)
114 }
115 }
116}
117
Lee Leahy77ff0b12015-05-05 15:07:29 -0700118Device (SDIO)
119{
120 Name (_HID, "INT33BB")
121 Name (_CID, "PNP0D40")
122 Name (_UID, 2)
123 Name (_DDN, "SDIO Controller")
124
125 Name (RBUF, ResourceTemplate()
126 {
127 Memory32Fixed (ReadWrite, 0, 0x1000, BAR0)
128 Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,)
129 {
130 SCC_SDIO_IRQ
131 }
132 })
133
134 Method (_CRS)
135 {
136 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
137 Store (\C1B0, RBAS)
138 Return (^RBUF)
139 }
140
141 Method (_STA)
142 {
143 If (LEqual (\C1EN, 1)) {
144 Return (0xF)
145 } Else {
146 Return (0x0)
147 }
148 }
149
150 OperationRegion (KEYS, SystemMemory, C1B1, 0x100)
151 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
152 {
153 Offset (0x84),
154 PSAT, 32,
155 }
156
157 Method (_PS3)
158 {
159 Or (PSAT, 0x00000003, PSAT)
160 Or (PSAT, 0x00000000, PSAT)
161 }
162
163 Method (_PS0)
164 {
165 And (PSAT, 0xfffffffc, PSAT)
166 Or (PSAT, 0x00000000, PSAT)
167 }
168}
169
170Device (SDCD)
171{
Lee Leahy32471722015-04-20 15:20:28 -0700172 Name (_HID, "INT33BB")
Lee Leahy77ff0b12015-05-05 15:07:29 -0700173 Name (_CID, "PNP0D40")
174 Name (_UID, 3)
175 Name (_DDN, "SD Card Controller")
176
177 Name (RBUF, ResourceTemplate()
178 {
Lee Leahy32471722015-04-20 15:20:28 -0700179 Memory32Fixed (ReadWrite, 0x00000000, 0x00001000, BAR0)
180 Interrupt(ResourceConsumer, Level, ActiveLow, Exclusive, , , )
181 {SCC_SD_IRQ} /* SD Card IRQ */
182 GpioInt(Edge, ActiveBoth, SharedAndWake, PullNone, 10000, "\\_SB.GPSE", 0, ResourceConsumer, , )
183 {SDCARD_CD} /* SE81 */
Lee Leahy77ff0b12015-05-05 15:07:29 -0700184 })
185
186 Method (_CRS)
187 {
188 CreateDwordField (^RBUF, ^BAR0._BAS, RBAS)
189 Store (\C2B0, RBAS)
190 Return (^RBUF)
191 }
192
193 Method (_STA)
194 {
195 If (LEqual (\C2EN, 1)) {
196 Return (0xF)
197 } Else {
198 Return (0x0)
199 }
200 }
201
202 OperationRegion (KEYS, SystemMemory, C2B1, 0x100)
203 Field (KEYS, DWordAcc, NoLock, WriteAsZeros)
204 {
205 Offset (0x84),
206 PSAT, 32,
207 }
208
209 Method (_PS3)
210 {
211 Or (PSAT, 0x00000003, PSAT)
212 Or (PSAT, 0x00000000, PSAT)
213 }
214
215 Method (_PS0)
216 {
217 And (PSAT, 0xfffffffc, PSAT)
218 Or (PSAT, 0x00000000, PSAT)
219 }
220}