Angel Pons | ba38f37 | 2020-04-05 15:46:45 +0200 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 3 | |
| 4 | Device (EMMC) |
| 5 | { |
| 6 | Name (_HID, "80860F14") |
| 7 | Name (_CID, "PNP0D40") |
| 8 | Name (_UID, 1) |
| 9 | Name (_DDN, "eMMC Controller 4.5") |
| 10 | |
| 11 | Name (RBUF, ResourceTemplate() |
| 12 | { |
| 13 | Memory32Fixed (ReadWrite, 0, 0x1000, BAR0) |
| 14 | Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,) |
| 15 | { |
| 16 | SCC_EMMC_IRQ |
| 17 | } |
| 18 | }) |
| 19 | |
| 20 | Method (_CRS) |
| 21 | { |
| 22 | CreateDwordField (^RBUF, ^BAR0._BAS, RBAS) |
| 23 | Store (\C0B0, RBAS) |
| 24 | Return (^RBUF) |
| 25 | } |
| 26 | |
| 27 | Method (_STA) |
| 28 | { |
| 29 | If (LEqual (\C0EN, 1)) { |
| 30 | Return (0xF) |
| 31 | } Else { |
| 32 | Return (0x0) |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | OperationRegion (KEYS, SystemMemory, C0B1, 0x100) |
| 37 | Field (KEYS, DWordAcc, NoLock, WriteAsZeros) |
| 38 | { |
| 39 | Offset (0x84), |
| 40 | PSAT, 32, |
| 41 | } |
| 42 | |
| 43 | Method (_PS3) |
| 44 | { |
| 45 | Or (PSAT, 0x00000003, PSAT) |
| 46 | Or (PSAT, 0x00000000, PSAT) |
| 47 | } |
| 48 | |
| 49 | Method (_PS0) |
| 50 | { |
| 51 | And (PSAT, 0xfffffffc, PSAT) |
| 52 | Or (PSAT, 0x00000000, PSAT) |
| 53 | } |
| 54 | |
| 55 | Device (EM45) |
| 56 | { |
| 57 | /* Slot 0, Function 8 */ |
| 58 | Name (_ADR, 0x8) |
| 59 | |
| 60 | Method (_RMV, 0, NotSerialized) |
| 61 | { |
| 62 | Return (0) |
| 63 | } |
| 64 | } |
| 65 | } |
| 66 | |
Matt DeVillier | 62bef5a | 2018-01-21 18:28:38 -0600 | [diff] [blame] | 67 | Device (PEMC) |
| 68 | { |
| 69 | Name (_ADR, 0x00100000) // _ADR: Address |
| 70 | |
| 71 | OperationRegion (SDIO, PCI_Config, 0x84, 0x04) |
| 72 | Field (SDIO, WordAcc, NoLock, Preserve) |
| 73 | { |
| 74 | Offset (0x01), |
| 75 | PMEE, 1, |
| 76 | , 6, |
| 77 | PMES, 1 |
| 78 | } |
| 79 | |
| 80 | Method (_STA, 0, NotSerialized) |
| 81 | { |
| 82 | If (LEqual (\C0EN, 1)) { |
| 83 | Return (0x0) |
| 84 | } |
| 85 | Else |
| 86 | { |
| 87 | Return (0xF) |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | Method (_DSW, 3, NotSerialized) |
| 92 | { |
| 93 | } |
| 94 | |
| 95 | Device (CARD) |
| 96 | { |
| 97 | Name (_ADR, 0x08) |
| 98 | Method (_RMV, 0, NotSerialized) |
| 99 | { |
| 100 | Return (Zero) |
| 101 | } |
| 102 | } |
| 103 | } |
| 104 | |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 105 | Device (SDIO) |
| 106 | { |
| 107 | Name (_HID, "INT33BB") |
| 108 | Name (_CID, "PNP0D40") |
| 109 | Name (_UID, 2) |
| 110 | Name (_DDN, "SDIO Controller") |
| 111 | |
| 112 | Name (RBUF, ResourceTemplate() |
| 113 | { |
| 114 | Memory32Fixed (ReadWrite, 0, 0x1000, BAR0) |
| 115 | Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,) |
| 116 | { |
| 117 | SCC_SDIO_IRQ |
| 118 | } |
| 119 | }) |
| 120 | |
| 121 | Method (_CRS) |
| 122 | { |
| 123 | CreateDwordField (^RBUF, ^BAR0._BAS, RBAS) |
| 124 | Store (\C1B0, RBAS) |
| 125 | Return (^RBUF) |
| 126 | } |
| 127 | |
| 128 | Method (_STA) |
| 129 | { |
| 130 | If (LEqual (\C1EN, 1)) { |
| 131 | Return (0xF) |
| 132 | } Else { |
| 133 | Return (0x0) |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | OperationRegion (KEYS, SystemMemory, C1B1, 0x100) |
| 138 | Field (KEYS, DWordAcc, NoLock, WriteAsZeros) |
| 139 | { |
| 140 | Offset (0x84), |
| 141 | PSAT, 32, |
| 142 | } |
| 143 | |
| 144 | Method (_PS3) |
| 145 | { |
| 146 | Or (PSAT, 0x00000003, PSAT) |
| 147 | Or (PSAT, 0x00000000, PSAT) |
| 148 | } |
| 149 | |
| 150 | Method (_PS0) |
| 151 | { |
| 152 | And (PSAT, 0xfffffffc, PSAT) |
| 153 | Or (PSAT, 0x00000000, PSAT) |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | Device (SDCD) |
| 158 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 159 | Name (_HID, "INT33BB") |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 160 | Name (_CID, "PNP0D40") |
| 161 | Name (_UID, 3) |
| 162 | Name (_DDN, "SD Card Controller") |
| 163 | |
| 164 | Name (RBUF, ResourceTemplate() |
| 165 | { |
Lee Leahy | 3247172 | 2015-04-20 15:20:28 -0700 | [diff] [blame] | 166 | Memory32Fixed (ReadWrite, 0x00000000, 0x00001000, BAR0) |
| 167 | Interrupt(ResourceConsumer, Level, ActiveLow, Exclusive, , , ) |
| 168 | {SCC_SD_IRQ} /* SD Card IRQ */ |
| 169 | GpioInt(Edge, ActiveBoth, SharedAndWake, PullNone, 10000, "\\_SB.GPSE", 0, ResourceConsumer, , ) |
| 170 | {SDCARD_CD} /* SE81 */ |
Lee Leahy | 77ff0b1 | 2015-05-05 15:07:29 -0700 | [diff] [blame] | 171 | }) |
| 172 | |
| 173 | Method (_CRS) |
| 174 | { |
| 175 | CreateDwordField (^RBUF, ^BAR0._BAS, RBAS) |
| 176 | Store (\C2B0, RBAS) |
| 177 | Return (^RBUF) |
| 178 | } |
| 179 | |
| 180 | Method (_STA) |
| 181 | { |
| 182 | If (LEqual (\C2EN, 1)) { |
| 183 | Return (0xF) |
| 184 | } Else { |
| 185 | Return (0x0) |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | OperationRegion (KEYS, SystemMemory, C2B1, 0x100) |
| 190 | Field (KEYS, DWordAcc, NoLock, WriteAsZeros) |
| 191 | { |
| 192 | Offset (0x84), |
| 193 | PSAT, 32, |
| 194 | } |
| 195 | |
| 196 | Method (_PS3) |
| 197 | { |
| 198 | Or (PSAT, 0x00000003, PSAT) |
| 199 | Or (PSAT, 0x00000000, PSAT) |
| 200 | } |
| 201 | |
| 202 | Method (_PS0) |
| 203 | { |
| 204 | And (PSAT, 0xfffffffc, PSAT) |
| 205 | Or (PSAT, 0x00000000, PSAT) |
| 206 | } |
| 207 | } |