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) |
| 22 | Store (\C0B0, RBAS) |
| 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 | { |
| 44 | Or (PSAT, 0x00000003, PSAT) |
| 45 | Or (PSAT, 0x00000000, PSAT) |
| 46 | } |
| 47 | |
| 48 | Method (_PS0) |
| 49 | { |
| 50 | And (PSAT, 0xfffffffc, PSAT) |
| 51 | Or (PSAT, 0x00000000, PSAT) |
| 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 | { |
| 99 | Return (Zero) |
| 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) |
| 123 | Store (\C1B0, RBAS) |
| 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 | { |
| 145 | Or (PSAT, 0x00000003, PSAT) |
| 146 | Or (PSAT, 0x00000000, PSAT) |
| 147 | } |
| 148 | |
| 149 | Method (_PS0) |
| 150 | { |
| 151 | And (PSAT, 0xfffffffc, PSAT) |
| 152 | Or (PSAT, 0x00000000, PSAT) |
| 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) |
| 175 | Store (\C2B0, RBAS) |
| 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 | { |
| 197 | Or (PSAT, 0x00000003, PSAT) |
| 198 | Or (PSAT, 0x00000000, PSAT) |
| 199 | } |
| 200 | |
| 201 | Method (_PS0) |
| 202 | { |
| 203 | And (PSAT, 0xfffffffc, PSAT) |
| 204 | Or (PSAT, 0x00000000, PSAT) |
| 205 | } |
| 206 | } |