150fbcf5f94b266830742ec149d51bbf29ce1c8d
[coreboot.git] / src / mainboard / via / vt8454c / dsdt.dsl
1 /*
2  * This file is part of the coreboot project.
3  * 
4  * Copyright (C) 2004 Nick Barker <Nick.Barker9@btinternet.com>
5  * Copyright (C) 2007-2009 coresystems GmbH
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; version 2 of
10  * the License.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20  * MA 02110-1301 USA
21  */
22
23 DefinitionBlock ("dsdt.aml", "DSDT", 1, "CX700 ", "COREBOOT", 0x00000001)
24 {
25         /*  
26          * Define the main processor
27          */
28         Scope (\_PR)
29         {
30                 Processor (\_PR.CPU0, 0x00, 0x00000410, 0x06) {}
31         }
32
33         /* For now only define 2 power states:
34          *  - S0 which is fully on
35          *  - S5 which is soft off
36          * any others would involve declaring the wake up methods
37          */
38         Name (\_S0, Package () {0x00, 0x00, 0x00, 0x00 })
39         Name (\_S5, Package () {0x02, 0x02, 0x00, 0x00 })
40
41         Scope (\) {     
42                 Name (PICF , 0)         // Global flag indicating whether to use PIC or APIC mode  
43                 Method ( _PIC,1)        // The OS is calling this
44                 {
45                         Store( Arg0 , PICF)
46                 }
47         } // end of \ scope 
48
49         /* Root of the bus hierarchy */
50         Scope (\_SB)
51         {
52                 /* Define how interrupt Link A is plumbed in */ 
53                 Device (LNKA)
54                 {
55                         Name (_HID, EisaId ("PNP0C0F"))
56                         Name (_UID, 0x01)
57
58                         /* Status - always return ready */
59                         Method (_STA, 0, NotSerialized)
60                         {
61                                 Return (0x0B)
62                         }
63
64                         /* Current Resources - return irq set up in BIOS */  
65                         Method (_CRS, 0, NotSerialized)
66                         {
67                                 Name (CRSP, ResourceTemplate () {
68                                         IRQ (Level, ActiveLow, Shared) {11}
69                                 })
70                                 Name (CRSA, ResourceTemplate () {
71                                         Interrupt (ResourceConsumer, Level, ActiveLow, Shared) {16}
72                                 })
73
74                                 If (LNot (PICF)) {
75                                         Return (CRSP)
76                                 } Else {
77                                         Return (CRSA)
78                                 }
79                         }
80                         /* Possible Resources - return the range of irqs
81                          * we are using for PCI - only here to keep Linux ACPI
82                          * happy 
83                          */
84                         Method (_PRS, 0, NotSerialized)
85                         {
86                                 Name (PRSP, ResourceTemplate () {
87                                         IRQ (Level, ActiveLow, Shared) {3,4,6,7,10,11,12}
88                                 })
89                                 Name (PRSA, ResourceTemplate () {
90                                         Interrupt (ResourceConsumer, Level, ActiveLow, Shared) {16,17,18,19,20,21,22,23}
91                                 })
92
93                                 If (LNot (PICF)) {
94                                         Return (PRSP)
95                                 } Else {
96                                         Return (PRSA)
97                                 }
98
99                         }
100                         /* Set Resources - dummy function to keep Linux ACPI happy
101                          * Linux is more than happy not to tinker with irq
102                          * assignments as long as the CRS and STA functions 
103                          * return good values
104                          */
105                         Method (_SRS, 1, NotSerialized ) {}
106                         /* Disable - dummy function to keep Linux ACPI happy */
107                         Method (_DIS, 0, NotSerialized ) {}
108  
109                 } // End of LNKA 
110
111                 /* Define how interrupt Link B is plumbed in */ 
112                 Device (LNKB)
113                 {
114                         Name (_HID, EisaId ("PNP0C0F"))
115                         Name (_UID, 0x02)
116
117                         /* Status - always return ready */
118                         Method (_STA, 0, NotSerialized)
119                         {
120                                 Return (0x0B)
121                         }
122
123                         /* Current Resources - return irq set up in BIOS */  
124                         Method (_CRS, 0, NotSerialized)
125                         {
126                                 Name (CRSP, ResourceTemplate () {
127                                         IRQ (Level, ActiveLow, Shared) {11}
128                                 })
129                                 Name (CRSA, ResourceTemplate () {
130                                         Interrupt (ResourceConsumer, Level, ActiveLow, Shared) {17}
131                                 })
132
133                                 If (LNot (PICF)) {
134                                         Return (CRSP)
135                                 } Else {
136                                         Return (CRSA)
137                                 }
138                         }
139                         /* Possible Resources - return the range of irqs
140                          * we are using for PCI - only here to keep Linux ACPI
141                          * happy 
142                          */
143                         Method (_PRS, 0, NotSerialized)
144                         {
145                                 Name (PRSP, ResourceTemplate () {
146                                         IRQ (Level, ActiveLow, Shared) {3,4,6,7,10,11,12}
147                                 })
148                                 Name (PRSA, ResourceTemplate () {
149                                         Interrupt (ResourceConsumer, Level, ActiveLow, Shared) {16,17,18,19,20,21,22,23}
150                                 })
151
152                                 If (LNot (PICF)) {
153                                         Return (PRSP)
154                                 } Else {
155                                         Return (PRSA)
156                                 }
157
158                         }
159
160                         /* Set Resources - dummy function to keep Linux ACPI happy
161                          * Linux is more than happy not to tinker with irq
162                          * assignments as long as the CRS and STA functions 
163                          * return good values
164                          */
165                         Method (_SRS, 1, NotSerialized ) {}
166                         /* Disable - dummy function to keep Linux ACPI happy */
167                         Method (_DIS, 0, NotSerialized ) {}
168  
169                 } // End of LNKB
170
171                 /* Define how interrupt Link C is plumbed in */ 
172                 Device (LNKC)
173                 {
174                         Name (_HID, EisaId ("PNP0C0F"))
175                         Name (_UID, 0x03)
176
177                         /* Status - always return ready */
178                         Method (_STA, 0, NotSerialized)
179                         {
180                                 Return (0x0B)
181                         }
182
183                         /* Current Resources - return irq set up in BIOS */  
184                         Method (_CRS, 0, NotSerialized)
185                         {
186                                 Name (CRSP, ResourceTemplate () {
187                                         IRQ (Level, ActiveLow, Shared) {10}
188                                 })
189                                 Name (CRSA, ResourceTemplate () {
190                                         Interrupt (ResourceConsumer, Level, ActiveLow, Shared) {18}
191                                 })
192
193                                 If (LNot (PICF)) {
194                                         Return (CRSP)
195                                 } Else {
196                                         Return (CRSA)
197                                 }
198                         }
199                         /* Possible Resources - return the range of irqs
200                          * we are using for PCI - only here to keep Linux ACPI
201                          * happy 
202                          */
203                         Method (_PRS, 0, NotSerialized)
204                         {
205                                 Name (PRSP, ResourceTemplate () {
206                                         IRQ (Level, ActiveLow, Shared) {3,4,6,7,10,11,12}
207                                 })
208                                 Name (PRSA, ResourceTemplate () {
209                                         Interrupt (ResourceConsumer, Level, ActiveLow, Shared) {16,17,18,19,20,21,22,23}
210                                 })
211
212                                 If (LNot (PICF)) {
213                                         Return (PRSP)
214                                 } Else {
215                                         Return (PRSA)
216                                 }
217
218                         }
219
220                         /* Set Resources - dummy function to keep Linux ACPI happy
221                          * Linux is more than happy not to tinker with irq
222                          * assignments as long as the CRS and STA functions 
223                          * return good values
224                          */
225                         Method (_SRS, 1, NotSerialized ) {}
226                         /* Disable - dummy function to keep Linux ACPI happy */
227                         Method (_DIS, 0, NotSerialized ) {}
228  
229                 } // End of LNKC
230
231                 /* Define how interrupt Link D is plumbed in */ 
232                 Device (LNKD)
233                 {
234                         Name (_HID, EisaId ("PNP0C0F"))
235                         Name (_UID, 0x04)
236
237                         /* Status - always return ready */
238                         Method (_STA, 0, NotSerialized)
239                         {
240                                 Return (0x0B)
241                         }
242
243                         /* Current Resources - return irq set up in BIOS */  
244                         Method (_CRS, 0, NotSerialized)
245                         {
246                                 Name (CRSP, ResourceTemplate () {
247                                         IRQ (Level, ActiveLow, Shared) {10}
248                                 })
249                                 Name (CRSA, ResourceTemplate () {
250                                         Interrupt (ResourceConsumer, Level, ActiveLow, Shared) {19}
251                                 })
252
253                                 If (LNot (PICF)) {
254                                         Return (CRSP)
255                                 } Else {
256                                         Return (CRSA)
257                                 }
258                         }
259                         /* Possible Resources - return the range of irqs
260                          * we are using for PCI - only here to keep Linux ACPI
261                          * happy 
262                          */
263                         Method (_PRS, 0, NotSerialized)
264                         {
265                                 Name (PRSP, ResourceTemplate () {
266                                         IRQ (Level, ActiveLow, Shared) {3,4,6,7,10,11,12}
267                                 })
268                                 Name (PRSA, ResourceTemplate () {
269                                         Interrupt (ResourceConsumer, Level, ActiveLow, Shared) {16,17,18,19,20,21,22,23}
270                                 })
271
272                                 If (LNot (PICF)) {
273                                         Return (PRSP)
274                                 } Else {
275                                         Return (PRSA)
276                                 }
277
278                         }
279
280                         /* Set Resources - dummy function to keep Linux ACPI happy
281                          * Linux is more than happy not to tinker with irq
282                          * assignments as long as the CRS and STA functions 
283                          * return good values
284                          */
285                         Method (_SRS, 1, NotSerialized ) {}
286                         /* Disable - dummy function to keep Linux ACPI happy */
287                         Method (_DIS, 0, NotSerialized ) {}
288  
289                 } // End of LNKD 
290
291                 /* PCI Root Bridge */
292                 Device (PCI0)
293                 {
294                         Name (_HID, EisaId ("PNP0A08"))
295                         Name (_CID, EisaId ("PNP0A03"))
296                         Name (_ADR, 0x00)
297                         Name (_UID, 0x00)
298                         Name (_BBN, 0x00)
299
300                         // Mainboard specific IRQ routing
301                         Include ("irq.dsl")
302
303                         /* PCI Routing Table */
304                         Method (_PRT, 0, NotSerialized)
305                         {
306                             If (LNot (PICF))
307                             {
308                                 Return (PICM)
309                             }
310                             Else
311                             {
312                                 Return (APIC)
313                             }
314                         }
315
316                         Device (P2PB) /* PCI to PCI bridge */
317                         {
318                                 Name (_ADR, 0x00130001)
319
320                                 Include ("irq-p2p-bridge.dsl")
321                                 Method (_PRT, 0, NotSerialized)
322                                 {
323                                         If (LNot (PICF))
324                                         {
325                                                 Return (PICM)
326                                         }
327                                         Else
328                                         {
329                                                 Return (APIC)
330                                         }
331                                 }
332                                 /* Status - always return ready */
333                                 Method (_STA, 0, NotSerialized)
334                                 {
335                                         Return (0x0F)
336                                 }
337                         }
338                 } // End of PCI0
339         } // End of _SB
340 } // End of Definition Block
341