summaryrefslogtreecommitdiff
path: root/ReferenceCode/ME/PchMeUma/PchMeUma.h
blob: 6530b23ac42830feb733964b9cdc82112a5d6b3a (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
/** @file
  Header file for Framework PEIM to PchMeUma

@copyright
  Copyright (c) 2010 - 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 uniquely
  identified as "Intel Reference Module" 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
**/
#ifndef _PCH_ME_UMA_H_
#define _PCH_ME_UMA_H_

#include EFI_PPI_DEFINITION (PchMeUma)
#include EFI_GUID_DEFINITION (MeDataHob)

///
/// LPT PCI Register Definition(s)
///
#define R_MESEG_BASE  0x70

//
// ME FW communication timeout value definitions
//
#define DID_TIMEOUT_MULTIPLIER    0x1388
#define MUSZV_TIMEOUT_MULTIPLIER  0x1388
#define CPURV_TIMEOUT_MULTIPLIER  0x32
#define STALL_1_MILLISECOND       1000
#define STALL_100_MICROSECONDS    100

//
// Function Prototype(s)
//

/**
  This procedure will read and return the amount of ME UMA requested
  by ME ROM from the HECI device.

  @param[in] PeiServices          General purpose services available to every PEIM.
  @param[in] FfsHeader            Pointer to the FFS file header

  @retval UINT32                  Return ME UMA Size
  @retval EFI_SUCCESS             Do not check for ME UMA
**/
UINT32
MeSendUmaSize (
  IN EFI_PEI_SERVICES             **PeiServices,
  IN EFI_FFS_FILE_HEADER          *FfsHeader
  )
;

/**
  Init and Install ME Hob

  @param[in] PeiServices          General purpose services available to every PEIM.

  @retval EFI_SUCCESS
**/
EFI_STATUS
InstallMeHob (
  IN EFI_PEI_SERVICES             **PeiServices
  )
;

/**
  This procedure will determine whether or not the CPU was replaced
  during system power loss or via dynamic fusing.
  Calling this procedure could result in a warm reset (if ME FW is requesting one).

  @param[in] PeiServices          General purpose services available to every PEIM.
  @param[in] FfsHeader            Not used.
  @param[out] ForceFullTraining   When set = 0x1, MRC will be forced to perform a full
                                  memory training cycle.

  @retval EFI_SUCCESS             The function completed successfully.
**/
EFI_STATUS
CpuReplacementCheck (
  IN EFI_PEI_SERVICES             **PeiServices,
  IN EFI_FFS_FILE_HEADER          *FfsHeader,
  OUT UINT8                       *ForceFullTraining
  )
;

/**
  This procedure will configure the ME Host General Status register,
  indicating that DRAM Initialization is complete and ME FW may
  begin using the allocated ME UMA space.

  @param[in] PeiServices          General purpose services available to every PEIM.
  @param[in] FfsHeader            Pointer to the FFS file header
  @param[in] MrcBootMode          MRC BootMode
  @param[in] InitStat             H_GS[27:24] Status
  @param[in] FtpmStolenBase       The base of FTPM

  @retval EFI_SUCCESS
**/
EFI_STATUS
MeConfigDidReg (
  IN EFI_PEI_SERVICES             **PeiServices,
  IN EFI_FFS_FILE_HEADER          *FfsHeader,
  IN MRC_BOOT_MODE_T              MrcBootMode,
  IN UINT8                        InitStat,
  IN UINT32                       FtpmStolenBase,
  IN UINT32                       MeUmaSize
  )
;

/**
  This procedure will enforce the BIOS Action that was requested by ME FW
  as part of the DRAM Init Done message.

  @param[in] PeiServices          General purpose services available to every PEIM.
  @param[in] MrcBootMode          MRC BootMode
  @param[in] BiosAction           Me requests BIOS to act

  @retval EFI_SUCCESS             Always return EFI_SUCCESS
**/
EFI_STATUS
HandleMeBiosAction (
  IN EFI_PEI_SERVICES             **PeiServices,
  IN MRC_BOOT_MODE_T              MrcBootMode,
  IN UINT8                        BiosAction
  )
;

/**
  This procedure will issue a Non-Power Cycle, Power Cycle, or Global Rest.

  @param[in] PeiServices          General purpose services available to every PEIM.
  @param[in] ResetType            Type of reset to be issued.

  @retval EFI_SUCCESS             The function completed successfully.
  @retval All other error conditions encountered result in an ASSERT.
**/
EFI_STATUS
PerformReset (
  IN EFI_PEI_SERVICES             **PeiServices,
  UINT8                           ResetType
  )
;

/**
  This procedure will clear the DISB.

  @param[in] None

  @retval EFI_SUCCESS             Always return EFI_SUCCESS
**/
EFI_STATUS
ClearDisb (
  VOID
  )
;

/**
  This procedure will clear the DISB.

  @param[in] None

  @retval EFI_SUCCESS             Always return EFI_SUCCESS
**/
EFI_STATUS
SetDISB (
  VOID
  )
;
#endif