summaryrefslogtreecommitdiff
path: root/ReferenceCode/Chipset/SystemAgent/AcpiTables/SaSsdt/SaPcieDsm.asl
blob: 613138c5ab3bd191e292c817d3332cefbadbf7b7 (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
/**************************************************************************;
;*                                                                        *;
;*    Intel Confidential                                                  *;
;*                                                                        *;
;*    Intel Corporation - ACPI Reference Code for the Haswell             *;
;*    Family of Customer Reference Boards.                                *;
;*                                                                        *;
;*                                                                        *;
;*    Copyright (c)  1999 - 2012 Intel Corporation. All rights reserved   *;
;*    This software and associated documentation (if any) is furnished    *;
;*    under a license and may only be used or copied in accordance        *;
;*    with the terms of the license. Except as permitted by such          *;
;*    license, no part of this software or documentation may be           *;
;*    reproduced, stored in a retrieval system, or transmitted in any     *;
;*    form or by any means without the express written consent of         *;
;*    Intel Corporation.                                                  *;
;*                                                                        *;
;*                                                                        *;
;**************************************************************************/
/*++
  This file contains an 'Intel Peripheral Driver' and is
  licensed for Intel CPUs and chipsets under the terms of your  
  license agreement with Intel or your vendor.  This file may   
  be modified by the user, subject to additional terms of the   
  license agreement                                             
--*/   

  Name(LTRV, Package(){0,0,0,0})
  Name(OPTS, 0) // SA SETUP options for LTR and OBFF

  //
  // _DSM Device Specific Method
  //
  // Arg0: UUID Unique function identifier
  // Arg1: Integer Revision Level
  // Arg2: Integer Function Index (0 = Return Supported Functions)
  // Arg3: Package Parameters
  Method(_DSM, 4, Serialized) {
    //
    // Switch based on which unique function identifier was passed in
    //
    Switch(ToInteger(Arg0)) {
      //
      // _DSM Definitions for Latency Tolerance Reporting
      //
      // Arguments:
      // Arg0: UUID: E5C937D0-3553-4d7a-9117-EA4D19C3434D
      // Arg1: Revision ID: 2
      // Arg2: Function Index: 6
      // Arg3: Empty Package
      //
      // Return:
      // A Package of four integers corresponding with the LTR encoding defined
      // in the PCI Express Base Specification, as follows:
      // Integer 0: Maximum Snoop Latency Scale
      // Integer 1: Maximum Snoop Latency Value
      // Integer 2: Maximum No-Snoop Latency Scale
      // Integer 3: Maximum No-Snoop Latency Value
      // These values correspond directly to the LTR Extended Capability Structure
      // fields described in the PCI Express Base Specification.
      //
      Case(ToUUID("E5C937D0-3553-4d7a-9117-EA4D19C3434D")) {
        //
        // Switch by function index
        //
        Switch(ToInteger(Arg2)) {
          //
          // Function Index:0
          // Standard query - A bitmask of functions supported
          //
          Case (0)
          {
            if (LEqual(Arg1, 2)){ // test Arg1 for Revision ID: 2
              Store(1, OPTS) // function 0
              if (LTRS){
                Or(OPTS,0x40,OPTS) // function 6
              }
              if (OBFS){
                Or(OPTS,0x10,OPTS) // function 4
              }
              Return (OPTS) // bitmask of supported functions: 6, 4, 0.
            } else {
              Return (0)
            }
          }
          //
          // Function Index: 4
          //
          Case(4) {
            if (LEqual(Arg1, 2)){ // test Arg1 for Revision ID: 2
              if (OBFS){
                Return (Buffer () {0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0}) // OBFF capable, offset 4[08h]
              } else {
                Return (Buffer () {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0})
              }
            }
          }
          //
          // Function Index: 6
          // LTR Extended Capability Structure
          //
          Case(6) {
            if (LEqual(Arg1, 2)){ // test Arg1 for Revision ID: 2
              if (LTRS){
                Store(And(ShiftRight(SMSL,10),7), Index(LTRV, 0))
                Store(And(SMSL,0x3FF), Index(LTRV, 1))
                Store(And(ShiftRight(SNSL,10),7), Index(LTRV, 2))
                Store(And(SNSL,0x3FF), Index(LTRV, 3))
                return (LTRV)
              } else {
                Return (0)
              }
            }
          }
        } // End of switch(Arg2)
      } // End of case(ToUUID("E5C937D0-3553-4d7a-9117-EA4D19C3434D"))
    } // End of switch(Arg0)
    return (Buffer() {0x00})
  } // End of _DSM