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 BOARD_SPECIFIC_PCI_RESOURSES
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)
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)
61 /* Fields provided by dynamically created ssdt */
65 External(P1S, BuffObj)
66 External(P1E, BuffObj)
67 External(P1L, BuffObj)
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)
75 Store(Add(Subtract(P0E, P0S), 1), PL32)
77 If (LEqual(P1V, Zero)) {
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)
88 /* add window and return result */
89 ConcatenateResTemplate(CRES, CR64, Local0)