1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
/** @file
PCI Host Bridge Definitions
Copyright (c) 2013-2015 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
Name(PBRS, ResourceTemplate() {
WORDBusNumber( //Bus number resource (0); the bridge produces bus numbers for its subsequent buses
ResourceProducer, // bit 0 of general flags is 1
MinFixed, // Range is fixed
MaxFixed, // Range is fixed
PosDecode, // PosDecode
0x0000, // Granularity
0x0000, // Min
0x001f, // Max
0x0000, // Translation
0x0020 // Range Length = Max-Min+1
)
WORDIO( //Consumed-and-produced resource (all I/O below CF8)
ResourceProducer, // bit 0 of general flags is 0
MinFixed, // Range is fixed
MaxFixed, // Range is fixed
PosDecode,
EntireRange,
0x0000, // Granularity
0x0000, // Min
0x0cf7, // Max
0x0000, // Translation
0x0cf8 // Range Length
)
IO( //Consumed resource (CF8-CFF)
Decode16,
0x0cf8,
0xcf8,
1,
8
)
WORDIO( //Consumed-and-produced resource (all I/O above CFF)
ResourceProducer, // bit 0 of general flags is 0
MinFixed, // Range is fixed
MaxFixed, // Range is fixed
PosDecode,
EntireRange,
0x0000, // Granularity
0x0d00, // Min
0xffff, // Max
0x0000, // Translation
0xf300 // Range Length
)
DWORDMEMORY( // descriptor for dos area(0->0xa0000)
ResourceProducer, // bit 0 of general flags is 0
PosDecode,
MinFixed, // Range is fixed
MaxFixed, // Range is Fixed
Cacheable,
ReadWrite,
0x00000000, // Granularity
0x000a0000, // Min
0x000bffff, // Max
0x00000000, // Translation
0x00020000 // Range Length
)
DWORDMemory( // Consumed-and-produced resource for pci memory mapped memory
ResourceProducer, // bit 0 of general flags is 0
PosDecode, // positive Decode
MinFixed, // Range is fixed
MaxFixed, // Range is fixed
Cacheable,
ReadWrite,
0x00000000, // Granularity
0x00000000, // Min (calculated dynamically)
0xfebfffff, // Max = IO Apic base address - 1
0x00000000, // Translation
0xfec00000, // Range Length (calculated dynamically)
, // Optional field left blank
, // Optional field left blank
MEM1 // Name declaration for this descriptor
)
}) // end of CRES Buffer
Method(_CRS, 0x0, NotSerialized)
{
CreateDWordField(PBRS, \_SB.PCI0.MEM1._MIN, MMIN)
CreateDWordField(PBRS, \_SB.PCI0.MEM1._MAX, MMAX)
CreateDWordField(PBRS, \_SB.PCI0.MEM1._LEN, MLEN)
// HMBOUND is PCI memory base
And(MNRD(0x03, 0x08), 0xFFFFF000, MMIN)
Add(Subtract(MMAX, MMIN), 1, MLEN)
Return(PBRS)
}
// Message Nework Registers
OperationRegion(MNR, PCI_Config, 0xD0, 0x10)
Field(MNR, DWordAcc, NoLock, Preserve)
{
MCR, 32, // Message Control Register
MDR, 32 // Message Data Register
}
// Message Nework Read Method
// Arg0 = Port
// Arg1 = RegAddress
// return 32 bit register value
Method(MNRD, 2, Serialized)
{
Or(ShiftLeft(Arg0, 16), ShiftLeft(Arg1, 8), Local0)
Or(Local0, 0x100000F0, Local0)
Store(Local0, MCR)
Return(MDR)
}
// Message Nework Write Method
// Arg0 = Port
// Arg1 = RegAddress
// Arg2 = 32 bit write value
Method(MNWR, 3, Serialized)
{
Store(Arg2, MDR)
Or(ShiftLeft(Arg0, 16), ShiftLeft(Arg1, 8), Local0)
Or(Local0, 0x110000F0, Local0)
Store(Local0, MCR)
}
Method(_PRT, 0, NotSerialized)
{
If (LEqual(\GPIC, Zero)) // 8259 Interrupt Routing
{
Return (
Package()
{
// Bus 0, Device 20 - IOSFAHB Bridge
Package() {0x0014ffff, 0, \_SB.PCI0.LPC.LNKA, 0}, // INTA
Package() {0x0014ffff, 1, \_SB.PCI0.LPC.LNKB, 0}, // INTB
Package() {0x0014ffff, 2, \_SB.PCI0.LPC.LNKC, 0}, // INTC
Package() {0x0014ffff, 3, \_SB.PCI0.LPC.LNKD, 0}, // INTD
// Bus 0, Device 21 - IOSFAHB Bridge
Package() {0x0015ffff, 0, \_SB.PCI0.LPC.LNKA, 0}, // INTA
Package() {0x0015ffff, 1, \_SB.PCI0.LPC.LNKB, 0}, // INTB
Package() {0x0015ffff, 2, \_SB.PCI0.LPC.LNKC, 0}, // INTC
Package() {0x0015ffff, 3, \_SB.PCI0.LPC.LNKD, 0}, // INTD
// Bus 0, Device 23 - PCIe port 0
Package() {0x0017ffff, 0, \_SB.PCI0.LPC.LNKE, 0}, // INTA
Package() {0x0017ffff, 1, \_SB.PCI0.LPC.LNKF, 0}, // INTB
Package() {0x0017ffff, 2, \_SB.PCI0.LPC.LNKG, 0}, // INTC
Package() {0x0017ffff, 3, \_SB.PCI0.LPC.LNKH, 0}, // INTD
// Bus 0, Device 31
Package() {0x001fffff, 0, \_SB.PCI0.LPC.LNKA, 0}, // LPC Bridge
}
)
}
else {
Return (
Package()
{
// Bus 0, Device 20 - IOSFAHB Bridge
Package() {0x0014ffff, 0, 0, 16}, // INTA
Package() {0x0014ffff, 1, 0, 17}, // INTB
Package() {0x0014ffff, 2, 0, 18}, // INTC
Package() {0x0014ffff, 3, 0, 19}, // INTD
// Bus 0, Device 21 - IOSFAHB Bridge
Package() {0x0015ffff, 0, 0, 16}, // INTA
Package() {0x0015ffff, 1, 0, 17}, // INTB
Package() {0x0015ffff, 2, 0, 18}, // INTC
Package() {0x0015ffff, 3, 0, 19}, // INTD
// Bus 0, Device 23 - PCIe port 0
Package() {0x0017ffff, 0, 0, 20}, // INTA
Package() {0x0017ffff, 1, 0, 21}, // INTB
Package() {0x0017ffff, 2, 0, 22}, // INTC
Package() {0x0017ffff, 3, 0, 23}, // INTD
// Bus 0, Device 31
Package() {0x001fffff, 0, 0, 16}, // LPC Bridge
}
)
}
}
|