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