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