blob: 2940c2ffd2512abb92846606ad86a35571a5bdec [file] [log] [blame]
Angel Pons182dbde2020-04-02 23:49:05 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Stefan Reinauercc46e732009-03-13 00:44:09 +00003
4// Intel LPC Bus Device - 0:1f.0
5
6Device (LPCB)
7{
8 Name(_ADR, 0x001f0000)
Stefan Reinauer109ab312009-08-12 16:08:05 +00009
Stefan Reinauercc46e732009-03-13 00:44:09 +000010 OperationRegion(LPC0, PCI_Config, 0x00, 0x100)
11 Field (LPC0, AnyAcc, NoLock, Preserve)
12 {
13 Offset (0x40),
14 PMBS, 16, // PMBASE
15 Offset (0x60), // Interrupt Routing Registers
16 PRTA, 8,
17 PRTB, 8,
18 PRTC, 8,
19 PRTD, 8,
20 Offset (0x68),
21 PRTE, 8,
22 PRTF, 8,
23 PRTG, 8,
24 PRTH, 8,
25
26 Offset (0x80), // IO Decode Ranges
27 IOD0, 8,
28 IOD1, 8,
29
30 Offset (0xf0), // RCBA
31 RCEN, 1,
32 , 13,
33 RCBA, 18,
34 }
35
Patrick Georgi334328a2012-02-16 19:01:22 +010036 #include "irqlinks.asl"
Stefan Reinauer109ab312009-08-12 16:08:05 +000037
Stefan Reinaueraca6ec62009-10-26 17:12:21 +000038 #include "acpi/ec.asl"
Stefan Reinauercc46e732009-03-13 00:44:09 +000039
40 Device (DMAC) // DMA Controller
41 {
42 Name(_HID, EISAID("PNP0200"))
43 Name(_CRS, ResourceTemplate()
44 {
45 IO (Decode16, 0x00, 0x00, 0x01, 0x20)
46 IO (Decode16, 0x81, 0x81, 0x01, 0x11)
47 IO (Decode16, 0x93, 0x93, 0x01, 0x0d)
48 IO (Decode16, 0xc0, 0xc0, 0x01, 0x20)
49 DMA (Compatibility, NotBusMaster, Transfer8_16) { 4 }
50 })
51 }
52
Stefan Reinauer573f7d42009-07-21 21:50:34 +000053 Device (FWH) // Firmware Hub
Stefan Reinauercc46e732009-03-13 00:44:09 +000054 {
55 Name (_HID, EISAID("INT0800"))
56 Name (_CRS, ResourceTemplate()
57 {
58 Memory32Fixed(ReadOnly, 0xff000000, 0x01000000)
59 })
60 }
61
62 Device (HPET)
63 {
64 Name (_HID, EISAID("PNP0103"))
Stefan Reinauer573f7d42009-07-21 21:50:34 +000065 Name (_CID, 0x010CD041)
Stefan Reinauercc46e732009-03-13 00:44:09 +000066
67 Name(BUF0, ResourceTemplate()
68 {
Elyes HAOUAS1644e482019-10-30 11:28:42 +010069 Memory32Fixed(ReadOnly, CONFIG_HPET_ADDRESS, 0x400, FED0)
Stefan Reinauercc46e732009-03-13 00:44:09 +000070 })
71
72 Method (_STA, 0) // Device Status
73 {
74 If (HPTE) {
75 // Note: Ancient versions of Windows don't want
76 // to see the HPET in order to work right
Stefan Reinauer573f7d42009-07-21 21:50:34 +000077 If (LGreaterEqual(OSYS, 2001)) {
78 Return (0xf) // Enable and show device
79 } Else {
80 Return (0xb) // Enable and don't show device
81 }
Stefan Reinauercc46e732009-03-13 00:44:09 +000082 }
83
84 Return (0x0) // Not enabled, don't show.
85 }
86
Stefan Reinauer573f7d42009-07-21 21:50:34 +000087 Method (_CRS, 0, Serialized) // Current resources
Stefan Reinauercc46e732009-03-13 00:44:09 +000088 {
Stefan Reinauer573f7d42009-07-21 21:50:34 +000089 If (HPTE) {
90 CreateDWordField(BUF0, \_SB.PCI0.LPCB.HPET.FED0._BAS, HPT0)
91 If (Lequal(HPAS, 1)) {
Elyes HAOUAS1644e482019-10-30 11:28:42 +010092 Add(CONFIG_HPET_ADDRESS, 0x1000, HPT0)
Stefan Reinauer573f7d42009-07-21 21:50:34 +000093 }
94
95 If (Lequal(HPAS, 2)) {
Elyes HAOUAS1644e482019-10-30 11:28:42 +010096 Add(CONFIG_HPET_ADDRESS, 0x2000, HPT0)
Stefan Reinauer573f7d42009-07-21 21:50:34 +000097 }
98
99 If (Lequal(HPAS, 3)) {
Elyes HAOUAS1644e482019-10-30 11:28:42 +0100100 Add(CONFIG_HPET_ADDRESS, 0x3000, HPT0)
Stefan Reinauer573f7d42009-07-21 21:50:34 +0000101 }
102 }
Stefan Reinauercc46e732009-03-13 00:44:09 +0000103
104 Return (BUF0)
105 }
106 }
107
108 Device(PIC) // 8259 Interrupt Controller
109 {
110 Name(_HID,EISAID("PNP0000"))
111 Name(_CRS, ResourceTemplate()
112 {
113 IO (Decode16, 0x20, 0x20, 0x01, 0x02)
114 IO (Decode16, 0x24, 0x24, 0x01, 0x02)
115 IO (Decode16, 0x28, 0x28, 0x01, 0x02)
116 IO (Decode16, 0x2c, 0x2c, 0x01, 0x02)
117 IO (Decode16, 0x30, 0x30, 0x01, 0x02)
118 IO (Decode16, 0x34, 0x34, 0x01, 0x02)
119 IO (Decode16, 0x38, 0x38, 0x01, 0x02)
120 IO (Decode16, 0x3c, 0x3c, 0x01, 0x02)
121 IO (Decode16, 0xa0, 0xa0, 0x01, 0x02)
122 IO (Decode16, 0xa4, 0xa4, 0x01, 0x02)
123 IO (Decode16, 0xa8, 0xa8, 0x01, 0x02)
124 IO (Decode16, 0xac, 0xac, 0x01, 0x02)
125 IO (Decode16, 0xb0, 0xb0, 0x01, 0x02)
126 IO (Decode16, 0xb4, 0xb4, 0x01, 0x02)
127 IO (Decode16, 0xb8, 0xb8, 0x01, 0x02)
128 IO (Decode16, 0xbc, 0xbc, 0x01, 0x02)
Stefan Reinauer573f7d42009-07-21 21:50:34 +0000129 IO (Decode16, 0x4d0, 0x4d0, 0x01, 0x02)
Stefan Reinauercc46e732009-03-13 00:44:09 +0000130 IRQNoFlags () { 2 }
131 })
132 }
133
134 Device(MATH) // FPU
135 {
136 Name (_HID, EISAID("PNP0C04"))
137 Name (_CRS, ResourceTemplate()
138 {
139 IO (Decode16, 0xf0, 0xf0, 0x01, 0x01)
140 IRQNoFlags() { 13 }
141 })
142 }
143
Stefan Reinauer573f7d42009-07-21 21:50:34 +0000144 Device(LDRC) // LPC device: Resource consumption
Stefan Reinauercc46e732009-03-13 00:44:09 +0000145 {
146 Name (_HID, EISAID("PNP0C02"))
147 Name (_UID, 2)
148 Name (_CRS, ResourceTemplate()
149 {
150 IO (Decode16, 0x2e, 0x2e, 0x1, 0x02) // First SuperIO
151 IO (Decode16, 0x4e, 0x4e, 0x1, 0x02) // Second SuperIO
Stefan Reinauer573f7d42009-07-21 21:50:34 +0000152 IO (Decode16, 0x61, 0x61, 0x1, 0x01) // NMI Status
153 IO (Decode16, 0x63, 0x63, 0x1, 0x01) // CPU Reserved
154 IO (Decode16, 0x65, 0x65, 0x1, 0x01) // CPU Reserved
155 IO (Decode16, 0x67, 0x67, 0x1, 0x01) // CPU Reserved
156 IO (Decode16, 0x80, 0x80, 0x1, 0x01) // Port 80 Post
157 IO (Decode16, 0x92, 0x92, 0x1, 0x01) // CPU Reserved
Stefan Reinauercc46e732009-03-13 00:44:09 +0000158 IO (Decode16, 0xb2, 0xb2, 0x1, 0x02) // SWSMI
Stefan Reinauercc46e732009-03-13 00:44:09 +0000159 IO (Decode16, 0x800, 0x800, 0x1, 0x10) // ACPI I/O trap
Stefan Reinaueraca6ec62009-10-26 17:12:21 +0000160 IO (Decode16, DEFAULT_PMBASE, DEFAULT_PMBASE, 0x1, 0x80) // ICH7-M ACPI
161 IO (Decode16, DEFAULT_GPIOBASE, DEFAULT_GPIOBASE, 0x1, 0x40) // ICH7-M GPIO
Stefan Reinauercc46e732009-03-13 00:44:09 +0000162 })
163 }
164
165 Device (RTC) // Real Time Clock
166 {
167 Name (_HID, EISAID("PNP0B00"))
168 Name (_CRS, ResourceTemplate()
169 {
170 IO (Decode16, 0x70, 0x70, 1, 8)
Stefan Reinaueraca6ec62009-10-26 17:12:21 +0000171// Disable as Windows doesn't like it, and systems don't seem to use it.
172// IRQNoFlags() { 8 }
Stefan Reinauercc46e732009-03-13 00:44:09 +0000173 })
174 }
175
176 Device (TIMR) // Intel 8254 timer
177 {
178 Name(_HID, EISAID("PNP0100"))
179 Name(_CRS, ResourceTemplate()
180 {
181 IO (Decode16, 0x40, 0x40, 0x01, 0x04)
182 IO (Decode16, 0x50, 0x50, 0x10, 0x04)
183 IRQNoFlags() {0}
184 })
185 }
186
Stefan Reinaueraca6ec62009-10-26 17:12:21 +0000187 #include "acpi/superio.asl"
188
Stefan Reinauercc46e732009-03-13 00:44:09 +0000189 Device (PS2K) // Keyboard
190 {
191 Name(_HID, EISAID("PNP0303"))
Stefan Reinauer573f7d42009-07-21 21:50:34 +0000192 Name(_CID, EISAID("PNP030B"))
193
Stefan Reinauercc46e732009-03-13 00:44:09 +0000194 Name(_CRS, ResourceTemplate()
195 {
196 IO (Decode16, 0x60, 0x60, 0x01, 0x01)
197 IO (Decode16, 0x64, 0x64, 0x01, 0x01)
198 IRQ (Edge, ActiveHigh, Exclusive) { 0x01 } // IRQ 1
199 })
Stefan Reinauer573f7d42009-07-21 21:50:34 +0000200
201 Method (_STA, 0)
202 {
203 Return (0xf)
204 }
Stefan Reinauercc46e732009-03-13 00:44:09 +0000205 }
206
207 Device (PS2M) // Mouse
208 {
209 Name(_HID, EISAID("PNP0F13"))
210 Name(_CRS, ResourceTemplate()
211 {
212 IRQ (Edge, ActiveHigh, Exclusive) { 0x0c } // IRQ 12
213 })
Stefan Reinauer573f7d42009-07-21 21:50:34 +0000214
215 Method(_STA, 0)
216 {
217 Return (0xf)
218 }
219 }
220
Stefan Reinaueraca6ec62009-10-26 17:12:21 +0000221#ifdef ENABLE_FDC
Stefan Reinauer573f7d42009-07-21 21:50:34 +0000222 Device (FDC0) // Floppy controller
223 {
224 Name (_HID, EisaId ("PNP0700"))
225 Method (_STA, 0, NotSerialized)
226 {
227 Return (0x0f) // FIXME
228 }
229
230 Name(_CRS, ResourceTemplate()
231 {
232 IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
233 IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
234 IRQNoFlags () {6}
235 DMA (Compatibility, NotBusMaster, Transfer8) {2}
236 })
237
238 Name(_PRS, ResourceTemplate()
239 {
240 IO (Decode16, 0x03F0, 0x03F0, 0x01, 0x06)
241 IO (Decode16, 0x03F7, 0x03F7, 0x01, 0x01)
242 IRQNoFlags () {6}
243 DMA (Compatibility, NotBusMaster, Transfer8) {2}
244 })
245
Stefan Reinauercc46e732009-03-13 00:44:09 +0000246 }
Stefan Reinaueraca6ec62009-10-26 17:12:21 +0000247#endif
Stefan Reinauercc46e732009-03-13 00:44:09 +0000248}