Angel Pons | c3f58f6 | 2020-04-05 15:46:41 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [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 | 476fe6a | 2022-12-12 07:30:07 +0100 | [diff] [blame] | 22 | RBAS = \C0B0 |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 23 | Return (^RBUF) |
| 24 | } |
| 25 | |
| 26 | Method (_STA) |
| 27 | { |
Felix Singer | 26c7672 | 2022-12-11 21:15:05 +0100 | [diff] [blame] | 28 | If (\C0EN == 1) { |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [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 |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [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 |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [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 | |
| 66 | Device (SDIO) |
| 67 | { |
| 68 | Name (_HID, "INT33BB") |
| 69 | Name (_CID, "PNP0D40") |
| 70 | Name (_UID, 2) |
| 71 | Name (_DDN, "SDIO Controller") |
| 72 | |
| 73 | Name (RBUF, ResourceTemplate() |
| 74 | { |
| 75 | Memory32Fixed (ReadWrite, 0, 0x1000, BAR0) |
| 76 | Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,) |
| 77 | { |
| 78 | SCC_SDIO_IRQ |
| 79 | } |
| 80 | }) |
| 81 | |
| 82 | Method (_CRS) |
| 83 | { |
| 84 | CreateDwordField (^RBUF, ^BAR0._BAS, RBAS) |
Felix Singer | 476fe6a | 2022-12-12 07:30:07 +0100 | [diff] [blame] | 85 | RBAS = \C1B0 |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 86 | Return (^RBUF) |
| 87 | } |
| 88 | |
| 89 | Method (_STA) |
| 90 | { |
Felix Singer | 26c7672 | 2022-12-11 21:15:05 +0100 | [diff] [blame] | 91 | If (\C1EN == 1) { |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 92 | Return (0xF) |
| 93 | } Else { |
| 94 | Return (0x0) |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | OperationRegion (KEYS, SystemMemory, C1B1, 0x100) |
| 99 | Field (KEYS, DWordAcc, NoLock, WriteAsZeros) |
| 100 | { |
| 101 | Offset (0x84), |
| 102 | PSAT, 32, |
| 103 | } |
| 104 | |
| 105 | Method (_PS3) |
| 106 | { |
Felix Singer | 86bc2e7 | 2022-12-16 04:40:39 +0100 | [diff] [blame] | 107 | PSAT |= 3 |
| 108 | PSAT |= 0 |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 109 | } |
| 110 | |
| 111 | Method (_PS0) |
| 112 | { |
Felix Singer | 35e65a8 | 2022-12-16 07:11:17 +0100 | [diff] [blame^] | 113 | PSAT &= 0xfffffffc |
Felix Singer | 86bc2e7 | 2022-12-16 04:40:39 +0100 | [diff] [blame] | 114 | PSAT |= 0 |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 115 | } |
| 116 | } |
| 117 | |
| 118 | Device (SDCD) |
| 119 | { |
| 120 | Name (_HID, "80860F16") |
| 121 | Name (_CID, "PNP0D40") |
| 122 | Name (_UID, 3) |
| 123 | Name (_DDN, "SD Card Controller") |
| 124 | |
| 125 | Name (RBUF, ResourceTemplate() |
| 126 | { |
| 127 | Memory32Fixed (ReadWrite, 0, 0x1000, BAR0) |
| 128 | Interrupt (ResourceConsumer, Level, ActiveLow, Exclusive,,,) |
| 129 | { |
| 130 | SCC_SD_IRQ |
| 131 | } |
| 132 | }) |
| 133 | |
| 134 | Method (_CRS) |
| 135 | { |
| 136 | CreateDwordField (^RBUF, ^BAR0._BAS, RBAS) |
Felix Singer | 476fe6a | 2022-12-12 07:30:07 +0100 | [diff] [blame] | 137 | RBAS = \C2B0 |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 138 | Return (^RBUF) |
| 139 | } |
| 140 | |
| 141 | Method (_STA) |
| 142 | { |
Felix Singer | 26c7672 | 2022-12-11 21:15:05 +0100 | [diff] [blame] | 143 | If (\C2EN == 1) { |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 144 | Return (0xF) |
| 145 | } Else { |
| 146 | Return (0x0) |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | OperationRegion (KEYS, SystemMemory, C2B1, 0x100) |
| 151 | Field (KEYS, DWordAcc, NoLock, WriteAsZeros) |
| 152 | { |
| 153 | Offset (0x84), |
| 154 | PSAT, 32, |
| 155 | } |
| 156 | |
| 157 | Method (_PS3) |
| 158 | { |
Felix Singer | 86bc2e7 | 2022-12-16 04:40:39 +0100 | [diff] [blame] | 159 | PSAT |= 3 |
| 160 | PSAT |= 0 |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | Method (_PS0) |
| 164 | { |
Felix Singer | 35e65a8 | 2022-12-16 07:11:17 +0100 | [diff] [blame^] | 165 | PSAT &= 0xfffffffc |
Felix Singer | 86bc2e7 | 2022-12-16 04:40:39 +0100 | [diff] [blame] | 166 | PSAT |= 0 |
Duncan Laurie | 430bf0d | 2013-12-10 14:37:42 -0800 | [diff] [blame] | 167 | } |
| 168 | } |