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
|
/*++
Copyright (c) 2004 - 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
PlatformMemtest.h
Abstract:
This files defines the protocol produced by platform memory test driver.
--*/
#ifndef __PLATFORM_MEMTEST_H__
#define __PLATFORM_MEMTEST_H__
#if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
#include EFI_PROTOCOL_CONSUMER (HiiDatabase)
#else
#include EFI_PROTOCOL_CONSUMER (Hii)
#endif
#include EFI_PROTOCOL_CONSUMER (GenericMemoryTest)
#define EFI_PLATFORM_MEMTEST_PROTOCOL_GUID \
{ 0x859ba18, 0x7dd7, 0x4ed7, {0xa8, 0x8e, 0x10, 0x9c, 0x63, 0x91, 0x7b, 0xdd} }
//
// Forward reference for pure ANSI compatability
//
EFI_FORWARD_DECLARATION (EFI_PLATFORM_MEMTEST_PROTOCOL);
//
// Basic type definitions
//
typedef UINT16 EFI_DIMM_ID;
#define EFI_INVALID_DIMM_ID 0xFFFF
//
// This describes the capabilities
//
typedef struct {
UINT32 HwCap;
EFI_PHYSICAL_ADDRESS InitBlockSize;
EFI_PHYSICAL_ADDRESS TestBlockSize;
} EFI_PLATFORM_MEMTEST_CAPABILITIES;
//
// This defines the platform driver phases to use in notify phase
//
typedef enum {
EfiMemtestPhaseBegin,
EfiMemtestPhaseEnd,
EfiMemtestPhaseMaximum
} EFI_MEMTEST_PHASE ;
//
// Definitions of Capability bits
//
#define EFI_MEMTEST_CAP_NONE 0X00000000
#define EFI_MEMTEST_CAP_ECC 0X00000001
#define EFI_MEMTEST_CAP_HW_TEST 0X00000002
#define EFI_MEMTEST_CAP_HW_INIT 0X00000004
//
// This describes the pattern for testing all memory cells
//
typedef struct {
UINT32 Count; // Number of patterns
UINT32 Width; // Width of patterns
VOID *Pattern; // Array of patterns
}EFI_MEMTEST_DATA_PATTERN;
//
// This describes the data and address line patterns
//
typedef struct {
UINT32 Count; // Number of patterns
EFI_PHYSICAL_ADDRESS *Address; // Array of addresses
EFI_PHYSICAL_ADDRESS *Pattern; // Array of patterns
} EFI_MEMTEST_ADDRESS_PATTERN;
#define EFI_INVALID_DIMM_ID 0xFFFF
//
// DIMM information exported by the platform driver
//
typedef struct {
EFI_DIMM_ID DimmId;
STRING_REF DimmReference;
} EFI_MEMTEST_DIMM_INFO;
//
// Various types of errors
//
typedef enum {
EfiMemtestCorrectableError = 1,
EfiMemtestUncorrectableError,
EfiMemtestErrorMaximum
} EFI_DIMM_ERROR;
//
// Actions to be taken.
//
typedef enum {
EfiMemtestActionReport = 1,
EfiMemtestActionDisableMem,
EfiMemtestActionMaximum
} EFI_MEMTEST_ERROR_ACTION;
//
// Structure indicating a policy entry.
//
typedef struct {
EFI_DIMM_ERROR ErrorType;
UINT32 Threshold;
EFI_MEMTEST_ERROR_ACTION Action;
} EFI_MEMTEST_POLICY_ENTRY;
//
// Error Information.
//
typedef struct {
EFI_DIMM_ERROR Error;
EFI_DIMM_ID DimmId;
} EFI_PLATFORM_MEMTEST_ERROR;
typedef
EFI_STATUS
(EFIAPI *EFI_PLATFORM_MEMTEST_NOTIFY_PHASE) (
IN EFI_PLATFORM_MEMTEST_PROTOCOL *This,
IN EFI_MEMTEST_PHASE Phase
);
typedef
EFI_STATUS
(EFIAPI *EFI_PLATFORM_MEMTEST_GET_PLATFORM_INFO) (
IN EFI_PLATFORM_MEMTEST_PROTOCOL *This,
OUT EFI_PLATFORM_MEMTEST_CAPABILITIES *Capabilities,
OUT EFI_MEMTEST_ADDRESS_PATTERN *AddressPattern,
OUT EFI_MEMTEST_DATA_PATTERN *DataPattern,
OUT EFI_MEMTEST_DATA_PATTERN *MemoryPattern,
OUT UINT32 *EntryCount,
OUT EFI_MEMTEST_POLICY_ENTRY **PolicyGrid
);
typedef
EFI_STATUS
(EFIAPI * EFI_PLATFORM_MEMTEST_GET_NEXT_DIMM_INFO) (
IN EFI_PLATFORM_MEMTEST_PROTOCOL *This,
IN OUT EFI_MEMTEST_DIMM_INFO *DimmInfo
);
typedef
EFI_STATUS
(EFIAPI *EFI_PLATFORM_MEMTEST_INITIALIZE_MEMORY) (
IN EFI_PLATFORM_MEMTEST_PROTOCOL *This,
IN EFI_PHYSICAL_ADDRESS Start,
IN EFI_PHYSICAL_ADDRESS Size
);
typedef
EFI_STATUS
(EFIAPI * EFI_PLATFORM_MEMTEST_HW_MEMORY_TEST) (
IN EFI_PLATFORM_MEMTEST_PROTOCOL *This,
IN EXTENDMEM_COVERAGE_LEVEL Level,
IN EFI_PHYSICAL_ADDRESS Start,
IN EFI_PHYSICAL_ADDRESS Size,
OUT UINTN *ErrorCount,
OUT EFI_PLATFORM_MEMTEST_ERROR **ErrorInfo
);
typedef
EFI_STATUS
(EFIAPI * EFI_PLATFORM_MEMTEST_FLUSH_BUFFER) (
IN EFI_PLATFORM_MEMTEST_PROTOCOL *This
);
typedef
EFI_STATUS
(EFIAPI * EFI_PLATFORM_MEMTEST_CHECK_FOR_ERROR) (
IN EFI_PLATFORM_MEMTEST_PROTOCOL *This,
OUT UINT32 *ErrorCount,
OUT EFI_PLATFORM_MEMTEST_ERROR **ErrorInfo
);
typedef
EFI_STATUS
(EFIAPI * EFI_PLATFORM_MEMTEST_LOCATE_BAD_DIMM) (
IN EFI_PLATFORM_MEMTEST_PROTOCOL *This,
IN EFI_PHYSICAL_ADDRESS FailingAddress,
IN UINT8 Expected,
IN UINT8 Found,
OUT UINT32 *ErrorInfoCount,
OUT EFI_PLATFORM_MEMTEST_ERROR **ErrorInfoBuffer
);
typedef
EFI_STATUS
(EFIAPI * EFI_PLATFORM_MEMTEST_CLEAR_ERROR) (
IN EFI_PLATFORM_MEMTEST_PROTOCOL *This
);
typedef
EFI_STATUS
(EFIAPI * EFI_PLATFORM_MEMTEST_DISABLE_DIMM) (
IN EFI_PLATFORM_MEMTEST_PROTOCOL *This,
IN UINT16 *DimmCount,
IN EFI_DIMM_ID *DimmIds,
IN BOOLEAN RebootRequired
);
typedef
EFI_STATUS
(EFIAPI * EFI_PLATFORM_MEMTEST_OVERLAP) (
IN EFI_PLATFORM_MEMTEST_PROTOCOL *This,
IN EFI_DIMM_ID DimmId,
IN EFI_PHYSICAL_ADDRESS start,
IN EFI_PHYSICAL_ADDRESS Size,
OUT BOOLEAN *Overlap
);
struct _EFI_PLATFORM_MEMTEST_PROTOCOL {
EFI_PLATFORM_MEMTEST_NOTIFY_PHASE NotifyPhase;
EFI_PLATFORM_MEMTEST_GET_PLATFORM_INFO GetPlatformInfo;
EFI_PLATFORM_MEMTEST_GET_NEXT_DIMM_INFO GetNextDimmInfo;
EFI_PLATFORM_MEMTEST_INITIALIZE_MEMORY InitializeMem;
EFI_PLATFORM_MEMTEST_HW_MEMORY_TEST HwTest;
EFI_PLATFORM_MEMTEST_FLUSH_BUFFER FlushBuffer;
EFI_PLATFORM_MEMTEST_CHECK_FOR_ERROR CheckError;
EFI_PLATFORM_MEMTEST_LOCATE_BAD_DIMM LocateBadDimm;
EFI_PLATFORM_MEMTEST_CLEAR_ERROR ClearError;
EFI_PLATFORM_MEMTEST_DISABLE_DIMM DisableDimm;
EFI_PLATFORM_MEMTEST_OVERLAP Overlap;
};
extern EFI_GUID gEfiPlatformMemTestGuid;
#endif
|