4 Copyright (c) 2004 - 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 This files defines the protocol produced by platform memory test driver.
22 #ifndef __PLATFORM_MEMTEST_H__
23 #define __PLATFORM_MEMTEST_H__
25 #if (EFI_SPECIFICATION_VERSION >= 0x0002000A)
26 #include EFI_PROTOCOL_CONSUMER (HiiDatabase)
28 #include EFI_PROTOCOL_CONSUMER (Hii)
30 #include EFI_PROTOCOL_CONSUMER (GenericMemoryTest)
33 #define EFI_PLATFORM_MEMTEST_PROTOCOL_GUID \
34 { 0x859ba18, 0x7dd7, 0x4ed7, 0xa8, 0x8e, 0x10, 0x9c, 0x63, 0x91, 0x7b, 0xdd }
37 // Forward reference for pure ANSI compatability
39 EFI_FORWARD_DECLARATION (EFI_PLATFORM_MEMTEST_PROTOCOL
);
43 // Basic type definitions
45 typedef UINT16 EFI_DIMM_ID
;
46 #define EFI_INVALID_DIMM_ID 0xFFFF
49 // This describes the capabilities
53 EFI_PHYSICAL_ADDRESS InitBlockSize
;
54 EFI_PHYSICAL_ADDRESS TestBlockSize
;
55 } EFI_PLATFORM_MEMTEST_CAPABILITIES
;
58 // This defines the platform driver phases to use in notify phase
63 EfiMemtestPhaseMaximum
68 // Definitions of Capability bits
70 #define EFI_MEMTEST_CAP_NONE 0X00000000
71 #define EFI_MEMTEST_CAP_ECC 0X00000001
72 #define EFI_MEMTEST_CAP_HW_TEST 0X00000002
73 #define EFI_MEMTEST_CAP_HW_INIT 0X00000004
76 // This describes the pattern for testing all memory cells
79 UINT32 Count
; // Number of patterns
80 UINT32 Width
; // Width of patterns
81 VOID
*Pattern
; // Array of patterns
82 }EFI_MEMTEST_DATA_PATTERN
;
85 // This describes the data and address line patterns
88 UINT32 Count
; // Number of patterns
89 EFI_PHYSICAL_ADDRESS
*Address
; // Array of addresses
90 EFI_PHYSICAL_ADDRESS
*Pattern
; // Array of patterns
91 } EFI_MEMTEST_ADDRESS_PATTERN
;
94 #define EFI_INVALID_DIMM_ID 0xFFFF
97 // DIMM information exported by the platform driver
102 STRING_REF DimmReference
;
103 } EFI_MEMTEST_DIMM_INFO
;
107 // Various types of errors
110 EfiMemtestCorrectableError
= 1,
111 EfiMemtestUncorrectableError
,
112 EfiMemtestErrorMaximum
,
116 // Actions to be taken.
119 EfiMemtestActionReport
= 1,
120 EfiMemtestActionDisableMem
,
121 EfiMemtestActionMaximum
,
122 } EFI_MEMTEST_ERROR_ACTION
;
126 // Structure indicating a policy entry.
130 EFI_DIMM_ERROR ErrorType
;
132 EFI_MEMTEST_ERROR_ACTION Action
;
133 } EFI_MEMTEST_POLICY_ENTRY
;
138 // Error Information.
141 EFI_DIMM_ERROR Error
;
143 } EFI_PLATFORM_MEMTEST_ERROR
;
148 (EFIAPI
*EFI_PLATFORM_MEMTEST_NOTIFY_PHASE
) (
149 IN EFI_PLATFORM_MEMTEST_PROTOCOL
*This
,
150 IN EFI_MEMTEST_PHASE Phase
155 (EFIAPI
*EFI_PLATFORM_MEMTEST_GET_PLATFORM_INFO
) (
156 IN EFI_PLATFORM_MEMTEST_PROTOCOL
*This
,
157 OUT EFI_PLATFORM_MEMTEST_CAPABILITIES
*Capabilities
,
158 OUT EFI_MEMTEST_ADDRESS_PATTERN
*AddressPattern
,
159 OUT EFI_MEMTEST_DATA_PATTERN
*DataPattern
,
160 OUT EFI_MEMTEST_DATA_PATTERN
*MemoryPattern
,
161 OUT UINT32
*EntryCount
,
162 OUT EFI_MEMTEST_POLICY_ENTRY
**PolicyGrid
167 (EFIAPI
* EFI_PLATFORM_MEMTEST_GET_NEXT_DIMM_INFO
) (
168 IN EFI_PLATFORM_MEMTEST_PROTOCOL
*This
,
169 IN OUT EFI_MEMTEST_DIMM_INFO
*DimmInfo
174 (EFIAPI
*EFI_PLATFORM_MEMTEST_INITIALIZE_MEMORY
) (
175 IN EFI_PLATFORM_MEMTEST_PROTOCOL
*This
,
176 IN EFI_PHYSICAL_ADDRESS Start
,
177 IN EFI_PHYSICAL_ADDRESS Size
182 (EFIAPI
* EFI_PLATFORM_MEMTEST_HW_MEMORY_TEST
) (
183 IN EFI_PLATFORM_MEMTEST_PROTOCOL
*This
,
184 IN EXTENDMEM_COVERAGE_LEVEL Level
,
185 IN EFI_PHYSICAL_ADDRESS Start
,
186 IN EFI_PHYSICAL_ADDRESS Size
,
187 OUT UINTN
*ErrorCount
,
188 OUT EFI_PLATFORM_MEMTEST_ERROR
**ErrorInfo
193 (EFIAPI
* EFI_PLATFORM_MEMTEST_FLUSH_BUFFER
) (
194 IN EFI_PLATFORM_MEMTEST_PROTOCOL
*This
199 (EFIAPI
* EFI_PLATFORM_MEMTEST_CHECK_FOR_ERROR
) (
200 IN EFI_PLATFORM_MEMTEST_PROTOCOL
*This
,
201 OUT UINT32
*ErrorCount
,
202 OUT EFI_PLATFORM_MEMTEST_ERROR
**ErrorInfo
208 (EFIAPI
* EFI_PLATFORM_MEMTEST_LOCATE_BAD_DIMM
) (
209 IN EFI_PLATFORM_MEMTEST_PROTOCOL
*This
,
210 IN EFI_PHYSICAL_ADDRESS FailingAddress
,
213 OUT UINT32
*ErrorInfoCount
,
214 OUT EFI_PLATFORM_MEMTEST_ERROR
**ErrorInfoBuffer
219 (EFIAPI
* EFI_PLATFORM_MEMTEST_CLEAR_ERROR
) (
220 IN EFI_PLATFORM_MEMTEST_PROTOCOL
*This
225 (EFIAPI
* EFI_PLATFORM_MEMTEST_DISABLE_DIMM
) (
226 IN EFI_PLATFORM_MEMTEST_PROTOCOL
*This
,
227 IN UINT16
*DimmCount
,
228 IN EFI_DIMM_ID
*DimmIds
,
229 IN BOOLEAN RebootRequired
235 (EFIAPI
* EFI_PLATFORM_MEMTEST_OVERLAP
) (
236 IN EFI_PLATFORM_MEMTEST_PROTOCOL
*This
,
237 IN EFI_DIMM_ID DimmId
,
238 IN EFI_PHYSICAL_ADDRESS start
,
239 IN EFI_PHYSICAL_ADDRESS Size
,
243 typedef struct _EFI_PLATFORM_MEMTEST_PROTOCOL
{
244 EFI_PLATFORM_MEMTEST_NOTIFY_PHASE NotifyPhase
;
245 EFI_PLATFORM_MEMTEST_GET_PLATFORM_INFO GetPlatformInfo
;
246 EFI_PLATFORM_MEMTEST_GET_NEXT_DIMM_INFO GetNextDimmInfo
;
247 EFI_PLATFORM_MEMTEST_INITIALIZE_MEMORY InitializeMem
;
248 EFI_PLATFORM_MEMTEST_HW_MEMORY_TEST HwTest
;
249 EFI_PLATFORM_MEMTEST_FLUSH_BUFFER FlushBuffer
;
250 EFI_PLATFORM_MEMTEST_CHECK_FOR_ERROR CheckError
;
251 EFI_PLATFORM_MEMTEST_LOCATE_BAD_DIMM LocateBadDimm
;
252 EFI_PLATFORM_MEMTEST_CLEAR_ERROR ClearError
;
253 EFI_PLATFORM_MEMTEST_DISABLE_DIMM DisableDimm
;
254 EFI_PLATFORM_MEMTEST_OVERLAP Overlap
;
255 } EFI_PLATFORM_MEMTEST_PROTOCOL
;
259 extern EFI_GUID gEfiPlatformMemTestGuid
;