Add acpi_get_sleep_type() to i82371eb and P2B _PTS/_WAK methods
[coreboot.git] / src / mainboard / asus / p2b / dsdt.asl
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2010 Tobias Diedrich <ranma+coreboot@tdiedrich.de>
5  *
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.
9  *
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.
14  *
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
18  */
19
20 #include "southbridge/intel/i82371eb/i82371eb.h"
21
22 DefinitionBlock ("DSDT.aml", "DSDT", 2, "CORE  ", "COREBOOT", 1)
23 {
24         /*
25          * Intel 82371EB (PIIX4E) datasheet, section 7.2.3, page 142
26          *
27          * 0: soft off/suspend to disk                                  S5
28          * 1: suspend to ram                                            S3
29          * 2: powered on suspend, context lost                          S2
30          *    Note: 'context lost' means the CPU restarts at the reset
31          *          vector
32          * 3: powered on suspend, CPU context lost                      S1
33          *    Note: Looks like 'CPU context lost' does _not_ mean the
34          *          CPU restarts at the reset vector. Most likely only
35          *          caches are lost, so both 0x3 and 0x4 map to acpi S1
36          * 4: powered on suspend, context maintained                    S1
37          * 5: working (clock control)                                   S0
38          * 6: reserved
39          * 7: reserved
40          */
41         Name (\_S0, Package () { 0x05, 0x05, 0x00, 0x00 })
42         Name (\_S1, Package () { 0x03, 0x03, 0x00, 0x00 })
43         Name (\_S5, Package () { 0x00, 0x00, 0x00, 0x00 })
44
45         OperationRegion (SIO1, SystemIO, Add(DEFAULT_PMBASE, GPO0), 2)
46         Field (SIO1, ByteAcc, NoLock, Preserve)
47         {
48                 FANP,   1, /* CPU/case fan power */
49                 Offset (0x01),
50                 PLED,   1,
51         }
52
53         Method (\_PTS, 1, NotSerialized)
54         {
55                 /* Disable fan, blink power led */
56                 Store (Zero, FANP)
57                 Store (Zero, PLED)
58         }
59
60         Method (\_WAK, 1, NotSerialized)
61         {
62                 /* Re-enable fan, stop power led blinking */
63                 Store (One, FANP)
64                 Store (One, PLED)
65                 /* wake OK */
66                 Return(Package(0x02){0x00, 0x00})
67         }
68
69         /* Root of the bus hierarchy */
70         Scope (\_SB)
71         {
72                 /* Top PCI device */
73                 Device (PCI0)
74                 {
75                         Name (_HID, EisaId ("PNP0A03"))
76                         Name (_ADR, 0x00)
77                         Name (_UID, 0x00)
78                         Name (_BBN, 0x00)
79
80                         /* PCI Routing Table */
81                         Name (_PRT, Package () {
82                                 Package (0x04) { 0x0001FFFF, 0, LNKA, 0 },
83                                 Package (0x04) { 0x0001FFFF, 1, LNKB, 0 },
84                                 Package (0x04) { 0x0001FFFF, 2, LNKC, 0 },
85                                 Package (0x04) { 0x0001FFFF, 3, LNKD, 0 },
86
87                                 Package (0x04) { 0x0004FFFF, 0, LNKA, 0 },
88                                 Package (0x04) { 0x0004FFFF, 1, LNKB, 0 },
89                                 Package (0x04) { 0x0004FFFF, 2, LNKC, 0 },
90                                 Package (0x04) { 0x0004FFFF, 3, LNKD, 0 },
91
92                                 Package (0x04) { 0x0009FFFF, 0, LNKD, 0 },
93                                 Package (0x04) { 0x0009FFFF, 1, LNKA, 0 },
94                                 Package (0x04) { 0x0009FFFF, 2, LNKB, 0 },
95                                 Package (0x04) { 0x0009FFFF, 3, LNKC, 0 },
96
97                                 Package (0x04) { 0x000AFFFF, 0, LNKC, 0 },
98                                 Package (0x04) { 0x000AFFFF, 1, LNKD, 0 },
99                                 Package (0x04) { 0x000AFFFF, 2, LNKA, 0 },
100                                 Package (0x04) { 0x000AFFFF, 3, LNKB, 0 },
101
102                                 Package (0x04) { 0x000BFFFF, 0, LNKB, 0 },
103                                 Package (0x04) { 0x000BFFFF, 1, LNKC, 0 },
104                                 Package (0x04) { 0x000BFFFF, 2, LNKD, 0 },
105                                 Package (0x04) { 0x000BFFFF, 3, LNKA, 0 },
106
107                                 Package (0x04) { 0x000CFFFF, 0, LNKA, 0 },
108                                 Package (0x04) { 0x000CFFFF, 1, LNKB, 0 },
109                                 Package (0x04) { 0x000CFFFF, 2, LNKC, 0 },
110                                 Package (0x04) { 0x000CFFFF, 3, LNKD, 0 },
111
112                         })
113
114 #include "northbridge/intel/i440bx/acpi/sb_pci0_crs.asl"
115 #include "southbridge/intel/i82371eb/acpi/isabridge.asl"
116                 }
117 #include "southbridge/intel/i82371eb/acpi/pirq.asl"
118         }
119 }