summaryrefslogtreecommitdiff
path: root/ReferenceCode/Chipset/SystemAgent/SaInit/Dxe/SaInit.h
blob: a8c2b8f21a7eb396e9d4c6211ffc36aaf182552f (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
/** @file
  Header file for SA Initialization Driver.

@copyright
  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 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 _SA_INITIALIZATION_DRIVER_H_
#define _SA_INITIALIZATION_DRIVER_H_

///
/// External include files do NOT need to be explicitly specified in real EDKII
/// environment
///
#if !defined(EDK_RELEASE_VERSION) || (EDK_RELEASE_VERSION < 0x00020000)
#include "EdkIIGlueDxe.h"
#include "EfiScriptLib.h"
#include "SaBuildFlags.h"
#include "LegacyRegion.h"
#include "Vtd.h"
#include "GraphicsInit.h"
#include "IgdOpregion.h"
#include "PciExpressInit.h"
#include "AudioInit.h"
#include "RcFviDxeLib.h"
#include "CpuRegs.h"
#include "CpuPlatformLib.h"
#include "PcieComplex.h"
#include "VTd.h"
#include "SwitchableGraphicsInit.h"

///
/// Driver Consumed Protocol Prototypes
///
#include EFI_PROTOCOL_DEFINITION (SaPlatformPolicy)
#include EFI_PROTOCOL_PRODUCER (SaInfo)
#endif
///
/// Data definitions
///
#define CRID_DATA 0x69
#define CRID_LOCK 0x17

typedef struct {
  UINT64  BaseAddr;
  UINT32  Offset;
  UINT32  AndMask;
  UINT32  OrMask;
} BOOT_SCRIPT_REGISTER_SETTING;

typedef struct {
  UINT64                Address;
  EFI_BOOT_SCRIPT_WIDTH Width;
  UINT32                Value;
} BOOT_SCRIPT_PCI_REGISTER_SAVE;

typedef struct {
  EFI_SA_INFO_PROTOCOL  SaInfo;
} SA_INSTANCE_PRIVATE_DATA;

typedef struct {
  UINT8 DeviceNumber;
  UINT8 FunctionNumber;
  UINT8 SvidRegOffset;
} SA_SVID_SID_INIT_ENTRY;

#define SA_FVI_STRING          "Reference Code - SA - System Agent"
#define SA_FVI_SMBIOS_TYPE     0xDD  ///< Default value
#define SA_FVI_SMBIOS_INSTANCE 0x06
#define MEM_FVI_STRING         "Reference Code - MRC"
#define MEM_RC_VERSION \
  { \
    0xFF, 0xFF, 0xFF, 0xFFFF \
  }
#define PCIE_FVI_STRING "SA - PCIe Version"
#define PCIE_RC_VERSION \
  { \
    0xFF, 0xFF, 0xFF, 0xFFFF \
  }
#define SA_CRID_STATUS          "SA-CRID Status"
#define SA_CRID_ORIGINAL_VALUE  "SA-CRID Original Value"
#define SA_CRID_NEW_VALUE       "SA-CRID New Value"
#define SA_CRID_ENABLED         "Enabled "
#define SA_CRID_DISABLED        "Disabled"
#define SA_CRID_VERSION \
  { \
    0xFF, 0xFF, 0xFF, 0xFFFF \
  }
#define VBIOS_FVI_STRING        "OPROM - VBIOS"
#define VBIOS_RC_VERSION \
  { \
    0xFF, 0xFF, 0xFF, 0xFFFF \
  }

enum {
  SA_RC_VER     = 0,
  MEM_RC_VER,
  PCIE_VER,
  CRID_STATUS,
  CRID_ORIGINAL,
  CRID_NEW,
  VBIOS_VER
} SA_FVI_INDEX;

extern FVI_ELEMENT_AND_FUNCTION       mSaFviElementsData[];
extern FVI_DATA_HUB_CALLBACK_CONTEXT  mSaFviVersionData;
extern UINTN                          mSaFviElements;

///
/// Function Prototype
///
VOID
EFIAPI
SaPciEnumCompleteCallback (
  IN EFI_EVENT Event,
  IN VOID      *Context
  )
/**
  This function gets registered as a callback to perform SA initialization before ExitPmAuth

  @param[in] Event     - A pointer to the Event that triggered the callback.
  @param[in] Context   - A pointer to private data registered with the callback function.

  @retval EFI_SUCCESS   - Always.

  **/
;

VOID
EFIAPI
SaExitPmAuthCallback (
  IN EFI_EVENT Event,
  IN VOID      *Context
  )
/**
  This function gets registered as a callback to perform SA configuration security lock

  @param[in] Event     - A pointer to the Event that triggered the callback.
  @param[in] Context   - A pointer to private data registered with the callback function.

  @retval EFI_SUCCESS   - Always.

  **/
;

VOID
DeviceConfigure (
  IN DXE_PLATFORM_SA_POLICY_PROTOCOL *DxePlatformSaPolicy
  )
/**
  This function performs SA internal devices enabling/disabling

  @param[in] DxePlatformSaPolicy - SA DxePlatformPolicy protocol

  **/
;

VOID
ProgramSvidSid (
  IN DXE_PLATFORM_SA_POLICY_PROTOCOL *DxePlatformSaPolicy
  )
/**
    Program SA devices Subsystem Vendor Identifier (SVID) and Subsystem Identifier (SID).

    @param[in] DxePlatformSaPolicy   The SAPlatform Policy protocol instance
**/
;

VOID
SaDxePolicyDump (
  IN DXE_PLATFORM_SA_POLICY_PROTOCOL *mDxePlatformSaPolicy
  )
/**
  This function prints the DXE phase platform policy.

  @param[in] mDxePlatformSaPolicy - SA DxePlatformPolicy protocol

  **/
;

#endif