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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 /* DefinitionBlock Statement */
22 "DSDT.AML", /* Output filename */
23 "DSDT", /* Signature */
24 0x02, /* DSDT Revision, needs to be 2 for 64bit */
26 "TORPEDO ", /* TABLE ID */
27 0x00010001 /* OEM Revision */
29 { /* Start of ASL file */
30 /* #include "../../../arch/x86/acpi/debug.asl" */ /* Include global debug methods if needed */
32 /* Data to be patched by the BIOS during POST */
33 /* FIXME the patching is not done yet! */
34 /* Memory related values */
35 Name(LOMH, 0x0) /* Start of unused memory in C0000-E0000 range */
36 Name(PBAD, 0x0) /* Address of BIOS area (If TOM2 != 0, Addr >> 16) */
37 Name(PBLN, 0x0) /* Length of BIOS area */
39 Name(PCBA, 0xE0000000) /* Base address of PCIe config space */
40 Name(HPBA, 0xFED00000) /* Base address of HPET table */
42 Name(SSFG, 0x0D) /* S1 support: bit 0, S2 Support: bit 1, etc. S0 & S5 assumed */
44 /* Some global data */
45 Name(OSV, Ones) /* Assume nothing */
46 Name(GPIC, 0x1) /* Assume PIC */
52 Scope (\_PR) { /* define processor scope */
54 CPU0, /* name space name */
55 0, /* Unique number for this processor */
56 0x810, /* PBLK system I/O address !hardcoded! */
57 0x06 /* PBLKLEN for boot processor */
59 #include "acpi/cpstate.asl"
62 CPU1, /* name space name */
63 1, /* Unique number for this processor */
64 0x0000, /* PBLK system I/O address !hardcoded! */
65 0x00 /* PBLKLEN for boot processor */
67 #include "acpi/cpstate.asl"
70 CPU2, /* name space name */
71 2, /* Unique number for this processor */
72 0x0000, /* PBLK system I/O address !hardcoded! */
73 0x00 /* PBLKLEN for boot processor */
75 #include "acpi/cpstate.asl"
78 CPU3, /* name space name */
79 3, /* Unique number for this processor */
80 0x0000, /* PBLK system I/O address !hardcoded! */
81 0x00 /* PBLKLEN for boot processor */
83 #include "acpi/cpstate.asl"
87 /* PIC IRQ mapping registers, C00h-C01h. */
88 OperationRegion(PIRQ, SystemIO, 0x00000C00, 0x00000002)
89 Field(PIRQ, ByteAcc, NoLock, Preserve) {
91 PDAT, 0x00000008, /* Offset: 1h */
93 IndexField(PIDX, PDAT, ByteAcc, NoLock, Preserve) {
94 PIRA, 0x00000008, /* Index 0 */
95 PIRB, 0x00000008, /* Index 1 */
96 PIRC, 0x00000008, /* Index 2 */
97 PIRD, 0x00000008, /* Index 3 */
98 PIRE, 0x00000008, /* Index 4 */
99 PIRF, 0x00000008, /* Index 5 */
100 PIRG, 0x00000008, /* Index 6 */
101 PIRH, 0x00000008, /* Index 7 */
126 /* PCI Error control register */
127 OperationRegion(PERC, SystemIO, 0x00000C14, 0x00000001)
128 Field(PERC, ByteAcc, NoLock, Preserve) {
135 /* Client Management index/data registers */
136 OperationRegion(CMT, SystemIO, 0x00000C50, 0x00000002)
137 Field(CMT, ByteAcc, NoLock, Preserve) {
139 /* Client Management Data register */
147 /* GPM Port register */
148 OperationRegion(GPT, SystemIO, 0x00000C52, 0x00000001)
149 Field(GPT, ByteAcc, NoLock, Preserve) {
160 /* Flash ROM program enable register */
161 OperationRegion(FRE, SystemIO, 0x00000C6F, 0x00000001)
162 Field(FRE, ByteAcc, NoLock, Preserve) {
167 /* PM2 index/data registers */
168 OperationRegion(PM2R, SystemIO, 0x00000CD0, 0x00000002)
169 Field(PM2R, ByteAcc, NoLock, Preserve) {
174 /* Power Management I/O registers, TODO:PMIO is quite different in SB900. */
175 OperationRegion(PMRG, SystemIO, 0x00000CD6, 0x00000002)
176 Field(PMRG, ByteAcc, NoLock, Preserve) {
180 IndexField (PMRI, PMRD, ByteAcc, NoLock, Preserve) {
183 Offset(0x37), /* GPMLevelConfig0 */
190 Offset(0x38), /* GPMLevelConfig1 */
201 Offset(0x65), /* UsbPMControl */
204 Offset(0x96), /* GPM98IN */
207 Offset(0x9A), /* EnhanceControl */
220 * First word is PM1_Status, Second word is PM1_Enable
222 OperationRegion(P1E0, SystemIO, P1EB, 0x04)
223 Field(P1E0, ByteAcc, NoLock, Preserve) {
231 OperationRegion (GRAM, SystemMemory, 0x0400, 0x0100)
232 Field (GRAM, ByteAcc, Lock, Preserve)
239 /* PCIe Configuration Space for 16 busses */
240 OperationRegion(PCFG, SystemMemory, PCBA, 0x01000000) /* Each bus consumes 1MB */
241 Field(PCFG, ByteAcc, NoLock, Preserve) {
242 /* Byte offsets are computed using the following technique:
243 * ((bus number + 1) * ((device number * 8) * 4096)) + register offset
244 * The 8 comes from 8 functions per device, and 4096 bytes per function config space
246 Offset(0x00088024), /* Byte offset to SATA register 24h - Bus 0, Device 17, Function 0 */
248 Offset(0x00098042), /* Byte offset to OHCI0 register 42h - Bus 0, Device 19, Function 0 */
259 Offset(0x000A0004), /* Byte offset to SMBUS register 4h - Bus 0, Device 20, Function 0 */
262 Offset(0x000A0008), /* Byte offset to SMBUS register 8h - Bus 0, Device 20, Function 0 */
264 Offset(0x000A0014), /* Byte offset to SMBUS register 14h - Bus 0, Device 20, Function 0 */
266 Offset(0x000A0078), /* Byte offset to SMBUS register 78h - Bus 0, Device 20, Function 0 */
268 P92E, 1, /* Port92 decode enable */
271 OperationRegion(SB5, SystemMemory, STB5, 0x1000)
272 Field(SB5, AnyAcc, NoLock, Preserve){
274 Offset(0x120), /* Port 0 Task file status */
280 Offset(0x128), /* Port 0 Serial ATA status */
284 Offset(0x12C), /* Port 0 Serial ATA control */
286 Offset(0x130), /* Port 0 Serial ATA error */
291 offset(0x1A0), /* Port 1 Task file status */
297 Offset(0x1A8), /* Port 1 Serial ATA status */
301 Offset(0x1AC), /* Port 1 Serial ATA control */
303 Offset(0x1B0), /* Port 1 Serial ATA error */
308 Offset(0x220), /* Port 2 Task file status */
314 Offset(0x228), /* Port 2 Serial ATA status */
318 Offset(0x22C), /* Port 2 Serial ATA control */
320 Offset(0x230), /* Port 2 Serial ATA error */
325 Offset(0x2A0), /* Port 3 Task file status */
331 Offset(0x2A8), /* Port 3 Serial ATA status */
335 Offset(0x2AC), /* Port 3 Serial ATA control */
337 Offset(0x2B0), /* Port 3 Serial ATA error */
344 #include "acpi/routing.asl"
348 /* Debug Port registers, 80h. */
349 OperationRegion(DBBG, SystemIO, 0x00000080, 0x00000001)
350 Field(DBBG, ByteAcc, NoLock, Preserve) {
357 Store(0xAA, \_SB.DBG8)
360 Store(0xAC, \_SB.DBG8)
407 Name(IRQB, ResourceTemplate() {
408 IRQ(Level, ActiveLow, Shared) {
412 Name(IRQP, ResourceTemplate() {
413 IRQ(Level, ActiveLow, Shared) {
414 3, 4, 5, 7, 10, 11, 12, 14, 15
418 Name(_HID, EISAID("PNP0C0F"))
434 CreateWordField(IRQB, 1, IRQN)
435 ShiftLeft(1, PIRA, IRQN)
439 CreateWordField(Arg0, 1, IRQM)
440 FindSetRightBit(IRQM, Local0)
447 Name(_HID, EISAID("PNP0C0F"))
463 CreateWordField(IRQB, 1, IRQN)
464 ShiftLeft(1, PIRB, IRQN)
468 CreateWordField(Arg0, 1, IRQM)
469 FindSetRightBit(IRQM, Local0)
476 Name(_HID, EISAID("PNP0C0F"))
492 CreateWordField(IRQB, 1, IRQN)
493 ShiftLeft(1, PIRC, IRQN)
497 CreateWordField(Arg0, 1, IRQM)
498 FindSetRightBit(IRQM, Local0)
505 Name(_HID, EISAID("PNP0C0F"))
521 CreateWordField(IRQB, 1, IRQN)
522 ShiftLeft(1, PIRD, IRQN)
526 CreateWordField(Arg0, 1, IRQM)
527 FindSetRightBit(IRQM, Local0)
534 Name(_HID, EISAID("PNP0C0F"))
550 CreateWordField(IRQB, 1, IRQN)
551 ShiftLeft(1, PIRE, IRQN)
555 CreateWordField(Arg0, 1, IRQM)
556 FindSetRightBit(IRQM, Local0)
563 Name(_HID, EISAID("PNP0C0F"))
579 CreateWordField(IRQB, 1, IRQN)
580 ShiftLeft(1, PIRF, IRQN)
584 CreateWordField(Arg0, 1, IRQM)
585 FindSetRightBit(IRQM, Local0)
592 Name(_HID, EISAID("PNP0C0F"))
608 CreateWordField(IRQB, 1, IRQN)
609 ShiftLeft(1, PIRG, IRQN)
613 CreateWordField(Arg0, 1, IRQM)
614 FindSetRightBit(IRQM, Local0)
621 Name(_HID, EISAID("PNP0C0F"))
637 CreateWordField(IRQB, 1, IRQN)
638 ShiftLeft(1, PIRH, IRQN)
642 CreateWordField(Arg0, 1, IRQM)
643 FindSetRightBit(IRQM, Local0)
648 } /* End Scope(_SB) */
651 /* Supported sleep states: */
652 Name(\_S0, Package () {0x00, 0x00, 0x00, 0x00} ) /* (S0) - working state */
654 If (LAnd(SSFG, 0x01)) {
655 Name(\_S1, Package () {0x01, 0x01, 0x00, 0x00} ) /* (S1) - sleeping w/CPU context */
657 If (LAnd(SSFG, 0x02)) {
658 Name(\_S2, Package () {0x02, 0x02, 0x00, 0x00} ) /* (S2) - "light" Suspend to RAM */
660 If (LAnd(SSFG, 0x04)) {
661 Name(\_S3, Package () {0x03, 0x03, 0x00, 0x00} ) /* (S3) - Suspend to RAM */
663 If (LAnd(SSFG, 0x08)) {
664 Name(\_S4, Package () {0x04, 0x04, 0x00, 0x00} ) /* (S4) - Suspend to Disk */
667 Name(\_S5, Package () {0x05, 0x05, 0x00, 0x00} ) /* (S5) - Soft Off */
669 Name(\_SB.CSPS ,0) /* Current Sleep State (S0, S1, S2, S3, S4, S5) */
670 Name(CSMS, 0) /* Current System State */
672 /* Wake status package */
673 Name(WKST,Package(){Zero, Zero})
676 * \_PTS - Prepare to Sleep method
679 * Arg0=The value of the sleeping state S1=1, S2=2, etc
684 * The _PTS control method is executed at the beginning of the sleep process
685 * for S1-S5. The sleeping value is passed to the _PTS control method. This
686 * control method may be executed a relatively long time before entering the
687 * sleep state and the OS may abort the operation without notification to
688 * the ACPI driver. This method cannot modify the configuration or power
689 * state of any device in the system.
692 /* DBGO("\\_PTS\n") */
693 /* DBGO("From S0 to S") */
697 /* Don't allow PCIRST# to reset USB */
702 /* Clear sleep SMI status flag and enable sleep SMI trap. */
706 /* On older chips, clear PciExpWakeDisEn */
707 /*if (LLessEqual(\_SB.SBRI, 0x13)) {
712 /* Clear wake status structure. */
713 Store(0, Index(WKST,0))
714 Store(0, Index(WKST,1))
715 } /* End Method(\_PTS) */
718 * The following method results in a "not a valid reserved NameSeg"
719 * warning so I have commented it out for the duration. It isn't
720 * used, so it could be removed.
723 * \_GTS OEM Going To Sleep method
726 * Arg0=The value of the sleeping state S1=1, S2=2
733 * DBGO("From S0 to S")
740 * \_BFS OEM Back From Sleep method
743 * Arg0=The value of the sleeping state S1=1, S2=2
749 /* DBGO("\\_BFS\n") */
752 /* DBGO(" to S0\n") */
756 * \_WAK System Wake method
759 * Arg0=The value of the sleeping state S1=1, S2=2
762 * Return package of 2 DWords
764 * 0x00000000 wake succeeded
765 * 0x00000001 Wake was signaled but failed due to lack of power
766 * 0x00000002 Wake was signaled but failed due to thermal condition
767 * Dword 2 - Power Supply state
768 * if non-zero the effective S-state the power supply entered
771 /* DBGO("\\_WAK\n") */
774 /* DBGO(" to S0\n") */
779 /* Restore PCIRST# so it resets USB */
784 /* Arbitrarily clear PciExpWakeStatus */
787 /* if(DeRefOf(Index(WKST,0))) {
788 * Store(0, Index(WKST,1))
790 * Store(Arg0, Index(WKST,1))
794 } /* End Method(\_WAK) */
796 Scope(\_GPE) { /* Start Scope GPE */
797 } /* End Scope GPE */
800 Scope(\_SB) { /* Start \_SB scope */
801 #include "../../../arch/x86/acpi/globutil.asl" /* global utility methods expected within the \_SB scope */
804 /* Note: Only need HID on Primary Bus */
808 Name(_HID, EISAID("PNP0A03"))
809 Name(_ADR, 0x00180000) /* Dev# = BSP Dev#, Func# = 0 */
810 Method(_BBN, 0) { /* Bus number = 0 */
814 /* DBGO("\\_SB\\PCI0\\_STA\n") */
815 Return(0x0B) /* Status is visible */
818 If(GPIC){ Return(APR0) } /* APIC mode */
819 Return (PR0) /* PIC Mode */
822 /* Describe the Northbridge devices */
824 Name(_ADR, 0x00000000)
827 /* The internal GFX bridge */
829 Name(_ADR, 0x00010000)
835 /* The external GFX bridge */
837 Name(_ADR, 0x00020000)
839 If(GPIC){ Return(APS2) } /* APIC mode */
840 Return (PS2) /* PIC Mode */
844 /* The external GFX bridge */
846 Name(_ADR, 0x00030000)
848 If(GPIC){ Return(APS3) } /* APIC mode */
849 Return (PS3) /* PIC Mode */
854 Name(_ADR, 0x00040000)
856 If(GPIC){ Return(APS4) } /* APIC mode */
857 Return (PS4) /* PIC Mode */
862 Name(_ADR, 0x00050000)
864 If(GPIC){ Return(APS5) } /* APIC mode */
865 Return (PS5) /* PIC Mode */
870 Name(_ADR, 0x00060000)
872 If(GPIC){ Return(APS6) } /* APIC mode */
873 Return (PS6) /* PIC Mode */
877 /* The onboard EtherNet chip */
879 Name(_ADR, 0x00070000)
881 If(GPIC){ Return(APS7) } /* APIC mode */
882 Return (PS7) /* PIC Mode */
887 Name(_ADR, 0x00150000)
889 If(GPIC){ Return(APE0) } /* APIC mode */
890 Return (PE0) /* PIC Mode */
894 Name(_ADR, 0x00150001)
896 If(GPIC){ Return(APE1) } /* APIC mode */
897 Return (PE1) /* PIC Mode */
901 Name(_ADR, 0x00150002)
903 If(GPIC){ Return(APE2) } /* APIC mode */
904 Return (APE2) /* PIC Mode */
908 Name(_ADR, 0x00150003)
910 If(GPIC){ Return(APE3) } /* APIC mode */
911 Return (PE3) /* PIC Mode */
915 /* Describe the Southbridge devices */
917 Name(_ADR, 0x00140002)
918 OperationRegion(AZPD, PCI_Config, 0x00, 0x100)
919 Field(AZPD, AnyAcc, NoLock, Preserve) {
928 Name(_ADR, 0x00140006)
932 Name(_ADR, 0x00120000)
933 #include "acpi/usb.asl"
937 Name(_ADR, 0x00130000)
938 #include "acpi/usb.asl"
942 Name(_ADR, 0x00160000)
943 #include "acpi/usb.asl"
947 Name(_ADR, 0x00140005)
948 #include "acpi/usb.asl"
952 Name(_ADR, 0x00120002)
953 #include "acpi/usb.asl"
957 Name(_ADR, 0x00130002)
958 #include "acpi/usb.asl"
962 Name(_ADR, 0x00160002)
963 #include "acpi/usb.asl"
967 Name(_ADR, 0x00100000)
968 #include "acpi/usb.asl"
972 Name(_ADR, 0x00100001)
973 #include "acpi/usb.asl"
977 Name(_ADR, 0x00140000)
981 Name(_ADR, 0x00140003)
982 /* Real Time Clock Device */
984 Name(_HID, EISAID("PNP0B00")) /* AT Real Time Clock (not PIIX4 compatible) */
985 Name(_CRS, ResourceTemplate() {
987 IO(Decode16,0x0070, 0x0070, 0, 2)
988 /* IO(Decode16,0x0070, 0x0070, 0, 4) */
990 } /* End Device(_SB.PCI0.LpcIsaBr.RTC0) */
992 Device(TMR) { /* Timer */
993 Name(_HID,EISAID("PNP0100")) /* System Timer */
994 Name(_CRS, ResourceTemplate() {
996 IO(Decode16, 0x0040, 0x0040, 0, 4)
997 /* IO(Decode16, 0x0048, 0x0048, 0, 4) */
999 } /* End Device(_SB.PCI0.LpcIsaBr.TMR) */
1001 Device(SPKR) { /* Speaker */
1002 Name(_HID,EISAID("PNP0800")) /* AT style speaker */
1003 Name(_CRS, ResourceTemplate() {
1004 IO(Decode16, 0x0061, 0x0061, 0, 1)
1006 } /* End Device(_SB.PCI0.LpcIsaBr.SPKR) */
1009 Name(_HID,EISAID("PNP0000")) /* AT Interrupt Controller */
1010 Name(_CRS, ResourceTemplate() {
1012 IO(Decode16,0x0020, 0x0020, 0, 2)
1013 IO(Decode16,0x00A0, 0x00A0, 0, 2)
1014 /* IO(Decode16, 0x00D0, 0x00D0, 0x10, 0x02) */
1015 /* IO(Decode16, 0x04D0, 0x04D0, 0x10, 0x02) */
1017 } /* End Device(_SB.PCI0.LpcIsaBr.PIC) */
1019 Device(MAD) { /* 8257 DMA */
1020 Name(_HID,EISAID("PNP0200")) /* Hardware Device ID */
1021 Name(_CRS, ResourceTemplate() {
1022 DMA(Compatibility,BusMaster,Transfer8){4}
1023 IO(Decode16, 0x0000, 0x0000, 0x10, 0x10)
1024 IO(Decode16, 0x0081, 0x0081, 0x01, 0x03)
1025 IO(Decode16, 0x0087, 0x0087, 0x01, 0x01)
1026 IO(Decode16, 0x0089, 0x0089, 0x01, 0x03)
1027 IO(Decode16, 0x008F, 0x008F, 0x01, 0x01)
1028 IO(Decode16, 0x00C0, 0x00C0, 0x10, 0x20)
1029 }) /* End Name(_SB.PCI0.LpcIsaBr.MAD._CRS) */
1030 } /* End Device(_SB.PCI0.LpcIsaBr.MAD) */
1033 Name(_HID,EISAID("PNP0C04")) /* Math Coprocessor */
1034 Name(_CRS, ResourceTemplate() {
1035 IO(Decode16, 0x00F0, 0x00F0, 0, 0x10)
1038 } /* End Device(_SB.PCI0.LpcIsaBr.COPR) */
1041 Name(_HID,EISAID("PNP0103"))
1042 Name(CRS,ResourceTemplate() {
1043 Memory32Fixed(ReadOnly,0xFED00000, 0x00000400, HPT) /* 1kb reserved space */
1046 Return(0x0F) /* sata is visible */
1049 CreateDwordField(CRS, ^HPT._BAS, HPBA)
1053 } /* End Device(_SB.PCI0.LpcIsaBr.COPR) */
1056 Name (_HID, EisaId ("PNP0F13"))
1057 Name (_CRS, ResourceTemplate () {
1060 Method (_STA, 0, NotSerialized) {
1061 And (FLG0, 0x04, Local0)
1062 If (LEqual (Local0, 0x04)) {
1071 Name (_HID, EisaId ("PNP0303"))
1072 Name (_CRS, ResourceTemplate () {
1073 IO (Decode16, 0x0060, 0x0060, 0x01, 0x01)
1074 IO (Decode16, 0x0064, 0x0064, 0x01, 0x01)
1081 Name(_ADR, 0x00110000)
1082 #include "acpi/sata.asl"
1085 /* Primary (and only) IDE channel */
1087 Name(_ADR, 0x00140001)
1088 #include "acpi/ide.asl"
1091 Name(CRES, ResourceTemplate() {
1092 IO(Decode16, 0x0CF8, 0x0CF8, 1, 8)
1094 WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
1095 0x0000, /* address granularity */
1096 0x0000, /* range minimum */
1097 0x0CF7, /* range maximum */
1098 0x0000, /* translation */
1102 WORDIO(ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
1103 0x0000, /* address granularity */
1104 0x0D00, /* range minimum */
1105 0xFFFF, /* range maximum */
1106 0x0000, /* translation */
1110 /* memory space for PCI BARs below 4GB */
1111 Memory32Fixed(ReadOnly, 0x00000000, 0x00000000, MMIO)
1112 }) /* End Name(_SB.PCI0.CRES) */
1115 /* DBGO("\\_SB\\PCI0\\_CRS\n") */
1116 CreateDWordField(CRES, ^MMIO._BAS, MM1B)
1117 CreateDWordField(CRES, ^MMIO._LEN, MM1L)
1119 * Declare memory between TOM1 and 4GB as available
1121 * Use ShiftLeft to avoid 64bit constant (for XP).
1122 * This will work even if the OS does 32bit arithmetic, as
1123 * 32bit (0x00000000 - TOM1) will wrap and give the same
1124 * result as 64bit (0x100000000 - TOM1).
1127 ShiftLeft(0x10000000, 4, Local0)
1128 Subtract(Local0, TOM1, Local0)
1131 Return(CRES) /* note to change the Name buffer */
1132 } /* end of Method(_SB.PCI0._CRS) */
1133 } /* End Device(PCI0) */
1135 Device(PWRB) { /* Start Power button device */
1136 Name(_HID, EISAID("PNP0C0C"))
1138 Name(_STA, 0x0B) /* sata is invisible */
1140 } /* End \_SB scope */
1142 /* End of ASL file */