blob: 62a1cbab603f452427dce3f752ddd049ddc6a15d [file] [log] [blame]
Brice Goglin0da34b62006-05-23 06:10:15 -04001#ifndef __MYRI10GE_MCP_GEN_HEADER_H__
2#define __MYRI10GE_MCP_GEN_HEADER_H__
3
Brice Goglin0da34b62006-05-23 06:10:15 -04004
5#define MCP_HEADER_PTR_OFFSET 0x3c
6
7#define MCP_TYPE_MX 0x4d582020 /* "MX " */
8#define MCP_TYPE_PCIE 0x70636965 /* "PCIE" pcie-only MCP */
9#define MCP_TYPE_ETH 0x45544820 /* "ETH " */
10#define MCP_TYPE_MCP0 0x4d435030 /* "MCP0" */
Brice Goglin0f7229d2008-05-09 02:16:19 +020011#define MCP_TYPE_DFLT 0x20202020 /* " " */
Brice Goglin7f649262009-03-24 16:32:13 -070012#define MCP_TYPE_ETHZ 0x4554485a /* "ETHZ" */
Brice Goglin0da34b62006-05-23 06:10:15 -040013
14struct mcp_gen_header {
15 /* the first 4 fields are filled at compile time */
16 unsigned header_length;
Al Viro40f6cff2006-11-20 13:48:32 -050017 __be32 mcp_type;
Brice Goglin0da34b62006-05-23 06:10:15 -040018 char version[128];
Brice Goglin0f7229d2008-05-09 02:16:19 +020019 unsigned mcp_private; /* pointer to mcp-type specific structure */
Brice Goglin0da34b62006-05-23 06:10:15 -040020
21 /* filled by the MCP at run-time */
22 unsigned sram_size;
23 unsigned string_specs; /* either the original STRING_SPECS or a superset */
24 unsigned string_specs_len;
25
26 /* Fields above this comment are guaranteed to be present.
Jeff Garzik6ed14252006-05-24 00:28:37 -040027 *
Brice Goglin0da34b62006-05-23 06:10:15 -040028 * Fields below this comment are extensions added in later versions
29 * of this struct, drivers should compare the header_length against
30 * offsetof(field) to check wether a given MCP implements them.
Jeff Garzik6ed14252006-05-24 00:28:37 -040031 *
Brice Goglin0da34b62006-05-23 06:10:15 -040032 * Never remove any field. Keep everything naturally align.
33 */
Brice Goglin0f7229d2008-05-09 02:16:19 +020034
35 /* Specifies if the running mcp is mcp0, 1, or 2. */
36 unsigned char mcp_index;
37 unsigned char disable_rabbit;
38 unsigned char unaligned_tlp;
Brice Goglin6a4c4ad2008-08-06 16:14:43 +020039 unsigned char pcie_link_algo;
Brice Goglin0f7229d2008-05-09 02:16:19 +020040 unsigned counters_addr;
41 unsigned copy_block_info; /* for small mcps loaded with "lload -d" */
42 unsigned short handoff_id_major; /* must be equal */
43 unsigned short handoff_id_caps; /* bitfield: new mcp must have superset */
44 unsigned msix_table_addr; /* start address of msix table in firmware */
Brice Goglin2c62ad72008-11-23 15:49:54 -080045 unsigned bss_addr; /* start of bss */
Brice Gogline92df282008-12-25 18:08:59 -080046 unsigned features;
Brice Goglin7f649262009-03-24 16:32:13 -070047 unsigned ee_hdr_addr;
Brice Goglin0f7229d2008-05-09 02:16:19 +020048 /* 8 */
Brice Goglin0da34b62006-05-23 06:10:15 -040049};
50
Brice Goglin7f649262009-03-24 16:32:13 -070051struct zmcp_info {
52 unsigned info_len;
53 unsigned zmcp_addr;
54 unsigned zmcp_len;
55 unsigned mcp_edata;
56};
57
Brice Goglin0da34b62006-05-23 06:10:15 -040058#endif /* __MYRI10GE_MCP_GEN_HEADER_H__ */