xref: /linux/drivers/net/ethernet/broadcom/bnxt/bnxt_fw_hdr.h (revision da1d9caf95def6f0320819cf941c9fd1069ba9e1)
1 /* Broadcom NetXtreme-C/E network driver.
2  *
3  * Copyright (c) 2014-2016 Broadcom Corporation
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation.
8  */
9 
10 #ifndef __BNXT_FW_HDR_H__
11 #define __BNXT_FW_HDR_H__
12 
13 #define BNXT_FIRMWARE_BIN_SIGNATURE     0x1a4d4342	/* "BCM"+0x1a */
14 #define BNXT_UCODE_TRAILER_SIGNATURE	0x726c7254	/* "Trlr" */
15 
16 enum SUPPORTED_FAMILY {
17 	DEVICE_5702_3_4_FAMILY,		/* 0  - Denali, Vinson, K2 */
18 	DEVICE_5705_FAMILY,		/* 1  - Bachelor */
19 	DEVICE_SHASTA_FAMILY,		/* 2  - 5751 */
20 	DEVICE_5706_FAMILY,		/* 3  - Teton */
21 	DEVICE_5714_FAMILY,		/* 4  - Hamilton */
22 	DEVICE_STANFORD_FAMILY,		/* 5  - 5755 */
23 	DEVICE_STANFORD_ME_FAMILY,	/* 6  - 5756 */
24 	DEVICE_SOLEDAD_FAMILY,		/* 7  - 5761[E] */
25 	DEVICE_CILAI_FAMILY,		/* 8  - 57780/60/90/91 */
26 	DEVICE_ASPEN_FAMILY,		/* 9  - 57781/85/61/65/91/95 */
27 	DEVICE_ASPEN_PLUS_FAMILY,	/* 10 - 57786 */
28 	DEVICE_LOGAN_FAMILY,		/* 11 - Any device in the Logan family
29 					 */
30 	DEVICE_LOGAN_5762,		/* 12 - Logan Enterprise (aka Columbia)
31 					 */
32 	DEVICE_LOGAN_57767,		/* 13 - Logan Client */
33 	DEVICE_LOGAN_57787,		/* 14 - Logan Consumer */
34 	DEVICE_LOGAN_5725,		/* 15 - Logan Server (TruManage-enabled)
35 					 */
36 	DEVICE_SAWTOOTH_FAMILY,		/* 16 - 5717/18 */
37 	DEVICE_COTOPAXI_FAMILY,		/* 17 - 5719 */
38 	DEVICE_SNAGGLETOOTH_FAMILY,	/* 18 - 5720 */
39 	DEVICE_CUMULUS_FAMILY,		/* 19 - Cumulus/Whitney */
40 	MAX_DEVICE_FAMILY
41 };
42 
43 enum SUPPORTED_CODE {
44 	CODE_ASF1,		/* 0  - ASF VERSION 1.03 <deprecated> */
45 	CODE_ASF2,		/* 1  - ASF VERSION 2.00 <deprecated> */
46 	CODE_PASSTHRU,		/* 2  - PassThru         <deprecated> */
47 	CODE_PT_SEC,		/* 3  - PassThru with security <deprecated> */
48 	CODE_UMP,		/* 4  - UMP                     <deprecated> */
49 	CODE_BOOT,		/* 5  - Bootcode */
50 	CODE_DASH,		/* 6  - TruManage (DASH + ASF + PMCI)
51 				 *	Management firmwares
52 				 */
53 	CODE_MCTP_PASSTHRU,	/* 7  - NCSI / MCTP Passt-hrough firmware */
54 	CODE_PM_OFFLOAD,	/* 8  - Power-Management Proxy Offload firmwares
55 				 */
56 	CODE_MDNS_SD_OFFLOAD,	/* 9  - Multicast DNS Service Discovery Proxys
57 				 *	Offload firmware
58 				 */
59 	CODE_DISC_OFFLOAD,	/* 10 - Discovery Offload firmware */
60 	CODE_MUSTANG,		/* 11 - I2C Error reporting APE firmwares
61 				 *	<deprecated>
62 				 */
63 	CODE_ARP_BATCH,		/* 12 - ARP Batch firmware */
64 	CODE_SMASH,		/* 13 - TruManage (SMASH + DCMI/IPMI + PMCI)
65 				 *	Management firmware
66 				 */
67 	CODE_APE_DIAG,		/* 14 - APE Test Diag firmware */
68 	CODE_APE_PATCH,		/* 15 - APE Patch firmware */
69 	CODE_TANG_PATCH,	/* 16 - TANG Patch firmware */
70 	CODE_KONG_FW,		/* 17 - KONG firmware */
71 	CODE_KONG_PATCH,	/* 18 - KONG Patch firmware */
72 	CODE_BONO_FW,		/* 19 - BONO firmware */
73 	CODE_BONO_PATCH,	/* 20 - BONO Patch firmware */
74 	CODE_CHIMP_PATCH,	/* 21 - ChiMP Patch firmware */
75 
76 	MAX_CODE_TYPE,
77 };
78 
79 enum SUPPORTED_MEDIA {
80 	MEDIA_COPPER,		/* 0 */
81 	MEDIA_FIBER,		/* 1 */
82 	MEDIA_NONE,		/* 2 */
83 	MEDIA_COPPER_FIBER,	/* 3 */
84 	MAX_MEDIA_TYPE,
85 };
86 
87 struct bnxt_fw_header {
88 	__le32 signature;	/* constains the constant value of
89 				 * BNXT_FIRMWARE_BIN_SIGNATURE
90 				 */
91 	u8 flags;		/* reserved for ChiMP use */
92 	u8 code_type;		/* enum SUPPORTED_CODE */
93 	u8 device;		/* enum SUPPORTED_FAMILY */
94 	u8 media;		/* enum SUPPORTED_MEDIA */
95 	u8 version[16];		/* the null terminated version string to
96 				 * indicate the version of the
97 				 * file, this will be copied from the binary
98 				 * file version string
99 				 */
100 	u8 build;
101 	u8 revision;
102 	u8 minor_ver;
103 	u8 major_ver;
104 };
105 
106 /* Microcode and pre-boot software/firmware trailer: */
107 struct bnxt_ucode_trailer {
108 	u8 rsa_sig[256];
109 	__le16 flags;
110 	u8 version_format;
111 	u8 version_length;
112 	u8 version[16];
113 	__le16 dir_type;
114 	__le16 trailer_length;
115 	__le32 sig;		/* BNXT_UCODE_TRAILER_SIGNATURE */
116 	__le32 chksum;		/* CRC-32 */
117 };
118 
119 #endif
120