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 BOARD_SPECIFIC_PCI_RESOURSES
41 DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
42 0x00000000, // Address Space Granularity
43 0x000A0000, // Address Range Minimum
44 0x000BFFFF, // Address Range Maximum
45 0x00000000, // Address Translation Offset
46 0x00020000, // Address Length
47 ,, , AddressRangeMemory, TypeStatic)
48 DWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, NonCacheable, ReadWrite,
49 0x00000000, // Address Space Granularity
50 0xE0000000, // Address Range Minimum
51 0xFEBFFFFF, // Address Range Maximum
52 0x00000000, // Address Translation Offset
53 0x1EC00000, // Address Length
54 ,, PW32, AddressRangeMemory, TypeStatic)
57 Name(CR64, ResourceTemplate() {
58 QWordMemory(ResourceProducer, PosDecode, MinFixed, MaxFixed, Cacheable, ReadWrite,
59 0x00000000, // Address Space Granularity
60 0x8000000000, // Address Range Minimum
61 0xFFFFFFFFFF, // Address Range Maximum
62 0x00000000, // Address Translation Offset
63 0x8000000000, // Address Length
64 ,, PW64, AddressRangeMemory, TypeStatic)
68 /* Fields provided by dynamically created ssdt */
72 External(P1S, BuffObj)
73 External(P1E, BuffObj)
74 External(P1L, BuffObj)
76 /* fixup 32bit pci io window */
77 CreateDWordField(CRES, \_SB.PCI0.PW32._MIN, PS32)
78 CreateDWordField(CRES, \_SB.PCI0.PW32._MAX, PE32)
79 CreateDWordField(CRES, \_SB.PCI0.PW32._LEN, PL32)
82 Store(Add(Subtract(P0E, P0S), 1), PL32)
84 If (LEqual(P1V, Zero)) {
88 /* fixup 64bit pci io window */
89 CreateQWordField(CR64, \_SB.PCI0.PW64._MIN, PS64)
90 CreateQWordField(CR64, \_SB.PCI0.PW64._MAX, PE64)
91 CreateQWordField(CR64, \_SB.PCI0.PW64._LEN, PL64)
95 /* add window and return result */
96 ConcatenateResTemplate(CRES, CR64, Local0)