Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / x86 / include / asm / arch-baytrail / acpi / lpc.asl
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2007-2009 coresystems GmbH
4  * Copyright (C) 2013 Google Inc.
5  * Copyright (C) 2016 Bin Meng <bmeng.cn@gmail.com>
6  *
7  * Modified from coreboot src/soc/intel/baytrail/acpi/lpc.asl
8  */
9
10 /* Intel LPC Bus Device - 0:1f.0 */
11
12 Scope (\)
13 {
14         /* Intel Legacy Block */
15         OperationRegion(ILBS, SystemMemory, ILB_BASE_ADDRESS, ILB_BASE_SIZE)
16         Field(ILBS, AnyAcc, NoLock, Preserve) {
17                 Offset (0x8),
18                 PRTA, 8,
19                 PRTB, 8,
20                 PRTC, 8,
21                 PRTD, 8,
22                 PRTE, 8,
23                 PRTF, 8,
24                 PRTG, 8,
25                 PRTH, 8,
26                 Offset (0x88),
27                     , 3,
28                 UI3E, 1,
29                 UI4E, 1
30         }
31 }
32
33 Device (LPCB)
34 {
35         Name(_ADR, 0x001f0000)
36
37         OperationRegion(LPC0, PCI_Config, 0x00, 0x100)
38         Field(LPC0, AnyAcc, NoLock, Preserve) {
39                 Offset(0x08),
40                 SRID, 8,
41                 Offset(0x80),
42                 C1EN, 1,
43                 Offset(0x84)
44         }
45
46         #include <asm/acpi/irqlinks.asl>
47
48         /* Firmware Hub */
49         Device (FWH)
50         {
51                 Name(_HID, EISAID("INT0800"))
52                 Name(_CRS, ResourceTemplate()
53                 {
54                         Memory32Fixed(ReadOnly, 0xff000000, 0x01000000)
55                 })
56         }
57
58         /* 8259 Interrupt Controller */
59         Device (PIC)
60         {
61                 Name(_HID, EISAID("PNP0000"))
62                 Name(_CRS, ResourceTemplate()
63                 {
64                         IO(Decode16, 0x20, 0x20, 0x01, 0x02)
65                         IO(Decode16, 0x24, 0x24, 0x01, 0x02)
66                         IO(Decode16, 0x28, 0x28, 0x01, 0x02)
67                         IO(Decode16, 0x2c, 0x2c, 0x01, 0x02)
68                         IO(Decode16, 0x30, 0x30, 0x01, 0x02)
69                         IO(Decode16, 0x34, 0x34, 0x01, 0x02)
70                         IO(Decode16, 0x38, 0x38, 0x01, 0x02)
71                         IO(Decode16, 0x3c, 0x3c, 0x01, 0x02)
72                         IO(Decode16, 0xa0, 0xa0, 0x01, 0x02)
73                         IO(Decode16, 0xa4, 0xa4, 0x01, 0x02)
74                         IO(Decode16, 0xa8, 0xa8, 0x01, 0x02)
75                         IO(Decode16, 0xac, 0xac, 0x01, 0x02)
76                         IO(Decode16, 0xb0, 0xb0, 0x01, 0x02)
77                         IO(Decode16, 0xb4, 0xb4, 0x01, 0x02)
78                         IO(Decode16, 0xb8, 0xb8, 0x01, 0x02)
79                         IO(Decode16, 0xbc, 0xbc, 0x01, 0x02)
80                         IO(Decode16, 0x4d0, 0x4d0, 0x01, 0x02)
81                         IRQNoFlags () { 2 }
82                 })
83         }
84
85         /* 8254 timer */
86         Device (TIMR)
87         {
88                 Name(_HID, EISAID("PNP0100"))
89                 Name(_CRS, ResourceTemplate()
90                 {
91                         IO(Decode16, 0x40, 0x40, 0x01, 0x04)
92                         IO(Decode16, 0x50, 0x50, 0x10, 0x04)
93                         IRQNoFlags() { 0 }
94                 })
95         }
96
97         /* HPET */
98         Device (HPET)
99         {
100                 Name(_HID, EISAID("PNP0103"))
101                 Name(_CID, 0x010CD041)
102                 Name(_CRS, ResourceTemplate()
103                 {
104                         Memory32Fixed(ReadOnly, HPET_BASE_ADDRESS, HPET_BASE_SIZE)
105                 })
106
107                 Method(_STA)
108                 {
109                         Return (STA_VISIBLE)
110                 }
111         }
112
113         /* Internal UART */
114         Device (IURT)
115         {
116                 Name(_HID, EISAID("PNP0501"))
117                 Name(_UID, 1)
118
119                 Method(_STA, 0, Serialized)
120                 {
121                         If (LEqual(IURE, 1)) {
122                                 Store(1, UI3E)
123                                 Store(1, UI4E)
124                                 Store(1, C1EN)
125                                 Return (STA_VISIBLE)
126                         } Else {
127                                 Return (STA_MISSING)
128                         }
129
130                 }
131
132                 Method(_DIS, 0, Serialized)
133                 {
134                         Store(0, UI3E)
135                         Store(0, UI4E)
136                         Store(0, C1EN)
137                 }
138
139                 Name(BUF0, ResourceTemplate()
140                 {
141                         IO(Decode16, 0x03f8, 0x03f8, 0x01, 0x08)
142                         IRQNoFlags() { 3 }
143                 })
144
145                 Name(BUF1, ResourceTemplate()
146                 {
147                         IO(Decode16, 0x03f8, 0x03f8, 0x01, 0x08)
148                         IRQNoFlags() { 4 }
149                 })
150
151                 Method(_CRS, 0, Serialized)
152                 {
153                         If (LLessEqual(SRID, 0x04)) {
154                                 Return (BUF0)
155                         } Else {
156                                 Return (BUF1)
157                         }
158                 }
159         }
160
161         /* Real Time Clock */
162         Device (RTC)
163         {
164                 Name(_HID, EISAID("PNP0B00"))
165                 Name(_CRS, ResourceTemplate()
166                 {
167                         IO(Decode16, 0x70, 0x70, 1, 8)
168                         /*
169                          * Disable as Windows doesn't like it, and systems
170                          * don't seem to use it
171                          */
172                         /* IRQNoFlags() { 8 } */
173                 })
174         }
175
176         /* LPC device: Resource consumption */
177         Device (LDRC)
178         {
179                 Name(_HID, EISAID("PNP0C02"))
180                 Name(_UID, 2)
181
182                 Name(RBUF, ResourceTemplate()
183                 {
184                         IO(Decode16, 0x61, 0x61, 0x1, 0x01) /* NMI Status */
185                         IO(Decode16, 0x63, 0x63, 0x1, 0x01) /* CPU Reserved */
186                         IO(Decode16, 0x65, 0x65, 0x1, 0x01) /* CPU Reserved */
187                         IO(Decode16, 0x67, 0x67, 0x1, 0x01) /* CPU Reserved */
188                         IO(Decode16, 0x80, 0x80, 0x1, 0x01) /* Port 80 Post */
189                         IO(Decode16, 0x92, 0x92, 0x1, 0x01) /* CPU Reserved */
190                         IO(Decode16, 0xb2, 0xb2, 0x1, 0x02) /* SWSMI */
191                 })
192
193                 Method(_CRS, 0, NotSerialized)
194                 {
195                         Return (RBUF)
196                 }
197         }
198 }