piflash64.h revision 1.1.1.1.6.2 1 1.1.1.1.6.2 yamt /* $NetBSD: piflash64.h,v 1.1.1.1.6.2 2014/05/22 11:40:57 yamt Exp $ */
2 1.1.1.1.6.2 yamt
3 1.1.1.1.6.2 yamt #ifndef _PIFLASH64_H
4 1.1.1.1.6.2 yamt #define _PIFLASH64_H
5 1.1.1.1.6.2 yamt
6 1.1.1.1.6.2 yamt /*++
7 1.1.1.1.6.2 yamt
8 1.1.1.1.6.2 yamt Copyright (c) 1999 Intel Corporation
9 1.1.1.1.6.2 yamt
10 1.1.1.1.6.2 yamt Module Name:
11 1.1.1.1.6.2 yamt
12 1.1.1.1.6.2 yamt PIflash64.h
13 1.1.1.1.6.2 yamt
14 1.1.1.1.6.2 yamt Abstract:
15 1.1.1.1.6.2 yamt
16 1.1.1.1.6.2 yamt Iflash64.efi protocol to abstract iflash from
17 1.1.1.1.6.2 yamt the system.
18 1.1.1.1.6.2 yamt
19 1.1.1.1.6.2 yamt Revision History
20 1.1.1.1.6.2 yamt
21 1.1.1.1.6.2 yamt --*/
22 1.1.1.1.6.2 yamt
23 1.1.1.1.6.2 yamt //
24 1.1.1.1.6.2 yamt // Guid that identifies the IFLASH protocol
25 1.1.1.1.6.2 yamt //
26 1.1.1.1.6.2 yamt #define IFLASH64_PROTOCOL_PROTOCOL \
27 1.1.1.1.6.2 yamt { 0x65cba110, 0x74ab, 0x11d3, 0xbb, 0x89, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 };
28 1.1.1.1.6.2 yamt
29 1.1.1.1.6.2 yamt //
30 1.1.1.1.6.2 yamt // Unlock FLASH from StartAddress to EndAddress and return a LockKey
31 1.1.1.1.6.2 yamt //
32 1.1.1.1.6.2 yamt typedef
33 1.1.1.1.6.2 yamt EFI_STATUS
34 1.1.1.1.6.2 yamt (EFIAPI *UNLOCK_FLASH_API)(
35 1.1.1.1.6.2 yamt IN struct _IFLASH64_PROTOCOL_INTERFACE *This
36 1.1.1.1.6.2 yamt );
37 1.1.1.1.6.2 yamt
38 1.1.1.1.6.2 yamt //
39 1.1.1.1.6.2 yamt // Lock the flash represented by the LockKey
40 1.1.1.1.6.2 yamt //
41 1.1.1.1.6.2 yamt typedef
42 1.1.1.1.6.2 yamt EFI_STATUS
43 1.1.1.1.6.2 yamt (EFIAPI *LOCK_FLASH_API)(
44 1.1.1.1.6.2 yamt IN struct _IFLASH64_PROTOCOL_INTERFACE *This
45 1.1.1.1.6.2 yamt );
46 1.1.1.1.6.2 yamt
47 1.1.1.1.6.2 yamt //
48 1.1.1.1.6.2 yamt // Status callback for a utility like IFLASH64
49 1.1.1.1.6.2 yamt //
50 1.1.1.1.6.2 yamt // Token would map to a list like Ted proposed. The utility has no idea what
51 1.1.1.1.6.2 yamt // happens on the other side.
52 1.1.1.1.6.2 yamt // ErrorStatus - Level of Error or success. Independent of Token. If you
53 1.1.1.1.6.2 yamt // don't know the token you will at least know pass or fail.
54 1.1.1.1.6.2 yamt // String - Optional extra information about the error. Could be used for
55 1.1.1.1.6.2 yamt // debug or future expansion
56 1.1.1.1.6.2 yamt //
57 1.1.1.1.6.2 yamt // Attributes - Options screen attributes for String. Could allow the string to be different colors.
58 1.1.1.1.6.2 yamt //
59 1.1.1.1.6.2 yamt typedef
60 1.1.1.1.6.2 yamt EFI_STATUS
61 1.1.1.1.6.2 yamt (EFIAPI *UTILITY_PROGRESS_API)(
62 1.1.1.1.6.2 yamt IN struct _IFLASH64_PROTOCOL_INTERFACE *This,
63 1.1.1.1.6.2 yamt IN UINTN Token,
64 1.1.1.1.6.2 yamt IN EFI_STATUS ErrorStatus,
65 1.1.1.1.6.2 yamt IN CHAR16 *String, OPTIONAL
66 1.1.1.1.6.2 yamt IN UINTN *Attributes OPTIONAL
67 1.1.1.1.6.2 yamt );
68 1.1.1.1.6.2 yamt
69 1.1.1.1.6.2 yamt //
70 1.1.1.1.6.2 yamt // Token Values
71 1.1.1.1.6.2 yamt //
72 1.1.1.1.6.2 yamt // IFlash64 Token Codes
73 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_IFLASHSTART 0xB0 // IFlash64 has started
74 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_READINGFILE 0xB1 // Reading File
75 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_INITVPP 0xB2 // Initializing Vpp
76 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_DISABLEVPP 0x10 // Disable Vpp
77 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_FLASHUNLOCK 0xB3 // Unlocking FLASH Devices
78 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_FLASHERASE 0xB4 // Erasing FLASH Devices
79 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_FLASHPROGRAM 0xB5 // Programming FLASH
80 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_FLASHVERIFY 0xB6 // Verifying FLASH
81 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_UPDATESUCCES 0xB7 // FLASH Updage Success!
82 1.1.1.1.6.2 yamt
83 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_PROGRESS_READINGFILE 0x11 // % Reading File
84 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_PROGRESS_FLASHUNLOCK 0x13 // % Unlocking FLASH Devices
85 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_PROGRESS_FLASHERASE 0x14 // % Erasing FLASH Devices
86 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_PROGRESS_FLASHPROGRAM 0x15 // % Programming FLASH
87 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_PROGRESS_FLASHVERIFY 0x16 // % Verifying FLASH
88 1.1.1.1.6.2 yamt
89 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_READINGFILE_ER 0xB8 // File Read Error
90 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_INITVPP_ER 0xB9 // Initialization of IFB Error
91 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_FLASHUNLOCK_ER 0xBA // FLASH Unlock Error
92 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_FLASHERASE_ER 0xBB // FLASH Erase Error
93 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_FLASHVERIFY_ER 0xBC // FLASH Verify Error
94 1.1.1.1.6.2 yamt #define IFLASH_TOKEN_FLASHPROG_ER 0xBD // FLASH Program Error
95 1.1.1.1.6.2 yamt
96 1.1.1.1.6.2 yamt #define IFLASH_TABLE_END 0x00
97 1.1.1.1.6.2 yamt
98 1.1.1.1.6.2 yamt //
99 1.1.1.1.6.2 yamt // If this number changes one of the existing API's has changes
100 1.1.1.1.6.2 yamt //
101 1.1.1.1.6.2 yamt #define IFLASH_PI_MAJOR_VERSION 0x01
102 1.1.1.1.6.2 yamt
103 1.1.1.1.6.2 yamt //
104 1.1.1.1.6.2 yamt // This number changes when new APIs or data variables get added to the end
105 1.1.1.1.6.2 yamt // of the data structure
106 1.1.1.1.6.2 yamt //
107 1.1.1.1.6.2 yamt #define IFLASH_PI_MINOR_VERSION 0x01
108 1.1.1.1.6.2 yamt
109 1.1.1.1.6.2 yamt typedef struct _IFLASH64_PROTOCOL_INTERFACE {
110 1.1.1.1.6.2 yamt UINT32 MajorVersion;
111 1.1.1.1.6.2 yamt UINT32 MinorVersion;
112 1.1.1.1.6.2 yamt UNLOCK_FLASH_API UnlockFlash;
113 1.1.1.1.6.2 yamt LOCK_FLASH_API LockFlash;
114 1.1.1.1.6.2 yamt UTILITY_PROGRESS_API Progress;
115 1.1.1.1.6.2 yamt
116 1.1.1.1.6.2 yamt //
117 1.1.1.1.6.2 yamt // Future expansion goes here
118 1.1.1.1.6.2 yamt //
119 1.1.1.1.6.2 yamt
120 1.1.1.1.6.2 yamt } IFLASH64_PROTOCOL_INTERFACE;
121 1.1.1.1.6.2 yamt
122 1.1.1.1.6.2 yamt
123 1.1.1.1.6.2 yamt #endif
124