diff options
author | Ajit Khaparde <ajitkhaparde@gmail.com> | 2010-02-08 20:30:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-12 15:27:57 -0500 |
commit | 3f0d4560aedaa67546eaeb3dc75fcdf68ec21036 (patch) | |
tree | 419489b855a61a6f4a347ff143a4576305a84d39 /drivers/net/benet/be_hw.h | |
parent | e254f6ecaeb4e7c0588e739bf4641df0e8c22bba (diff) |
be2net: bug fix for flashing the BladeEngine3 ASIC
Now flashing both BE2 and BE3 devices is supported.
From: Naresh G <nareshg@serverengines.com>
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_hw.h')
-rw-r--r-- | drivers/net/benet/be_hw.h | 119 |
1 files changed, 83 insertions, 36 deletions
diff --git a/drivers/net/benet/be_hw.h b/drivers/net/benet/be_hw.h index e2b3beffd49d..bb2ae6f924db 100644 --- a/drivers/net/benet/be_hw.h +++ b/drivers/net/benet/be_hw.h | |||
@@ -99,6 +99,63 @@ | |||
99 | /* Number of entries posted */ | 99 | /* Number of entries posted */ |
100 | #define DB_MCCQ_NUM_POSTED_SHIFT (16) /* bits 16 - 29 */ | 100 | #define DB_MCCQ_NUM_POSTED_SHIFT (16) /* bits 16 - 29 */ |
101 | 101 | ||
102 | /* Flashrom related descriptors */ | ||
103 | #define IMAGE_TYPE_FIRMWARE 160 | ||
104 | #define IMAGE_TYPE_BOOTCODE 224 | ||
105 | #define IMAGE_TYPE_OPTIONROM 32 | ||
106 | |||
107 | #define NUM_FLASHDIR_ENTRIES 32 | ||
108 | |||
109 | #define IMG_TYPE_ISCSI_ACTIVE 0 | ||
110 | #define IMG_TYPE_REDBOOT 1 | ||
111 | #define IMG_TYPE_BIOS 2 | ||
112 | #define IMG_TYPE_PXE_BIOS 3 | ||
113 | #define IMG_TYPE_FCOE_BIOS 8 | ||
114 | #define IMG_TYPE_ISCSI_BACKUP 9 | ||
115 | #define IMG_TYPE_FCOE_FW_ACTIVE 10 | ||
116 | #define IMG_TYPE_FCOE_FW_BACKUP 11 | ||
117 | #define IMG_TYPE_NCSI_BITFILE 13 | ||
118 | #define IMG_TYPE_NCSI_8051 14 | ||
119 | |||
120 | #define FLASHROM_OPER_FLASH 1 | ||
121 | #define FLASHROM_OPER_SAVE 2 | ||
122 | #define FLASHROM_OPER_REPORT 4 | ||
123 | |||
124 | #define FLASH_IMAGE_MAX_SIZE_g2 (1310720) /* Max firmware image sz */ | ||
125 | #define FLASH_BIOS_IMAGE_MAX_SIZE_g2 (262144) /* Max OPTION ROM img sz */ | ||
126 | #define FLASH_REDBOOT_IMAGE_MAX_SIZE_g2 (262144) /* Max Redboot image sz */ | ||
127 | #define FLASH_IMAGE_MAX_SIZE_g3 (2097152) /* Max fw image size */ | ||
128 | #define FLASH_BIOS_IMAGE_MAX_SIZE_g3 (524288) /* Max OPTION ROM img sz */ | ||
129 | #define FLASH_REDBOOT_IMAGE_MAX_SIZE_g3 (1048576) /* Max Redboot image sz */ | ||
130 | |||
131 | #define FLASH_NCSI_MAGIC (0x16032009) | ||
132 | #define FLASH_NCSI_DISABLED (0) | ||
133 | #define FLASH_NCSI_ENABLED (1) | ||
134 | |||
135 | #define FLASH_NCSI_BITFILE_HDR_OFFSET (0x600000) | ||
136 | |||
137 | /* Offsets for components on Flash. */ | ||
138 | #define FLASH_iSCSI_PRIMARY_IMAGE_START_g2 (1048576) | ||
139 | #define FLASH_iSCSI_BACKUP_IMAGE_START_g2 (2359296) | ||
140 | #define FLASH_FCoE_PRIMARY_IMAGE_START_g2 (3670016) | ||
141 | #define FLASH_FCoE_BACKUP_IMAGE_START_g2 (4980736) | ||
142 | #define FLASH_iSCSI_BIOS_START_g2 (7340032) | ||
143 | #define FLASH_PXE_BIOS_START_g2 (7864320) | ||
144 | #define FLASH_FCoE_BIOS_START_g2 (524288) | ||
145 | #define FLASH_REDBOOT_START_g2 (0) | ||
146 | |||
147 | #define FLASH_iSCSI_PRIMARY_IMAGE_START_g3 (2097152) | ||
148 | #define FLASH_iSCSI_BACKUP_IMAGE_START_g3 (4194304) | ||
149 | #define FLASH_FCoE_PRIMARY_IMAGE_START_g3 (6291456) | ||
150 | #define FLASH_FCoE_BACKUP_IMAGE_START_g3 (8388608) | ||
151 | #define FLASH_iSCSI_BIOS_START_g3 (12582912) | ||
152 | #define FLASH_PXE_BIOS_START_g3 (13107200) | ||
153 | #define FLASH_FCoE_BIOS_START_g3 (13631488) | ||
154 | #define FLASH_REDBOOT_START_g3 (262144) | ||
155 | |||
156 | |||
157 | |||
158 | |||
102 | /* | 159 | /* |
103 | * BE descriptors: host memory data structures whose formats | 160 | * BE descriptors: host memory data structures whose formats |
104 | * are hardwired in BE silicon. | 161 | * are hardwired in BE silicon. |
@@ -107,6 +164,7 @@ | |||
107 | #define EQ_ENTRY_VALID_MASK 0x1 /* bit 0 */ | 164 | #define EQ_ENTRY_VALID_MASK 0x1 /* bit 0 */ |
108 | #define EQ_ENTRY_RES_ID_MASK 0xFFFF /* bits 16 - 31 */ | 165 | #define EQ_ENTRY_RES_ID_MASK 0xFFFF /* bits 16 - 31 */ |
109 | #define EQ_ENTRY_RES_ID_SHIFT 16 | 166 | #define EQ_ENTRY_RES_ID_SHIFT 16 |
167 | |||
110 | struct be_eq_entry { | 168 | struct be_eq_entry { |
111 | u32 evt; | 169 | u32 evt; |
112 | }; | 170 | }; |
@@ -221,41 +279,6 @@ struct be_eth_rx_compl { | |||
221 | u32 dw[4]; | 279 | u32 dw[4]; |
222 | }; | 280 | }; |
223 | 281 | ||
224 | /* Flashrom related descriptors */ | ||
225 | #define IMAGE_TYPE_FIRMWARE 160 | ||
226 | #define IMAGE_TYPE_BOOTCODE 224 | ||
227 | #define IMAGE_TYPE_OPTIONROM 32 | ||
228 | |||
229 | #define NUM_FLASHDIR_ENTRIES 32 | ||
230 | |||
231 | #define FLASHROM_TYPE_ISCSI_ACTIVE 0 | ||
232 | #define FLASHROM_TYPE_REDBOOT 1 | ||
233 | #define FLASHROM_TYPE_BIOS 2 | ||
234 | #define FLASHROM_TYPE_PXE_BIOS 3 | ||
235 | #define FLASHROM_TYPE_FCOE_BIOS 8 | ||
236 | #define FLASHROM_TYPE_ISCSI_BACKUP 9 | ||
237 | #define FLASHROM_TYPE_FCOE_FW_ACTIVE 10 | ||
238 | #define FLASHROM_TYPE_FCOE_FW_BACKUP 11 | ||
239 | |||
240 | #define FLASHROM_OPER_FLASH 1 | ||
241 | #define FLASHROM_OPER_SAVE 2 | ||
242 | #define FLASHROM_OPER_REPORT 4 | ||
243 | |||
244 | #define FLASH_IMAGE_MAX_SIZE (1310720) /* Max firmware image size */ | ||
245 | #define FLASH_BIOS_IMAGE_MAX_SIZE (262144) /* Max OPTION ROM image sz */ | ||
246 | #define FLASH_REDBOOT_IMAGE_MAX_SIZE (262144) /* Max redboot image sz */ | ||
247 | |||
248 | /* Offsets for components on Flash. */ | ||
249 | #define FLASH_iSCSI_PRIMARY_IMAGE_START (1048576) | ||
250 | #define FLASH_iSCSI_BACKUP_IMAGE_START (2359296) | ||
251 | #define FLASH_FCoE_PRIMARY_IMAGE_START (3670016) | ||
252 | #define FLASH_FCoE_BACKUP_IMAGE_START (4980736) | ||
253 | #define FLASH_iSCSI_BIOS_START (7340032) | ||
254 | #define FLASH_PXE_BIOS_START (7864320) | ||
255 | #define FLASH_FCoE_BIOS_START (524288) | ||
256 | #define FLASH_REDBOOT_START (32768) | ||
257 | #define FLASH_REDBOOT_ISM_START (0) | ||
258 | |||
259 | struct controller_id { | 282 | struct controller_id { |
260 | u32 vendor; | 283 | u32 vendor; |
261 | u32 device; | 284 | u32 device; |
@@ -263,7 +286,20 @@ struct controller_id { | |||
263 | u32 subdevice; | 286 | u32 subdevice; |
264 | }; | 287 | }; |
265 | 288 | ||
266 | struct flash_file_hdr { | 289 | struct flash_comp { |
290 | unsigned long offset; | ||
291 | int optype; | ||
292 | int size; | ||
293 | }; | ||
294 | |||
295 | struct image_hdr { | ||
296 | u32 imageid; | ||
297 | u32 imageoffset; | ||
298 | u32 imagelength; | ||
299 | u32 image_checksum; | ||
300 | u8 image_version[32]; | ||
301 | }; | ||
302 | struct flash_file_hdr_g2 { | ||
267 | u8 sign[32]; | 303 | u8 sign[32]; |
268 | u32 cksum; | 304 | u32 cksum; |
269 | u32 antidote; | 305 | u32 antidote; |
@@ -275,6 +311,17 @@ struct flash_file_hdr { | |||
275 | u8 build[24]; | 311 | u8 build[24]; |
276 | }; | 312 | }; |
277 | 313 | ||
314 | struct flash_file_hdr_g3 { | ||
315 | u8 sign[52]; | ||
316 | u8 ufi_version[4]; | ||
317 | u32 file_len; | ||
318 | u32 cksum; | ||
319 | u32 antidote; | ||
320 | u32 num_imgs; | ||
321 | u8 build[24]; | ||
322 | u8 rsvd[32]; | ||
323 | }; | ||
324 | |||
278 | struct flash_section_hdr { | 325 | struct flash_section_hdr { |
279 | u32 format_rev; | 326 | u32 format_rev; |
280 | u32 cksum; | 327 | u32 cksum; |