summaryrefslogtreecommitdiff
path: root/Protocol/EnhancedSpeedstep/EnhancedSpeedstep.h
blob: 35b43d5965d1a52a827e8b2c9f2303807b811bf2 (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
//
// This file contains 'Framework Code' and is licensed as such 
// under the terms of your license agreement with Intel or your
// vendor.  This file may not be modified, except as allowed by
// additional terms of your license agreement.                 
//
/*++

Copyright (c)  2004 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.


Module Name:

  EnhancedSpeedstep.h

Abstract:

  Enhanced Speedstep protocol 

  The Enhanced Speedstep Protocol support.   
--*/

#ifndef _ENHANCED_SPEEDSTEP_H_
#define _ENHANCED_SPEEDSTEP_H_

#define DXE_ENHANCED_SPEEDSTEP_PROTOCOL_GUID \
  { \
    0xe98021, 0xf4fe, 0x46cc, 0xab, 0x2d, 0x89, 0x4c, 0x37, 0x3a, 0xfa, 0x1 \
  }

EFI_FORWARD_DECLARATION (DXE_ENHANCED_SPEEDSTEP_PROTOCOL);

typedef struct {
  UINT32  Stepping;     // Matches value returned by CPUID function 1
  UINT8   Version;      // FVID State format
  UINT8   Size;         // Size of 1 FVID_STATE element
  UINT8   MaxVid;       // Calculated Max VID
  UINT8   MaxBusRatio;  // Calculated max ratio
  UINT8   NumStates;    // Number of states of FVID (N)
} FVID_INFORMATION;

typedef struct {
  UINT32  Power;        // Typical power consumed by CPU in this state
  UINT16  State;        // State Number (0 - N-1)
  UINT16  Vid;          // VID_SEL value to be written to PERF_CTL
  UINT16  BusRatio;     // BUS_RATIO_SEL value written to PERF_CTL
  UINT16  Reserved;     // to preserve alignment
} FVID_STATE_1;

#define ES_FVID_STATE_VERSION_1 1

typedef struct {
  UINT32  Features;
  UINT32  Locks;
} ENHANCED_SPEEDSTEP_STATE;

#define ES_GV3  (1 << 0)
#define ES_TM2  (1 << 1)
//
// All other bits reserved.
//
typedef
EFI_STATUS
(EFIAPI *ES_GET_CAPABILITIES) (
  IN      DXE_ENHANCED_SPEEDSTEP_PROTOCOL    * This,
  IN OUT  ENHANCED_SPEEDSTEP_STATE           * Capabilities
  );

typedef
EFI_STATUS
(EFIAPI *ES_GET_STATE) (
  IN      DXE_ENHANCED_SPEEDSTEP_PROTOCOL    * This,
  IN OUT  ENHANCED_SPEEDSTEP_STATE           * State
  );

typedef
EFI_STATUS
(EFIAPI *ES_SET_STATE) (
  IN      DXE_ENHANCED_SPEEDSTEP_PROTOCOL     * This,
  IN OUT  ENHANCED_SPEEDSTEP_STATE            * State,
  IN      ENHANCED_SPEEDSTEP_STATE            * Mask
  );

typedef
EFI_STATUS
(EFIAPI *ES_GET_FVID_TABLE) (
  IN    DXE_ENHANCED_SPEEDSTEP_PROTOCOL    * This,
  OUT   FVID_INFORMATION                   **FvidInformation,
  OUT   VOID                               **FvidStates
  );

typedef struct _DXE_ENHANCED_SPEEDSTEP_PROTOCOL {
  ES_GET_CAPABILITIES GetCapabilities;
  ES_GET_STATE        GetState;
  ES_SET_STATE        SetState;
  ES_GET_FVID_TABLE   GetFvidTable;
  UINT16              ProcNumber;
} DXE_ENHANCED_SPEEDSTEP_PROTOCOL;
//
// There will be an instance of this protocol for every processor
// in the system.  ProcNumber is used to manage all the different
// processors in the system and passed into the MP protocol
// to run code streams on application processors
//
extern EFI_GUID gDxeEnhancedSpeedstepProtocolGuid;

#endif