summaryrefslogtreecommitdiff
path: root/Chipset/SB/SATA.ASL
blob: 2a3e31850def5ccb2a6f59f9ad25eacc1b45f09b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
// Set of generic ACPI Control Methods to configure SATA Controller and SATA Drives settings
// File is included under SATA controller PCI device scope
//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2011, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************

//*************************************************************************
// $Header: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Chipset/SB/SATA.ASL 1     6/17/16 4:05a Chienhsieh $
//
// $Revision: 1 $
//
// $Date: 6/17/16 4:05a $
//*************************************************************************
// Revision History
// ----------------
// $Log: /Alaska/Projects/Intel/Haswell/LynxPoint_SharkBay-DT_Crb_1AQQW/Chipset/SB/SATA.ASL $
// 
// 1     6/17/16 4:05a Chienhsieh
// [TAG]  		EIP255383
// [Category]  	Improvement
// [Description]  	when the FORCE_HDD_PASSWORD_PROMPT sdl token enabled ,
// even though use select s4 option, on resume system booted like S5. 
// set HDD password and enter Win8 S4(Hibernate) sleep, behaviour of S4
// resume would be like restart.
// [Files]  		SATA.ASL
// 
// 2     10/23/12 3:19a Scottyang
// [TAG]      EIP84560
// [Category] Bug Fix
// [Symptom]  Can't enter Win8 after Win8 AHCI driver version:11.5.0.1122
// install.
// [Solution] fixed in EIP84560
// [Files]    sb.sdl, sb.mak, sata.asl
// 
// 1     2/08/12 8:25a Yurenlai
// Intel Lynx Point/SB eChipset initially releases.
// 
//*************************************************************************

