blob: 6755258f4dce2213be652542d9c0b31cbed6ab4c [file] [log] [blame]
Kyösti Mälkki595ef3d2015-05-27 12:44:16 +03001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2012-2013 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.
Kyösti Mälkki595ef3d2015-05-27 12:44:16 +030014 */
15
16/* No SATA functionality */
17
18#if 0
19/*
20Scope (_SB) {
21 Device(PCI0) {
22 Device(SATA) {
23 Name(_ADR, 0x00110000)
24 #include "sata.asl"
25 }
26 }
27}
28*/
29
30Name(STTM, Buffer(20) {
31 0x78, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
32 0x78, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
33 0x1f, 0x00, 0x00, 0x00
34})
35
36/* Start by clearing the PhyRdyChg bits */
37Method(_INI) {
38 \_GPE._L1F()
39}
40
41Device(PMRY)
42{
43 Name(_ADR, 0)
44 Method(_GTM, 0x0, NotSerialized) {
45 Return(STTM)
46 }
47 Method(_STM, 0x3, NotSerialized) {}
48
49 Device(PMST) {
50 Name(_ADR, 0)
51 Method(_STA,0) {
52 if (LGreater(P0IS,0)) {
53 return (0x0F) /* sata is visible */
54 }
55 else {
56 return (0x00) /* sata is missing */
57 }
58 }
59 }/* end of PMST */
60
61 Device(PSLA)
62 {
63 Name(_ADR, 1)
64 Method(_STA,0) {
65 if (LGreater(P1IS,0)) {
66 return (0x0F) /* sata is visible */
67 }
68 else {
69 return (0x00) /* sata is missing */
70 }
71 }
72 } /* end of PSLA */
73} /* end of PMRY */
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}
146#endif