2 * This file is part of the coreboot project.
4 * Copyright (C) 2011 Advanced Micro Devices, Inc.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
19 /* Operating System Capabilities Method */
22 // Create DWord-addressable fields from the Capabilities Buffer
23 CreateDWordField(Arg3,0,CDW1)
24 CreateDWordField(Arg3,4,CDW2)
25 CreateDWordField(Arg3,8,CDW3)
27 /* Check for proper PCI/PCIe UUID */
28 If(LEqual(Arg0,ToUUID("33DB4D5B-1FF7-401C-9657-7441C03DD766")))
30 /* Let OS control everything */
33 Or(CDW1,4,CDW1) // Unrecognized UUID
38 Method(_BBN, 0) { /* Bus number = 0 */
42 /* DBGO("\\_SB\\PCI0\\_STA\n") */
43 Return(0x0B) /* Status is visible */
47 If(PMOD){ Return(APR0) } /* APIC mode */
48 Return (PR0) /* PIC Mode */
51 /* Describe the Southbridge devices */
55 /* PCI slot 1, 2, 3 */
57 Name(_ADR, 0x00140004)
58 Name(_PRW, Package() {0x18, 4})
66 Name(_ADR, 0x00110000)
67 #include "acpi/sata.asl"
73 Name(_ADR, 0x00140000)
81 Name(_ADR, 0x00140004)
85 Name(_ADR, 0x00140005)
89 Name(_ADR, 0x00140006)
92 Name(CRES, ResourceTemplate() {
93 /* Set the Bus number and Secondary Bus number for the PCI0 device
94 * The Secondary bus range for PCI0 lets the system
95 * know what bus values are allowed on the downstream
96 * side of this PCI bus if there is a PCI-PCI bridge.
97 * PCI busses can have 256 secondary busses which
98 * range from [0-0xFF] but they do not need to be
101 WordBusNumber (ResourceProducer, MinFixed, MaxFixed, PosDecode,
102 0x0000, /* address granularity */
103 0x0000, /* range minimum */
104 0x00FF, /* range maximum */
105 0x0000, /* translation */
107 ,, PSB0) /* ResourceSourceIndex, ResourceSource, DescriptorName */
109 IO(Decode16, 0x0CF8, 0x0CF8, 1, 8)
111 WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
112 0x0000, /* address granularity */
113 0x0000, /* range minimum */
114 0x0CF7, /* range maximum */
115 0x0000, /* translation */
119 WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
120 0x0000, /* address granularity */
121 0x0D00, /* range minimum */
122 0xFFFF, /* range maximum */
123 0x0000, /* translation */
127 Memory32Fixed(READONLY, 0x000A0000, 0x00020000, VGAM) /* VGA memory space */
129 /* memory space for PCI BARs below 4GB */
130 Memory32Fixed(ReadOnly, 0x00000000, 0x00000000, MMIO)
131 }) /* End Name(_SB.PCI0.CRES) */
134 /* DBGO("\\_SB\\PCI0\\_CRS\n") */
135 CreateDWordField(CRES, ^MMIO._BAS, MM1B)
136 CreateDWordField(CRES, ^MMIO._LEN, MM1L)
139 * Declare memory between TOM1 and 4GB as available
141 * Use ShiftLeft to avoid 64bit constant (for XP).
142 * This will work even if the OS does 32bit arithmetic, as
143 * 32bit (0x00000000 - TOM1) will wrap and give the same
144 * result as 64bit (0x100000000 - TOM1).
147 ShiftLeft(0x10000000, 4, Local0)
148 Subtract(Local0, TOM1, Local0)
151 Return(CRES) /* note to change the Name buffer */
152 } /* end of Method(_SB.PCI0._CRS) */
156 * FIRST METHOD CALLED UPON BOOT
158 * 1. If debugging, print current OS and ACPI interpreter.
159 * 2. Get PCI Interrupt routing from ACPI VSM, this
160 * value is based on user choice in BIOS setup.
163 /* DBGO("\\_SB\\_INI\n") */
164 /* DBGO(" DSDT.ASL code from ") */
168 /* DBGO("\n Sleep states supported: ") */
170 /* DBGO(" \\_OS=") */
172 /* DBGO("\n \\_REV=") */
176 /* Determine the OS we're running on */
179 /* On older chips, clear PciExpWakeDisEn */
180 /*if (LLessEqual(\SBRI, 0x13)) {
184 } /* End Method(_SB._INI) */
187 /* Client Management index/data registers */
188 OperationRegion(CMT, SystemIO, 0x00000C50, 0x00000002)
189 Field(CMT, ByteAcc, NoLock, Preserve) {
191 /* Client Management Data register */
199 /* GPM Port register */
200 OperationRegion(GPT, SystemIO, 0x00000C52, 0x00000001)
201 Field(GPT, ByteAcc, NoLock, Preserve) {
212 /* Flash ROM program enable register */
213 OperationRegion(FRE, SystemIO, 0x00000C6F, 0x00000001)
214 Field(FRE, ByteAcc, NoLock, Preserve) {
219 /* PM2 index/data registers */
220 OperationRegion(PM2R, SystemIO, 0x00000CD0, 0x00000002)
221 Field(PM2R, ByteAcc, NoLock, Preserve) {
226 /* Power Management I/O registers, TODO:PMIO is quite different in SB800. */
227 OperationRegion(PIOR, SystemIO, 0x00000CD6, 0x00000002)
228 Field(PIOR, ByteAcc, NoLock, Preserve) {
232 IndexField (PIOI, PIOD, ByteAcc, NoLock, Preserve) {
233 Offset(0x00), /* MiscControl */
237 Offset(0x01), /* MiscStatus */
241 Offset(0x04), /* SmiWakeUpEventEnable3 */
244 Offset(0x07), /* SmiWakeUpEventStatus3 */
247 Offset(0x10), /* AcpiEnable */
250 Offset(0x1C), /* ProgramIoEnable */
257 Offset(0x1D), /* IOMonitorStatus */
264 Offset(0x20), /* AcpiPmEvtBlk. TODO: should be 0x60 */
266 Offset(0x36), /* GEvtLevelConfig */
270 Offset(0x37), /* GPMLevelConfig0 */
277 Offset(0x38), /* GPMLevelConfig1 */
284 Offset(0x3B), /* PMEStatus1 */
293 Offset(0x55), /* SoftPciRst */
301 /* Offset(0x61), */ /* Options_1 */
305 Offset(0x65), /* UsbPMControl */
308 Offset(0x68), /* MiscEnable68 */
312 Offset(0x92), /* GEVENTIN */
315 Offset(0x96), /* GPM98IN */
318 Offset(0x9A), /* EnhanceControl */
321 Offset(0xA8), /* PIO7654Enable */
326 Offset(0xA9), /* PIO7654Status */
334 * First word is PM1_Status, Second word is PM1_Enable
336 OperationRegion(P1EB, SystemIO, APEB, 0x04)
337 Field(P1EB, ByteAcc, NoLock, Preserve) {
363 Device(PWRB) { /* Start Power button device */
364 Name(_HID, EISAID("PNP0C0C"))
366 Name(_PRW, Package () {3, 0x04}) /* wake from S1-S4 */
367 Name(_STA, 0x0B) /* sata is invisible */
369 } /* End Scope(_SB) */