Angel Pons | 182dbde | 2020-04-02 23:49:05 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 2 | |
| 3 | // Intel LPC Bus Device - 0:1f.0 |
| 4 | |
| 5 | Device (LPCB) |
| 6 | { |
| 7 | Name(_ADR, 0x001f0000) |
Stefan Reinauer | 109ab31 | 2009-08-12 16:08:05 +0000 | [diff] [blame] | 8 | |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 9 | OperationRegion(LPC0, PCI_Config, 0x00, 0x100) |
| 10 | Field (LPC0, AnyAcc, NoLock, Preserve) |
| 11 | { |
| 12 | Offset (0x40), |
| 13 | PMBS, 16, // PMBASE |
| 14 | Offset (0x60), // Interrupt Routing Registers |
| 15 | PRTA, 8, |
| 16 | PRTB, 8, |
| 17 | PRTC, 8, |
| 18 | PRTD, 8, |
| 19 | Offset (0x68), |
| 20 | PRTE, 8, |
| 21 | PRTF, 8, |
| 22 | PRTG, 8, |
| 23 | PRTH, 8, |
| 24 | |
| 25 | Offset (0x80), // IO Decode Ranges |
| 26 | IOD0, 8, |
| 27 | IOD1, 8, |
| 28 | |
| 29 | Offset (0xf0), // RCBA |
| 30 | RCEN, 1, |
| 31 | , 13, |
| 32 | RCBA, 18, |
| 33 | } |
| 34 | |
Angel Pons | e12de37 | 2020-07-07 01:33:00 +0200 | [diff] [blame^] | 35 | #include <southbridge/intel/common/acpi/irqlinks.asl> |
Stefan Reinauer | 109ab31 | 2009-08-12 16:08:05 +0000 | [diff] [blame] | 36 | |
Stefan Reinauer | aca6ec6 | 2009-10-26 17:12:21 +0000 | [diff] [blame] | 37 | #include "acpi/ec.asl" |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 38 | |
| 39 | Device (DMAC) // DMA Controller |
| 40 | { |
| 41 | Name(_HID, EISAID("PNP0200")) |
| 42 | Name(_CRS, ResourceTemplate() |
| 43 | { |
| 44 | IO (Decode16, 0x00, 0x00, 0x01, 0x20) |
| 45 | IO (Decode16, 0x81, 0x81, 0x01, 0x11) |
| 46 | IO (Decode16, 0x93, 0x93, 0x01, 0x0d) |
| 47 | IO (Decode16, 0xc0, 0xc0, 0x01, 0x20) |
| 48 | DMA (Compatibility, NotBusMaster, Transfer8_16) { 4 } |
| 49 | }) |
| 50 | } |
| 51 | |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 52 | Device (FWH) // Firmware Hub |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 53 | { |
| 54 | Name (_HID, EISAID("INT0800")) |
| 55 | Name (_CRS, ResourceTemplate() |
| 56 | { |
| 57 | Memory32Fixed(ReadOnly, 0xff000000, 0x01000000) |
| 58 | }) |
| 59 | } |
| 60 | |
| 61 | Device (HPET) |
| 62 | { |
| 63 | Name (_HID, EISAID("PNP0103")) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 64 | Name (_CID, 0x010CD041) |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 65 | |
| 66 | Name(BUF0, ResourceTemplate() |
| 67 | { |
Elyes HAOUAS | 1644e48 | 2019-10-30 11:28:42 +0100 | [diff] [blame] | 68 | Memory32Fixed(ReadOnly, CONFIG_HPET_ADDRESS, 0x400, FED0) |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 69 | }) |
| 70 | |
| 71 | Method (_STA, 0) // Device Status |
| 72 | { |
| 73 | If (HPTE) { |
| 74 | // Note: Ancient versions of Windows don't want |
| 75 | // to see the HPET in order to work right |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 76 | If (LGreaterEqual(OSYS, 2001)) { |
| 77 | Return (0xf) // Enable and show device |
| 78 | } Else { |
| 79 | Return (0xb) // Enable and don't show device |
| 80 | } |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | Return (0x0) // Not enabled, don't show. |
| 84 | } |
| 85 | |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 86 | Method (_CRS, 0, Serialized) // Current resources |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 87 | { |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 88 | If (HPTE) { |
| 89 | CreateDWordField(BUF0, \_SB.PCI0.LPCB.HPET.FED0._BAS, HPT0) |
| 90 | If (Lequal(HPAS, 1)) { |
Elyes HAOUAS | 1644e48 | 2019-10-30 11:28:42 +0100 | [diff] [blame] | 91 | Add(CONFIG_HPET_ADDRESS, 0x1000, HPT0) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | If (Lequal(HPAS, 2)) { |
Elyes HAOUAS | 1644e48 | 2019-10-30 11:28:42 +0100 | [diff] [blame] | 95 | Add(CONFIG_HPET_ADDRESS, 0x2000, HPT0) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | If (Lequal(HPAS, 3)) { |
Elyes HAOUAS | 1644e48 | 2019-10-30 11:28:42 +0100 | [diff] [blame] | 99 | Add(CONFIG_HPET_ADDRESS, 0x3000, HPT0) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 100 | } |
| 101 | } |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 102 | |
| 103 | Return (BUF0) |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | Device(PIC) // 8259 Interrupt Controller |
| 108 | { |
| 109 | Name(_HID,EISAID("PNP0000")) |
| 110 | Name(_CRS, ResourceTemplate() |
| 111 | { |
| 112 | IO (Decode16, 0x20, 0x20, 0x01, 0x02) |
| 113 | IO (Decode16, 0x24, 0x24, 0x01, 0x02) |
| 114 | IO (Decode16, 0x28, 0x28, 0x01, 0x02) |
| 115 | IO (Decode16, 0x2c, 0x2c, 0x01, 0x02) |
| 116 | IO (Decode16, 0x30, 0x30, 0x01, 0x02) |
| 117 | IO (Decode16, 0x34, 0x34, 0x01, 0x02) |
| 118 | IO (Decode16, 0x38, 0x38, 0x01, 0x02) |
| 119 | IO (Decode16, 0x3c, 0x3c, 0x01, 0x02) |
| 120 | IO (Decode16, 0xa0, 0xa0, 0x01, 0x02) |
| 121 | IO (Decode16, 0xa4, 0xa4, 0x01, 0x02) |
| 122 | IO (Decode16, 0xa8, 0xa8, 0x01, 0x02) |
| 123 | IO (Decode16, 0xac, 0xac, 0x01, 0x02) |
| 124 | IO (Decode16, 0xb0, 0xb0, 0x01, 0x02) |
| 125 | IO (Decode16, 0xb4, 0xb4, 0x01, 0x02) |
| 126 | IO (Decode16, 0xb8, 0xb8, 0x01, 0x02) |
| 127 | IO (Decode16, 0xbc, 0xbc, 0x01, 0x02) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 128 | IO (Decode16, 0x4d0, 0x4d0, 0x01, 0x02) |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 129 | IRQNoFlags () { 2 } |
| 130 | }) |
| 131 | } |
| 132 | |
| 133 | Device(MATH) // FPU |
| 134 | { |
| 135 | Name (_HID, EISAID("PNP0C04")) |
| 136 | Name (_CRS, ResourceTemplate() |
| 137 | { |
| 138 | IO (Decode16, 0xf0, 0xf0, 0x01, 0x01) |
| 139 | IRQNoFlags() { 13 } |
| 140 | }) |
| 141 | } |
| 142 | |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 143 | Device(LDRC) // LPC device: Resource consumption |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 144 | { |
| 145 | Name (_HID, EISAID("PNP0C02")) |
| 146 | Name (_UID, 2) |
| 147 | Name (_CRS, ResourceTemplate() |
| 148 | { |
| 149 | IO (Decode16, 0x2e, 0x2e, 0x1, 0x02) // First SuperIO |
| 150 | IO (Decode16, 0x4e, 0x4e, 0x1, 0x02) // Second SuperIO |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 151 | IO (Decode16, 0x61, 0x61, 0x1, 0x01) // NMI Status |
| 152 | IO (Decode16, 0x63, 0x63, 0x1, 0x01) // CPU Reserved |
| 153 | IO (Decode16, 0x65, 0x65, 0x1, 0x01) // CPU Reserved |
| 154 | IO (Decode16, 0x67, 0x67, 0x1, 0x01) // CPU Reserved |
| 155 | IO (Decode16, 0x80, 0x80, 0x1, 0x01) // Port 80 Post |
| 156 | IO (Decode16, 0x92, 0x92, 0x1, 0x01) // CPU Reserved |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 157 | IO (Decode16, 0xb2, 0xb2, 0x1, 0x02) // SWSMI |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 158 | IO (Decode16, 0x800, 0x800, 0x1, 0x10) // ACPI I/O trap |
Angel Pons | ba04565 | 2020-07-07 01:22:57 +0200 | [diff] [blame] | 159 | IO (Decode16, DEFAULT_PMBASE, DEFAULT_PMBASE, 0x1, 0x80) // ICH ACPI |
| 160 | IO (Decode16, DEFAULT_GPIOBASE, DEFAULT_GPIOBASE, 0x1, 0x40) // ICH GPIO |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 161 | }) |
| 162 | } |
| 163 | |
| 164 | Device (RTC) // Real Time Clock |
| 165 | { |
| 166 | Name (_HID, EISAID("PNP0B00")) |
| 167 | Name (_CRS, ResourceTemplate() |
| 168 | { |
| 169 | IO (Decode16, 0x70, 0x70, 1, 8) |
Stefan Reinauer | aca6ec6 | 2009-10-26 17:12:21 +0000 | [diff] [blame] | 170 | // Disable as Windows doesn't like it, and systems don't seem to use it. |
| 171 | // IRQNoFlags() { 8 } |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 172 | }) |
| 173 | } |
| 174 | |
| 175 | Device (TIMR) // Intel 8254 timer |
| 176 | { |
| 177 | Name(_HID, EISAID("PNP0100")) |
| 178 | Name(_CRS, ResourceTemplate() |
| 179 | { |
| 180 | IO (Decode16, 0x40, 0x40, 0x01, 0x04) |
| 181 | IO (Decode16, 0x50, 0x50, 0x10, 0x04) |
| 182 | IRQNoFlags() {0} |
| 183 | }) |
| 184 | } |
| 185 | |
Stefan Reinauer | aca6ec6 | 2009-10-26 17:12:21 +0000 | [diff] [blame] | 186 | #include "acpi/superio.asl" |
| 187 | |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 188 | Device (PS2K) // Keyboard |
| 189 | { |
| 190 | Name(_HID, EISAID("PNP0303")) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 191 | Name(_CID, EISAID("PNP030B")) |
| 192 | |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 193 | Name(_CRS, ResourceTemplate() |
| 194 | { |
| 195 | IO (Decode16, 0x60, 0x60, 0x01, 0x01) |
| 196 | IO (Decode16, 0x64, 0x64, 0x01, 0x01) |
| 197 | IRQ (Edge, ActiveHigh, Exclusive) { 0x01 } // IRQ 1 |
| 198 | }) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 199 | |
| 200 | Method (_STA, 0) |
| 201 | { |
| 202 | Return (0xf) |
| 203 | } |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 204 | } |
| 205 | |
| 206 | Device (PS2M) // Mouse |
| 207 | { |
| 208 | Name(_HID, EISAID("PNP0F13")) |
| 209 | Name(_CRS, ResourceTemplate() |
| 210 | { |
| 211 | IRQ (Edge, ActiveHigh, Exclusive) { 0x0c } // IRQ 12 |
| 212 | }) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 213 | |
| 214 | Method(_STA, 0) |
| 215 | { |
| 216 | Return (0xf) |
| 217 | } |
| 218 | } |
| 219 | |
Stefan Reinauer | aca6ec6 | 2009-10-26 17:12:21 +0000 | [diff] [blame] | 220 | #ifdef ENABLE_FDC |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 221 | Device (FDC0) // Floppy controller |
| 222 | { |
| 223 | Name (_HID, EisaId ("PNP0700")) |
| 224 | Method (_STA, 0, NotSerialized) |
| 225 | { |
| 226 | Return (0x0f) // FIXME |
| 227 | } |
| 228 | |
| 229 | Name(_CRS, ResourceTemplate() |
| 230 | { |
| 231 | IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06) |
| 232 | IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01) |
| 233 | IRQNoFlags () {6} |
| 234 | DMA (Compatibility, NotBusMaster, Transfer8) {2} |
| 235 | }) |
| 236 | |
| 237 | Name(_PRS, ResourceTemplate() |
| 238 | { |
| 239 | IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06) |
| 240 | IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01) |
| 241 | IRQNoFlags () {6} |
| 242 | DMA (Compatibility, NotBusMaster, Transfer8) {2} |
| 243 | }) |
| 244 | |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 245 | } |
Stefan Reinauer | aca6ec6 | 2009-10-26 17:12:21 +0000 | [diff] [blame] | 246 | #endif |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 247 | } |