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 | |
Felix Held | 972d9f2 | 2022-02-23 16:32:20 +0100 | [diff] [blame^] | 3 | #include <arch/hpet.h> |
| 4 | |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 5 | // Intel LPC Bus Device - 0:1f.0 |
| 6 | |
| 7 | Device (LPCB) |
| 8 | { |
| 9 | Name(_ADR, 0x001f0000) |
Stefan Reinauer | 109ab31 | 2009-08-12 16:08:05 +0000 | [diff] [blame] | 10 | |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 11 | OperationRegion(LPC0, PCI_Config, 0x00, 0x100) |
| 12 | Field (LPC0, AnyAcc, NoLock, Preserve) |
| 13 | { |
| 14 | Offset (0x40), |
| 15 | PMBS, 16, // PMBASE |
| 16 | Offset (0x60), // Interrupt Routing Registers |
| 17 | PRTA, 8, |
| 18 | PRTB, 8, |
| 19 | PRTC, 8, |
| 20 | PRTD, 8, |
| 21 | Offset (0x68), |
| 22 | PRTE, 8, |
| 23 | PRTF, 8, |
| 24 | PRTG, 8, |
| 25 | PRTH, 8, |
| 26 | |
| 27 | Offset (0x80), // IO Decode Ranges |
| 28 | IOD0, 8, |
| 29 | IOD1, 8, |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 30 | } |
| 31 | |
Angel Pons | e12de37 | 2020-07-07 01:33:00 +0200 | [diff] [blame] | 32 | #include <southbridge/intel/common/acpi/irqlinks.asl> |
Stefan Reinauer | 109ab31 | 2009-08-12 16:08:05 +0000 | [diff] [blame] | 33 | |
Stefan Reinauer | aca6ec6 | 2009-10-26 17:12:21 +0000 | [diff] [blame] | 34 | #include "acpi/ec.asl" |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 35 | |
| 36 | Device (DMAC) // DMA Controller |
| 37 | { |
| 38 | Name(_HID, EISAID("PNP0200")) |
| 39 | Name(_CRS, ResourceTemplate() |
| 40 | { |
| 41 | IO (Decode16, 0x00, 0x00, 0x01, 0x20) |
| 42 | IO (Decode16, 0x81, 0x81, 0x01, 0x11) |
| 43 | IO (Decode16, 0x93, 0x93, 0x01, 0x0d) |
| 44 | IO (Decode16, 0xc0, 0xc0, 0x01, 0x20) |
| 45 | DMA (Compatibility, NotBusMaster, Transfer8_16) { 4 } |
| 46 | }) |
| 47 | } |
| 48 | |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 49 | Device (FWH) // Firmware Hub |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 50 | { |
| 51 | Name (_HID, EISAID("INT0800")) |
| 52 | Name (_CRS, ResourceTemplate() |
| 53 | { |
| 54 | Memory32Fixed(ReadOnly, 0xff000000, 0x01000000) |
| 55 | }) |
| 56 | } |
| 57 | |
| 58 | Device (HPET) |
| 59 | { |
| 60 | Name (_HID, EISAID("PNP0103")) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 61 | Name (_CID, 0x010CD041) |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 62 | |
| 63 | Name(BUF0, ResourceTemplate() |
| 64 | { |
Felix Held | 972d9f2 | 2022-02-23 16:32:20 +0100 | [diff] [blame^] | 65 | Memory32Fixed(ReadOnly, HPET_BASE_ADDRESS, 0x400, FED0) |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 66 | }) |
| 67 | |
| 68 | Method (_STA, 0) // Device Status |
| 69 | { |
Kyösti Mälkki | e173814 | 2020-12-29 09:04:30 +0200 | [diff] [blame] | 70 | Return (\HPTS(HPTE)) |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 71 | } |
| 72 | |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 73 | Method (_CRS, 0, Serialized) // Current resources |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 74 | { |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 75 | If (HPTE) { |
| 76 | CreateDWordField(BUF0, \_SB.PCI0.LPCB.HPET.FED0._BAS, HPT0) |
Elyes HAOUAS | 08b5ef4 | 2020-09-10 21:06:40 +0200 | [diff] [blame] | 77 | If (HPAS == 1) { |
Felix Held | 972d9f2 | 2022-02-23 16:32:20 +0100 | [diff] [blame^] | 78 | HPT0 = HPET_BASE_ADDRESS + 0x1000 |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 79 | } |
| 80 | |
Elyes HAOUAS | 08b5ef4 | 2020-09-10 21:06:40 +0200 | [diff] [blame] | 81 | If (HPAS == 2) { |
Felix Held | 972d9f2 | 2022-02-23 16:32:20 +0100 | [diff] [blame^] | 82 | HPT0 = HPET_BASE_ADDRESS + 0x2000 |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 83 | } |
| 84 | |
Elyes HAOUAS | 08b5ef4 | 2020-09-10 21:06:40 +0200 | [diff] [blame] | 85 | If (HPAS == 3) { |
Felix Held | 972d9f2 | 2022-02-23 16:32:20 +0100 | [diff] [blame^] | 86 | HPT0 = HPET_BASE_ADDRESS + 0x3000 |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 87 | } |
| 88 | } |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 89 | |
| 90 | Return (BUF0) |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | Device(PIC) // 8259 Interrupt Controller |
| 95 | { |
| 96 | Name(_HID,EISAID("PNP0000")) |
| 97 | Name(_CRS, ResourceTemplate() |
| 98 | { |
| 99 | IO (Decode16, 0x20, 0x20, 0x01, 0x02) |
| 100 | IO (Decode16, 0x24, 0x24, 0x01, 0x02) |
| 101 | IO (Decode16, 0x28, 0x28, 0x01, 0x02) |
| 102 | IO (Decode16, 0x2c, 0x2c, 0x01, 0x02) |
| 103 | IO (Decode16, 0x30, 0x30, 0x01, 0x02) |
| 104 | IO (Decode16, 0x34, 0x34, 0x01, 0x02) |
| 105 | IO (Decode16, 0x38, 0x38, 0x01, 0x02) |
| 106 | IO (Decode16, 0x3c, 0x3c, 0x01, 0x02) |
| 107 | IO (Decode16, 0xa0, 0xa0, 0x01, 0x02) |
| 108 | IO (Decode16, 0xa4, 0xa4, 0x01, 0x02) |
| 109 | IO (Decode16, 0xa8, 0xa8, 0x01, 0x02) |
| 110 | IO (Decode16, 0xac, 0xac, 0x01, 0x02) |
| 111 | IO (Decode16, 0xb0, 0xb0, 0x01, 0x02) |
| 112 | IO (Decode16, 0xb4, 0xb4, 0x01, 0x02) |
| 113 | IO (Decode16, 0xb8, 0xb8, 0x01, 0x02) |
| 114 | IO (Decode16, 0xbc, 0xbc, 0x01, 0x02) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 115 | IO (Decode16, 0x4d0, 0x4d0, 0x01, 0x02) |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 116 | IRQNoFlags () { 2 } |
| 117 | }) |
| 118 | } |
| 119 | |
| 120 | Device(MATH) // FPU |
| 121 | { |
| 122 | Name (_HID, EISAID("PNP0C04")) |
| 123 | Name (_CRS, ResourceTemplate() |
| 124 | { |
| 125 | IO (Decode16, 0xf0, 0xf0, 0x01, 0x01) |
| 126 | IRQNoFlags() { 13 } |
| 127 | }) |
| 128 | } |
| 129 | |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 130 | Device(LDRC) // LPC device: Resource consumption |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 131 | { |
| 132 | Name (_HID, EISAID("PNP0C02")) |
| 133 | Name (_UID, 2) |
| 134 | Name (_CRS, ResourceTemplate() |
| 135 | { |
| 136 | IO (Decode16, 0x2e, 0x2e, 0x1, 0x02) // First SuperIO |
| 137 | IO (Decode16, 0x4e, 0x4e, 0x1, 0x02) // Second SuperIO |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 138 | IO (Decode16, 0x61, 0x61, 0x1, 0x01) // NMI Status |
| 139 | IO (Decode16, 0x63, 0x63, 0x1, 0x01) // CPU Reserved |
| 140 | IO (Decode16, 0x65, 0x65, 0x1, 0x01) // CPU Reserved |
| 141 | IO (Decode16, 0x67, 0x67, 0x1, 0x01) // CPU Reserved |
| 142 | IO (Decode16, 0x80, 0x80, 0x1, 0x01) // Port 80 Post |
| 143 | IO (Decode16, 0x92, 0x92, 0x1, 0x01) // CPU Reserved |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 144 | IO (Decode16, 0xb2, 0xb2, 0x1, 0x02) // SWSMI |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 145 | IO (Decode16, 0x800, 0x800, 0x1, 0x10) // ACPI I/O trap |
Angel Pons | ba04565 | 2020-07-07 01:22:57 +0200 | [diff] [blame] | 146 | IO (Decode16, DEFAULT_PMBASE, DEFAULT_PMBASE, 0x1, 0x80) // ICH ACPI |
| 147 | IO (Decode16, DEFAULT_GPIOBASE, DEFAULT_GPIOBASE, 0x1, 0x40) // ICH GPIO |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 148 | }) |
| 149 | } |
| 150 | |
| 151 | Device (RTC) // Real Time Clock |
| 152 | { |
| 153 | Name (_HID, EISAID("PNP0B00")) |
| 154 | Name (_CRS, ResourceTemplate() |
| 155 | { |
| 156 | IO (Decode16, 0x70, 0x70, 1, 8) |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 157 | }) |
| 158 | } |
| 159 | |
| 160 | Device (TIMR) // Intel 8254 timer |
| 161 | { |
| 162 | Name(_HID, EISAID("PNP0100")) |
| 163 | Name(_CRS, ResourceTemplate() |
| 164 | { |
| 165 | IO (Decode16, 0x40, 0x40, 0x01, 0x04) |
| 166 | IO (Decode16, 0x50, 0x50, 0x10, 0x04) |
| 167 | IRQNoFlags() {0} |
| 168 | }) |
| 169 | } |
| 170 | |
Stefan Reinauer | aca6ec6 | 2009-10-26 17:12:21 +0000 | [diff] [blame] | 171 | #include "acpi/superio.asl" |
| 172 | |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 173 | Device (PS2K) // Keyboard |
| 174 | { |
| 175 | Name(_HID, EISAID("PNP0303")) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 176 | Name(_CID, EISAID("PNP030B")) |
| 177 | |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 178 | Name(_CRS, ResourceTemplate() |
| 179 | { |
| 180 | IO (Decode16, 0x60, 0x60, 0x01, 0x01) |
| 181 | IO (Decode16, 0x64, 0x64, 0x01, 0x01) |
| 182 | IRQ (Edge, ActiveHigh, Exclusive) { 0x01 } // IRQ 1 |
| 183 | }) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 184 | |
| 185 | Method (_STA, 0) |
| 186 | { |
| 187 | Return (0xf) |
| 188 | } |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | Device (PS2M) // Mouse |
| 192 | { |
| 193 | Name(_HID, EISAID("PNP0F13")) |
| 194 | Name(_CRS, ResourceTemplate() |
| 195 | { |
| 196 | IRQ (Edge, ActiveHigh, Exclusive) { 0x0c } // IRQ 12 |
| 197 | }) |
Stefan Reinauer | 573f7d4 | 2009-07-21 21:50:34 +0000 | [diff] [blame] | 198 | |
| 199 | Method(_STA, 0) |
| 200 | { |
| 201 | Return (0xf) |
| 202 | } |
| 203 | } |
Stefan Reinauer | cc46e73 | 2009-03-13 00:44:09 +0000 | [diff] [blame] | 204 | } |