[go: nahoru, domu]

16b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/*
240263820b4488971c6623d938be663020d6e916dVasundhara Volam * Copyright (C) 2005 - 2014 Emulex
36b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * All rights reserved.
46b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla *
56b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * This program is free software; you can redistribute it and/or
66b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * modify it under the terms of the GNU General Public License version 2
76b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * as published by the Free Software Foundation.  The full GNU General
86b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * Public License is included in this distribution in the file called COPYING.
96b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla *
106b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * Contact Information:
11d2145cde58135dabe7c48a599de4b81c2fe3ea61Ajit Khaparde * linux-drivers@emulex.com
126b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla *
13d2145cde58135dabe7c48a599de4b81c2fe3ea61Ajit Khaparde * Emulex
14d2145cde58135dabe7c48a599de4b81c2fe3ea61Ajit Khaparde * 3333 Susan Street
15d2145cde58135dabe7c48a599de4b81c2fe3ea61Ajit Khaparde * Costa Mesa, CA 92626
166b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla */
176b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
186b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/********* Mailbox door bell *************/
196b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Used for driver communication with the FW.
206b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * The software must write this register twice to post any command. First,
216b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * it writes the register with hi=1 and the upper bits of the physical address
226b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * for the MAILBOX structure. Software must poll the ready bit until this
236b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * is acknowledged. Then, sotware writes the register with hi=0 with the lower
246b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * bits in the address. It must poll the ready bit until the command is
256b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * complete. Upon completion, the MAILBOX will contain a valid completion
266b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * queue entry.
276b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla */
286b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define MPU_MAILBOX_DB_OFFSET	0x160
296b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define MPU_MAILBOX_DB_RDY_MASK	0x1 	/* bit 0 */
306b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define MPU_MAILBOX_DB_HI_MASK	0x2	/* bit 1 */
316b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
326b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define MPU_EP_CONTROL 		0
336b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
341bc8e7e4f36c0c19dd7dea29e7c248b7c6ef3a15Sathya Perla/********** MPU semphore: used for SH & BE  *************/
35c5b3ad4c67989c778e4753be4f91dc7193a04d21Sathya Perla#define SLIPORT_SEMAPHORE_OFFSET_BEx		0xac  /* CSR BAR offset */
36c5b3ad4c67989c778e4753be4f91dc7193a04d21Sathya Perla#define SLIPORT_SEMAPHORE_OFFSET_SH		0x94  /* PCI-CFG offset */
371bc8e7e4f36c0c19dd7dea29e7c248b7c6ef3a15Sathya Perla#define POST_STAGE_MASK				0x0000FFFF
381bc8e7e4f36c0c19dd7dea29e7c248b7c6ef3a15Sathya Perla#define POST_ERR_MASK				0x1
391bc8e7e4f36c0c19dd7dea29e7c248b7c6ef3a15Sathya Perla#define POST_ERR_SHIFT				31
40fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla
416b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* MPU semphore POST stage values */
426b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define POST_STAGE_AWAITING_HOST_RDY 	0x1 /* FW awaiting goahead from host */
436b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define POST_STAGE_HOST_RDY 		0x2 /* Host has given go-ahed to FW */
446b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define POST_STAGE_BE_RESET		0x3 /* Host wants to reset chip */
456b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define POST_STAGE_ARMFW_RDY		0xc000	/* FW is done with POST */
466b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
4737eed1cbbd446dc2808e1bff717010aa978fc0dePadmanabh Ratnakar
48f67ef7bae8dd025086fdf8186958865bceb44595Padmanabh Ratnakar/* Lancer SLIPORT registers */
4937eed1cbbd446dc2808e1bff717010aa978fc0dePadmanabh Ratnakar#define SLIPORT_STATUS_OFFSET		0x404
5037eed1cbbd446dc2808e1bff717010aa978fc0dePadmanabh Ratnakar#define SLIPORT_CONTROL_OFFSET		0x408
51e1cfb67acd5e890bbad695000d2c997bfb7f1756Padmanabh Ratnakar#define SLIPORT_ERROR1_OFFSET		0x40C
52e1cfb67acd5e890bbad695000d2c997bfb7f1756Padmanabh Ratnakar#define SLIPORT_ERROR2_OFFSET		0x410
53f67ef7bae8dd025086fdf8186958865bceb44595Padmanabh Ratnakar#define PHYSDEV_CONTROL_OFFSET		0x414
5437eed1cbbd446dc2808e1bff717010aa978fc0dePadmanabh Ratnakar
5537eed1cbbd446dc2808e1bff717010aa978fc0dePadmanabh Ratnakar#define SLIPORT_STATUS_ERR_MASK		0x80000000
565c510811547f88522b00623417b97d9fba85a06bSomnath Kotur#define SLIPORT_STATUS_DIP_MASK		0x02000000
5737eed1cbbd446dc2808e1bff717010aa978fc0dePadmanabh Ratnakar#define SLIPORT_STATUS_RN_MASK		0x01000000
5837eed1cbbd446dc2808e1bff717010aa978fc0dePadmanabh Ratnakar#define SLIPORT_STATUS_RDY_MASK		0x00800000
5937eed1cbbd446dc2808e1bff717010aa978fc0dePadmanabh Ratnakar#define SLI_PORT_CONTROL_IP_MASK	0x08000000
60f67ef7bae8dd025086fdf8186958865bceb44595Padmanabh Ratnakar#define PHYSDEV_CONTROL_FW_RESET_MASK	0x00000002
615c510811547f88522b00623417b97d9fba85a06bSomnath Kotur#define PHYSDEV_CONTROL_DD_MASK		0x00000004
62f67ef7bae8dd025086fdf8186958865bceb44595Padmanabh Ratnakar#define PHYSDEV_CONTROL_INP_MASK	0x40000000
6337eed1cbbd446dc2808e1bff717010aa978fc0dePadmanabh Ratnakar
6467297ad8a61c88508ad86c6bda51c050cdc7f150Padmanabh Ratnakar#define SLIPORT_ERROR_NO_RESOURCE1	0x2
6567297ad8a61c88508ad86c6bda51c050cdc7f150Padmanabh Ratnakar#define SLIPORT_ERROR_NO_RESOURCE2	0x9
6667297ad8a61c88508ad86c6bda51c050cdc7f150Padmanabh Ratnakar
674bebb56a6d50ca50a34048194877dca34f572f8fSomnath Kotur#define SLIPORT_ERROR_FW_RESET1		0x2
684bebb56a6d50ca50a34048194877dca34f572f8fSomnath Kotur#define SLIPORT_ERROR_FW_RESET2		0x0
694bebb56a6d50ca50a34048194877dca34f572f8fSomnath Kotur
706b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/********* Memory BAR register ************/
716b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 	0xfc
726b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt
736b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * Disable" may still globally block interrupts in addition to individual
746b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * interrupt masks; a mechanism for the device driver to block all interrupts
756b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * atomically without having to arbitrate for the PCI Interrupt Disable bit
766b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * with the OS.
776b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla */
786b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK	(1 << 29) /* bit 29 */
796b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
8094d73aaa3fe42292a30eaad2ec011035ae25fa90Vasundhara Volam/********* PCI Function Capability *********/
8194d73aaa3fe42292a30eaad2ec011035ae25fa90Vasundhara Volam#define BE_FUNCTION_CAPS_RSS			0x2
8294d73aaa3fe42292a30eaad2ec011035ae25fa90Vasundhara Volam#define BE_FUNCTION_CAPS_SUPER_NIC		0x40
8394d73aaa3fe42292a30eaad2ec011035ae25fa90Vasundhara Volam
8465155b3708137fabee865dc4da822763c0c41208Uwe Kleine-König/********* Power management (WOL) **********/
8571d8d1b58aa4025ea73a66a130a98d0ed077f9b1Ajit Khaparde#define PCICFG_PM_CONTROL_OFFSET		0x44
8671d8d1b58aa4025ea73a66a130a98d0ed077f9b1Ajit Khaparde#define PCICFG_PM_CONTROL_MASK			0x108	/* bits 3 & 8 */
8771d8d1b58aa4025ea73a66a130a98d0ed077f9b1Ajit Khaparde
887c185276e8d820fa50a678c61abd611ee599920eAjit Khaparde/********* Online Control Registers *******/
897c185276e8d820fa50a678c61abd611ee599920eAjit Khaparde#define PCICFG_ONLINE0				0xB0
907c185276e8d820fa50a678c61abd611ee599920eAjit Khaparde#define PCICFG_ONLINE1				0xB4
917c185276e8d820fa50a678c61abd611ee599920eAjit Khaparde
927c185276e8d820fa50a678c61abd611ee599920eAjit Khaparde/********* UE Status and Mask Registers ***/
937c185276e8d820fa50a678c61abd611ee599920eAjit Khaparde#define PCICFG_UE_STATUS_LOW			0xA0
947c185276e8d820fa50a678c61abd611ee599920eAjit Khaparde#define PCICFG_UE_STATUS_HIGH			0xA4
957c185276e8d820fa50a678c61abd611ee599920eAjit Khaparde#define PCICFG_UE_STATUS_LOW_MASK		0xA8
967c185276e8d820fa50a678c61abd611ee599920eAjit Khaparde#define PCICFG_UE_STATUS_HI_MASK		0xAC
977c185276e8d820fa50a678c61abd611ee599920eAjit Khaparde
98fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla/******** SLI_INTF ***********************/
99fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_REG_OFFSET			0x58
100fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_VALID_MASK			0xE0000000
101fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_VALID				0xC0000000
102fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_HINT2_MASK			0x1F000000
103fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_HINT2_SHIFT			24
104fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_HINT1_MASK			0x00FF0000
105fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_HINT1_SHIFT			16
106fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_FAMILY_MASK			0x00000F00
107fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_FAMILY_SHIFT			8
108fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_IF_TYPE_MASK			0x0000F000
109fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_IF_TYPE_SHIFT			12
110fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_REV_MASK			0x000000F0
111fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_REV_SHIFT			4
112fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define SLI_INTF_FT_MASK			0x00000001
113fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla
114045508a8a36f9a82b63d1f6362bd323085638588Parav Pandit#define SLI_INTF_TYPE_2		2
115045508a8a36f9a82b63d1f6362bd323085638588Parav Pandit#define SLI_INTF_TYPE_3		3
116fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla
117c001c213b109c8baeeb6d012b422bf059b18368fSathya Perla/********* ISR0 Register offset **********/
118c001c213b109c8baeeb6d012b422bf059b18368fSathya Perla#define CEV_ISR0_OFFSET 			0xC18
119c001c213b109c8baeeb6d012b422bf059b18368fSathya Perla#define CEV_ISR_SIZE				4
120c001c213b109c8baeeb6d012b422bf059b18368fSathya Perla
1216b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/********* Event Q door bell *************/
1226b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_EQ_OFFSET			DB_CQ_OFFSET
1236b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_EQ_RING_ID_MASK		0x1FF	/* bits 0 - 8 */
124fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define DB_EQ_RING_ID_EXT_MASK		0x3e00  /* bits 9-13 */
125fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define DB_EQ_RING_ID_EXT_MASK_SHIFT	(2) /* qid bits 9-13 placing at 11-15 */
126fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla
1276b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Clear the interrupt for this eq */
1286b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_EQ_CLR_SHIFT			(9)	/* bit 9 */
1296b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Must be 1 */
1305fb379ee67a7ec55ff65b467b472f3d69b60ba16Sathya Perla#define DB_EQ_EVNT_SHIFT		(10)	/* bit 10 */
1316b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Number of event entries processed */
1326b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_EQ_NUM_POPPED_SHIFT		(16)	/* bits 16 - 28 */
1336b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Rearm bit */
1346b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_EQ_REARM_SHIFT		(29)	/* bit 29 */
1356b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
1366b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/********* Compl Q door bell *************/
1376b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_CQ_OFFSET 			0x120
1386b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_CQ_RING_ID_MASK		0x3FF	/* bits 0 - 9 */
139fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define DB_CQ_RING_ID_EXT_MASK		0x7C00	/* bits 10-14 */
140fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla#define DB_CQ_RING_ID_EXT_MASK_SHIFT	(1)	/* qid bits 10-14
141fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla						 placing at 11-15 */
142fe6d2a38b2076cba515dc95b5dc1589a7ab51c17Sathya Perla
1436b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Number of event entries processed */
1446b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_CQ_NUM_POPPED_SHIFT		(16) 	/* bits 16 - 28 */
1456b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Rearm bit */
1466b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_CQ_REARM_SHIFT		(29) 	/* bit 29 */
1476b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
1486b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/********** TX ULP door bell *************/
1496b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_TXULP1_OFFSET		0x60
1506b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_TXULP_RING_ID_MASK		0x7FF	/* bits 0 - 10 */
1516b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Number of tx entries posted */
1526b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_TXULP_NUM_POSTED_SHIFT	(16)	/* bits 16 - 29 */
1536b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_TXULP_NUM_POSTED_MASK	0x3FFF	/* bits 16 - 29 */
1546b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
1556b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/********** RQ(erx) door bell ************/
1566b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_RQ_OFFSET 			0x100
1576b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_RQ_RING_ID_MASK		0x3FF	/* bits 0 - 9 */
1586b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Number of rx frags posted */
1596b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define DB_RQ_NUM_POSTED_SHIFT		(24)	/* bits 24 - 31 */
1606b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
1615fb379ee67a7ec55ff65b467b472f3d69b60ba16Sathya Perla/********** MCC door bell ************/
1625fb379ee67a7ec55ff65b467b472f3d69b60ba16Sathya Perla#define DB_MCCQ_OFFSET 			0x140
1635fb379ee67a7ec55ff65b467b472f3d69b60ba16Sathya Perla#define DB_MCCQ_RING_ID_MASK		0x7FF	/* bits 0 - 10 */
1645fb379ee67a7ec55ff65b467b472f3d69b60ba16Sathya Perla/* Number of entries posted */
1655fb379ee67a7ec55ff65b467b472f3d69b60ba16Sathya Perla#define DB_MCCQ_NUM_POSTED_SHIFT	(16)	/* bits 16 - 29 */
1665fb379ee67a7ec55ff65b467b472f3d69b60ba16Sathya Perla
167ba343c7736b36d62d276e20383588bcf9403d6c6Sarveshwar Bandi/********** SRIOV VF PCICFG OFFSET ********/
168ba343c7736b36d62d276e20383588bcf9403d6c6Sarveshwar Bandi#define SRIOV_VF_PCICFG_OFFSET		(4096)
169ba343c7736b36d62d276e20383588bcf9403d6c6Sarveshwar Bandi
170311fddc7569d7a3340d61de262cff11685060f74Somnath Kotur/********** FAT TABLE  ********/
171311fddc7569d7a3340d61de262cff11685060f74Somnath Kotur#define RETRIEVE_FAT	0
172311fddc7569d7a3340d61de262cff11685060f74Somnath Kotur#define QUERY_FAT	1
173311fddc7569d7a3340d61de262cff11685060f74Somnath Kotur
1743f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde/* Flashrom related descriptors */
175c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define MAX_FLASH_COMP			32
1763f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define IMAGE_TYPE_FIRMWARE		160
1773f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define IMAGE_TYPE_BOOTCODE		224
1783f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define IMAGE_TYPE_OPTIONROM		32
1793f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
1803f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define NUM_FLASHDIR_ENTRIES		32
1813f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
182c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define OPTYPE_ISCSI_ACTIVE		0
183c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define OPTYPE_REDBOOT			1
184c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define OPTYPE_BIOS			2
185c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define OPTYPE_PXE_BIOS			3
186c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define OPTYPE_FCOE_BIOS		8
187c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define OPTYPE_ISCSI_BACKUP		9
188c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define OPTYPE_FCOE_FW_ACTIVE		10
189c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define OPTYPE_FCOE_FW_BACKUP		11
190c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define OPTYPE_NCSI_FW			13
19196c9b2e45e0f6bb5889cdc11805d00b364f00158Vasundhara Volam#define OPTYPE_REDBOOT_DIR		18
19296c9b2e45e0f6bb5889cdc11805d00b364f00158Vasundhara Volam#define OPTYPE_REDBOOT_CONFIG		19
19396c9b2e45e0f6bb5889cdc11805d00b364f00158Vasundhara Volam#define OPTYPE_SH_PHY_FW		21
19496c9b2e45e0f6bb5889cdc11805d00b364f00158Vasundhara Volam#define OPTYPE_FLASHISM_JUMPVECTOR	22
19596c9b2e45e0f6bb5889cdc11805d00b364f00158Vasundhara Volam#define OPTYPE_UFI_DIR			23
196c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define OPTYPE_PHY_FW			99
197306f13487c9f7d6e3303a547e01e22958a04c666Sathya Perla#define TN_8022				13
1983f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
199306f13487c9f7d6e3303a547e01e22958a04c666Sathya Perla#define FLASHROM_OPER_PHY_FLASH		9
200306f13487c9f7d6e3303a547e01e22958a04c666Sathya Perla#define FLASHROM_OPER_PHY_SAVE		10
2013f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASHROM_OPER_FLASH		1
2023f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASHROM_OPER_SAVE		2
2033f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASHROM_OPER_REPORT		4
2043f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
205306f13487c9f7d6e3303a547e01e22958a04c666Sathya Perla#define FLASH_IMAGE_MAX_SIZE_g2		(1310720) /* Max firmware image size */
206306f13487c9f7d6e3303a547e01e22958a04c666Sathya Perla#define FLASH_BIOS_IMAGE_MAX_SIZE_g2	(262144)  /* Max OPTION ROM image sz */
207306f13487c9f7d6e3303a547e01e22958a04c666Sathya Perla#define FLASH_REDBOOT_IMAGE_MAX_SIZE_g2	(262144)  /* Max Redboot image sz    */
208306f13487c9f7d6e3303a547e01e22958a04c666Sathya Perla#define FLASH_IMAGE_MAX_SIZE_g3		(2097152) /* Max firmware image size */
209306f13487c9f7d6e3303a547e01e22958a04c666Sathya Perla#define FLASH_BIOS_IMAGE_MAX_SIZE_g3	(524288)  /* Max OPTION ROM image sz */
210306f13487c9f7d6e3303a547e01e22958a04c666Sathya Perla#define FLASH_REDBOOT_IMAGE_MAX_SIZE_g3	(1048576)  /* Max Redboot image sz    */
211306f13487c9f7d6e3303a547e01e22958a04c666Sathya Perla#define FLASH_NCSI_IMAGE_MAX_SIZE_g3	(262144)
212306f13487c9f7d6e3303a547e01e22958a04c666Sathya Perla#define FLASH_PHY_FW_IMAGE_MAX_SIZE_g3	262144
2133f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
2143f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_NCSI_MAGIC		(0x16032009)
2153f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_NCSI_DISABLED		(0)
2163f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_NCSI_ENABLED		(1)
2173f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
2183f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_NCSI_BITFILE_HDR_OFFSET	(0x600000)
2193f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
2203f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde/* Offsets for components on Flash. */
2213f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_iSCSI_PRIMARY_IMAGE_START_g2 (1048576)
2223f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_iSCSI_BACKUP_IMAGE_START_g2  (2359296)
2233f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_FCoE_PRIMARY_IMAGE_START_g2  (3670016)
2243f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_FCoE_BACKUP_IMAGE_START_g2   (4980736)
2253f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_iSCSI_BIOS_START_g2          (7340032)
2263f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_PXE_BIOS_START_g2            (7864320)
2273f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_FCoE_BIOS_START_g2           (524288)
2283f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_REDBOOT_START_g2		  (0)
2293f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
2309fe969345b10931319b3f1e7034fbdeb786de234Sarveshwar Bandi#define FLASH_NCSI_START_g3		   (15990784)
2313f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_iSCSI_PRIMARY_IMAGE_START_g3 (2097152)
2323f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_iSCSI_BACKUP_IMAGE_START_g3  (4194304)
2333f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_FCoE_PRIMARY_IMAGE_START_g3  (6291456)
2343f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_FCoE_BACKUP_IMAGE_START_g3   (8388608)
2353f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_iSCSI_BIOS_START_g3          (12582912)
2363f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_PXE_BIOS_START_g3            (13107200)
2373f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_FCoE_BIOS_START_g3           (13631488)
2383f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde#define FLASH_REDBOOT_START_g3             (262144)
239306f13487c9f7d6e3303a547e01e22958a04c666Sathya Perla#define FLASH_PHY_FW_START_g3		   1310720
2403f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
241c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_NCSI			16
242c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_OPTION_ROM_PXE		32
243c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_OPTION_ROM_FCoE		33
244c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_OPTION_ROM_ISCSI		34
245c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_FLASHISM_JUMPVECTOR	48
246c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_FLASH_ISM			49
247c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_JUMP_VECTOR		50
248c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_FIRMWARE_iSCSI		160
249c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_FIRMWARE_COMP_iSCSI	161
250c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_FIRMWARE_FCoE		162
251c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_FIRMWARE_COMP_FCoE	163
252c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_FIRMWARE_BACKUP_iSCSI	176
253c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_FIRMWARE_BACKUP_COMP_iSCSI 177
254c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_FIRMWARE_BACKUP_FCoE	178
255c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_FIRMWARE_BACKUP_COMP_FCoE 179
256c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_FIRMWARE_PHY		192
25796c9b2e45e0f6bb5889cdc11805d00b364f00158Vasundhara Volam#define IMAGE_REDBOOT_DIR		208
25896c9b2e45e0f6bb5889cdc11805d00b364f00158Vasundhara Volam#define IMAGE_REDBOOT_CONFIG		209
25996c9b2e45e0f6bb5889cdc11805d00b364f00158Vasundhara Volam#define IMAGE_UFI_DIR			210
260c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar#define IMAGE_BOOT_CODE			224
261c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar
2621ef78abec6b5e9e3062e3ae6660eabaf055a718dAjit Khaparde/************* Rx Packet Type Encoding **************/
2631ef78abec6b5e9e3062e3ae6660eabaf055a718dAjit Khaparde#define BE_UNICAST_PACKET		0
2641ef78abec6b5e9e3062e3ae6660eabaf055a718dAjit Khaparde#define BE_MULTICAST_PACKET		1
2651ef78abec6b5e9e3062e3ae6660eabaf055a718dAjit Khaparde#define BE_BROADCAST_PACKET		2
2661ef78abec6b5e9e3062e3ae6660eabaf055a718dAjit Khaparde#define BE_RSVD_PACKET			3
2673f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
2686b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/*
2696b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * BE descriptors: host memory data structures whose formats
2706b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * are hardwired in BE silicon.
2716b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla */
2726b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Event Queue Descriptor */
2736b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define EQ_ENTRY_VALID_MASK 		0x1	/* bit 0 */
2746b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define EQ_ENTRY_RES_ID_MASK 		0xFFFF	/* bits 16 - 31 */
2756b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define EQ_ENTRY_RES_ID_SHIFT 		16
2763f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
2776b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perlastruct be_eq_entry {
2786b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u32 evt;
2796b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla};
2806b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
2816b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* TX Queue Descriptor */
2826b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla#define ETH_WRB_FRAG_LEN_MASK		0xFFFF
2836b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perlastruct be_eth_wrb {
2846b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u32 frag_pa_hi;		/* dword 0 */
2856b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u32 frag_pa_lo;		/* dword 1 */
2866b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u32 rsvd0;		/* dword 2 */
2876b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u32 frag_len;		/* dword 3: bits 0 - 15 */
2886b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla} __packed;
2896b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
2906b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Pseudo amap definition for eth_hdr_wrb in which each bit of the
2916b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * actual structure is defined as a byte : used to calculate
2926b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * offset/shift/mask of each field */
2936b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perlastruct amap_eth_hdr_wrb {
2946b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 rsvd0[32];		/* dword 0 */
2956b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 rsvd1[32];		/* dword 1 */
2966b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 complete;		/* dword 2 */
2976b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 event;
2986b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 crc;
2996b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 forward;
30049e4b8476f89956ec64b8b9fb7074cb4309a1169Ajit Khaparde	u8 lso6;
3016b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 mgmt;
3026b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 ipcs;
3036b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 udpcs;
3046b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 tcpcs;
3056b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 lso;
3066b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 vlan;
3076b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 gso[2];
3086b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 num_wrb[5];
3096b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 lso_mss[14];
3106b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 len[16];		/* dword 3 */
3116b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 vlan_tag[16];
3126b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla} __packed;
3136b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
3146b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perlastruct be_eth_hdr_wrb {
3156b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u32 dw[4];
3166b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla};
3176b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
318512bb8a244d2854953c65c0b36b0d0812fced7d5Kalesh AP/********* Tx Compl Status Encoding *********/
319512bb8a244d2854953c65c0b36b0d0812fced7d5Kalesh AP#define BE_TX_COMP_HDR_PARSE_ERR	0x2
320512bb8a244d2854953c65c0b36b0d0812fced7d5Kalesh AP#define BE_TX_COMP_NDMA_ERR		0x3
321512bb8a244d2854953c65c0b36b0d0812fced7d5Kalesh AP#define BE_TX_COMP_ACL_ERR		0x5
322512bb8a244d2854953c65c0b36b0d0812fced7d5Kalesh AP
323512bb8a244d2854953c65c0b36b0d0812fced7d5Kalesh AP#define LANCER_TX_COMP_LSO_ERR			0x1
324512bb8a244d2854953c65c0b36b0d0812fced7d5Kalesh AP#define LANCER_TX_COMP_HSW_DROP_MAC_ERR		0x3
325512bb8a244d2854953c65c0b36b0d0812fced7d5Kalesh AP#define LANCER_TX_COMP_HSW_DROP_VLAN_ERR	0x5
326512bb8a244d2854953c65c0b36b0d0812fced7d5Kalesh AP#define LANCER_TX_COMP_QINQ_ERR			0x7
327512bb8a244d2854953c65c0b36b0d0812fced7d5Kalesh AP#define LANCER_TX_COMP_PARITY_ERR		0xb
328512bb8a244d2854953c65c0b36b0d0812fced7d5Kalesh AP#define LANCER_TX_COMP_DMA_ERR			0xd
329512bb8a244d2854953c65c0b36b0d0812fced7d5Kalesh AP
3306b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* TX Compl Queue Descriptor */
3316b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
3326b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* Pseudo amap definition for eth_tx_compl in which each bit of the
3336b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * actual structure is defined as a byte: used to calculate
3346b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * offset/shift/mask of each field */
3356b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perlastruct amap_eth_tx_compl {
3366b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 wrb_index[16];	/* dword 0 */
3376b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 ct[2]; 		/* dword 0 */
3386b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 port[2];		/* dword 0 */
3396b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 rsvd0[8];		/* dword 0 */
3406b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 status[4];		/* dword 0 */
3416b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 user_bytes[16];	/* dword 1 */
3426b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 nwh_bytes[8];	/* dword 1 */
3436b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 lso;			/* dword 1 */
3446b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 cast_enc[2];		/* dword 1 */
3456b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 rsvd1[5];		/* dword 1 */
3466b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 rsvd2[32];		/* dword 2 */
3476b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 pkts[16];		/* dword 3 */
3486b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 ringid[11];		/* dword 3 */
3496b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 hash_val[4];		/* dword 3 */
3506b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 valid;		/* dword 3 */
3516b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla} __packed;
3526b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
3536b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perlastruct be_eth_tx_compl {
3546b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u32 dw[4];
3556b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla};
3566b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
3576b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* RX Queue Descriptor */
3586b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perlastruct be_eth_rx_d {
3596b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u32 fragpa_hi;
3606b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u32 fragpa_lo;
3616b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla};
3626b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
3636b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla/* RX Compl Queue Descriptor */
3646b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
3652e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla/* Pseudo amap definition for BE2 and BE3 legacy mode eth_rx_compl in which
3662e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla * each bit of the actual structure is defined as a byte: used to calculate
3676b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla * offset/shift/mask of each field */
3682e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perlastruct amap_eth_rx_compl_v0 {
3696b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 vlan_tag[16];	/* dword 0 */
3706b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 pktsize[14];		/* dword 0 */
3716b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 port;		/* dword 0 */
3726b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 ip_opt;		/* dword 0 */
3736b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 err;			/* dword 1 */
3746b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 rsshp;		/* dword 1 */
3756b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 ipf;			/* dword 1 */
3766b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 tcpf;		/* dword 1 */
3776b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 udpf;		/* dword 1 */
3786b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 ipcksm;		/* dword 1 */
3796b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 l4_cksm;		/* dword 1 */
3806b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 ip_version;		/* dword 1 */
3816b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 macdst[6];		/* dword 1 */
3826b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 vtp;			/* dword 1 */
383e38b170695d4108eeb6cd84db36f567fc6de4120Somnath Kotur	u8 ip_frag;		/* dword 1 */
3846b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 fragndx[10];		/* dword 1 */
3856b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 ct[2];		/* dword 1 */
3866b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 sw;			/* dword 1 */
3876b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 numfrags[3];		/* dword 1 */
3886b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 rss_flush;		/* dword 2 */
3896b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 cast_enc[2];		/* dword 2 */
390f93f160b5a3546b6d3143894f63a326442071e48Vasundhara Volam	u8 qnq;			/* dword 2 */
3916b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 rss_bank;		/* dword 2 */
3926b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 rsvd1[23];		/* dword 2 */
3936b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 lro_pkt;		/* dword 2 */
3946b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 rsvd2[2];		/* dword 2 */
3956b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 valid;		/* dword 2 */
3966b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u8 rsshash[32];		/* dword 3 */
3976b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla} __packed;
3986b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla
3992e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla/* Pseudo amap definition for BE3 native mode eth_rx_compl in which
4002e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla * each bit of the actual structure is defined as a byte: used to calculate
4012e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla * offset/shift/mask of each field */
4022e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perlastruct amap_eth_rx_compl_v1 {
4032e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 vlan_tag[16];	/* dword 0 */
4042e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 pktsize[14];		/* dword 0 */
4052e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 vtp;			/* dword 0 */
4062e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 ip_opt;		/* dword 0 */
4072e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 err;			/* dword 1 */
4082e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 rsshp;		/* dword 1 */
4092e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 ipf;			/* dword 1 */
4102e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 tcpf;		/* dword 1 */
4112e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 udpf;		/* dword 1 */
4122e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 ipcksm;		/* dword 1 */
4132e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 l4_cksm;		/* dword 1 */
4142e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 ip_version;		/* dword 1 */
4152e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 macdst[7];		/* dword 1 */
4162e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 rsvd0;		/* dword 1 */
4172e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 fragndx[10];		/* dword 1 */
4182e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 ct[2];		/* dword 1 */
4192e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 sw;			/* dword 1 */
4202e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 numfrags[3];		/* dword 1 */
4212e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 rss_flush;		/* dword 2 */
4222e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 cast_enc[2];		/* dword 2 */
423f93f160b5a3546b6d3143894f63a326442071e48Vasundhara Volam	u8 qnq;			/* dword 2 */
4242e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 rss_bank;		/* dword 2 */
4252e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 port[2];		/* dword 2 */
4262e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 vntagp;		/* dword 2 */
4272e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 header_len[8];	/* dword 2 */
4282e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 header_split[2];	/* dword 2 */
429c9c47142f6bf4684c13b571b312b67f3830f1d86Sathya Perla	u8 rsvd1[12];		/* dword 2 */
430c9c47142f6bf4684c13b571b312b67f3830f1d86Sathya Perla	u8 tunneled;
4312e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 valid;		/* dword 2 */
4322e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla	u8 rsshash[32];		/* dword 3 */
4332e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla} __packed;
4342e588f84f254cca0fc3b9f01297d06799b8c85d3Sathya Perla
4356b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perlastruct be_eth_rx_compl {
4366b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla	u32 dw[4];
4376b7c5b947c671a96e39f9526a5fd70c178b8dfd1Sathya Perla};
43884517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde
4399e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khapardestruct mgmt_hba_attribs {
4409e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 flashrom_version_string[32];
4419e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 manufacturer_name[32];
4429e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u32 supported_modes;
4439e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u32 rsvd0[3];
4449e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 ncsi_ver_string[12];
4459e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u32 default_extended_timeout;
4469e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 controller_model_number[32];
4479e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 controller_description[64];
4489e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 controller_serial_number[32];
4499e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 ip_version_string[32];
4509e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 firmware_version_string[32];
4519e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 bios_version_string[32];
4529e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 redboot_version_string[32];
4539e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 driver_version_string[32];
4549e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 fw_on_flash_version_string[32];
4559e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u32 functionalities_supported;
4569e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u16 max_cdblength;
4579e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 asic_revision;
4589e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 generational_guid[16];
4599e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 hba_port_count;
4609e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u16 default_link_down_timeout;
4619e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 iscsi_ver_min_max;
4629e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 multifunction_device;
4639e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 cache_valid;
4649e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 hba_status;
4659e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 max_domains_supported;
4669e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 phy_port;
4679e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u32 firmware_post_status;
4689e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u32 hba_mtu[8];
4699e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u32 rsvd1[4];
4709e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde};
4719e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde
4729e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khapardestruct mgmt_controller_attrib {
4739e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	struct mgmt_hba_attribs hba_attribs;
4749e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u16 pci_vendor_id;
4759e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u16 pci_device_id;
4769e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u16 pci_sub_vendor_id;
4779e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u16 pci_sub_system_id;
4789e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 pci_bus_number;
4799e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 pci_device_number;
4809e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 pci_function_number;
4819e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u8 interface_type;
4829e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u64 unique_identifier;
4839e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde	u32 rsvd0[5];
4849e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde};
4859e1453c5c5fe670bb98a6097b262122386b0d3feAjit Khaparde
48684517482e19bc775de7b3b4e998dee2f506bc34eAjit Khapardestruct controller_id {
48784517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 vendor;
48884517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 device;
48984517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 subvendor;
49084517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 subdevice;
49184517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde};
49284517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde
4933f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khapardestruct flash_comp {
4943f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	unsigned long offset;
4953f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	int optype;
4963f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	int size;
497c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	int img_type;
4983f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde};
4993f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
5003f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khapardestruct image_hdr {
5013f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	u32 imageid;
5023f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	u32 imageoffset;
5033f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	u32 imagelength;
5043f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	u32 image_checksum;
5053f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	u8 image_version[32];
5063f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde};
5073f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khapardestruct flash_file_hdr_g2 {
50884517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u8 sign[32];
50984517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 cksum;
51084517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 antidote;
51184517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	struct controller_id cont_id;
51284517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 file_len;
51384517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 chunk_num;
51484517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 total_chunks;
51584517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 num_imgs;
51684517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u8 build[24];
51784517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde};
51884517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde
5193f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khapardestruct flash_file_hdr_g3 {
5203f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	u8 sign[52];
5213f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	u8 ufi_version[4];
5223f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	u32 file_len;
5233f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	u32 cksum;
5243f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	u32 antidote;
5253f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	u32 num_imgs;
5263f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde	u8 build[24];
5270ad3157e813a59e91dfbea2eff6a3d330215f5afVasundhara Volam	u8 asic_type_rev;
5280ad3157e813a59e91dfbea2eff6a3d330215f5afVasundhara Volam	u8 rsvd[31];
5293f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde};
5303f0d4560aedaa67546eaeb3dc75fcdf68ec21036Ajit Khaparde
53184517482e19bc775de7b3b4e998dee2f506bc34eAjit Khapardestruct flash_section_hdr {
53284517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 format_rev;
53384517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 cksum;
53484517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 antidote;
535c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	u32 num_images;
536c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	u8 id_string[128];
537c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	u32 rsvd[4];
538c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar} __packed;
539c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar
540c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakarstruct flash_section_hdr_g2 {
541c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	u32 format_rev;
542c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	u32 cksum;
543c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	u32 antidote;
544c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	u32 build_num;
545c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	u8 id_string[128];
546c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	u32 rsvd[8];
547c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar} __packed;
54884517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde
54984517482e19bc775de7b3b4e998dee2f506bc34eAjit Khapardestruct flash_section_entry {
55084517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 type;
55184517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 offset;
55284517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 pad_size;
55384517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 image_size;
55484517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 cksum;
55584517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 entry_point;
55696c9b2e45e0f6bb5889cdc11805d00b364f00158Vasundhara Volam	u16 optype;
55796c9b2e45e0f6bb5889cdc11805d00b364f00158Vasundhara Volam	u16 rsvd0;
55884517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u32 rsvd1;
55984517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u8 ver_data[32];
560c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar} __packed;
56184517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde
56284517482e19bc775de7b3b4e998dee2f506bc34eAjit Khapardestruct flash_section_info {
56384517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	u8 cookie[32];
56484517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	struct flash_section_hdr fsec_hdr;
56584517482e19bc775de7b3b4e998dee2f506bc34eAjit Khaparde	struct flash_section_entry fsec_entry[32];
566c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar} __packed;
567c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar
568c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakarstruct flash_section_info_g2 {
569c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	u8 cookie[32];
570c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	struct flash_section_hdr_g2 fsec_hdr;
571c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar	struct flash_section_entry fsec_entry[32];
572c165541efc4d1024d7db22ecdf64359b1f6107fcPadmanabh Ratnakar} __packed;
573