DefinitionBlock (
    "Sata.aml",
    "SSDT",
    1,
    "SataRef",
    "SataTabl",
    0x1000
        )
{

External(DSSP, IntObj)
External(\_SB.PCI0.SAT0, DeviceObj)

Scope(\)
{
    // SATA Command Set
    //---------------------------------------------------------------//
    //                    Reg1  Reg2  Reg3  Reg4  Reg5  Reg6  Reg7
    //---------------------------------------------------------------//
    Name(STFE, Buffer(){0x10, 0x06, 0x00, 0x00, 0x00, 0x00, 0xEF,})     // Set Features - Enable USE of SATA Feature
    Name(STFD, Buffer(){0x90, 0x06, 0x00, 0x00, 0x00, 0x00, 0xEF,})     // Set Features - Disable USE of SATA Feature
    Name(FZTF, Buffer(){0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF5 })     // Freeze Lock Command
    Name(DCFL, Buffer(){0xC1, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB1 })     // Device Configuration Freeze Lock Command

    Name(SCBF, Buffer(21){})                                    // SATA Command Buffer to be returned

    // The number of SATA command
    Name (CMDC, 0)                                              // SATA Commands counter

    // Build the return buffer for GTF() control method
    Method (GTFB, 2, Serialized)
    //      Arg0 - Command to write
    //      Arg1 - Subcommand value for "Set Feature command"
    {
        Multiply(CMDC, 56, Local0)
        CreateField(SCBF, Local0, 56, CMDx)                     // Command field
        Multiply(CMDC, 7, Local0)
        CreateByteField(SCBF, Add(Local0, 1), A001)             // Subcommand of "Set Feature" command
        Store(Arg0, CMDx)                                       // Store command into return buffer
        Store(Arg1, A001)                                       // Set Subcommand code
        Increment(CMDC)
    }
}

Scope(\_SB.PCI0.SAT0)
{
    Name(REGF, 1)               // PCI Bus access Flag

    Method(_REG, 2)             // is PCI Config space accessible as OpRegion?
                                // _REG to update REGF status
    {
      If(LEqual(Arg0, 0x2))
      {
         Store(Arg1, REGF)
      }
    }
    // Buffer to be returned by _GTM
    Name(TMD0, Buffer(20){})            // 5 DWORD length
    CreateDWordField(TMD0, 00, PIO0)
    CreateDWordField(TMD0, 04, DMA0)
    CreateDWordField(TMD0, 8,  PIO1)    // do not use "08"
    CreateDWordField(TMD0, 12, DMA1)
    CreateDWordField(TMD0, 16, CHNF)

    // Get Timing PIO/DMA Mode
    Method(_GTM,0 ) {    // Return Buffer
                         // PIO 0 Speed DWORD
                         // DMA 0 Speed DWORD
                         // PIO 1 Speed DWORD
                         // DMA 1 Speed DWORD
                         // Flags DWORD

      Store(120,  PIO0)  // Forced to PIO Mode 4
      Store(20,   DMA0)  // Forced to UDMA Mode 5
      Store(120,  PIO1)  // Forced to PIO Mode 4
      Store(20,   DMA1)  // Forced to UDMA Mode 5

      Or(CHNF, 0x05, CHNF)

      Return (TMD0)
    }                    // end Method _GTM
////////////////////////////////////////////////////////////////////////////////
    // Set Timing PIO/DMA Mode
    Method(_STM, 3)      // Arg 0 = Channel Timing Info (Package)
                         // Arg 1 = ATA Command set Master(Buffer)
                         // Arg 2 = ATA Command set Slave (Buffer)
    {}                   // end Method _STM
////////////////////////////////////////////////////////////////////////////////
#if defined(ASL_ZPODD_SATA_PORT) && (ASL_ZPODD_SATA_PORT==0)
#else
    // SATA PORT0 //
    Device(SPT0)
    {
        Name(_ADR,0x0000FFFF)

        // GET TASK FILE METHOD
        Method(_GTF, 0, NotSerialized) {
            Store(0, CMDC)                                      // SATA Commands counter

            If(LEqual(DSSP, 0x1)) {                             // Check DISABLE_SOFT_SET_PREV SDL Token Enabled
                GTFB(STFD, 0x06)                                // Disable SW Preservation Settings
            } else {
                GTFB(STFE, 0x06)                                // Enable SW Preservation Settings
            }

            GTFB(FZTF, 0x00)                                    // Issue Freeze Lock Command
            GTFB(DCFL, 0x00)                                    // Issue Device Configuration Freeze Lock Command
            Return(SCBF)
        }
    }

#endif
    // SATA PORT1 //
#if defined(ASL_ZPODD_SATA_PORT) && (ASL_ZPODD_SATA_PORT==1)
#else
    Device(SPT1)
    {
        Name(_ADR,0x0001FFFF)

        // GET TASK FILE METHOD
        Method(_GTF, 0, NotSerialized) {
            Store(0, CMDC)                                      // SATA Commands counter

           If(LEqual(DSSP, 0x1)) {                              // Check DISABLE_SOFT_SET_PREV SDL Token Enabled
                GTFB(STFD, 0x06)                                // Disable SW Preservation Settings
            } else {
                GTFB(STFE, 0x06)                                // Enable SW Preservation Settings
            }

            GTFB(FZTF, 0x00)                                    // Issue Freeze Lock Command
            GTFB(DCFL, 0x00)                                    // Issue Device Configuration Freeze Lock Command
            Return(SCBF)
        }
    }

#endif
    // SATA PORT2 //
#if defined(ASL_ZPODD_SATA_PORT) && (ASL_ZPODD_SATA_PORT==2)
#else
    Device(SPT2)
    {
        Name(_ADR,0x0002FFFF)

        // GET TASK FILE METHOD
        Method(_GTF, 0, NotSerialized) {
            Store(0, CMDC)                                      // SATA Commands counter

           If(LEqual(DSSP, 0x1)) {                              // Check DISABLE_SOFT_SET_PREV SDL Token Enabled
                GTFB(STFD, 0x06)                                // Disable SW Preservation Settings
            } else {
                GTFB(STFE, 0x06)                                // Enable SW Preservation Settings
            }

            GTFB(FZTF, 0x00)                                    // Issue Freeze Lock Command
            GTFB(DCFL, 0x00)                                    // Issue Device Configuration Freeze Lock Command
            Return(SCBF)
        }
    }

#endif
    // SATA PORT3 //
#if defined(ASL_ZPODD_SATA_PORT) && (ASL_ZPODD_SATA_PORT==3)
#else
    Device(SPT3)
    {
        Name(_ADR,0x0003FFFF)

        // GET TASK FILE METHOD
        Method(_GTF, 0, NotSerialized) {
            Store(0, CMDC)                                      // SATA Commands counter

           If(LEqual(DSSP, 0x1)) {                              // Check DISABLE_SOFT_SET_PREV SDL Token Enabled
                GTFB(STFD, 0x06)                                // Disable SW Preservation Settings
            } else {
                GTFB(STFE, 0x06)                                // Enable SW Preservation Settings
            }

            GTFB(FZTF, 0x00)                                    // Issue Freeze Lock Command
            GTFB(DCFL, 0x00)                                    // Issue Device Configuration Freeze Lock Command
            Return(SCBF)
        }
    }

#endif
    // SATA PORT4 //
#if defined(ASL_ZPODD_SATA_PORT) && (ASL_ZPODD_SATA_PORT==4)
#else
    Device(SPT4)
    {
        Name(_ADR,0x0004FFFF)

        // GET TASK FILE METHOD
        Method(_GTF, 0, NotSerialized) {
            Store(0, CMDC)                                      // SATA Commands counter

           If(LEqual(DSSP, 0x1)) {                              // Check DISABLE_SOFT_SET_PREV SDL Token Enabled
                GTFB(STFD, 0x06)                                // Disable SW Preservation Settings
            } else {
                GTFB(STFE, 0x06)                                // Enable SW Preservation Settings
            }

            GTFB(FZTF, 0x00)                                    // Issue Freeze Lock Command
            GTFB(DCFL, 0x00)                                    // Issue Device Configuration Freeze Lock Command
            Return(SCBF)
        }
    }

#endif
    // SATA PORT5 //
#if defined(ASL_ZPODD_SATA_PORT) && (ASL_ZPODD_SATA_PORT==5)
#else
    Device(SPT5)
    {
        Name(_ADR,0x0005FFFF)

        // GET TASK FILE METHOD
        Method(_GTF, 0, NotSerialized) {
            Store(0, CMDC)                                      // SATA Commands counter

           If(LEqual(DSSP, 0x1)) {                              // Check DISABLE_SOFT_SET_PREV SDL Token Enabled
                GTFB(STFD, 0x06)                                // Disable SW Preservation Settings
            } else {
                GTFB(STFE, 0x06)                                // Enable SW Preservation Settings
            }

            GTFB(FZTF, 0x00)                                    // Issue Freeze Lock Command
            GTFB(DCFL, 0x00)                                    // Issue Device Configuration Freeze Lock Command
            Return(SCBF)
        }
    }
#endif
}
}//end of SSDT


//*************************************************************************
//*************************************************************************
//**                                                                     **
//**        (C)Copyright 1985-2011, American Megatrends, Inc.            **
//**                                                                     **
//**                       All Rights Reserved.                          **
//**                                                                     **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093           **
//**                                                                     **
//**                       Phone: (770)-246-8600                         **
//**                                                                     **
//*************************************************************************
//*************************************************************************