]>
Commit | Line | Data |
---|---|---|
74523b85 MT |
1 | /* |
2 | * This program is free software; you can redistribute it and/or modify | |
3 | * it under the terms of the GNU General Public License as published by | |
4 | * the Free Software Foundation; either version 2 of the License, or | |
5 | * (at your option) any later version. | |
6 | ||
7 | * This program is distributed in the hope that it will be useful, | |
8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
10 | * GNU General Public License for more details. | |
11 | ||
12 | * You should have received a copy of the GNU General Public License along | |
13 | * with this program; if not, see <http://www.gnu.org/licenses/>. | |
14 | */ | |
15 | ||
16 | /* PCI CRS (current resources) definition. */ | |
17 | Scope(\_SB.PCI0) { | |
18 | ||
19 | Name(CRES, ResourceTemplate() { | |
20 | WordBusNumber(ResourceProducer, MinFixed, MaxFixed, PosDecode, | |
21 | 0x0000, // Address Space Granularity | |
22 | 0x0000, // Address Range Minimum | |
23 | 0x00FF, // Address Range Maximum | |
24 | 0x0000, // Address Translation Offset | |
25 | 0x0100, // Address Length | |
26 | ,, ) | |
27 | IO(Decode16, | |
28 | 0x0CF8, // Address Range Minimum | |
29 | 0x0CF8, // Address Range Maximum | |
30 | 0x01, // Address Alignment | |
31 | 0x08, // Address Length | |
32 | ) | |
1aa149b4 | 33 | BOARD_SPECIFIC_PCI_RESOURSES |
74523b85 MT |
34 | DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, |
35 | 0x00000000, // Address Space Granularity | |
36 | 0x000A0000, // Address Range Minimum | |
37 | 0x000BFFFF, // Address Range Maximum | |
38 | 0x00000000, // Address Translation Offset | |
39 | 0x00020000, // Address Length | |
40 | ,, , AddressRangeMemory, TypeStatic) | |
41 | DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite, | |
42 | 0x00000000, // Address Space Granularity | |
43 | 0xE0000000, // Address Range Minimum | |
44 | 0xFEBFFFFF, // Address Range Maximum | |
45 | 0x00000000, // Address Translation Offset | |
46 | 0x1EC00000, // Address Length | |
47 | ,, PW32, AddressRangeMemory, TypeStatic) | |
48 | }) | |
49 | ||
50 | Name(CR64, ResourceTemplate() { | |
51 | QWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite, | |
52 | 0x00000000, // Address Space Granularity | |
53 | 0x8000000000, // Address Range Minimum | |
54 | 0xFFFFFFFFFF, // Address Range Maximum | |
55 | 0x00000000, // Address Translation Offset | |
56 | 0x8000000000, // Address Length | |
57 | ,, PW64, AddressRangeMemory, TypeStatic) | |
58 | }) | |
59 | ||
60 | Method(_CRS, 0) { | |
61 | /* Fields provided by dynamically created ssdt */ | |
62 | External(P0S, IntObj) | |
63 | External(P0E, IntObj) | |
64 | External(P1V, IntObj) | |
65 | External(P1S, BuffObj) | |
66 | External(P1E, BuffObj) | |
67 | External(P1L, BuffObj) | |
68 | ||
69 | /* fixup 32bit pci io window */ | |
70 | CreateDWordField(CRES, \_SB.PCI0.PW32._MIN, PS32) | |
71 | CreateDWordField(CRES, \_SB.PCI0.PW32._MAX, PE32) | |
72 | CreateDWordField(CRES, \_SB.PCI0.PW32._LEN, PL32) | |
73 | Store(P0S, PS32) | |
74 | Store(P0E, PE32) | |
75 | Store(Add(Subtract(P0E, P0S), 1), PL32) | |
76 | ||
77 | If (LEqual(P1V, Zero)) { | |
78 | Return (CRES) | |
79 | } | |
80 | ||
81 | /* fixup 64bit pci io window */ | |
82 | CreateQWordField(CR64, \_SB.PCI0.PW64._MIN, PS64) | |
83 | CreateQWordField(CR64, \_SB.PCI0.PW64._MAX, PE64) | |
84 | CreateQWordField(CR64, \_SB.PCI0.PW64._LEN, PL64) | |
85 | Store(P1S, PS64) | |
86 | Store(P1E, PE64) | |
87 | Store(P1L, PL64) | |
88 | /* add window and return result */ | |
89 | ConcatenateResTemplate(CRES, CR64, Local0) | |
90 | Return (Local0) | |
91 | } | |
92 | } |