1/*
2 * Copyright (C) 2016, Bin Meng <bmeng.cn@gmail.com>
3 *
4 * SPDX-License-Identifier:	GPL-2.0+
5 */
6
7/* Intel LPC Bus Device - 0:1f.0 */
8
9Device (LPCB)
10{
11	Name(_ADR, 0x001f0000)
12
13	OperationRegion(PRTX, PCI_Config, 0x60, 8)
14	Field(PRTX, AnyAcc, NoLock, Preserve) {
15		PRTA, 8,
16		PRTB, 8,
17		PRTC, 8,
18		PRTD, 8,
19		PRTE, 8,
20		PRTF, 8,
21		PRTG, 8,
22		PRTH, 8,
23	}
24
25	#include <asm/acpi/irqlinks.asl>
26
27	/* Firmware Hub */
28	Device (FWH)
29	{
30		Name(_HID, EISAID("INT0800"))
31		Name(_CRS, ResourceTemplate()
32		{
33			Memory32Fixed(ReadOnly, 0xff000000, 0x01000000)
34		})
35	}
36
37	/* 8259 Interrupt Controller */
38	Device (PIC)
39	{
40		Name(_HID, EISAID("PNP0000"))
41		Name(_CRS, ResourceTemplate()
42		{
43			IO(Decode16, 0x20, 0x20, 0x01, 0x02)
44			IO(Decode16, 0x24, 0x24, 0x01, 0x02)
45			IO(Decode16, 0x28, 0x28, 0x01, 0x02)
46			IO(Decode16, 0x2c, 0x2c, 0x01, 0x02)
47			IO(Decode16, 0x30, 0x30, 0x01, 0x02)
48			IO(Decode16, 0x34, 0x34, 0x01, 0x02)
49			IO(Decode16, 0x38, 0x38, 0x01, 0x02)
50			IO(Decode16, 0x3c, 0x3c, 0x01, 0x02)
51			IO(Decode16, 0xa0, 0xa0, 0x01, 0x02)
52			IO(Decode16, 0xa4, 0xa4, 0x01, 0x02)
53			IO(Decode16, 0xa8, 0xa8, 0x01, 0x02)
54			IO(Decode16, 0xac, 0xac, 0x01, 0x02)
55			IO(Decode16, 0xb0, 0xb0, 0x01, 0x02)
56			IO(Decode16, 0xb4, 0xb4, 0x01, 0x02)
57			IO(Decode16, 0xb8, 0xb8, 0x01, 0x02)
58			IO(Decode16, 0xbc, 0xbc, 0x01, 0x02)
59			IO(Decode16, 0x4d0, 0x4d0, 0x01, 0x02)
60			IRQNoFlags () { 2 }
61		})
62	}
63
64	/* 8254 timer */
65	Device (TIMR)
66	{
67		Name(_HID, EISAID("PNP0100"))
68		Name(_CRS, ResourceTemplate()
69		{
70			IO(Decode16, 0x40, 0x40, 0x01, 0x04)
71			IO(Decode16, 0x50, 0x50, 0x10, 0x04)
72			IRQNoFlags() { 0 }
73		})
74	}
75
76	/* HPET */
77	Device (HPET)
78	{
79		Name(_HID, EISAID("PNP0103"))
80		Name(_CID, 0x010CD041)
81		Name(_CRS, ResourceTemplate()
82		{
83			Memory32Fixed(ReadOnly, HPET_BASE_ADDRESS, HPET_BASE_SIZE)
84		})
85
86		Method(_STA)
87		{
88			Return (STA_VISIBLE)
89		}
90	}
91
92	/* Real Time Clock */
93	Device (RTC)
94	{
95		Name(_HID, EISAID("PNP0B00"))
96		Name(_CRS, ResourceTemplate()
97		{
98			IO(Decode16, 0x70, 0x70, 1, 8)
99			IRQNoFlags() { 8 }
100		})
101	}
102
103	/* LPC device: Resource consumption */
104	Device (LDRC)
105	{
106		Name(_HID, EISAID("PNP0C02"))
107		Name(_UID, 2)
108
109		Name(RBUF, ResourceTemplate()
110		{
111			IO(Decode16, 0x61, 0x61, 0x1, 0x01) /* NMI Status */
112			IO(Decode16, 0x63, 0x63, 0x1, 0x01) /* CPU Reserved */
113			IO(Decode16, 0x65, 0x65, 0x1, 0x01) /* CPU Reserved */
114			IO(Decode16, 0x67, 0x67, 0x1, 0x01) /* CPU Reserved */
115			IO(Decode16, 0x80, 0x80, 0x1, 0x01) /* Port 80 Post */
116			IO(Decode16, 0x92, 0x92, 0x1, 0x01) /* CPU Reserved */
117			IO(Decode16, 0xb2, 0xb2, 0x1, 0x02) /* SWSMI */
118		})
119
120		Method(_CRS, 0, NotSerialized)
121		{
122			Return (RBUF)
123		}
124	}
125}
126