summaryrefslogtreecommitdiff
path: root/Board/EM/Isct/AcpiTables/Isct.asl
blob: a98416b1319241e3f80f765c596c8dfd49df9585 (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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2012, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093        **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************

//**********************************************************************
// $Header: /Alaska/SOURCE/Modules/SharkBayRefCodes/ISCT/IsctAcpiTables/Isct.asl 7     7/11/14 9:52a Mirayang $
//
// $Revision: 7 $
//
// $Date: 7/11/14 9:52a $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/SharkBayRefCodes/ISCT/IsctAcpiTables/Isct.asl $
// 
// 7     7/11/14 9:52a Mirayang
// Remove override.
// 
// 6     7/08/14 5:09a Mirayang
// EIP142924 iSCT 5.0 for Shark Bay Platform
// 
// 5     5/14/13 6:29a Bensonlai
// [TAG]  		EIP123328
// [Category]  	Spec Update
// [Severity]  	Normal
// [Description]  	[SBY] Intel Smart Connect Technology 4.x BIOS Reference
// Code
// 
// 4     3/27/13 9:13a Bensonlai
// [TAG]  		EIP118307
// [Category]  	New Feature
// [Description]  	Implementation of the ISCT Platform Design
// Specification 0.8.
// [Files]  		Isct.asl, IsctAcpi.c, IsctAcpi.mak
// 
// 3     1/14/13 12:03a Bensonlai
// [TAG]  		EIP112064
// [Category]  	Bug Fix
// [Severity]  	Normal
// [Symptom]  	[ISCT] GWLS,SWLS,GWWS and SWWS are fail while set wake up
// timer to RTC
// [Solution]  	Implement the GWLS,SWLS,GWWS and SWWS while set wake up
// timer to RTC
// [Files]  		Isct.asl
// 
// 2     1/13/13 5:14a Bensonlai
// [TAG]  		EIP112064
// [Category]  	Bug Fix
// [Severity]  	Normal
// [Symptom]  	[ISCT] GWLS,SWLS,GWWS and SWWS are fail while set wake up
// timer to RTC
// [Solution]  	Implement the GWLS,SWLS,GWWS and SWWS while set wake up
// timer to RTC
// [Files]  		Isct.asl
// 
// 1     9/02/12 11:18p Bensonlai
// Intel Smart Connect Technology initially releases.
//
//
//**********************************************************************
//<AMI_FHDR_START>
//
// Name:  Isct.asl
//
// Description:	This file provides the ACPI methods for the iSCT agent to use.
//
//<AMI_FHDR_END>
//**********************************************************************

DefinitionBlock (
  "IsctAcpi.aml",
  "SSDT",
  1,
  "Intel_",
  "IsctTabl",
  0x1000
  )

{
  External(ICNF) //Isct Configuration
  External(\_SB.PCI0.LPCB.H_EC.IBT1)            // Isct Byte1 for EC
  External(\_SB.PCI0.LPCB.H_EC.IBT2)            // Isct Byte2 for EC
  External(\_SB.PCI0.LPCB.H_EC.ECMD, MethodObj) // EC Command method
  External(\_SB.PCI0.LPCB.H_EC.WTMS)            // EC Wake Timer Settings
  External(\_SB.PCI0.LPCB.H_EC.AWT0)            // EC Wake Timer Value (BIT7-0)
  External(\_SB.PCI0.LPCB.H_EC.AWT1)            // EC Wake Timer Value (BIT15-8)
  External(\_SB.PCI0.LPCB.H_EC.AWT2)            // EC Wake Timer Value (BIT23-16)
  External(\_SB.PCI0.LPCB.H_EC.LSTE)            // Lid State (Lid Open = 1)
  External(\_SB.IFFS.FFSS)

  External(\_SB.PCI0.GFX0.TCHE)                 // Technology enabled indicator
  External(\_SB.PCI0.GFX0.STAT)                 // State Indicator
  External(\_SB.PCI0.GFX0.ASLE)                 // Reg 0xE4, ASLE interrupt register
  External(\_SB.PCI0.GFX0.ASLC)                 // ASLE interrupt command/status
  External(\_SB.PCI0.GFX0.PARD, MethodObj)      // Check if the driver is ready to handle ASLE interrupts
  External(\ADBG, MethodObj)                    // Print message to ACPI Debug Buffer
  
  Scope (\_SB)
  {
    Device (IAOE)
    {
      OperationRegion(ISCT,SystemMemory,0xFFFF0008,0xAA58)
      Field(ISCT,AnyAcc,Lock,Preserve)
      {
        WKRS,  8,      // (0) ISCT Wake Reason
        AOCE,  8,      // (1) ISCT is Enabled
        FFSE,  8,      // (2) IFFS Enabled
        ITMR,  8,      // (3) ISCT Timer Type: 0 = EC, 1 = RTC
        ECTM,  32,     // (4) ISCT EC Timer
        RCTM,  32,     // (8) ISCT RTC Timer
        GNPT,  32,     // (12)ISCT GlobalNvs Ptr
        ATOW,  8,      // (16)ISCT timer over write, 1 = overwrited as ISCT timer
      }
      Name (_HID, "INT33A0")
      Name (_CID, "PNP0C02")
      Name (_UID, 0x00)

      Name (IBT1, 0)   // Isct Byte1 for EC (local)
      Name (IBT2, 0)   // Isct Byte2 for EC (local)
      Name (INSB, 0)   // Isct Notification Status Bit
      Name (WTMS, 0)   // EC Wake Timer Settings (local)
      Name (AWT0, 0)   // EC Wake Timer Value (BIT7-0) (local)
      Name (AWT1, 0)   // EC Wake Timer Value (BIT15-8) (local)
      Name (AWT2, 0)   // EC Wake Timer Value (BIT23-16) (local)
      Name (PTSL, 0)   // Platform Sleep Level
      Name (SLPD, 0)   // Sleep duration for when using NetDetect (dummy)
      Name (IMDS, 0)   // Isct Mode Select Bits
                       // Bits:    Description
                       //  0        Reserved
                       //  1        ISCT Wake Mode Select: 0 = Normal ISCT Wake Mode, 1 = Extended ISCT Wake Mode
                       //  2        Wake From S4: 0 = No Wake from S4, 1 = Wake from S4
                       //  3-7      Reserved
      Name (IWDT, 0)   // Isct Wake Duration Time
 
      /**
        GABS - Get ISCT BIOS Enablign Setting
        Input:   None
        Return:   
        Bits   Description       
        - 0      ISCT Configured: 0 = Disabled, 1 = Enabled 
        - 1      ISCT Notification Control: 0 = Unsupported, 1 = Supported 
        - 2      ISCT WLAN Power Control : 0 = Unsupported, 1 = Supported 
        - 3      ISCT WWAN Power Control : 0 = Unsupported, 1 = Supported 
        - 4      Must be set to 1 (BIOS Program Timer)
        - 5      Sleep duration value format: 0 = Actual time, 1 = Duration in Seconds
        - 6      RF Kill Switch Type: 0 = Software, 1 = Hardware
        - 7      Wake from S4: 0 = Unsupported, 1 = Supported 
      **/
      Method (GABS, 0, NotSerialized) {
        Return (ICNF)
      }

      //
      // GAOS - Get ISCT Function Status
      // Input:   None
      // Return:
      // Bits   Description
      // 0      ISCT Mode: 0 = Disabled, 1 = Enabled
      // 1      ISCT Wake Mode Select: 0 = ISCT Wake Mode, 1 = Extended ISCT Wake
      // 2 - 7  Reserved
      //
      Method (GAOS, 0, NotSerialized)
      {
        //
        // Check for RTC Timer, else EC timer
        //
        If (LEqual(ITMR, 1))
        {
        // Get Isct Mode Enable and Get Isct Wake Mode Select
        //
        Return(Or(And(IBT1, 0x01), And(IMDS, 0x06)))
        }
        Else
        {
          //
          //Get Isct Mode Enable
          //
          If (CondRefOf(\_SB.PCI0.LPCB.H_EC.IBT1))
          {
            Store(\_SB.PCI0.LPCB.H_EC.IBT1, Local0)
          }
          Else
          {	
            Store(IBT1, Local0)
          }
          And(Local0, 0x01, Local0)
          //
          // Get Isct Wake Mode Select
          //
          Or(Local0, And(IMDS, 0x02), Local0)
          Return (Local0)
        }
      }
    
      /**
        SAOS - Set ISCT Function Status
        Input:   
        Bits   Description 
        - 0      ISCT Mode: 0 = Disabled, 1 = Enabled 
        - 1      ISCT Wake Mode Select: 0 = Normal ISCT Wake Mode, 1 = Extended ISCT Wake Mode
        - 2      Wake From S4: 0 = No Wake from S4, 1 = Wake from S4
        - 3 - 7  Reserved 
      **/
      Method (SAOS, 1, NotSerialized)
      {
        //
        // If Graphics Driver supports disable display notification in ISCT mode
        //
        If (And(\_SB.PCI0.GFX0.TCHE, 0x100))
        {
          //
          // Check for RTC Timer, else EC timer
          //
          If (LEqual(ITMR, 1))
          {
            //
          // If iSCT Mode and agent is disabling iSCT Mode and the iSCT Wake Reason indicates display off
            // Then notify graphics driver to turn on display
            //
          If (LAnd(LAnd(And(IBT1, 0x01), LNot(And(Arg0, 0x01))), And(\_SB.IAOE.WKRS, 0x10))) {
              If (LNot(\_SB.PCI0.GFX0.PARD()))
              {
                Store(And(\_SB.PCI0.GFX0.STAT, Not(0x03)), \_SB.PCI0.GFX0.STAT)          // STAT[1:0] = 00, Normal Resume to S0

                Store(Or(\_SB.PCI0.GFX0.ASLC, 0x100), \_SB.PCI0.GFX0.ASLC)               // ASLC[8] = 1, ISCT State Change Request

                Store(0x01, \_SB.PCI0.GFX0.ASLE)                                         // Generate ASLE interrupt
              }
            }
          } else {
            If(CondRefOf(\_SB.PCI0.LPCB.H_EC.IBT1)) {
              //
              // If ISCT Mode and Wake Reason was ISCT wake (EC Timer or Network PME) and agent is disabling ISCT Mode
              // Then notify graphics driver to turn on display
              //
              If (LAnd(LAnd(And(\_SB.PCI0.LPCB.H_EC.IBT1, 0x01), LOr(And(\_SB.IAOE.WKRS, 0x02), And(\_SB.IAOE.WKRS, 0x10))), LNot(And(Arg0, 0x01)))) {
                If (LNot(\_SB.PCI0.GFX0.PARD()))
                {
                  Store(And(\_SB.PCI0.GFX0.STAT, Not(0x03)), \_SB.PCI0.GFX0.STAT)          // STAT[1:0] = 00, Normal Resume to S0

                  Store(Or(\_SB.PCI0.GFX0.ASLC, 0x100), \_SB.PCI0.GFX0.ASLC)               // ASLC[8] = 1, ISCT State Change Request

                  Store(0x01, \_SB.PCI0.GFX0.ASLE)                                         // Generate ASLE interrupt
                }
              }
            }
          }
        }

        //
        // Check for RTC Timer, else EC timer
        //
        If (LEqual(ITMR, 1))
        {
          //
        // Set Isct Wake Mode Selection and Wake from S4
        //
        Store(And(Arg0, 0x06), IMDS)
          /// @note: Low Power Fan control for Extended Wake
        //
        // Set Isct Mode Enable
        //
        Or(And(IBT1, 0xFE), And(Arg0, 0x01), IBT1)
        }
        Else
        {
          //
          //Set Isct Mode Enable
          //
          If (CondRefOf(\_SB.PCI0.LPCB.H_EC.IBT1))
          {
            Store(\_SB.PCI0.LPCB.H_EC.IBT1, Local0)
          }
          Else
          {	
            Store(IBT1, Local0)
          }
          And(Local0, 0xFE, Local0)
          Or(Local0, And(Arg0, 0x01), Local0)
          //
          // Set Isct Wake Mode Select
          //
          Store(And(Arg0, 0x02), IMDS)
            //TBD: Low Power Fan control
          If (CondRefOf(\_SB.PCI0.LPCB.H_EC.IBT1))
          {
            Store(Local0, \_SB.PCI0.LPCB.H_EC.IBT1)
            //Send EC IsctUpdateCommand - 0x2B
            \_SB.PCI0.LPCB.H_EC.ECMD (0x2B)
          }
          Else
          {	
            Store(Local0, IBT1)
          }
        }
      }

      //
      // GANS - Get ISCT Notification Status
      // Input:   None
      // Return:
      // Bits   Description
      // 0      ISCT Notification : 0 = Disabled, 1 = Enabled
      // 1 - 7  Reserved
      //
      Method (GANS, 0, NotSerialized)
      {
        Return (INSB)
      }

      //
      // SANS - Set ISCT Notification Status
      // Input:
      // Bits   Description
      // 0      ISCT Notification : 0 = Disabled, 1 = Enabled
      // 1 - 7  Reserved
      //
      Method (SANS, 1, NotSerialized)
      {
        Store(And(Arg0, 0x01), INSB)
      }

      //
      // GWLS - Get WLAN Module Status
      // Input:   None
      // Return:
      // Bits   Description
      // 0      Reserved(set to 0)
      // 1      WLAN Module Powered in S3: 0 = Disabled, 1 = Enabled
      // 2      WLAN Module Powered in S4: 0 = Disabled, 1 = Enabled
      // 3      WLAN Module Powered in S5: 0 = Disabled, 1 = Enabled
      // 4 - 7  Reserved
      //
      Method (GWLS, 0, NotSerialized)
      {
        If(LEqual(And(ICNF, 0x04), Zero))
        {
          Return (Zero)
        }
        //
        // Check for RTC Timer, else EC timer
        //
        If (LEqual(ITMR, 1))
        {
	  Store(One, Local0)
	  Store(IBT1, Local1)
	  Or(Local0, And(Local1, 0x0E), Local0)
          Return (Local0)
        }
        Else
        {
          //
          // Set WLAN Wireless Disable Bit to 1 if EC
          //
          If (CondRefOf(\_SB.PCI0.LPCB.H_EC.IBT2))
          {
            Store(\_SB.PCI0.LPCB.H_EC.IBT2, Local0)
            Or(Local0, 1, Local0)
          }

          //
          // Get WLAN Powered States
          //
          If (CondRefOf(\_SB.PCI0.LPCB.H_EC.IBT1))
          {
            Store(\_SB.PCI0.LPCB.H_EC.IBT1, Local1)
          }
          Else
          {
            Store(IBT1, Local1)
          }
          Or(Local0, And(Local1, 0x0E), Local0)

          Return (Local0)
        }
      }
      //
      // SWLS - Set WLAN Module Status
      // Input:
      // Bits   Description
      // 0      N/A (WLAN Wireless Disable is Read only)  Always set to 0
      // 1      WLAN Module Powered in S3: 0 = Disabled, 1 = Enabled
      // 2      WLAN Module Powered in S4: 0 = Disabled, 1 = Enabled
      // 3      WLAN Module Powered in S5: 0 = Disabled, 1 = Enabled
      // 4 - 7  Reserved
      //
      Method (SWLS, 1, NotSerialized)
      {
        If(LEqual(And(ICNF, 0x04), Zero))
        {
          Return
        }      
        //
        // Check for RTC Timer, else EC timer
        //
        If (LEqual(ITMR, 1))
        {
          Store(IBT1, Local0)

          //
          // Set new Power States
          //
          And(Local0, 0xF1, Local0)
          Or(Local0, And(Arg0, 0x0E), Local0)
          If(CondRefOf(\_SB.IFFS.FFSS))
          {
            If(LAnd(And(\_SB.IFFS.FFSS, 0x03), And(Arg0,0x02)))
            {
              Or(Local0, 0x04, Local0)
            }
          }
          Store(Local0, IBT1)
        }
        Else
        {
          //
          // Read ISCTByte1 from EC
          //
          If (CondRefOf(\_SB.PCI0.LPCB.H_EC.IBT1))
          {
            Store(\_SB.PCI0.LPCB.H_EC.IBT1, Local0)
          }
          Else
          {
            Store(IBT1, Local0)
          }

          //
          // Set new Power States
          //
          And(Local0, 0xF1, Local0)
          Or(Local0, And(Arg0, 0x0E), Local0)

          //
          // If RapidStart is enabled and WLAN powered in S3, enable power in S4
          //
          If(CondRefOf(\_SB.IFFS.FFSS))
          {
            If(LAnd(And(\_SB.IFFS.FFSS, 0x03), And(Arg0,0x02)))
            {
              Or(Local0, 0x04, Local0)
            }
          }

          //
          // Save ISCTByte1 to EC
          //
          If (CondRefOf(\_SB.PCI0.LPCB.H_EC.IBT1))
          {
            Store(Local0, \_SB.PCI0.LPCB.H_EC.IBT1)
            //Send EC IsctUpdateCommand - 0x2B
            \_SB.PCI0.LPCB.H_EC.ECMD (0x2B)
          }
          Else
          {
            Store(Local0, IBT1)
          }
        }
      }

      //
      // GWWS - Get WWAN Module Status
      // Input:   None
      // Return:
      // Bits   Description
      // 0      WWAN Wireless Disable (W_DISABLE#) :0 = Disabled, 1 = Enabled
      // 1      WWAN Module Powered in S3: 0 = Disabled, 1 = Enabled
      // 2      WWAN Module Powered in S4: 0 = Disabled, 1 = Enabled
      // 3      WWAN Module Powered in S5: 0 = Disabled, 1 = Enabled
      // 4 - 7  Reserved
      //
      Method (GWWS, 0, NotSerialized)
      {
        If(LEqual(And(ICNF, 0x08), Zero))
        {
          Return (Zero)
        }
        //
        // Check for RTC Timer, else EC timer
        //
        If (LEqual(ITMR, 1))
        {
          Store(One, Local0)
	  Store(IBT1, Local1)
	  Or(Local0, ShiftRight(And(Local1, 0x70), 3), Local0)
	  Return (Local0)
        }
        Else
        {
          //
          // Set WWAN Wireless Disable Bit to 1 if EC
          //
          If (CondRefOf(\_SB.PCI0.LPCB.H_EC.IBT2))
          {
            Store(\_SB.PCI0.LPCB.H_EC.IBT2, Local0)
            ShiftRight(Or(Local0, 2), 1, Local0)
          }

          //
          // Get WWAN Powered States
          //
          If (CondRefOf(\_SB.PCI0.LPCB.H_EC.IBT1))
          {
            Store(\_SB.PCI0.LPCB.H_EC.IBT1, Local1)
          }
          Else
          {
            Store(IBT1, Local1)
          }
          Or(Local0, ShiftRight(And(Local1, 0x70), 3), Local0)

          Return (Local0)
        }
      }

      //
      // SWWS - Set WWAN Module Status
      // Input:
      // Bits   Description
      // 0      N/A (WWAN Wireless Disable is Read only)  Always set to 0
      // 1      WWAN Module Powered in S3: 0 = Disabled, 1 = Enabled
      // 2      WWAN Module Powered in S4: 0 = Disabled, 1 = Enabled
      // 3      WWAN Module Powered in S5: 0 = Disabled, 1 = Enabled
      // 4 - 7  Reserved
      //
      Method (SWWS, 1, NotSerialized)
      {
        If(LEqual(And(ICNF, 0x08), Zero))
        {
          Return
        }      
        //
        // Check for RTC Timer, else EC timer
        //
        If (LEqual(ITMR, 1))
        {
	  Store(IBT1, Local0)
          //
          // Set new Power States
          //
          And(Local0, 0x8F, Local0)
          Or(Local0, ShiftLeft(And(Arg0, 0x0E), 3), Local0)
	  
          //
          // If RapidStart is enabled and WWAN powered in S3, enable power in S4
          //
          If(CondRefOf(\_SB.IFFS.FFSS))
          {
            If(LAnd(And(\_SB.IFFS.FFSS, 0x03), And(Arg0,2)))
            {
               Or(Local0, ShiftLeft(0x04, 3), Local0)
            }
          }	  
	  Store(Local0, IBT1)
        }
        Else
        {
          //
          // Read ISCTByte1 from EC
          //
          If (CondRefOf(\_SB.PCI0.LPCB.H_EC.IBT1))
          {
            Store(\_SB.PCI0.LPCB.H_EC.IBT1, Local0)
          }
          Else
          {
            Store(IBT1, Local0)
          }

          //
          // Set new Power States
          //
          And(Local0, 0x8F, Local0)
          Or(Local0, ShiftLeft(And(Arg0, 0x0E), 3), Local0)

          //
          // If RapidStart is enabled and WWAN powered in S3, enable power in S4
          //
          If(CondRefOf(\_SB.IFFS.FFSS))
          {
            If(LAnd(And(\_SB.IFFS.FFSS, 0x03), And(Arg0,2)))
            {
               Or(Local0, ShiftLeft(0x04, 3), Local0)
            }
          }

          //
          // Save ISCTByte1 to EC
          //
          If (CondRefOf(\_SB.PCI0.LPCB.H_EC.IBT1))
          {
            Store(Local0, \_SB.PCI0.LPCB.H_EC.IBT1)
            //Send EC IsctUpdateCommand - 0x2B
            \_SB.PCI0.LPCB.H_EC.ECMD (0x2B)
          }
          Else
          {
            Store(Local0, IBT1)
          }
        }
      }

      //
      // SASD - Set Intel Smart Connect Technology Sleep Duration
      // Input:
      // Bits   Description
      // 0 - 30 Sleep Duration
      // 31  : 0 = Sleep Duration in seconds
      //       1 = Actual time
      //
      Method (SASD, 1, NotSerialized)
      {
        //
        // Arg0  =  0 - NetDetect support
        //       >  0 - EC / RTC Based Timer
        //       Bit31 : 0 - Sleep Duration in seconds
        //               1 - Actual Time
        //
        If(LAnd(And(ICNF, 0x10), LGreater(Arg0, 0)))
        {
          //
          // See if RTC (1) or EC (0) Timer
          //
          If (LEqual(ITMR, 1))
          {
            Store(Arg0, RCTM)
          }
          Else
          {
            Store(Arg0, ECTM)
          }

          If (LAnd(CondRefOf(\_SB.PCI0.LPCB.H_EC.WTMS), LEqual(PTSL, 0x03)))
          {
             Store(And(ECTM, 0xFF), \_SB.PCI0.LPCB.H_EC.AWT0)
             Store(ShiftRight(And(ECTM, 0xFF00), 8), \_SB.PCI0.LPCB.H_EC.AWT1)
             Store(ShiftRight(And(ECTM, 0xFF0000), 16), \_SB.PCI0.LPCB.H_EC.AWT2)
             //
             // Enable EC timer - BIT7
             // Enable wake from S3 on timer exiry - BIT0
             //
             Store(\_SB.PCI0.LPCB.H_EC.WTMS, Local0)
             Store(Or(0x81,Local0), \_SB.PCI0.LPCB.H_EC.WTMS)
          }
          Else
          {
             Store(And(ECTM, 0xFF), AWT0)
             Store(ShiftRight(And(ECTM, 0xFF00), 8), AWT1)
             Store(ShiftRight(And(ECTM, 0xFF0000), 16), AWT2)
             Store(WTMS, Local0)
             Store(Or(0x81,Local0), WTMS)
          }
        }
        Else
        {
          If (LEqual(ITMR, 1))
          {
            Store(0, RCTM)
          } else {
            If(CondRefOf(\_SB.PCI0.LPCB.H_EC.WTMS))
            {
              Store(0, ECTM)
              Store(0, \_SB.PCI0.LPCB.H_EC.WTMS)
            }
          }

          Store(Arg0, SLPD)
        }
      } // Method (SASD)

      //
      // GPWR - Get Wake Reason
      // Input:   None
      // Return:   
      // Bits   Description 
      // 0      User Pressed Power Button: 0 = False, 1 = True
      // 1      EC / RTC caused wake (requested by iSCT agent): 0 = False, 1 = True
      // 2      RTC Timer caused wake: 0 = False, 1 = True
      // 3      Wake due to PME (Not Network Wake): 0 = False, 1 = True
      // 4      Internal BIOS bit PME (Known Network Wake): 0 = False, 1 = True (Reserved for Agent- Must be 0)
      // 5 - 7  Reserved
      //
      Method (GPWR, 0, NotSerialized)
      {
        //
        // Return Wake Reason
        //
        If(And(WKRS,0x2F))
        {
          //
          // Mask out the Internal BIOS Network PME bit and the reserved bits.
          //
          Return(And(WKRS, 0x2F))
        }
        Else
        {
          Return(0)
        }
      } // Method (GPWR)

      //
      // GPCS - Get Platform Component State
      // Input: None
      // Return:
      // Bits   Description
      // 0      LID State: 0 - Closed, 1 - Open
      // 1 - 7  Reserved
      //
      Method (GPCS, 0, NotSerialized)
      {
        //
        // See if EC (0) or RTC (1) Timer
        //
        If (LEqual(ITMR, 0))
        {
          If (CondRefOf(\_SB.PCI0.LPCB.H_EC.LSTE))
          {
            Return(And(\_SB.PCI0.LPCB.H_EC.LSTE,0x01))
          }
        }
        Else
        {
          Return(1)
        }
      } // Method (GPCS)

      //
      // GAWD - Get Isct Wake Duration
      // Input: None
      // Return:
      // Bits   Description
      // 0 - 7  Isct Wake Duration
      //
      Method (GAWD, 0, NotSerialized)
      {
        Return (IWDT)
      }

      //
      // SAWD - Set Isct Wake Duration
      // Input:
      // Bits   Description
      // 0 - 7  Isct Wake Duration
      //
      Method (SAWD, 1, NotSerialized)
      {
        Store (Arg0, IWDT)
          //TBD Set EC Watchdog Timer
      }

    } // Device (IAOE)
  } // Scope (\_SB)
} // End SSDT

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