• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/* SPDX-License-Identifier: GPL-2.0-only */
2
3#include <arch/hpet.h>
4
5// Intel LPC Bus Device  - 0:1f.0
6
7Device (LPCB)
8{
9	Name(_ADR, 0x001f0000)
10
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,
30	}
31
32	#include <southbridge/intel/common/acpi/irqlinks.asl>
33
34	#include "acpi/ec.asl"
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
49	Device (FWH)		// Firmware Hub
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"))
61		Name (_CID, 0x010CD041)
62
63		Name(BUF0, ResourceTemplate()
64		{
65			Memory32Fixed(ReadOnly, HPET_BASE_ADDRESS, 0x400, FED0)
66		})
67
68		Method (_STA, 0)	// Device Status
69		{
70			Return (\HPTS(HPTE))
71		}
72
73		Method (_CRS, 0, Serialized) // Current resources
74		{
75			If (HPTE) {
76				CreateDWordField(BUF0, \_SB.PCI0.LPCB.HPET.FED0._BAS, HPT0)
77				If (HPAS == 1) {
78					HPT0 = HPET_BASE_ADDRESS + 0x1000
79				}
80
81				If (HPAS == 2) {
82					HPT0 = HPET_BASE_ADDRESS + 0x2000
83				}
84
85				If (HPAS == 3) {
86					HPT0 = HPET_BASE_ADDRESS + 0x3000
87				}
88			}
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)
115			IO (Decode16, 0x4d0, 0x4d0, 0x01, 0x02)
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
130	Device(LDRC)	// LPC device: Resource consumption
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
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
144			IO (Decode16, 0xb2, 0xb2, 0x1, 0x02)		// SWSMI
145			IO (Decode16, 0x800, 0x800, 0x1, 0x10)		// ACPI I/O trap
146			IO (Decode16, DEFAULT_PMBASE, DEFAULT_PMBASE, 0x1, 0x80)	// ICH ACPI
147			IO (Decode16, DEFAULT_GPIOBASE, DEFAULT_GPIOBASE, 0x1, 0x40)	// ICH GPIO
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)
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
171	#include "acpi/superio.asl"
172
173	Device (PS2K)		// Keyboard
174	{
175		Name(_HID, EISAID("PNP0303"))
176		Name(_CID, EISAID("PNP030B"))
177
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		})
184
185		Method (_STA, 0)
186		{
187			Return (0xf)
188		}
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		})
198
199		Method(_STA, 0)
200		{
201			Return (0xf)
202		}
203	}
204}
205