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.
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.
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/>.
16 /* PCI CRS (current resources) definition. */
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
28 0x0CF8, // Address Range Minimum
29 0x0CF8, // Address Range Maximum
30 0x01, // Address Alignment
31 0x08, // Address Length
33 WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
34 0x0000, // Address Space Granularity
35 0x0000, // Address Range Minimum
36 0x0CF7, // Address Range Maximum
37 0x0000, // Address Translation Offset
38 0x0CF8, // Address Length
40 WordIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
41 0x0000, // Address Space Granularity
42 0x0D00, // Address Range Minimum
43 0xFFFF, // Address Range Maximum
44 0x0000, // Address Translation Offset
45 0xF300, // Address Length
47 DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
48 0x00000000, // Address Space Granularity
49 0x000A0000, // Address Range Minimum
50 0x000BFFFF, // Address Range Maximum
51 0x00000000, // Address Translation Offset
52 0x00020000, // Address Length
53 ,, , AddressRangeMemory, TypeStatic)
54 DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
55 0x00000000, // Address Space Granularity
56 0xE0000000, // Address Range Minimum
57 0xFEBFFFFF, // Address Range Maximum
58 0x00000000, // Address Translation Offset
59 0x1EC00000, // Address Length
60 ,, PW32, AddressRangeMemory, TypeStatic)
63 Name(CR64, ResourceTemplate() {
64 QWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
65 0x00000000, // Address Space Granularity
66 0x8000000000, // Address Range Minimum
67 0xFFFFFFFFFF, // Address Range Maximum
68 0x00000000, // Address Translation Offset
69 0x8000000000, // Address Length
70 ,, PW64, AddressRangeMemory, TypeStatic)
74 /* Fields provided by dynamically created ssdt */
78 External(P1S, BuffObj)
79 External(P1E, BuffObj)
80 External(P1L, BuffObj)
82 /* fixup 32bit pci io window */
83 CreateDWordField(CRES, \_SB.PCI0.PW32._MIN, PS32)
84 CreateDWordField(CRES, \_SB.PCI0.PW32._MAX, PE32)
85 CreateDWordField(CRES, \_SB.PCI0.PW32._LEN, PL32)
88 Store(Add(Subtract(P0E, P0S), 1), PL32)
90 If (LEqual(P1V, Zero)) {
94 /* fixup 64bit pci io window */
95 CreateQWordField(CR64, \_SB.PCI0.PW64._MIN, PS64)
96 CreateQWordField(CR64, \_SB.PCI0.PW64._MAX, PE64)
97 CreateQWordField(CR64, \_SB.PCI0.PW64._LEN, PL64)
101 /* add window and return result */
102 ConcatenateResTemplate(CRES, CR64, Local0)