summaryrefslogtreecommitdiff
path: root/Include/BootScriptCommon.h
blob: 11f8cd96f385aa2d3ac2d94ada58b3b6584aafa8 (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
195
196
197
198
199
200
201
202
203
204
205
206
//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2011, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093        **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************

//**********************************************************************
// $Header: /Alaska/BIN/Core/Include/BootScriptCommon.h 5     6/24/11 1:47p Felixp $
//
// $Revision: 5 $
//
// $Date: 6/24/11 1:47p $
//**********************************************************************
// Revision History
// ----------------
// $Log: /Alaska/BIN/Core/Include/BootScriptCommon.h $
// 
// 5     6/24/11 1:47p Felixp
// Improved compatibility with the Framework drivers in PI mode.
// 
// 4     6/16/11 10:01a Felixp
// Enhancements: 
// 1. SAVE_STATE_... macros are removed (used BOOT_SCRIPT_S3_... from
// AmiDxeLib.h instead) 
// 2. OEM OpCodes moved into the Framework section of the header (no OEM
// OpCodes in PEI)
// 
// 3     5/13/11 3:28p Oleksiyy
// [TAG]  		EIP56650 
// [Category]  	New Feature
// [Description]  	S3 Save State Protocol and S3 Smm Save State Protocol
// functions added. Support for opcodes introduced in PI 1.2 added.
// [Files]  		BootScriptCommon.h, BootScriptExecuter.c,
// BootScriptPrivate.h, BootScriptSave.c and BootScriptSave.h
// 
// 2     3/11/11 7:02p Artems
// 
// 1     3/09/11 5:33p Artems
// 
// 1     2/03/11 4:45p Oleksiyy
// 
// 1     2/03/11 4:09p Oleksiyy
// [TAG]  		EIP53402 
// [Category]  	Improvement
// [Description]  	Create new label of ACPI with separate S3 Functionality
// [Files]  		S3Common.cif
// ..\..\..\Include\BootScriptCommon.h
// 
// 8     7/17/07 10:44a Markw
// Updated typecasts in macro where UINTN is needed.
// 
// 7     2/12/07 11:20a Felixp
// Clean up
// 
// 6     2/12/07 11:18a Felixp
// Revision field removed from EFI_BOOT_SCRIPT_SAVE_PROTOCOL structure
// to match BootScript spec (it was earlier their for Tiano compliance.
// Tiano header is fixed now).
// 
// 5     12/26/06 2:57p Markw
// Add BootScript Polling.
// 
// 4     3/13/06 1:40a Felixp
// 
// 3     11/07/05 3:42p Sivagarn
// Removed SMBus related definitions.  The Smbus definitions are moved to
// appropriate SMBUS.H file.
// 
// 2     4/04/05 4:37p Markw
// Modified existing and added new macros.
// 
// 1     1/28/05 12:44p Felixp
// 
// 1     12/23/04 9:41a Felixp
// 
// 5     4/22/04 2:32p Felixp
// 
// 4     3/09/04 9:37a Markw
// Fixed Io RW Macro.
// 
// 3     3/08/04 5:25p Markw
// Fixed the BootScriptSave macros.
// 
// 2     3/02/04 4:44p Markw
// Added Boot Script Macros
// 
// 1     2/26/04 2:36p Markw
// 
//**********************************************************************


//<AMI_FHDR_START>
//---------------------------------------------------------------------------
// Name:	BootScriptCommon.h
//
// Description: Boot Script Common definitions header.
//
//---------------------------------------------------------------------------
//<AMI_FHDR_END>

#ifndef __BOOT_SCRIPT_COMMON__H__
#define __BOOT_SCRIPT_COMMON__H__
#ifdef __cplusplus
extern "C" {
#endif

//*******************************************
// EFI Save State Script Opcode definitions (Common)
//*******************************************
#define EFI_BOOT_SCRIPT_IO_WRITE_OPCODE                 0x00
#define EFI_BOOT_SCRIPT_IO_READ_WRITE_OPCODE            0x01
#define EFI_BOOT_SCRIPT_MEM_WRITE_OPCODE                0x02
#define EFI_BOOT_SCRIPT_MEM_READ_WRITE_OPCODE           0x03
#define EFI_BOOT_SCRIPT_PCI_CONFIG_WRITE_OPCODE         0x04
#define EFI_BOOT_SCRIPT_PCI_CONFIG_READ_WRITE_OPCODE    0x05
#define EFI_BOOT_SCRIPT_SMBUS_EXECUTE_OPCODE            0x06
#define EFI_BOOT_SCRIPT_STALL_OPCODE                    0x07
#define EFI_BOOT_SCRIPT_DISPATCH_OPCODE                 0x08

#if PI_SPECIFICATION_VERSION>=0x0001000A
//*******************************************
// EFI Save State Script Opcode definitions (PI)
//*******************************************
#define EFI_BOOT_SCRIPT_DISPATCH_2_OPCODE               0x09
#define EFI_BOOT_SCRIPT_INFORMATION_OPCODE              0x0A
#define EFI_BOOT_SCRIPT_PCI_CONFIG2_WRITE_OPCODE        0x0B
#define EFI_BOOT_SCRIPT_PCI_CONFIG2_READ_WRITE_OPCODE   0x0C
#define EFI_BOOT_SCRIPT_IO_POLL_OPCODE                  0x0D
#define EFI_BOOT_SCRIPT_MEM_POLL_OPCODE                 0x0E
#define EFI_BOOT_SCRIPT_PCI_CONFIG_POLL_OPCODE          0x0F
#define EFI_BOOT_SCRIPT_PCI_CONFIG2_POLL_OPCODE         0x10
#define EFI_BOOT_SCRIPT_LABEL_OPCODE_OEM                0x83
#endif

#if BACKWARD_COMPATIBLE_MODE || PI_SPECIFICATION_VERSION < 0x0001000A
//*******************************************
// EFI Boot Script Opcode definitions (Framework)
//*******************************************

// Extensions to boot script definitions
//OEM
#ifndef EFI_BOOT_SCRIPT_IO_POLL_OPCODE_OEM
#define EFI_BOOT_SCRIPT_IO_POLL_OPCODE_OEM                  0x80
#endif

#ifndef EFI_BOOT_SCRIPT_MEM_POLL_OPCODE_OEM
#define EFI_BOOT_SCRIPT_MEM_POLL_OPCODE_OEM                 0x81
#endif

#ifndef EFI_BOOT_SCRIPT_PCI_POLL_OPCODE_OEM
#define EFI_BOOT_SCRIPT_PCI_POLL_OPCODE_OEM                 0x82
#endif

#endif

#define EFI_BOOT_SCRIPT_TABLE_OPCODE                  0xAA
#define EFI_BOOT_SCRIPT_TERMINATE_OPCODE              0xFF

//*******************************************
// EFI_BOOT_SCRIPT_WIDTH
//*******************************************
typedef enum {
	EfiBootScriptWidthUint8,
	EfiBootScriptWidthUint16,
	EfiBootScriptWidthUint32,
	EfiBootScriptWidthUint64,
	EfiBootScriptWidthFifoUint8,
	EfiBootScriptWidthFifoUint16,
	EfiBootScriptWidthFifoUint32,
	EfiBootScriptWidthFifoUint64,
	EfiBootScriptWidthFillUint8,
	EfiBootScriptWidthFillUint16,
	EfiBootScriptWidthFillUint32,
	EfiBootScriptWidthFillUint64,
	EfiBootScriptWidthMaximum
} EFI_BOOT_SCRIPT_WIDTH;

//////////////////////////////////////////////////////////////////////////////////

/****** DO NOT WRITE BELOW THIS LINE *******/
#ifdef __cplusplus
}
#endif
#endif

//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2011, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**      5555 Oakbrook Parkway, Suite 200, Norcross, GA 30093        **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************