diff options
author | Vladislav Zolotarov <vladz@broadcom.com> | 2009-04-27 06:27:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-27 06:27:43 -0400 |
commit | 94a78b79cb5f14c09a42522738d6694c6a1cdd20 (patch) | |
tree | 17bb6b92c16c91db0398baafa04996c958a8d494 /drivers/net/bnx2x_fw_file_hdr.h | |
parent | ec9323f417e803f07a99a15a9cfb207662ad2c55 (diff) |
bnx2x: Separated FW from the source.
>From now on FW will be downloaded from the binary file using request_firmware.
There will be different files for every supported chip. Currently 57710 (e1) and
57711 (e1h).
File names have the following format: bnx2x-<chip version>-<FW version>.fw.
ihex versions of current FW files are submitted in the next patch.
Each binary file has a header in the following format:
struct bnx2x_fw_file_section {
__be32 len;
__be32 offset;
}
struct bnx2x_fw_file_hdr {
struct bnx2x_fw_file_section init_ops;
struct bnx2x_fw_file_section init_ops_offsets;
struct bnx2x_fw_file_section init_data;
struct bnx2x_fw_file_section tsem_int_table_data;
struct bnx2x_fw_file_section tsem_pram_data;
struct bnx2x_fw_file_section usem_int_table_data;
struct bnx2x_fw_file_section usem_pram_data;
struct bnx2x_fw_file_section csem_int_table_data;
struct bnx2x_fw_file_section csem_pram_data;
struct bnx2x_fw_file_section xsem_int_table_data;
struct bnx2x_fw_file_section xsem_pram_data;
struct bnx2x_fw_file_section fw_version;
}
Each bnx2x_fw_file_section contains the length and the offset of the appropriate
section in the binary file. Values are stored in the big endian format.
Data types of arrays:
init_data __be32
init_ops_offsets __be16
XXsem_pram_data u8
XXsem_int_table_data u8
init_ops struct raw_op {
u8 op;
__be24 offset;
__be32 data;
}
fw_version u8
>From now boundaries of a specific initialization stage are stored in
init_ops_offsets array instead of being defined by separate macroes. The index
in init_ops_offsets is calculated by BLOCK_OPS_IDX macro:
#define BLOCK_OPS_IDX(block, stage, end) \
(2*(((block)*STAGE_IDX_MAX) + (stage)) + (end))
Security:
In addition to sanity check of array boundaries bnx2x will check a FW version.
Additional checks might be added in the future.
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x_fw_file_hdr.h')
-rw-r--r-- | drivers/net/bnx2x_fw_file_hdr.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/drivers/net/bnx2x_fw_file_hdr.h b/drivers/net/bnx2x_fw_file_hdr.h new file mode 100644 index 000000000000..3f5ee5d7cc2a --- /dev/null +++ b/drivers/net/bnx2x_fw_file_hdr.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* bnx2x_fw_file_hdr.h: FW binary file header structure. | ||
2 | * | ||
3 | * Copyright (c) 2007-2009 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 | * Maintained by: Eilon Greenstein <eilong@broadcom.com> | ||
10 | * Written by: Vladislav Zolotarov <vladz@broadcom.com> | ||
11 | * Based on the original idea of John Wright <john.wright@hp.com>. | ||
12 | */ | ||
13 | |||
14 | #ifndef BNX2X_INIT_FILE_HDR_H | ||
15 | #define BNX2X_INIT_FILE_HDR_H | ||
16 | |||
17 | struct bnx2x_fw_file_section { | ||
18 | __be32 len; | ||
19 | __be32 offset; | ||
20 | }; | ||
21 | |||
22 | struct bnx2x_fw_file_hdr { | ||
23 | struct bnx2x_fw_file_section init_ops; | ||
24 | struct bnx2x_fw_file_section init_ops_offsets; | ||
25 | struct bnx2x_fw_file_section init_data; | ||
26 | struct bnx2x_fw_file_section tsem_int_table_data; | ||
27 | struct bnx2x_fw_file_section tsem_pram_data; | ||
28 | struct bnx2x_fw_file_section usem_int_table_data; | ||
29 | struct bnx2x_fw_file_section usem_pram_data; | ||
30 | struct bnx2x_fw_file_section csem_int_table_data; | ||
31 | struct bnx2x_fw_file_section csem_pram_data; | ||
32 | struct bnx2x_fw_file_section xsem_int_table_data; | ||
33 | struct bnx2x_fw_file_section xsem_pram_data; | ||
34 | struct bnx2x_fw_file_section fw_version; | ||
35 | }; | ||
36 | |||
37 | #endif /* BNX2X_INIT_FILE_HDR_H */ | ||