mainboard: init m5a99x-evo from m5a88-v
[coreboot.git] / src / mainboard / asus / m5a99x-evo / acpi / sata.asl
1 /*
2  * This file is part of the coreboot project.
3  *
4  * Copyright (C) 2011 Advanced Micro Devices, Inc.
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 /* simple name description */
21
22 /*
23 Scope (_SB) {
24         Device(PCI0) {
25                 Device(SATA) {
26                         Name(_ADR, 0x00110000)
27                         #include "sata.asl"
28                 }
29         }
30 }
31 */
32
33 Name(STTM, Buffer(20) {
34         0x78, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
35         0x78, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
36         0x1f, 0x00, 0x00, 0x00
37 })
38
39 /* Start by clearing the PhyRdyChg bits */
40 Method(_INI) {
41         \_GPE._L1F()
42 }
43
44 Device(PMRY)
45 {
46         Name(_ADR, 0)
47         Method(_GTM, 0x0, NotSerialized) {
48                 Return(STTM)
49         }
50         Method(_STM, 0x3, NotSerialized) {}
51
52         Device(PMST) {
53                 Name(_ADR, 0)
54                 Method(_STA,0) {
55                         if (LGreater(P0IS,0)) {
56                                 return (0x0F) /* sata is visible */
57                         }
58                         else {
59                                 return  (0x00) /* sata is missing */
60                         }
61                 }
62         }/* end of PMST */
63
64         Device(PSLA)
65         {
66                 Name(_ADR, 1)
67                 Method(_STA,0) {
68                         if (LGreater(P1IS,0)) {
69                                 return (0x0F) /* sata is visible */
70                         }
71                         else {
72                                 return (0x00) /* sata is missing */
73                         }
74                 }
75         }       /* end of PSLA */
76 }   /* end of PMRY */
77
78
79 Device(SEDY)
80 {
81         Name(_ADR, 1)           /* IDE Scondary Channel */
82         Method(_GTM, 0x0, NotSerialized) {
83                 Return(STTM)
84         }
85         Method(_STM, 0x3, NotSerialized) {}
86
87         Device(SMST)
88         {
89                 Name(_ADR, 0)
90                 Method(_STA,0) {
91                         if (LGreater(P2IS,0)) {
92                                 return (0x0F) /* sata is visible */
93                         }
94                         else {
95                                 return (0x00) /* sata is missing */
96                         }
97                 }
98         } /* end of SMST */
99
100         Device(SSLA)
101         {
102                 Name(_ADR, 1)
103                 Method(_STA,0) {
104                         if (LGreater(P3IS,0)) {
105                                 return (0x0F) /* sata is visible */
106                         }
107                         else {
108                                 return (0x00) /* sata is missing */
109                         }
110                 }
111         } /* end of SSLA */
112 }   /* end of SEDY */
113
114 /* SATA Hot Plug Support */
115 Scope(\_GPE) {
116         Method(_L1F,0x0,NotSerialized) {
117                 if (\_SB.P0PR) {
118                         if (LGreater(\_SB.P0IS,0)) {
119                                 sleep(32)
120                         }
121                         Notify(\_SB.PCI0.STCR.PMRY.PMST, 0x01) /* NOTIFY_DEVICE_CHECK */
122                         store(one, \_SB.P0PR)
123                 }
124
125                 if (\_SB.P1PR) {
126                         if (LGreater(\_SB.P1IS,0)) {
127                                 sleep(32)
128                         }
129                         Notify(\_SB.PCI0.STCR.PMRY.PSLA, 0x01) /* NOTIFY_DEVICE_CHECK */
130                         store(one, \_SB.P1PR)
131                 }
132
133                 if (\_SB.P2PR) {
134                         if (LGreater(\_SB.P2IS,0)) {
135                                 sleep(32)
136                         }
137                         Notify(\_SB.PCI0.STCR.SEDY.SMST, 0x01) /* NOTIFY_DEVICE_CHECK */
138                         store(one, \_SB.P2PR)
139                 }
140
141                 if (\_SB.P3PR) {
142                         if (LGreater(\_SB.P3IS,0)) {
143                                 sleep(32)
144                         }
145                         Notify(\_SB.PCI0.STCR.SEDY.SSLA, 0x01) /* NOTIFY_DEVICE_CHECK */
146                         store(one, \_SB.P3PR)
147                 }
148         }
149 }