1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <soc/pcr_ids.h>
8 * Clear register 0x1C20/0x4820
11 Method(SCSC, 1, Serialized)
13 ^PCRA (Arg0, 0x1C20, 0x0)
14 ^PCRA (Arg0, 0x4820, 0x0)
19 Name(_ADR, 0x001A0000)
20 Name (_DDN, "eMMC Controller")
22 Name (DSUU, ToUUID("f6c13ea5-65cd-461f-ab7a-29f7e8d5bd61"))
24 OperationRegion(SCSR, PCI_Config, 0x00, 0x100)
25 Field(SCSR, WordAcc, NoLock, Preserve) {
26 VDID, 32, /* PCI VID DID */
27 Offset (0x84), /* PMECTRLSTATUS */
29 Offset (0xA2), /* PG_CONFIG */
31 PGEN, 1, /* PG_ENABLE */
35 /* Clear register 0x1C20/0x4820 */
39 Method(_PS0, 0, Serialized) {
40 Stall (50) // Sleep 50 us
42 PGEN = 0 // Disable PG
44 /* Clear register 0x1C20/0x4820 */
47 /* Set Power State to D0 */
52 Method(_PS3, 0, Serialized) {
55 /* Set Power State to D3 */
62 Name (_ADR, 0x00000008)
63 Method (_RMV, 0, NotSerialized)
68 /* _DSM x86 Device Specific Method
69 * Arg0: UUID Unique function identifier
70 * Arg1: Integer Revision Level
71 * Arg2: Integer Function Index (0 = Return Supported Functions)
72 * Arg3: Package Parameters
77 /* Check the revision */
80 * Function Index 0 the return value is a buffer
81 * containing one bit for each function index, starting
83 * Bit 0 - Indicates whether there is support for any
84 * functions other than function 0
85 * Bit 1 - Indicates support to clear power control
87 * Bit 2 - Indicates support to set power control
89 * Bit 3 - Indicates support to set 1.8V signalling
90 * Bit 4 - Indicates support to set 3.3V signalling
91 * Bit 5 - Indicates support for HS200 mode
92 * Bit 6 - Indicates support for HS400 mode
93 * Bit 9 - Indicates eMMC I/O Driver Strength
96 If (VDID == 0x02c48086) {
98 * Set bit 9 for CML eMMC to indicate
99 * eMMC I/O driver strength is supported
101 Return(Buffer() {0x0, 0x02})
106 * Function Index 9, the return value is preferred eMMC
115 Return(Buffer() {0x4})
119 Return(Buffer() { 0x0 })
126 Name (_ADR, 0x00140005)
127 Name (_DDN, "SD Controller")
129 Name (DSUU, ToUUID("f6c13ea5-65cd-461f-ab7a-29f7e8d5bd61"))
131 OperationRegion (SDPC, PCI_Config, 0x00, 0x100)
132 Field (SDPC, WordAcc, NoLock, Preserve)
134 Offset (0x84), /* PMECTRLSTATUS */
136 Offset (0xA2), /* PG_CONFIG */
138 PGEN, 1, /* PG_ENABLE */
141 /* _DSM x86 Device Specific Method
142 * Arg0: UUID Unique function identifier
143 * Arg1: Integer Revision Level
144 * Arg2: Integer Function Index (0 = Return Supported Functions)
145 * Arg3: Package Parameters
150 /* Check the revision */
153 * Function Index 0 the return value is a buffer containing
154 * one bit for each function index, starting with zero.
155 * Bit 0 - Indicates whether there is support for any functions other than function 0.
156 * Bit 1 - Indicates support to clear power control register
157 * Bit 2 - Indicates support to set power control register
158 * Bit 3 - Indicates support to set 1.8V signalling
159 * Bit 4 - Indicates support to set 3.3V signalling
160 * Bit 5 - Indicates support for HS200 mode
161 * Bit 6 - Indicates support for HS400 mode
162 * Bit 9 - Indicates eMMC I/O Driver Strength
165 * For SD we have to support functions to
166 * set 1.8V signalling and 3.3V signalling [BIT4, BIT3]
169 Return (Buffer () { 0x19 })
172 * Function Index 3: Set 1.8v signalling.
173 * We put a sleep of 100ms in this method to
174 * work around a known issue with detecting
175 * UHS SD card on PCH. This is to compensate
176 * for the SD VR slowness.
180 Return(Buffer () { 0x00 })
183 * Function Index 4: Set 3.3v signalling.
184 * We put a sleep of 100ms in this method to
185 * work around a known issue with detecting
186 * UHS SD card on PCH. This is to compensate
187 * for the SD VR slowness.
191 Return(Buffer () { 0x00 })
195 Return(Buffer() { 0x0 })
200 /* Clear register 0x1C20/0x4820 */
204 Method (_PS0, 0, Serialized)
206 PGEN = 0 /* Disable PG */
208 /* Clear register 0x1C20/0x4820 */
211 /* Set Power State to D0 */
215 #if CONFIG(MB_HAS_ACTIVE_HIGH_SD_PWR_ENABLE)
216 /* Change pad mode to Native */
217 GPMO(SD_PWR_EN_PIN, 0x1)
221 Method (_PS3, 0, Serialized)
223 PGEN = 1 /* Enable PG */
225 /* Set Power State to D3 */
229 #if CONFIG(MB_HAS_ACTIVE_HIGH_SD_PWR_ENABLE)
230 /* Change pad mode to GPIO control */
231 GPMO(SD_PWR_EN_PIN, 0x0)
233 /* Enable Tx Buffer */
234 GTXE(SD_PWR_EN_PIN, 0x1)
236 /* Drive TX to zero */
243 Name (_ADR, 0x00000008)
244 Method (_RMV, 0, NotSerialized)
249 } /* Device (SDXC) */