blob: a8662ea8079a6fdebc44a28d9b22ee5702e7c578 [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 Goglin0da34b62006-05-23 06:10:15 -040012
13struct mcp_gen_header {
14 /* the first 4 fields are filled at compile time */
15 unsigned header_length;
Al Viro40f6cff2006-11-20 13:48:32 -050016 __be32 mcp_type;
Brice Goglin0da34b62006-05-23 06:10:15 -040017 char version[128];
Brice Goglin0f7229d2008-05-09 02:16:19 +020018 unsigned mcp_private; /* pointer to mcp-type specific structure */
Brice Goglin0da34b62006-05-23 06:10:15 -040019
20 /* filled by the MCP at run-time */
21 unsigned sram_size;
22 unsigned string_specs; /* either the original STRING_SPECS or a superset */
23 unsigned string_specs_len;
24
25 /* Fields above this comment are guaranteed to be present.
Jeff Garzik6ed14252006-05-24 00:28:37 -040026 *
Brice Goglin0da34b62006-05-23 06:10:15 -040027 * Fields below this comment are extensions added in later versions
28 * of this struct, drivers should compare the header_length against
29 * offsetof(field) to check wether a given MCP implements them.
Jeff Garzik6ed14252006-05-24 00:28:37 -040030 *
Brice Goglin0da34b62006-05-23 06:10:15 -040031 * Never remove any field. Keep everything naturally align.
32 */
Brice Goglin0f7229d2008-05-09 02:16:19 +020033
34 /* Specifies if the running mcp is mcp0, 1, or 2. */
35 unsigned char mcp_index;
36 unsigned char disable_rabbit;
37 unsigned char unaligned_tlp;
Brice Goglin6a4c4ad2008-08-06 16:14:43 +020038 unsigned char pcie_link_algo;
Brice Goglin0f7229d2008-05-09 02:16:19 +020039 unsigned counters_addr;
40 unsigned copy_block_info; /* for small mcps loaded with "lload -d" */
41 unsigned short handoff_id_major; /* must be equal */
42 unsigned short handoff_id_caps; /* bitfield: new mcp must have superset */
43 unsigned msix_table_addr; /* start address of msix table in firmware */
44 /* 8 */
Brice Goglin0da34b62006-05-23 06:10:15 -040045};
46
47#endif /* __MYRI10GE_MCP_GEN_HEADER_H__ */