Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
elxu_ufi.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015, Emulex
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
33 #ifndef ELXU_UFI_H_
34 #define ELXU_UFI_H_
35 
36 #define LEN_16KB (16*1024)
37 #define LEN_64KB (64 * 1024)
38 #define LEN_128KB (128*1024)
39 #define LEN_256KB (256*1024)
40 #define LEN_512KB (512*1024)
41 #define LEN_1MB (1024*1024)
42 #define LEN_1_5MB (LEN_1MB + LEN_512KB)
43 #define LEN_2MB (2*LEN_1MB)
44 #define LEN_2_5MB (LEN_2MB + LEN_512KB)
45 
46 #define UFI_SIGNATURE_STR "ServerEngines Corporation"
47 
48 typedef struct ufi_file_header {
49  uint8_t signature[52]; // ServerEngines Corp. x.y.aaaa.bb
50  uint32_t ufi_version;
51  uint32_t file_len; //Header bytes + Binary Flash Image bytes. Not dword aligned.
52  uint32_t checksum;
53  uint32_t antidote;
54  uint32_t numOfImgs;
55  uint8_t build_version[24]; // Format 3.x.y.z
56  uint8_t asic_support;
57  uint8_t rsvd[31];
59 
60 #define FLASH_DIRECTORY_ENTRY_VERSION_SIZE 32
61 typedef struct flash_directory_entry
62 {
63  uint32_t entryType;
64  uint32_t offset;
65  uint32_t maxSize;
66  uint32_t imageSize;
67  uint32_t checkSum;
68  uint32_t entryPoint;
69  uint16_t opType;
70  uint16_t futureUse1;
71  uint32_t futureUse2;
73 
75 
76 #define NUM_FLASHDIR_ENTRIES 32 // Number of directory entries in a UFI Flash Directory
77 
78 typedef struct ufi_flash_directory
79 {
80  uint8_t signature[32]; // *** SE FLAS H DIRECTORY ***
81  uint32_t formatRevNumber;
82  uint32_t unused_0;
83  uint32_t unused_1;
84  uint32_t numImages;
85  uint8_t UFI_ID_string[128]; // Not used.
86  uint32_t reserved0;
87  uint32_t reserved1;
88  uint32_t reserved2;
89  uint32_t reserved3;
92 
93 
94 /*
95  * UFI Image Header
96  */
97 
98 typedef struct ufi_image_header {
99  uint32_t imageId;
100  uint32_t imageOffset;
101  uint32_t imageLength;
102  uint32_t imageChecksum;
103 #define FW_VER_LEN 32
104  uint8_t imageVer[FW_VER_LEN];
106 
107 #define UFI_FILE_HEADER_LENGTH 0xB0
108 
109 #endif /* ELXU_UFI_H_ */
#define NUM_FLASHDIR_ENTRIES
Definition: elxu_ufi.h:76
uint32_t checkSum
Definition: elxu_ufi.h:67
Definition: elxu_ufi.h:61
uint32_t maxSize
Definition: elxu_ufi.h:65
uint32_t reserved1
Definition: elxu_ufi.h:87
uint32_t reserved0
Definition: elxu_ufi.h:86
uint16_t opType
Definition: elxu_ufi.h:69
uint32_t imageLength
Definition: elxu_ufi.h:101
#define FLASH_DIRECTORY_ENTRY_VERSION_SIZE
Definition: elxu_ufi.h:60
uint32_t ufi_version
Definition: elxu_ufi.h:50
uint32_t checksum
Definition: elxu_ufi.h:52
uint32_t imageChecksum
Definition: elxu_ufi.h:102
uint32_t unused_0
Definition: elxu_ufi.h:82
uint32_t file_len
Definition: elxu_ufi.h:51
uint32_t numImages
Definition: elxu_ufi.h:84
uint32_t formatRevNumber
Definition: elxu_ufi.h:81
uint32_t entryType
Definition: elxu_ufi.h:63
uint32_t offset
Definition: elxu_ufi.h:64
uint32_t imageId
Definition: elxu_ufi.h:99
uint32_t futureUse2
Definition: elxu_ufi.h:71
uint32_t unused_1
Definition: elxu_ufi.h:83
#define FW_VER_LEN
Definition: elxu_ufi.h:103
uint32_t imageSize
Definition: elxu_ufi.h:66
uint32_t reserved3
Definition: elxu_ufi.h:89
uint8_t asic_support
Definition: elxu_ufi.h:56
uint16_t futureUse1
Definition: elxu_ufi.h:70
uint32_t imageOffset
Definition: elxu_ufi.h:100
uint32_t entryPoint
Definition: elxu_ufi.h:68
uint32_t antidote
Definition: elxu_ufi.h:53
uint32_t reserved2
Definition: elxu_ufi.h:88
uint32_t numOfImgs
Definition: elxu_ufi.h:54