Angel Pons | ba38f37 | 2020-04-05 15:46:45 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 2 | |
| 3 | Device (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 Singer | 84e6123 | 2022-12-12 07:39:15 +0100 | [diff] [blame] | 22 | RBAS = \C0B0 |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 23 | Return (^RBUF) |
| 24 | } |
| 25 | |
| 26 | Method (_STA) |
| 27 | { |
Felix Singer | edec4d9 | 2022-12-11 21:25:32 +0100 | [diff] [blame] | 28 | If (\C0EN == 1) { |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 29 | 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 Singer | 86bc2e7 | 2022-12-16 04:40:39 +0100 | [diff] [blame] | 44 | PSAT |= 3 |
| 45 | PSAT |= 0 |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | Method (_PS0) |
| 49 | { |
Felix Singer | 35e65a8 | 2022-12-16 07:11:17 +0100 | [diff] [blame] | 50 | PSAT &= 0xfffffffc |
Felix Singer | 86bc2e7 | 2022-12-16 04:40:39 +0100 | [diff] [blame] | 51 | PSAT |= 0 |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 52 | } |
| 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 DeVillier | 62bef5a | 2018-01-21 18:28:38 -0600 | [diff] [blame] | 66 | Device (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 Singer | edec4d9 | 2022-12-11 21:25:32 +0100 | [diff] [blame] | 81 | If (\C0EN == 1) { |
Matt DeVillier | 62bef5a | 2018-01-21 18:28:38 -0600 | [diff] [blame] | 82 | 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 Singer | 9df60d3 | 2022-12-26 09:43:07 +0100 | [diff] [blame^] | 99 | Return (0) |
Matt DeVillier | 62bef5a | 2018-01-21 18:28:38 -0600 | [diff] [blame] | 100 | } |
| 101 | } |
| 102 | } |
| 103 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 104 | Device (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 Singer | 84e6123 | 2022-12-12 07:39:15 +0100 | [diff] [blame] | 123 | RBAS = \C1B0 |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 124 | Return (^RBUF) |
| 125 | } |
| 126 | |
| 127 | Method (_STA) |
| 128 | { |
Felix Singer | edec4d9 | 2022-12-11 21:25:32 +0100 | [diff] [blame] | 129 | If (\C1EN == 1) { |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 130 | 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 Singer | 86bc2e7 | 2022-12-16 04:40:39 +0100 | [diff] [blame] | 145 | PSAT |= 3 |
| 146 | PSAT |= 0 |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 147 | } |
| 148 | |
| 149 | Method (_PS0) |
| 150 | { |
Felix Singer | 35e65a8 | 2022-12-16 07:11:17 +0100 | [diff] [blame] | 151 | PSAT &= 0xfffffffc |
Felix Singer | 86bc2e7 | 2022-12-16 04:40:39 +0100 | [diff] [blame] | 152 | PSAT |= 0 |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 153 | } |
| 154 | } |
| 155 | |
| 156 | Device (SDCD) |
| 157 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 158 | Name (_HID, "INT33BB") |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 159 | Name (_CID, "PNP0D40") |
| 160 | Name (_UID, 3) |
| 161 | Name (_DDN, "SD Card Controller") |
| 162 | |
| 163 | Name (RBUF, ResourceTemplate() |
| 164 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 165 | 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 Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 170 | }) |
| 171 | |
| 172 | Method (_CRS) |
| 173 | { |
| 174 | CreateDwordField (^RBUF, ^BAR0._BAS, RBAS) |
Felix Singer | 84e6123 | 2022-12-12 07:39:15 +0100 | [diff] [blame] | 175 | RBAS = \C2B0 |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 176 | Return (^RBUF) |
| 177 | } |
| 178 | |
| 179 | Method (_STA) |
| 180 | { |
Felix Singer | edec4d9 | 2022-12-11 21:25:32 +0100 | [diff] [blame] | 181 | If (\C2EN == 1) { |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 182 | 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 Singer | 86bc2e7 | 2022-12-16 04:40:39 +0100 | [diff] [blame] | 197 | PSAT |= 3 |
| 198 | PSAT |= 0 |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 199 | } |
| 200 | |
| 201 | Method (_PS0) |
| 202 | { |
Felix Singer | 35e65a8 | 2022-12-16 07:11:17 +0100 | [diff] [blame] | 203 | PSAT &= 0xfffffffc |
Felix Singer | 86bc2e7 | 2022-12-16 04:40:39 +0100 | [diff] [blame] | 204 | PSAT |= 0 |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 205 | } |
| 206 | } |