aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
diff options
context:
space:
mode:
authorVipul Pandya <vipul@chelsio.com>2012-09-25 22:39:39 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-27 17:55:50 -0400
commit636f9d371f70f22961fd598fe18380057518ca31 (patch)
tree27d411e800f6ba779be7c07b803ab55393791338 /drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
parent52367a763d8046190754ab43743e42638564a2d1 (diff)
cxgb4: Add support for T4 configuration file
Starting with T4 firmware version 1.3.11.0 the firmware now supports device configuration via a Firmware Configuration File. The Firmware Configuration File was primarily developed in order to centralize all of the configuration, resource allocation, etc. for Unified Wire operation where multiple Physical / Virtual Function Drivers would be using a T4 adapter simultaneously. The Firmware Configuration file can live in three locations as shown below in order of precedence. 1) User defined configuration file: /lib/firmware/cxgb4/t4-config.txt 2) Factory Default configuration file written to FLASH within the manufacturing process. 3) Hardwired driver configuration. Signed-off-by: Jay Hernandez <jay@chelsio.com> Signed-off-by: Vipul Pandya <vipul@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h37
1 files changed, 22 insertions, 15 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h b/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
index 94e3484b7d93..3f85019106fa 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
@@ -155,6 +155,17 @@ struct fw_eth_tx_pkt_vm_wr {
155 155
156#define FW_CMD_MAX_TIMEOUT 3000 156#define FW_CMD_MAX_TIMEOUT 3000
157 157
158/*
159 * If a host driver does a HELLO and discovers that there's already a MASTER
160 * selected, we may have to wait for that MASTER to finish issuing RESET,
161 * configuration and INITIALIZE commands. Also, there's a possibility that
162 * our own HELLO may get lost if it happens right as the MASTER is issuign a
163 * RESET command, so we need to be willing to make a few retries of our HELLO.
164 */
165#define FW_CMD_HELLO_TIMEOUT (3 * FW_CMD_MAX_TIMEOUT)
166#define FW_CMD_HELLO_RETRIES 3
167
168
158enum fw_cmd_opcodes { 169enum fw_cmd_opcodes {
159 FW_LDST_CMD = 0x01, 170 FW_LDST_CMD = 0x01,
160 FW_RESET_CMD = 0x03, 171 FW_RESET_CMD = 0x03,
@@ -307,6 +318,10 @@ struct fw_reset_cmd {
307 __be32 r3; 318 __be32 r3;
308}; 319};
309 320
321enum fw_hellow_cmd {
322 fw_hello_cmd_stage_os = 0x0
323};
324
310struct fw_hello_cmd { 325struct fw_hello_cmd {
311 __be32 op_to_write; 326 __be32 op_to_write;
312 __be32 retval_len16; 327 __be32 retval_len16;
@@ -315,8 +330,14 @@ struct fw_hello_cmd {
315#define FW_HELLO_CMD_INIT (1U << 30) 330#define FW_HELLO_CMD_INIT (1U << 30)
316#define FW_HELLO_CMD_MASTERDIS(x) ((x) << 29) 331#define FW_HELLO_CMD_MASTERDIS(x) ((x) << 29)
317#define FW_HELLO_CMD_MASTERFORCE(x) ((x) << 28) 332#define FW_HELLO_CMD_MASTERFORCE(x) ((x) << 28)
318#define FW_HELLO_CMD_MBMASTER(x) ((x) << 24) 333#define FW_HELLO_CMD_MBMASTER_MASK 0xfU
334#define FW_HELLO_CMD_MBMASTER_SHIFT 24
335#define FW_HELLO_CMD_MBMASTER(x) ((x) << FW_HELLO_CMD_MBMASTER_SHIFT)
336#define FW_HELLO_CMD_MBMASTER_GET(x) \
337 (((x) >> FW_HELLO_CMD_MBMASTER_SHIFT) & FW_HELLO_CMD_MBMASTER_MASK)
319#define FW_HELLO_CMD_MBASYNCNOT(x) ((x) << 20) 338#define FW_HELLO_CMD_MBASYNCNOT(x) ((x) << 20)
339#define FW_HELLO_CMD_STAGE(x) ((x) << 17)
340#define FW_HELLO_CMD_CLEARINIT (1U << 16)
320 __be32 fwrev; 341 __be32 fwrev;
321}; 342};
322 343
@@ -1654,18 +1675,4 @@ struct fw_hdr {
1654#define FW_HDR_FW_VER_MICRO_GET(x) (((x) >> 8) & 0xff) 1675#define FW_HDR_FW_VER_MICRO_GET(x) (((x) >> 8) & 0xff)
1655#define FW_HDR_FW_VER_BUILD_GET(x) (((x) >> 0) & 0xff) 1676#define FW_HDR_FW_VER_BUILD_GET(x) (((x) >> 0) & 0xff)
1656 1677
1657#define S_FW_CMD_OP 24
1658#define V_FW_CMD_OP(x) ((x) << S_FW_CMD_OP)
1659
1660#define S_FW_CMD_REQUEST 23
1661#define V_FW_CMD_REQUEST(x) ((x) << S_FW_CMD_REQUEST)
1662#define F_FW_CMD_REQUEST V_FW_CMD_REQUEST(1U)
1663
1664#define S_FW_CMD_WRITE 21
1665#define V_FW_CMD_WRITE(x) ((x) << S_FW_CMD_WRITE)
1666#define F_FW_CMD_WRITE V_FW_CMD_WRITE(1U)
1667
1668#define S_FW_LDST_CMD_ADDRSPACE 0
1669#define V_FW_LDST_CMD_ADDRSPACE(x) ((x) << S_FW_LDST_CMD_ADDRSPACE)
1670
1671#endif /* _T4FW_INTERFACE_H_ */ 1678#endif /* _T4FW_INTERFACE_H_ */