Brice Goglin | 0da34b6 | 2006-05-23 06:10:15 -0400 | [diff] [blame] | 1 | #ifndef __MYRI10GE_MCP_GEN_HEADER_H__ |
| 2 | #define __MYRI10GE_MCP_GEN_HEADER_H__ |
| 3 | |
Brice Goglin | 0da34b6 | 2006-05-23 06:10:15 -0400 | [diff] [blame] | 4 | |
| 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 Goglin | 0f7229d | 2008-05-09 02:16:19 +0200 | [diff] [blame] | 11 | #define MCP_TYPE_DFLT 0x20202020 /* " " */ |
Brice Goglin | 7f64926 | 2009-03-24 16:32:13 -0700 | [diff] [blame] | 12 | #define MCP_TYPE_ETHZ 0x4554485a /* "ETHZ" */ |
Brice Goglin | 0da34b6 | 2006-05-23 06:10:15 -0400 | [diff] [blame] | 13 | |
| 14 | struct mcp_gen_header { |
| 15 | /* the first 4 fields are filled at compile time */ |
| 16 | unsigned header_length; |
Al Viro | 40f6cff | 2006-11-20 13:48:32 -0500 | [diff] [blame] | 17 | __be32 mcp_type; |
Brice Goglin | 0da34b6 | 2006-05-23 06:10:15 -0400 | [diff] [blame] | 18 | char version[128]; |
Brice Goglin | 0f7229d | 2008-05-09 02:16:19 +0200 | [diff] [blame] | 19 | unsigned mcp_private; /* pointer to mcp-type specific structure */ |
Brice Goglin | 0da34b6 | 2006-05-23 06:10:15 -0400 | [diff] [blame] | 20 | |
| 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 Garzik | 6ed1425 | 2006-05-24 00:28:37 -0400 | [diff] [blame] | 27 | * |
Brice Goglin | 0da34b6 | 2006-05-23 06:10:15 -0400 | [diff] [blame] | 28 | * 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 Garzik | 6ed1425 | 2006-05-24 00:28:37 -0400 | [diff] [blame] | 31 | * |
Brice Goglin | 0da34b6 | 2006-05-23 06:10:15 -0400 | [diff] [blame] | 32 | * Never remove any field. Keep everything naturally align. |
| 33 | */ |
Brice Goglin | 0f7229d | 2008-05-09 02:16:19 +0200 | [diff] [blame] | 34 | |
| 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 Goglin | 6a4c4ad | 2008-08-06 16:14:43 +0200 | [diff] [blame] | 39 | unsigned char pcie_link_algo; |
Brice Goglin | 0f7229d | 2008-05-09 02:16:19 +0200 | [diff] [blame] | 40 | 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 Goglin | 2c62ad7 | 2008-11-23 15:49:54 -0800 | [diff] [blame] | 45 | unsigned bss_addr; /* start of bss */ |
Brice Goglin | e92df28 | 2008-12-25 18:08:59 -0800 | [diff] [blame] | 46 | unsigned features; |
Brice Goglin | 7f64926 | 2009-03-24 16:32:13 -0700 | [diff] [blame] | 47 | unsigned ee_hdr_addr; |
Brice Goglin | 0f7229d | 2008-05-09 02:16:19 +0200 | [diff] [blame] | 48 | /* 8 */ |
Brice Goglin | 0da34b6 | 2006-05-23 06:10:15 -0400 | [diff] [blame] | 49 | }; |
| 50 | |
Brice Goglin | 7f64926 | 2009-03-24 16:32:13 -0700 | [diff] [blame] | 51 | struct zmcp_info { |
| 52 | unsigned info_len; |
| 53 | unsigned zmcp_addr; |
| 54 | unsigned zmcp_len; |
| 55 | unsigned mcp_edata; |
| 56 | }; |
| 57 | |
Brice Goglin | 0da34b6 | 2006-05-23 06:10:15 -0400 | [diff] [blame] | 58 | #endif /* __MYRI10GE_MCP_GEN_HEADER_H__ */ |