]> git.proxmox.com Git - qemu.git/blob - hw/i386/acpi-dsdt-pci-crs.dsl
pcmcia/pxa2xx: QOM'ify PXA2xxPCMCIAState
[qemu.git] / hw / i386 / acpi-dsdt-pci-crs.dsl
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 )
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
39 ,, , TypeStatic)
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
46 ,, , TypeStatic)
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)
61 })
62
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)
71 })
72
73 Method(_CRS, 0) {
74 /* Fields provided by dynamically created ssdt */
75 External(P0S, IntObj)
76 External(P0E, IntObj)
77 External(P1V, IntObj)
78 External(P1S, BuffObj)
79 External(P1E, BuffObj)
80 External(P1L, BuffObj)
81
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)
86 Store(P0S, PS32)
87 Store(P0E, PE32)
88 Store(Add(Subtract(P0E, P0S), 1), PL32)
89
90 If (LEqual(P1V, Zero)) {
91 Return (CRES)
92 }
93
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)
98 Store(P1S, PS64)
99 Store(P1E, PE64)
100 Store(P1L, PL64)
101 /* add window and return result */
102 ConcatenateResTemplate(CRES, CR64, Local0)
103 Return (Local0)
104 }
105 }