blob: d2e88902f9b9f08b19ede6240009a7eb4a710fde [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Stefan Reinauercc46e732009-03-13 00:44:09 +00002
Felix Held972d9f22022-02-23 16:32:20 +01003#include <arch/hpet.h>
4
Stefan Reinauercc46e732009-03-13 00:44:09 +00005// Intel LPC Bus Device - 0:1f.0
6
7Device (LPCB)
8{
9 Name(_ADR, 0x001f0000)
Stefan Reinauer109ab312009-08-12 16:08:05 +000010
Stefan Reinauercc46e732009-03-13 00:44:09 +000011 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 Reinauercc46e732009-03-13 00:44:09 +000030 }
31
Angel Ponse12de372020-07-07 01:33:00 +020032 #include <southbridge/intel/common/acpi/irqlinks.asl>
Stefan Reinauer109ab312009-08-12 16:08:05 +000033
Stefan Reinaueraca6ec62009-10-26 17:12:21 +000034 #include "acpi/ec.asl"
Stefan Reinauercc46e732009-03-13 00:44:09 +000035
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 Reinauer573f7d42009-07-21 21:50:34 +000049 Device (FWH) // Firmware Hub
Stefan Reinauercc46e732009-03-13 00:44:09 +000050 {
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 Reinauer573f7d42009-07-21 21:50:34 +000061 Name (_CID, 0x010CD041)
Stefan Reinauercc46e732009-03-13 00:44:09 +000062
63 Name(BUF0, ResourceTemplate()
64 {
Felix Held972d9f22022-02-23 16:32:20 +010065 Memory32Fixed(ReadOnly, HPET_BASE_ADDRESS, 0x400, FED0)
Stefan Reinauercc46e732009-03-13 00:44:09 +000066 })
67
68 Method (_STA, 0) // Device Status
69 {
Kyösti Mälkkie1738142020-12-29 09:04:30 +020070 Return (\HPTS(HPTE))
Stefan Reinauercc46e732009-03-13 00:44:09 +000071 }
72
Stefan Reinauer573f7d42009-07-21 21:50:34 +000073 Method (_CRS, 0, Serialized) // Current resources
Stefan Reinauercc46e732009-03-13 00:44:09 +000074 {
Stefan Reinauer573f7d42009-07-21 21:50:34 +000075 If (HPTE) {
76 CreateDWordField(BUF0, \_SB.PCI0.LPCB.HPET.FED0._BAS, HPT0)
Elyes HAOUAS08b5ef42020-09-10 21:06:40 +020077 If (HPAS == 1) {
Felix Held972d9f22022-02-23 16:32:20 +010078 HPT0 = HPET_BASE_ADDRESS + 0x1000
Stefan Reinauer573f7d42009-07-21 21:50:34 +000079 }
80
Elyes HAOUAS08b5ef42020-09-10 21:06:40 +020081 If (HPAS == 2) {
Felix Held972d9f22022-02-23 16:32:20 +010082 HPT0 = HPET_BASE_ADDRESS + 0x2000
Stefan Reinauer573f7d42009-07-21 21:50:34 +000083 }
84
Elyes HAOUAS08b5ef42020-09-10 21:06:40 +020085 If (HPAS == 3) {
Felix Held972d9f22022-02-23 16:32:20 +010086 HPT0 = HPET_BASE_ADDRESS + 0x3000
Stefan Reinauer573f7d42009-07-21 21:50:34 +000087 }
88 }
Stefan Reinauercc46e732009-03-13 00:44:09 +000089
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 Reinauer573f7d42009-07-21 21:50:34 +0000115 IO (Decode16, 0x4d0, 0x4d0, 0x01, 0x02)
Stefan Reinauercc46e732009-03-13 00:44:09 +0000116 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 Reinauer573f7d42009-07-21 21:50:34 +0000130 Device(LDRC) // LPC device: Resource consumption
Stefan Reinauercc46e732009-03-13 00:44:09 +0000131 {
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 Reinauer573f7d42009-07-21 21:50:34 +0000138 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 Reinauercc46e732009-03-13 00:44:09 +0000144 IO (Decode16, 0xb2, 0xb2, 0x1, 0x02) // SWSMI
Stefan Reinauercc46e732009-03-13 00:44:09 +0000145 IO (Decode16, 0x800, 0x800, 0x1, 0x10) // ACPI I/O trap
Angel Ponsba045652020-07-07 01:22:57 +0200146 IO (Decode16, DEFAULT_PMBASE, DEFAULT_PMBASE, 0x1, 0x80) // ICH ACPI
147 IO (Decode16, DEFAULT_GPIOBASE, DEFAULT_GPIOBASE, 0x1, 0x40) // ICH GPIO
Stefan Reinauercc46e732009-03-13 00:44:09 +0000148 })
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 Reinauercc46e732009-03-13 00:44:09 +0000157 })
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 Reinaueraca6ec62009-10-26 17:12:21 +0000171 #include "acpi/superio.asl"
172
Stefan Reinauercc46e732009-03-13 00:44:09 +0000173 Device (PS2K) // Keyboard
174 {
175 Name(_HID, EISAID("PNP0303"))
Stefan Reinauer573f7d42009-07-21 21:50:34 +0000176 Name(_CID, EISAID("PNP030B"))
177
Stefan Reinauercc46e732009-03-13 00:44:09 +0000178 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 Reinauer573f7d42009-07-21 21:50:34 +0000184
185 Method (_STA, 0)
186 {
187 Return (0xf)
188 }
Stefan Reinauercc46e732009-03-13 00:44:09 +0000189 }
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 Reinauer573f7d42009-07-21 21:50:34 +0000198
199 Method(_STA, 0)
200 {
201 Return (0xf)
202 }
203 }
Stefan Reinauercc46e732009-03-13 00:44:09 +0000204}