1fe56b9e6SYuval Mintz /* QLogic qed NIC Driver
2fe56b9e6SYuval Mintz  * Copyright (c) 2015 QLogic Corporation
3fe56b9e6SYuval Mintz  *
4fe56b9e6SYuval Mintz  * This software is available under the terms of the GNU General Public License
5fe56b9e6SYuval Mintz  * (GPL) Version 2, available from the file COPYING in the main directory of
6fe56b9e6SYuval Mintz  * this source tree.
7fe56b9e6SYuval Mintz  */
8fe56b9e6SYuval Mintz 
9fe56b9e6SYuval Mintz #ifndef _QED_HSI_H
10fe56b9e6SYuval Mintz #define _QED_HSI_H
11fe56b9e6SYuval Mintz 
12fe56b9e6SYuval Mintz #include <linux/types.h>
13fe56b9e6SYuval Mintz #include <linux/io.h>
14fe56b9e6SYuval Mintz #include <linux/bitops.h>
15fe56b9e6SYuval Mintz #include <linux/delay.h>
16fe56b9e6SYuval Mintz #include <linux/kernel.h>
17fe56b9e6SYuval Mintz #include <linux/list.h>
18fe56b9e6SYuval Mintz #include <linux/slab.h>
19fe56b9e6SYuval Mintz #include <linux/qed/common_hsi.h>
2025c089d7SYuval Mintz #include <linux/qed/eth_common.h>
21fe56b9e6SYuval Mintz 
22fe56b9e6SYuval Mintz struct qed_hwfn;
23fe56b9e6SYuval Mintz struct qed_ptt;
24fe56b9e6SYuval Mintz /********************************/
25fe56b9e6SYuval Mintz /* Add include to common target */
26fe56b9e6SYuval Mintz /********************************/
27fe56b9e6SYuval Mintz 
28fe56b9e6SYuval Mintz /* opcodes for the event ring */
29fe56b9e6SYuval Mintz enum common_event_opcode {
30fe56b9e6SYuval Mintz 	COMMON_EVENT_PF_START,
31fe56b9e6SYuval Mintz 	COMMON_EVENT_PF_STOP,
32fe56b9e6SYuval Mintz 	COMMON_EVENT_RESERVED,
33fe56b9e6SYuval Mintz 	COMMON_EVENT_RESERVED2,
34fe56b9e6SYuval Mintz 	COMMON_EVENT_RESERVED3,
35fe56b9e6SYuval Mintz 	COMMON_EVENT_RESERVED4,
36fe56b9e6SYuval Mintz 	COMMON_EVENT_RESERVED5,
37fc48b7a6SYuval Mintz 	COMMON_EVENT_RESERVED6,
38fc48b7a6SYuval Mintz 	COMMON_EVENT_EMPTY,
39fe56b9e6SYuval Mintz 	MAX_COMMON_EVENT_OPCODE
40fe56b9e6SYuval Mintz };
41fe56b9e6SYuval Mintz 
42fe56b9e6SYuval Mintz /* Common Ramrod Command IDs */
43fe56b9e6SYuval Mintz enum common_ramrod_cmd_id {
44fe56b9e6SYuval Mintz 	COMMON_RAMROD_UNUSED,
45fe56b9e6SYuval Mintz 	COMMON_RAMROD_PF_START /* PF Function Start Ramrod */,
46fe56b9e6SYuval Mintz 	COMMON_RAMROD_PF_STOP /* PF Function Stop Ramrod */,
47fe56b9e6SYuval Mintz 	COMMON_RAMROD_RESERVED,
48fe56b9e6SYuval Mintz 	COMMON_RAMROD_RESERVED2,
49fe56b9e6SYuval Mintz 	COMMON_RAMROD_RESERVED3,
50fc48b7a6SYuval Mintz 	COMMON_RAMROD_EMPTY,
51fe56b9e6SYuval Mintz 	MAX_COMMON_RAMROD_CMD_ID
52fe56b9e6SYuval Mintz };
53fe56b9e6SYuval Mintz 
54fe56b9e6SYuval Mintz /* The core storm context for the Ystorm */
55fe56b9e6SYuval Mintz struct ystorm_core_conn_st_ctx {
56fe56b9e6SYuval Mintz 	__le32 reserved[4];
57fe56b9e6SYuval Mintz };
58fe56b9e6SYuval Mintz 
59fe56b9e6SYuval Mintz /* The core storm context for the Pstorm */
60fe56b9e6SYuval Mintz struct pstorm_core_conn_st_ctx {
61fe56b9e6SYuval Mintz 	__le32 reserved[4];
62fe56b9e6SYuval Mintz };
63fe56b9e6SYuval Mintz 
64fe56b9e6SYuval Mintz /* Core Slowpath Connection storm context of Xstorm */
65fe56b9e6SYuval Mintz struct xstorm_core_conn_st_ctx {
66fe56b9e6SYuval Mintz 	__le32		spq_base_lo /* SPQ Ring Base Address low dword */;
67fe56b9e6SYuval Mintz 	__le32		spq_base_hi /* SPQ Ring Base Address high dword */;
68fe56b9e6SYuval Mintz 	struct regpair	consolid_base_addr;
69fe56b9e6SYuval Mintz 	__le16		spq_cons /* SPQ Ring Consumer */;
70fe56b9e6SYuval Mintz 	__le16		consolid_cons /* Consolidation Ring Consumer */;
71fe56b9e6SYuval Mintz 	__le32		reserved0[55] /* Pad to 15 cycles */;
72fe56b9e6SYuval Mintz };
73fe56b9e6SYuval Mintz 
74fe56b9e6SYuval Mintz struct xstorm_core_conn_ag_ctx {
75fe56b9e6SYuval Mintz 	u8	reserved0 /* cdu_validation */;
76fe56b9e6SYuval Mintz 	u8	core_state /* state */;
77fe56b9e6SYuval Mintz 	u8	flags0;
78fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM0_MASK         0x1
79fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM0_SHIFT        0
80fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED1_MASK            0x1
81fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED1_SHIFT           1
82fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED2_MASK            0x1
83fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED2_SHIFT           2
84fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM3_MASK         0x1
85fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_EXIST_IN_QM3_SHIFT        3
86fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED3_MASK            0x1
87fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED3_SHIFT           4
88fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED4_MASK            0x1
89fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED4_SHIFT           5
90fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED5_MASK            0x1   /* bit6 */
91fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED5_SHIFT           6
92fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED6_MASK            0x1   /* bit7 */
93fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED6_SHIFT           7
94fe56b9e6SYuval Mintz 	u8 flags1;
95fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED7_MASK            0x1   /* bit8 */
96fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED7_SHIFT           0
97fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED8_MASK            0x1   /* bit9 */
98fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED8_SHIFT           1
99fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED9_MASK            0x1   /* bit10 */
100fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED9_SHIFT           2
101fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT11_MASK                0x1   /* bit11 */
102fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT11_SHIFT               3
103fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT12_MASK                0x1   /* bit12 */
104fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT12_SHIFT               4
105fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT13_MASK                0x1   /* bit13 */
106fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT13_SHIFT               5
107fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_TX_RULE_ACTIVE_MASK       0x1   /* bit14 */
108fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_TX_RULE_ACTIVE_SHIFT      6
109fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_DQ_CF_ACTIVE_MASK         0x1   /* bit15 */
110fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_DQ_CF_ACTIVE_SHIFT        7
111fe56b9e6SYuval Mintz 	u8 flags2;
112fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF0_MASK                  0x3   /* timer0cf */
113fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF0_SHIFT                 0
114fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF1_MASK                  0x3   /* timer1cf */
115fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF1_SHIFT                 2
116fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF2_MASK                  0x3   /* timer2cf */
117fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF2_SHIFT                 4
118fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF3_MASK                  0x3
119fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF3_SHIFT                 6
120fe56b9e6SYuval Mintz 	u8 flags3;
121fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF4_MASK                  0x3   /* cf4 */
122fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF4_SHIFT                 0
123fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF5_MASK                  0x3   /* cf5 */
124fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF5_SHIFT                 2
125fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF6_MASK                  0x3   /* cf6 */
126fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF6_SHIFT                 4
127fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF7_MASK                  0x3   /* cf7 */
128fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF7_SHIFT                 6
129fe56b9e6SYuval Mintz 	u8 flags4;
130fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF8_MASK                  0x3   /* cf8 */
131fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF8_SHIFT                 0
132fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF9_MASK                  0x3   /* cf9 */
133fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF9_SHIFT                 2
134fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF10_MASK                 0x3   /* cf10 */
135fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF10_SHIFT                4
136fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF11_MASK                 0x3   /* cf11 */
137fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF11_SHIFT                6
138fe56b9e6SYuval Mintz 	u8 flags5;
139fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF12_MASK                 0x3   /* cf12 */
140fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF12_SHIFT                0
141fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF13_MASK                 0x3   /* cf13 */
142fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF13_SHIFT                2
143fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF14_MASK                 0x3   /* cf14 */
144fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF14_SHIFT                4
145fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF15_MASK                 0x3   /* cf15 */
146fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF15_SHIFT                6
147fe56b9e6SYuval Mintz 	u8 flags6;
148fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_MASK     0x3   /* cf16 */
149fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_SHIFT    0
150fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF17_MASK                 0x3
151fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF17_SHIFT                2
152fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_DQ_CF_MASK                0x3   /* cf18 */
153fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_DQ_CF_SHIFT               4
154fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_MASK         0x3   /* cf19 */
155fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_SHIFT        6
156fe56b9e6SYuval Mintz 	u8 flags7;
157fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_MASK             0x3   /* cf20 */
158fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_SHIFT            0
159fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED10_MASK           0x3   /* cf21 */
160fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED10_SHIFT          2
161fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_MASK            0x3   /* cf22 */
162fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_SHIFT           4
163fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF0EN_MASK                0x1   /* cf0en */
164fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT               6
165fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF1EN_MASK                0x1   /* cf1en */
166fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT               7
167fe56b9e6SYuval Mintz 	u8 flags8;
168fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF2EN_MASK                0x1   /* cf2en */
169fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT               0
170fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF3EN_MASK                0x1   /* cf3en */
171fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF3EN_SHIFT               1
172fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF4EN_MASK                0x1   /* cf4en */
173fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF4EN_SHIFT               2
174fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF5EN_MASK                0x1   /* cf5en */
175fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF5EN_SHIFT               3
176fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF6EN_MASK                0x1   /* cf6en */
177fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF6EN_SHIFT               4
178fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF7EN_MASK                0x1   /* cf7en */
179fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF7EN_SHIFT               5
180fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF8EN_MASK                0x1   /* cf8en */
181fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF8EN_SHIFT               6
182fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF9EN_MASK                0x1   /* cf9en */
183fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF9EN_SHIFT               7
184fe56b9e6SYuval Mintz 	u8 flags9;
185fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF10EN_MASK               0x1   /* cf10en */
186fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF10EN_SHIFT              0
187fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF11EN_MASK               0x1   /* cf11en */
188fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF11EN_SHIFT              1
189fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF12EN_MASK               0x1   /* cf12en */
190fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF12EN_SHIFT              2
191fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF13EN_MASK               0x1   /* cf13en */
192fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF13EN_SHIFT              3
193fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF14EN_MASK               0x1   /* cf14en */
194fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF14EN_SHIFT              4
195fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF15EN_MASK               0x1   /* cf15en */
196fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF15EN_SHIFT              5
197fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_EN_MASK  0x1   /* cf16en */
198fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CONSOLID_PROD_CF_EN_SHIFT 6
199fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF17EN_MASK               0x1
200fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF17EN_SHIFT              7
201fe56b9e6SYuval Mintz 	u8 flags10;
202fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_DQ_CF_EN_MASK             0x1   /* cf18en */
203fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_DQ_CF_EN_SHIFT            0
204fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_EN_MASK      0x1   /* cf19en */
205fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_TERMINATE_CF_EN_SHIFT     1
206fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_EN_MASK          0x1   /* cf20en */
207fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_FLUSH_Q0_EN_SHIFT         2
208fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED11_MASK           0x1   /* cf21en */
209fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED11_SHIFT          3
210fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_EN_MASK         0x1   /* cf22en */
211fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_SLOW_PATH_EN_SHIFT        4
212fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF23EN_MASK               0x1   /* cf23en */
213fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF23EN_SHIFT              5
214fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED12_MASK           0x1   /* rule0en */
215fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED12_SHIFT          6
216fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED13_MASK           0x1   /* rule1en */
217fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED13_SHIFT          7
218fe56b9e6SYuval Mintz 	u8 flags11;
219fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED14_MASK           0x1   /* rule2en */
220fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED14_SHIFT          0
221fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED15_MASK           0x1   /* rule3en */
222fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RESERVED15_SHIFT          1
223fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_TX_DEC_RULE_EN_MASK       0x1   /* rule4en */
224fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_TX_DEC_RULE_EN_SHIFT      2
225fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE5EN_MASK              0x1   /* rule5en */
226fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE5EN_SHIFT             3
227fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE6EN_MASK              0x1   /* rule6en */
228fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE6EN_SHIFT             4
229fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE7EN_MASK              0x1   /* rule7en */
230fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE7EN_SHIFT             5
231fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED1_MASK         0x1   /* rule8en */
232fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED1_SHIFT        6
233fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE9EN_MASK              0x1   /* rule9en */
234fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE9EN_SHIFT             7
235fe56b9e6SYuval Mintz 	u8 flags12;
236fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE10EN_MASK             0x1   /* rule10en */
237fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE10EN_SHIFT            0
238fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE11EN_MASK             0x1   /* rule11en */
239fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE11EN_SHIFT            1
240fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED2_MASK         0x1   /* rule12en */
241fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED2_SHIFT        2
242fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED3_MASK         0x1   /* rule13en */
243fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED3_SHIFT        3
244fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE14EN_MASK             0x1   /* rule14en */
245fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE14EN_SHIFT            4
246fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE15EN_MASK             0x1   /* rule15en */
247fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE15EN_SHIFT            5
248fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE16EN_MASK             0x1   /* rule16en */
249fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE16EN_SHIFT            6
250fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE17EN_MASK             0x1   /* rule17en */
251fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE17EN_SHIFT            7
252fe56b9e6SYuval Mintz 	u8 flags13;
253fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE18EN_MASK             0x1   /* rule18en */
254fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE18EN_SHIFT            0
255fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE19EN_MASK             0x1   /* rule19en */
256fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_RULE19EN_SHIFT            1
257fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED4_MASK         0x1   /* rule20en */
258fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED4_SHIFT        2
259fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED5_MASK         0x1   /* rule21en */
260fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED5_SHIFT        3
261fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED6_MASK         0x1   /* rule22en */
262fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED6_SHIFT        4
263fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED7_MASK         0x1   /* rule23en */
264fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED7_SHIFT        5
265fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED8_MASK         0x1   /* rule24en */
266fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED8_SHIFT        6
267fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED9_MASK         0x1   /* rule25en */
268fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_A0_RESERVED9_SHIFT        7
269fe56b9e6SYuval Mintz 	u8 flags14;
270fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT16_MASK                0x1   /* bit16 */
271fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT16_SHIFT               0
272fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT17_MASK                0x1   /* bit17 */
273fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT17_SHIFT               1
274fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT18_MASK                0x1   /* bit18 */
275fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT18_SHIFT               2
276fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT19_MASK                0x1   /* bit19 */
277fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT19_SHIFT               3
278fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT20_MASK                0x1   /* bit20 */
279fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT20_SHIFT               4
280fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT21_MASK                0x1   /* bit21 */
281fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_BIT21_SHIFT               5
282fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF23_MASK                 0x3   /* cf23 */
283fe56b9e6SYuval Mintz #define XSTORM_CORE_CONN_AG_CTX_CF23_SHIFT                6
284fe56b9e6SYuval Mintz 	u8	byte2 /* byte2 */;
285fe56b9e6SYuval Mintz 	__le16	physical_q0 /* physical_q0 */;
286fe56b9e6SYuval Mintz 	__le16	consolid_prod /* physical_q1 */;
287fe56b9e6SYuval Mintz 	__le16	reserved16 /* physical_q2 */;
288fe56b9e6SYuval Mintz 	__le16	tx_bd_cons /* word3 */;
289fe56b9e6SYuval Mintz 	__le16	tx_bd_or_spq_prod /* word4 */;
290fe56b9e6SYuval Mintz 	__le16	word5 /* word5 */;
291fe56b9e6SYuval Mintz 	__le16	conn_dpi /* conn_dpi */;
292fe56b9e6SYuval Mintz 	u8	byte3 /* byte3 */;
293fe56b9e6SYuval Mintz 	u8	byte4 /* byte4 */;
294fe56b9e6SYuval Mintz 	u8	byte5 /* byte5 */;
295fe56b9e6SYuval Mintz 	u8	byte6 /* byte6 */;
296fe56b9e6SYuval Mintz 	__le32	reg0 /* reg0 */;
297fe56b9e6SYuval Mintz 	__le32	reg1 /* reg1 */;
298fe56b9e6SYuval Mintz 	__le32	reg2 /* reg2 */;
299fe56b9e6SYuval Mintz 	__le32	reg3 /* reg3 */;
300fe56b9e6SYuval Mintz 	__le32	reg4 /* reg4 */;
301fe56b9e6SYuval Mintz 	__le32	reg5 /* cf_array0 */;
302fe56b9e6SYuval Mintz 	__le32	reg6 /* cf_array1 */;
303fe56b9e6SYuval Mintz 	__le16	word7 /* word7 */;
304fe56b9e6SYuval Mintz 	__le16	word8 /* word8 */;
305fe56b9e6SYuval Mintz 	__le16	word9 /* word9 */;
306fe56b9e6SYuval Mintz 	__le16	word10 /* word10 */;
307fe56b9e6SYuval Mintz 	__le32	reg7 /* reg7 */;
308fe56b9e6SYuval Mintz 	__le32	reg8 /* reg8 */;
309fe56b9e6SYuval Mintz 	__le32	reg9 /* reg9 */;
310fe56b9e6SYuval Mintz 	u8	byte7 /* byte7 */;
311fe56b9e6SYuval Mintz 	u8	byte8 /* byte8 */;
312fe56b9e6SYuval Mintz 	u8	byte9 /* byte9 */;
313fe56b9e6SYuval Mintz 	u8	byte10 /* byte10 */;
314fe56b9e6SYuval Mintz 	u8	byte11 /* byte11 */;
315fe56b9e6SYuval Mintz 	u8	byte12 /* byte12 */;
316fe56b9e6SYuval Mintz 	u8	byte13 /* byte13 */;
317fe56b9e6SYuval Mintz 	u8	byte14 /* byte14 */;
318fe56b9e6SYuval Mintz 	u8	byte15 /* byte15 */;
319fe56b9e6SYuval Mintz 	u8	byte16 /* byte16 */;
320fe56b9e6SYuval Mintz 	__le16	word11 /* word11 */;
321fe56b9e6SYuval Mintz 	__le32	reg10 /* reg10 */;
322fe56b9e6SYuval Mintz 	__le32	reg11 /* reg11 */;
323fe56b9e6SYuval Mintz 	__le32	reg12 /* reg12 */;
324fe56b9e6SYuval Mintz 	__le32	reg13 /* reg13 */;
325fe56b9e6SYuval Mintz 	__le32	reg14 /* reg14 */;
326fe56b9e6SYuval Mintz 	__le32	reg15 /* reg15 */;
327fe56b9e6SYuval Mintz 	__le32	reg16 /* reg16 */;
328fe56b9e6SYuval Mintz 	__le32	reg17 /* reg17 */;
329fe56b9e6SYuval Mintz 	__le32	reg18 /* reg18 */;
330fe56b9e6SYuval Mintz 	__le32	reg19 /* reg19 */;
331fe56b9e6SYuval Mintz 	__le16	word12 /* word12 */;
332fe56b9e6SYuval Mintz 	__le16	word13 /* word13 */;
333fe56b9e6SYuval Mintz 	__le16	word14 /* word14 */;
334fe56b9e6SYuval Mintz 	__le16	word15 /* word15 */;
335fe56b9e6SYuval Mintz };
336fe56b9e6SYuval Mintz 
337fc48b7a6SYuval Mintz struct tstorm_core_conn_ag_ctx {
338fc48b7a6SYuval Mintz 	u8	byte0 /* cdu_validation */;
339fc48b7a6SYuval Mintz 	u8	byte1 /* state */;
340fc48b7a6SYuval Mintz 	u8	flags0;
341fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_BIT0_MASK     0x1       /* exist_in_qm0 */
342fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_BIT0_SHIFT    0
343fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_BIT1_MASK     0x1       /* exist_in_qm1 */
344fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_BIT1_SHIFT    1
345fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_BIT2_MASK     0x1       /* bit2 */
346fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_BIT2_SHIFT    2
347fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_BIT3_MASK     0x1       /* bit3 */
348fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_BIT3_SHIFT    3
349fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_BIT4_MASK     0x1       /* bit4 */
350fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_BIT4_SHIFT    4
351fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_BIT5_MASK     0x1       /* bit5 */
352fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_BIT5_SHIFT    5
353fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF0_MASK      0x3       /* timer0cf */
354fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF0_SHIFT     6
355fc48b7a6SYuval Mintz 	u8 flags1;
356fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF1_MASK      0x3       /* timer1cf */
357fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF1_SHIFT     0
358fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF2_MASK      0x3       /* timer2cf */
359fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF2_SHIFT     2
360fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF3_MASK      0x3       /* timer_stop_all */
361fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF3_SHIFT     4
362fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF4_MASK      0x3       /* cf4 */
363fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF4_SHIFT     6
364fc48b7a6SYuval Mintz 	u8 flags2;
365fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF5_MASK      0x3       /* cf5 */
366fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF5_SHIFT     0
367fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF6_MASK      0x3       /* cf6 */
368fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF6_SHIFT     2
369fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF7_MASK      0x3       /* cf7 */
370fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF7_SHIFT     4
371fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF8_MASK      0x3       /* cf8 */
372fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF8_SHIFT     6
373fc48b7a6SYuval Mintz 	u8 flags3;
374fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF9_MASK      0x3       /* cf9 */
375fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF9_SHIFT     0
376fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF10_MASK     0x3       /* cf10 */
377fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF10_SHIFT    2
378fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF0EN_MASK    0x1       /* cf0en */
379fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT   4
380fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF1EN_MASK    0x1       /* cf1en */
381fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT   5
382fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF2EN_MASK    0x1       /* cf2en */
383fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT   6
384fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF3EN_MASK    0x1       /* cf3en */
385fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF3EN_SHIFT   7
386fc48b7a6SYuval Mintz 	u8 flags4;
387fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF4EN_MASK    0x1       /* cf4en */
388fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF4EN_SHIFT   0
389fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF5EN_MASK    0x1       /* cf5en */
390fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF5EN_SHIFT   1
391fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF6EN_MASK    0x1       /* cf6en */
392fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF6EN_SHIFT   2
393fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF7EN_MASK    0x1       /* cf7en */
394fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF7EN_SHIFT   3
395fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF8EN_MASK    0x1       /* cf8en */
396fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF8EN_SHIFT   4
397fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF9EN_MASK    0x1       /* cf9en */
398fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF9EN_SHIFT   5
399fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF10EN_MASK   0x1       /* cf10en */
400fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_CF10EN_SHIFT  6
401fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE0EN_MASK  0x1       /* rule0en */
402fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT 7
403fc48b7a6SYuval Mintz 	u8 flags5;
404fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE1EN_MASK  0x1       /* rule1en */
405fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT 0
406fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE2EN_MASK  0x1       /* rule2en */
407fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT 1
408fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE3EN_MASK  0x1       /* rule3en */
409fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT 2
410fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE4EN_MASK  0x1       /* rule4en */
411fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT 3
412fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE5EN_MASK  0x1       /* rule5en */
413fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE5EN_SHIFT 4
414fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE6EN_MASK  0x1       /* rule6en */
415fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE6EN_SHIFT 5
416fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE7EN_MASK  0x1       /* rule7en */
417fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE7EN_SHIFT 6
418fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE8EN_MASK  0x1       /* rule8en */
419fc48b7a6SYuval Mintz #define TSTORM_CORE_CONN_AG_CTX_RULE8EN_SHIFT 7
420fc48b7a6SYuval Mintz 	__le32	reg0 /* reg0 */;
421fc48b7a6SYuval Mintz 	__le32	reg1 /* reg1 */;
422fc48b7a6SYuval Mintz 	__le32	reg2 /* reg2 */;
423fc48b7a6SYuval Mintz 	__le32	reg3 /* reg3 */;
424fc48b7a6SYuval Mintz 	__le32	reg4 /* reg4 */;
425fc48b7a6SYuval Mintz 	__le32	reg5 /* reg5 */;
426fc48b7a6SYuval Mintz 	__le32	reg6 /* reg6 */;
427fc48b7a6SYuval Mintz 	__le32	reg7 /* reg7 */;
428fc48b7a6SYuval Mintz 	__le32	reg8 /* reg8 */;
429fc48b7a6SYuval Mintz 	u8	byte2 /* byte2 */;
430fc48b7a6SYuval Mintz 	u8	byte3 /* byte3 */;
431fc48b7a6SYuval Mintz 	__le16	word0 /* word0 */;
432fc48b7a6SYuval Mintz 	u8	byte4 /* byte4 */;
433fc48b7a6SYuval Mintz 	u8	byte5 /* byte5 */;
434fc48b7a6SYuval Mintz 	__le16	word1 /* word1 */;
435fc48b7a6SYuval Mintz 	__le16	word2 /* conn_dpi */;
436fc48b7a6SYuval Mintz 	__le16	word3 /* word3 */;
437fc48b7a6SYuval Mintz 	__le32	reg9 /* reg9 */;
438fc48b7a6SYuval Mintz 	__le32	reg10 /* reg10 */;
439fc48b7a6SYuval Mintz };
440fc48b7a6SYuval Mintz 
441fc48b7a6SYuval Mintz struct ustorm_core_conn_ag_ctx {
442fc48b7a6SYuval Mintz 	u8	reserved /* cdu_validation */;
443fc48b7a6SYuval Mintz 	u8	byte1 /* state */;
444fc48b7a6SYuval Mintz 	u8	flags0;
445fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_BIT0_MASK     0x1       /* exist_in_qm0 */
446fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_BIT0_SHIFT    0
447fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_BIT1_MASK     0x1       /* exist_in_qm1 */
448fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_BIT1_SHIFT    1
449fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF0_MASK      0x3       /* timer0cf */
450fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF0_SHIFT     2
451fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF1_MASK      0x3       /* timer1cf */
452fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF1_SHIFT     4
453fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF2_MASK      0x3       /* timer2cf */
454fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF2_SHIFT     6
455fc48b7a6SYuval Mintz 	u8 flags1;
456fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF3_MASK      0x3       /* timer_stop_all */
457fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF3_SHIFT     0
458fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF4_MASK      0x3       /* cf4 */
459fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF4_SHIFT     2
460fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF5_MASK      0x3       /* cf5 */
461fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF5_SHIFT     4
462fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF6_MASK      0x3       /* cf6 */
463fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF6_SHIFT     6
464fc48b7a6SYuval Mintz 	u8 flags2;
465fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF0EN_MASK    0x1       /* cf0en */
466fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF0EN_SHIFT   0
467fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF1EN_MASK    0x1       /* cf1en */
468fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF1EN_SHIFT   1
469fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF2EN_MASK    0x1       /* cf2en */
470fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF2EN_SHIFT   2
471fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF3EN_MASK    0x1       /* cf3en */
472fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF3EN_SHIFT   3
473fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF4EN_MASK    0x1       /* cf4en */
474fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF4EN_SHIFT   4
475fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF5EN_MASK    0x1       /* cf5en */
476fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF5EN_SHIFT   5
477fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF6EN_MASK    0x1       /* cf6en */
478fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_CF6EN_SHIFT   6
479fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE0EN_MASK  0x1       /* rule0en */
480fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE0EN_SHIFT 7
481fc48b7a6SYuval Mintz 	u8 flags3;
482fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE1EN_MASK  0x1       /* rule1en */
483fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE1EN_SHIFT 0
484fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE2EN_MASK  0x1       /* rule2en */
485fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE2EN_SHIFT 1
486fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE3EN_MASK  0x1       /* rule3en */
487fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE3EN_SHIFT 2
488fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE4EN_MASK  0x1       /* rule4en */
489fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE4EN_SHIFT 3
490fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE5EN_MASK  0x1       /* rule5en */
491fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE5EN_SHIFT 4
492fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE6EN_MASK  0x1       /* rule6en */
493fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE6EN_SHIFT 5
494fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE7EN_MASK  0x1       /* rule7en */
495fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE7EN_SHIFT 6
496fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE8EN_MASK  0x1       /* rule8en */
497fc48b7a6SYuval Mintz #define USTORM_CORE_CONN_AG_CTX_RULE8EN_SHIFT 7
498fc48b7a6SYuval Mintz 	u8	byte2 /* byte2 */;
499fc48b7a6SYuval Mintz 	u8	byte3 /* byte3 */;
500fc48b7a6SYuval Mintz 	__le16	word0 /* conn_dpi */;
501fc48b7a6SYuval Mintz 	__le16	word1 /* word1 */;
502fc48b7a6SYuval Mintz 	__le32	rx_producers /* reg0 */;
503fc48b7a6SYuval Mintz 	__le32	reg1 /* reg1 */;
504fc48b7a6SYuval Mintz 	__le32	reg2 /* reg2 */;
505fc48b7a6SYuval Mintz 	__le32	reg3 /* reg3 */;
506fc48b7a6SYuval Mintz 	__le16	word2 /* word2 */;
507fc48b7a6SYuval Mintz 	__le16	word3 /* word3 */;
508fc48b7a6SYuval Mintz };
509fc48b7a6SYuval Mintz 
510fe56b9e6SYuval Mintz /* The core storm context for the Mstorm */
511fe56b9e6SYuval Mintz struct mstorm_core_conn_st_ctx {
512fe56b9e6SYuval Mintz 	__le32 reserved[24];
513fe56b9e6SYuval Mintz };
514fe56b9e6SYuval Mintz 
515fe56b9e6SYuval Mintz /* The core storm context for the Ustorm */
516fe56b9e6SYuval Mintz struct ustorm_core_conn_st_ctx {
517fe56b9e6SYuval Mintz 	__le32 reserved[4];
518fe56b9e6SYuval Mintz };
519fe56b9e6SYuval Mintz 
520fe56b9e6SYuval Mintz /* core connection context */
521fe56b9e6SYuval Mintz struct core_conn_context {
522fe56b9e6SYuval Mintz 	struct ystorm_core_conn_st_ctx	ystorm_st_context;
523fe56b9e6SYuval Mintz 	struct regpair			ystorm_st_padding[2] /* padding */;
524fe56b9e6SYuval Mintz 	struct pstorm_core_conn_st_ctx	pstorm_st_context;
525fe56b9e6SYuval Mintz 	struct regpair			pstorm_st_padding[2];
526fe56b9e6SYuval Mintz 	struct xstorm_core_conn_st_ctx	xstorm_st_context;
527fe56b9e6SYuval Mintz 	struct xstorm_core_conn_ag_ctx	xstorm_ag_context;
528fc48b7a6SYuval Mintz 	struct tstorm_core_conn_ag_ctx	tstorm_ag_context;
529fc48b7a6SYuval Mintz 	struct ustorm_core_conn_ag_ctx	ustorm_ag_context;
530fe56b9e6SYuval Mintz 	struct mstorm_core_conn_st_ctx	mstorm_st_context;
531fe56b9e6SYuval Mintz 	struct ustorm_core_conn_st_ctx	ustorm_st_context;
532fe56b9e6SYuval Mintz 	struct regpair			ustorm_st_padding[2] /* padding */;
533fe56b9e6SYuval Mintz };
534fe56b9e6SYuval Mintz 
5359df2ed04SManish Chopra struct eth_mstorm_per_queue_stat {
5369df2ed04SManish Chopra 	struct regpair  ttl0_discard;
5379df2ed04SManish Chopra 	struct regpair  packet_too_big_discard;
5389df2ed04SManish Chopra 	struct regpair  no_buff_discard;
5399df2ed04SManish Chopra 	struct regpair  not_active_discard;
5409df2ed04SManish Chopra 	struct regpair  tpa_coalesced_pkts;
5419df2ed04SManish Chopra 	struct regpair  tpa_coalesced_events;
5429df2ed04SManish Chopra 	struct regpair  tpa_aborts_num;
5439df2ed04SManish Chopra 	struct regpair  tpa_coalesced_bytes;
5449df2ed04SManish Chopra };
5459df2ed04SManish Chopra 
5469df2ed04SManish Chopra struct eth_pstorm_per_queue_stat {
5479df2ed04SManish Chopra 	struct regpair  sent_ucast_bytes;
5489df2ed04SManish Chopra 	struct regpair  sent_mcast_bytes;
5499df2ed04SManish Chopra 	struct regpair  sent_bcast_bytes;
5509df2ed04SManish Chopra 	struct regpair  sent_ucast_pkts;
5519df2ed04SManish Chopra 	struct regpair  sent_mcast_pkts;
5529df2ed04SManish Chopra 	struct regpair  sent_bcast_pkts;
5539df2ed04SManish Chopra 	struct regpair  error_drop_pkts;
5549df2ed04SManish Chopra };
5559df2ed04SManish Chopra 
5569df2ed04SManish Chopra struct eth_ustorm_per_queue_stat {
5579df2ed04SManish Chopra 	struct regpair  rcv_ucast_bytes;
5589df2ed04SManish Chopra 	struct regpair  rcv_mcast_bytes;
5599df2ed04SManish Chopra 	struct regpair  rcv_bcast_bytes;
5609df2ed04SManish Chopra 	struct regpair  rcv_ucast_pkts;
5619df2ed04SManish Chopra 	struct regpair  rcv_mcast_pkts;
5629df2ed04SManish Chopra 	struct regpair  rcv_bcast_pkts;
5639df2ed04SManish Chopra };
5649df2ed04SManish Chopra 
565fe56b9e6SYuval Mintz /* Event Ring Next Page Address */
566fe56b9e6SYuval Mintz struct event_ring_next_addr {
567fe56b9e6SYuval Mintz 	struct regpair	addr /* Next Page Address */;
568fe56b9e6SYuval Mintz 	__le32		reserved[2] /* Reserved */;
569fe56b9e6SYuval Mintz };
570fe56b9e6SYuval Mintz 
571fe56b9e6SYuval Mintz union event_ring_element {
572fe56b9e6SYuval Mintz 	struct event_ring_entry		entry /* Event Ring Entry */;
573fe56b9e6SYuval Mintz 	struct event_ring_next_addr	next_addr;
574fe56b9e6SYuval Mintz };
575fe56b9e6SYuval Mintz 
576fe56b9e6SYuval Mintz enum personality_type {
577fc48b7a6SYuval Mintz 	BAD_PERSONALITY_TYP,
578fe56b9e6SYuval Mintz 	PERSONALITY_RESERVED,
579fe56b9e6SYuval Mintz 	PERSONALITY_RESERVED2,
580fe56b9e6SYuval Mintz 	PERSONALITY_RDMA_AND_ETH /* Roce or Iwarp */,
581fe56b9e6SYuval Mintz 	PERSONALITY_RESERVED3,
582fc48b7a6SYuval Mintz 	PERSONALITY_CORE,
583fe56b9e6SYuval Mintz 	PERSONALITY_ETH /* Ethernet */,
584fe56b9e6SYuval Mintz 	PERSONALITY_RESERVED4,
585fe56b9e6SYuval Mintz 	MAX_PERSONALITY_TYPE
586fe56b9e6SYuval Mintz };
587fe56b9e6SYuval Mintz 
588fe56b9e6SYuval Mintz struct pf_start_tunnel_config {
589fe56b9e6SYuval Mintz 	u8	set_vxlan_udp_port_flg;
590fe56b9e6SYuval Mintz 	u8	set_geneve_udp_port_flg;
591fe56b9e6SYuval Mintz 	u8	tx_enable_vxlan /* If set, enable VXLAN tunnel in TX path. */;
592fe56b9e6SYuval Mintz 	u8	tx_enable_l2geneve;
593fe56b9e6SYuval Mintz 	u8	tx_enable_ipgeneve;
594fe56b9e6SYuval Mintz 	u8	tx_enable_l2gre /* If set, enable l2 GRE tunnel in TX path. */;
595fe56b9e6SYuval Mintz 	u8	tx_enable_ipgre /* If set, enable IP GRE tunnel in TX path. */;
596fe56b9e6SYuval Mintz 	u8	tunnel_clss_vxlan /* Classification scheme for VXLAN tunnel. */;
597fe56b9e6SYuval Mintz 	u8	tunnel_clss_l2geneve;
598fe56b9e6SYuval Mintz 	u8	tunnel_clss_ipgeneve;
599fe56b9e6SYuval Mintz 	u8	tunnel_clss_l2gre;
600fe56b9e6SYuval Mintz 	u8	tunnel_clss_ipgre;
601fe56b9e6SYuval Mintz 	__le16	vxlan_udp_port /* VXLAN tunnel UDP destination port. */;
602fe56b9e6SYuval Mintz 	__le16	geneve_udp_port /* GENEVE tunnel UDP destination port. */;
603fe56b9e6SYuval Mintz };
604fe56b9e6SYuval Mintz 
605fe56b9e6SYuval Mintz /* Ramrod data for PF start ramrod */
606fe56b9e6SYuval Mintz struct pf_start_ramrod_data {
607fe56b9e6SYuval Mintz 	struct regpair			event_ring_pbl_addr;
608fe56b9e6SYuval Mintz 	struct regpair			consolid_q_pbl_addr;
609fe56b9e6SYuval Mintz 	struct pf_start_tunnel_config	tunnel_config;
610fe56b9e6SYuval Mintz 	__le16				event_ring_sb_id;
611fe56b9e6SYuval Mintz 	u8				base_vf_id;
612fe56b9e6SYuval Mintz 	u8				num_vfs;
613fe56b9e6SYuval Mintz 	u8				event_ring_num_pages;
614fe56b9e6SYuval Mintz 	u8				event_ring_sb_index;
615fe56b9e6SYuval Mintz 	u8				path_id;
616fe56b9e6SYuval Mintz 	u8				warning_as_error;
617fe56b9e6SYuval Mintz 	u8				dont_log_ramrods;
618fe56b9e6SYuval Mintz 	u8				personality;
619fe56b9e6SYuval Mintz 	__le16				log_type_mask;
620fe56b9e6SYuval Mintz 	u8				mf_mode /* Multi function mode */;
621fe56b9e6SYuval Mintz 	u8				integ_phase /* Integration phase */;
622fe56b9e6SYuval Mintz 	u8				allow_npar_tx_switching;
623fe56b9e6SYuval Mintz 	u8				inner_to_outer_pri_map[8];
624fe56b9e6SYuval Mintz 	u8				pri_map_valid;
625fe56b9e6SYuval Mintz 	u32				outer_tag;
626fe56b9e6SYuval Mintz 	u8				reserved0[4];
627fe56b9e6SYuval Mintz };
628fe56b9e6SYuval Mintz 
629fe56b9e6SYuval Mintz enum ports_mode {
630fe56b9e6SYuval Mintz 	ENGX2_PORTX1 /* 2 engines x 1 port */,
631fe56b9e6SYuval Mintz 	ENGX2_PORTX2 /* 2 engines x 2 ports */,
632fe56b9e6SYuval Mintz 	ENGX1_PORTX1 /* 1 engine  x 1 port */,
633fe56b9e6SYuval Mintz 	ENGX1_PORTX2 /* 1 engine  x 2 ports */,
634fe56b9e6SYuval Mintz 	ENGX1_PORTX4 /* 1 engine  x 4 ports */,
635fe56b9e6SYuval Mintz 	MAX_PORTS_MODE
636fe56b9e6SYuval Mintz };
637fe56b9e6SYuval Mintz 
638fe56b9e6SYuval Mintz /* Ramrod Header of SPQE */
639fe56b9e6SYuval Mintz struct ramrod_header {
640fe56b9e6SYuval Mintz 	__le32	cid /* Slowpath Connection CID */;
641fe56b9e6SYuval Mintz 	u8	cmd_id /* Ramrod Cmd (Per Protocol Type) */;
642fe56b9e6SYuval Mintz 	u8	protocol_id /* Ramrod Protocol ID */;
643fe56b9e6SYuval Mintz 	__le16	echo /* Ramrod echo */;
644fe56b9e6SYuval Mintz };
645fe56b9e6SYuval Mintz 
646fe56b9e6SYuval Mintz /* Slowpath Element (SPQE) */
647fe56b9e6SYuval Mintz struct slow_path_element {
648fe56b9e6SYuval Mintz 	struct ramrod_header	hdr /* Ramrod Header */;
649fe56b9e6SYuval Mintz 	struct regpair		data_ptr;
650fe56b9e6SYuval Mintz };
651fe56b9e6SYuval Mintz 
652fe56b9e6SYuval Mintz struct tstorm_per_port_stat {
653fe56b9e6SYuval Mintz 	struct regpair	trunc_error_discard;
654fe56b9e6SYuval Mintz 	struct regpair	mac_error_discard;
655fe56b9e6SYuval Mintz 	struct regpair	mftag_filter_discard;
656fe56b9e6SYuval Mintz 	struct regpair	eth_mac_filter_discard;
657fe56b9e6SYuval Mintz 	struct regpair	ll2_mac_filter_discard;
658fe56b9e6SYuval Mintz 	struct regpair	ll2_conn_disabled_discard;
659fe56b9e6SYuval Mintz 	struct regpair	iscsi_irregular_pkt;
660fe56b9e6SYuval Mintz 	struct regpair	fcoe_irregular_pkt;
661fe56b9e6SYuval Mintz 	struct regpair	roce_irregular_pkt;
662fe56b9e6SYuval Mintz 	struct regpair	eth_irregular_pkt;
663fe56b9e6SYuval Mintz 	struct regpair	toe_irregular_pkt;
664fe56b9e6SYuval Mintz 	struct regpair	preroce_irregular_pkt;
665fe56b9e6SYuval Mintz };
666fe56b9e6SYuval Mintz 
667fe56b9e6SYuval Mintz struct atten_status_block {
668fe56b9e6SYuval Mintz 	__le32	atten_bits;
669fe56b9e6SYuval Mintz 	__le32	atten_ack;
670fe56b9e6SYuval Mintz 	__le16	reserved0;
671fe56b9e6SYuval Mintz 	__le16	sb_index /* status block running index */;
672fe56b9e6SYuval Mintz 	__le32	reserved1;
673fe56b9e6SYuval Mintz };
674fe56b9e6SYuval Mintz 
675fe56b9e6SYuval Mintz enum block_addr {
676fe56b9e6SYuval Mintz 	GRCBASE_GRC		= 0x50000,
677fe56b9e6SYuval Mintz 	GRCBASE_MISCS		= 0x9000,
678fe56b9e6SYuval Mintz 	GRCBASE_MISC		= 0x8000,
679fe56b9e6SYuval Mintz 	GRCBASE_DBU		= 0xa000,
680fe56b9e6SYuval Mintz 	GRCBASE_PGLUE_B		= 0x2a8000,
681fe56b9e6SYuval Mintz 	GRCBASE_CNIG		= 0x218000,
682fe56b9e6SYuval Mintz 	GRCBASE_CPMU		= 0x30000,
683fe56b9e6SYuval Mintz 	GRCBASE_NCSI		= 0x40000,
684fe56b9e6SYuval Mintz 	GRCBASE_OPTE		= 0x53000,
685fe56b9e6SYuval Mintz 	GRCBASE_BMB		= 0x540000,
686fe56b9e6SYuval Mintz 	GRCBASE_PCIE		= 0x54000,
687fe56b9e6SYuval Mintz 	GRCBASE_MCP		= 0xe00000,
688fe56b9e6SYuval Mintz 	GRCBASE_MCP2		= 0x52000,
689fe56b9e6SYuval Mintz 	GRCBASE_PSWHST		= 0x2a0000,
690fe56b9e6SYuval Mintz 	GRCBASE_PSWHST2		= 0x29e000,
691fe56b9e6SYuval Mintz 	GRCBASE_PSWRD		= 0x29c000,
692fe56b9e6SYuval Mintz 	GRCBASE_PSWRD2		= 0x29d000,
693fe56b9e6SYuval Mintz 	GRCBASE_PSWWR		= 0x29a000,
694fe56b9e6SYuval Mintz 	GRCBASE_PSWWR2		= 0x29b000,
695fe56b9e6SYuval Mintz 	GRCBASE_PSWRQ		= 0x280000,
696fe56b9e6SYuval Mintz 	GRCBASE_PSWRQ2		= 0x240000,
697fe56b9e6SYuval Mintz 	GRCBASE_PGLCS		= 0x0,
698fe56b9e6SYuval Mintz 	GRCBASE_PTU		= 0x560000,
699fe56b9e6SYuval Mintz 	GRCBASE_DMAE		= 0xc000,
700fe56b9e6SYuval Mintz 	GRCBASE_TCM		= 0x1180000,
701fe56b9e6SYuval Mintz 	GRCBASE_MCM		= 0x1200000,
702fe56b9e6SYuval Mintz 	GRCBASE_UCM		= 0x1280000,
703fe56b9e6SYuval Mintz 	GRCBASE_XCM		= 0x1000000,
704fe56b9e6SYuval Mintz 	GRCBASE_YCM		= 0x1080000,
705fe56b9e6SYuval Mintz 	GRCBASE_PCM		= 0x1100000,
706fe56b9e6SYuval Mintz 	GRCBASE_QM		= 0x2f0000,
707fe56b9e6SYuval Mintz 	GRCBASE_TM		= 0x2c0000,
708fe56b9e6SYuval Mintz 	GRCBASE_DORQ		= 0x100000,
709fe56b9e6SYuval Mintz 	GRCBASE_BRB		= 0x340000,
710fe56b9e6SYuval Mintz 	GRCBASE_SRC		= 0x238000,
711fe56b9e6SYuval Mintz 	GRCBASE_PRS		= 0x1f0000,
712fe56b9e6SYuval Mintz 	GRCBASE_TSDM		= 0xfb0000,
713fe56b9e6SYuval Mintz 	GRCBASE_MSDM		= 0xfc0000,
714fe56b9e6SYuval Mintz 	GRCBASE_USDM		= 0xfd0000,
715fe56b9e6SYuval Mintz 	GRCBASE_XSDM		= 0xf80000,
716fe56b9e6SYuval Mintz 	GRCBASE_YSDM		= 0xf90000,
717fe56b9e6SYuval Mintz 	GRCBASE_PSDM		= 0xfa0000,
718fe56b9e6SYuval Mintz 	GRCBASE_TSEM		= 0x1700000,
719fe56b9e6SYuval Mintz 	GRCBASE_MSEM		= 0x1800000,
720fe56b9e6SYuval Mintz 	GRCBASE_USEM		= 0x1900000,
721fe56b9e6SYuval Mintz 	GRCBASE_XSEM		= 0x1400000,
722fe56b9e6SYuval Mintz 	GRCBASE_YSEM		= 0x1500000,
723fe56b9e6SYuval Mintz 	GRCBASE_PSEM		= 0x1600000,
724fe56b9e6SYuval Mintz 	GRCBASE_RSS		= 0x238800,
725fe56b9e6SYuval Mintz 	GRCBASE_TMLD		= 0x4d0000,
726fe56b9e6SYuval Mintz 	GRCBASE_MULD		= 0x4e0000,
727fe56b9e6SYuval Mintz 	GRCBASE_YULD		= 0x4c8000,
728fe56b9e6SYuval Mintz 	GRCBASE_XYLD		= 0x4c0000,
729fe56b9e6SYuval Mintz 	GRCBASE_PRM		= 0x230000,
730fe56b9e6SYuval Mintz 	GRCBASE_PBF_PB1		= 0xda0000,
731fe56b9e6SYuval Mintz 	GRCBASE_PBF_PB2		= 0xda4000,
732fe56b9e6SYuval Mintz 	GRCBASE_RPB		= 0x23c000,
733fe56b9e6SYuval Mintz 	GRCBASE_BTB		= 0xdb0000,
734fe56b9e6SYuval Mintz 	GRCBASE_PBF		= 0xd80000,
735fe56b9e6SYuval Mintz 	GRCBASE_RDIF		= 0x300000,
736fe56b9e6SYuval Mintz 	GRCBASE_TDIF		= 0x310000,
737fe56b9e6SYuval Mintz 	GRCBASE_CDU		= 0x580000,
738fe56b9e6SYuval Mintz 	GRCBASE_CCFC		= 0x2e0000,
739fe56b9e6SYuval Mintz 	GRCBASE_TCFC		= 0x2d0000,
740fe56b9e6SYuval Mintz 	GRCBASE_IGU		= 0x180000,
741fe56b9e6SYuval Mintz 	GRCBASE_CAU		= 0x1c0000,
742fe56b9e6SYuval Mintz 	GRCBASE_UMAC		= 0x51000,
743fe56b9e6SYuval Mintz 	GRCBASE_XMAC		= 0x210000,
744fe56b9e6SYuval Mintz 	GRCBASE_DBG		= 0x10000,
745fe56b9e6SYuval Mintz 	GRCBASE_NIG		= 0x500000,
746fe56b9e6SYuval Mintz 	GRCBASE_WOL		= 0x600000,
747fe56b9e6SYuval Mintz 	GRCBASE_BMBN		= 0x610000,
748fe56b9e6SYuval Mintz 	GRCBASE_IPC		= 0x20000,
749fe56b9e6SYuval Mintz 	GRCBASE_NWM		= 0x800000,
750fe56b9e6SYuval Mintz 	GRCBASE_NWS		= 0x700000,
751fe56b9e6SYuval Mintz 	GRCBASE_MS		= 0x6a0000,
752fc48b7a6SYuval Mintz 	GRCBASE_PHY_PCIE	= 0x620000,
753fe56b9e6SYuval Mintz 	GRCBASE_MISC_AEU	= 0x8000,
754fe56b9e6SYuval Mintz 	GRCBASE_BAR0_MAP	= 0x1c00000,
755fe56b9e6SYuval Mintz 	MAX_BLOCK_ADDR
756fe56b9e6SYuval Mintz };
757fe56b9e6SYuval Mintz 
758fe56b9e6SYuval Mintz enum block_id {
759fe56b9e6SYuval Mintz 	BLOCK_GRC,
760fe56b9e6SYuval Mintz 	BLOCK_MISCS,
761fe56b9e6SYuval Mintz 	BLOCK_MISC,
762fe56b9e6SYuval Mintz 	BLOCK_DBU,
763fe56b9e6SYuval Mintz 	BLOCK_PGLUE_B,
764fe56b9e6SYuval Mintz 	BLOCK_CNIG,
765fe56b9e6SYuval Mintz 	BLOCK_CPMU,
766fe56b9e6SYuval Mintz 	BLOCK_NCSI,
767fe56b9e6SYuval Mintz 	BLOCK_OPTE,
768fe56b9e6SYuval Mintz 	BLOCK_BMB,
769fe56b9e6SYuval Mintz 	BLOCK_PCIE,
770fe56b9e6SYuval Mintz 	BLOCK_MCP,
771fe56b9e6SYuval Mintz 	BLOCK_MCP2,
772fe56b9e6SYuval Mintz 	BLOCK_PSWHST,
773fe56b9e6SYuval Mintz 	BLOCK_PSWHST2,
774fe56b9e6SYuval Mintz 	BLOCK_PSWRD,
775fe56b9e6SYuval Mintz 	BLOCK_PSWRD2,
776fe56b9e6SYuval Mintz 	BLOCK_PSWWR,
777fe56b9e6SYuval Mintz 	BLOCK_PSWWR2,
778fe56b9e6SYuval Mintz 	BLOCK_PSWRQ,
779fe56b9e6SYuval Mintz 	BLOCK_PSWRQ2,
780fe56b9e6SYuval Mintz 	BLOCK_PGLCS,
781fe56b9e6SYuval Mintz 	BLOCK_PTU,
782fe56b9e6SYuval Mintz 	BLOCK_DMAE,
783fe56b9e6SYuval Mintz 	BLOCK_TCM,
784fe56b9e6SYuval Mintz 	BLOCK_MCM,
785fe56b9e6SYuval Mintz 	BLOCK_UCM,
786fe56b9e6SYuval Mintz 	BLOCK_XCM,
787fe56b9e6SYuval Mintz 	BLOCK_YCM,
788fe56b9e6SYuval Mintz 	BLOCK_PCM,
789fe56b9e6SYuval Mintz 	BLOCK_QM,
790fe56b9e6SYuval Mintz 	BLOCK_TM,
791fe56b9e6SYuval Mintz 	BLOCK_DORQ,
792fe56b9e6SYuval Mintz 	BLOCK_BRB,
793fe56b9e6SYuval Mintz 	BLOCK_SRC,
794fe56b9e6SYuval Mintz 	BLOCK_PRS,
795fe56b9e6SYuval Mintz 	BLOCK_TSDM,
796fe56b9e6SYuval Mintz 	BLOCK_MSDM,
797fe56b9e6SYuval Mintz 	BLOCK_USDM,
798fe56b9e6SYuval Mintz 	BLOCK_XSDM,
799fe56b9e6SYuval Mintz 	BLOCK_YSDM,
800fe56b9e6SYuval Mintz 	BLOCK_PSDM,
801fe56b9e6SYuval Mintz 	BLOCK_TSEM,
802fe56b9e6SYuval Mintz 	BLOCK_MSEM,
803fe56b9e6SYuval Mintz 	BLOCK_USEM,
804fe56b9e6SYuval Mintz 	BLOCK_XSEM,
805fe56b9e6SYuval Mintz 	BLOCK_YSEM,
806fe56b9e6SYuval Mintz 	BLOCK_PSEM,
807fe56b9e6SYuval Mintz 	BLOCK_RSS,
808fe56b9e6SYuval Mintz 	BLOCK_TMLD,
809fe56b9e6SYuval Mintz 	BLOCK_MULD,
810fe56b9e6SYuval Mintz 	BLOCK_YULD,
811fe56b9e6SYuval Mintz 	BLOCK_XYLD,
812fe56b9e6SYuval Mintz 	BLOCK_PRM,
813fe56b9e6SYuval Mintz 	BLOCK_PBF_PB1,
814fe56b9e6SYuval Mintz 	BLOCK_PBF_PB2,
815fe56b9e6SYuval Mintz 	BLOCK_RPB,
816fe56b9e6SYuval Mintz 	BLOCK_BTB,
817fe56b9e6SYuval Mintz 	BLOCK_PBF,
818fe56b9e6SYuval Mintz 	BLOCK_RDIF,
819fe56b9e6SYuval Mintz 	BLOCK_TDIF,
820fe56b9e6SYuval Mintz 	BLOCK_CDU,
821fe56b9e6SYuval Mintz 	BLOCK_CCFC,
822fe56b9e6SYuval Mintz 	BLOCK_TCFC,
823fe56b9e6SYuval Mintz 	BLOCK_IGU,
824fe56b9e6SYuval Mintz 	BLOCK_CAU,
825fe56b9e6SYuval Mintz 	BLOCK_UMAC,
826fe56b9e6SYuval Mintz 	BLOCK_XMAC,
827fe56b9e6SYuval Mintz 	BLOCK_DBG,
828fe56b9e6SYuval Mintz 	BLOCK_NIG,
829fe56b9e6SYuval Mintz 	BLOCK_WOL,
830fe56b9e6SYuval Mintz 	BLOCK_BMBN,
831fe56b9e6SYuval Mintz 	BLOCK_IPC,
832fe56b9e6SYuval Mintz 	BLOCK_NWM,
833fe56b9e6SYuval Mintz 	BLOCK_NWS,
834fe56b9e6SYuval Mintz 	BLOCK_MS,
835fe56b9e6SYuval Mintz 	BLOCK_PHY_PCIE,
836fe56b9e6SYuval Mintz 	BLOCK_MISC_AEU,
837fe56b9e6SYuval Mintz 	BLOCK_BAR0_MAP,
838fe56b9e6SYuval Mintz 	MAX_BLOCK_ID
839fe56b9e6SYuval Mintz };
840fe56b9e6SYuval Mintz 
841fe56b9e6SYuval Mintz enum command_type_bit {
842fe56b9e6SYuval Mintz 	IGU_COMMAND_TYPE_NOP	= 0,
843fe56b9e6SYuval Mintz 	IGU_COMMAND_TYPE_SET	= 1,
844fe56b9e6SYuval Mintz 	MAX_COMMAND_TYPE_BIT
845fe56b9e6SYuval Mintz };
846fe56b9e6SYuval Mintz 
847fe56b9e6SYuval Mintz struct dmae_cmd {
848fe56b9e6SYuval Mintz 	__le32 opcode;
849fe56b9e6SYuval Mintz #define DMAE_CMD_SRC_MASK              0x1
850fe56b9e6SYuval Mintz #define DMAE_CMD_SRC_SHIFT             0
851fe56b9e6SYuval Mintz #define DMAE_CMD_DST_MASK              0x3
852fe56b9e6SYuval Mintz #define DMAE_CMD_DST_SHIFT             1
853fe56b9e6SYuval Mintz #define DMAE_CMD_C_DST_MASK            0x1
854fe56b9e6SYuval Mintz #define DMAE_CMD_C_DST_SHIFT           3
855fe56b9e6SYuval Mintz #define DMAE_CMD_CRC_RESET_MASK        0x1
856fe56b9e6SYuval Mintz #define DMAE_CMD_CRC_RESET_SHIFT       4
857fe56b9e6SYuval Mintz #define DMAE_CMD_SRC_ADDR_RESET_MASK   0x1
858fe56b9e6SYuval Mintz #define DMAE_CMD_SRC_ADDR_RESET_SHIFT  5
859fe56b9e6SYuval Mintz #define DMAE_CMD_DST_ADDR_RESET_MASK   0x1
860fe56b9e6SYuval Mintz #define DMAE_CMD_DST_ADDR_RESET_SHIFT  6
861fe56b9e6SYuval Mintz #define DMAE_CMD_COMP_FUNC_MASK        0x1
862fe56b9e6SYuval Mintz #define DMAE_CMD_COMP_FUNC_SHIFT       7
863fe56b9e6SYuval Mintz #define DMAE_CMD_COMP_WORD_EN_MASK     0x1
864fe56b9e6SYuval Mintz #define DMAE_CMD_COMP_WORD_EN_SHIFT    8
865fe56b9e6SYuval Mintz #define DMAE_CMD_COMP_CRC_EN_MASK      0x1
866fe56b9e6SYuval Mintz #define DMAE_CMD_COMP_CRC_EN_SHIFT     9
867fe56b9e6SYuval Mintz #define DMAE_CMD_COMP_CRC_OFFSET_MASK  0x7
868fe56b9e6SYuval Mintz #define DMAE_CMD_COMP_CRC_OFFSET_SHIFT 10
869fe56b9e6SYuval Mintz #define DMAE_CMD_RESERVED1_MASK        0x1
870fe56b9e6SYuval Mintz #define DMAE_CMD_RESERVED1_SHIFT       13
871fe56b9e6SYuval Mintz #define DMAE_CMD_ENDIANITY_MODE_MASK   0x3
872fe56b9e6SYuval Mintz #define DMAE_CMD_ENDIANITY_MODE_SHIFT  14
873fe56b9e6SYuval Mintz #define DMAE_CMD_ERR_HANDLING_MASK     0x3
874fe56b9e6SYuval Mintz #define DMAE_CMD_ERR_HANDLING_SHIFT    16
875fe56b9e6SYuval Mintz #define DMAE_CMD_PORT_ID_MASK          0x3
876fe56b9e6SYuval Mintz #define DMAE_CMD_PORT_ID_SHIFT         18
877fe56b9e6SYuval Mintz #define DMAE_CMD_SRC_PF_ID_MASK        0xF
878fe56b9e6SYuval Mintz #define DMAE_CMD_SRC_PF_ID_SHIFT       20
879fe56b9e6SYuval Mintz #define DMAE_CMD_DST_PF_ID_MASK        0xF
880fe56b9e6SYuval Mintz #define DMAE_CMD_DST_PF_ID_SHIFT       24
881fe56b9e6SYuval Mintz #define DMAE_CMD_SRC_VF_ID_VALID_MASK  0x1
882fe56b9e6SYuval Mintz #define DMAE_CMD_SRC_VF_ID_VALID_SHIFT 28
883fe56b9e6SYuval Mintz #define DMAE_CMD_DST_VF_ID_VALID_MASK  0x1
884fe56b9e6SYuval Mintz #define DMAE_CMD_DST_VF_ID_VALID_SHIFT 29
885fe56b9e6SYuval Mintz #define DMAE_CMD_RESERVED2_MASK        0x3
886fe56b9e6SYuval Mintz #define DMAE_CMD_RESERVED2_SHIFT       30
887fe56b9e6SYuval Mintz 	__le32	src_addr_lo;
888fe56b9e6SYuval Mintz 	__le32	src_addr_hi;
889fe56b9e6SYuval Mintz 	__le32	dst_addr_lo;
890fe56b9e6SYuval Mintz 	__le32	dst_addr_hi;
891fe56b9e6SYuval Mintz 	__le16	length /* Length in DW */;
892fe56b9e6SYuval Mintz 	__le16	opcode_b;
893fe56b9e6SYuval Mintz #define DMAE_CMD_SRC_VF_ID_MASK        0xFF     /* Source VF id */
894fe56b9e6SYuval Mintz #define DMAE_CMD_SRC_VF_ID_SHIFT       0
895fe56b9e6SYuval Mintz #define DMAE_CMD_DST_VF_ID_MASK        0xFF     /* Destination VF id */
896fe56b9e6SYuval Mintz #define DMAE_CMD_DST_VF_ID_SHIFT       8
897fe56b9e6SYuval Mintz 	__le32	comp_addr_lo /* PCIe completion address low or grc address */;
898fe56b9e6SYuval Mintz 	__le32	comp_addr_hi;
899fe56b9e6SYuval Mintz 	__le32	comp_val /* Value to write to copmletion address */;
900fe56b9e6SYuval Mintz 	__le32	crc32 /* crc16 result */;
901fe56b9e6SYuval Mintz 	__le32	crc_32_c /* crc32_c result */;
902fe56b9e6SYuval Mintz 	__le16	crc16 /* crc16 result */;
903fe56b9e6SYuval Mintz 	__le16	crc16_c /* crc16_c result */;
904fe56b9e6SYuval Mintz 	__le16	crc10 /* crc_t10 result */;
905fe56b9e6SYuval Mintz 	__le16	reserved;
906fe56b9e6SYuval Mintz 	__le16	xsum16 /* checksum16 result  */;
907fe56b9e6SYuval Mintz 	__le16	xsum8 /* checksum8 result  */;
908fe56b9e6SYuval Mintz };
909fe56b9e6SYuval Mintz 
910fe56b9e6SYuval Mintz struct igu_cleanup {
911fe56b9e6SYuval Mintz 	__le32 sb_id_and_flags;
912fe56b9e6SYuval Mintz #define IGU_CLEANUP_RESERVED0_MASK     0x7FFFFFF
913fe56b9e6SYuval Mintz #define IGU_CLEANUP_RESERVED0_SHIFT    0
914fe56b9e6SYuval Mintz #define IGU_CLEANUP_CLEANUP_SET_MASK   0x1 /* cleanup clear - 0, set - 1 */
915fe56b9e6SYuval Mintz #define IGU_CLEANUP_CLEANUP_SET_SHIFT  27
916fe56b9e6SYuval Mintz #define IGU_CLEANUP_CLEANUP_TYPE_MASK  0x7
917fe56b9e6SYuval Mintz #define IGU_CLEANUP_CLEANUP_TYPE_SHIFT 28
918fe56b9e6SYuval Mintz #define IGU_CLEANUP_COMMAND_TYPE_MASK  0x1
919fe56b9e6SYuval Mintz #define IGU_CLEANUP_COMMAND_TYPE_SHIFT 31
920fe56b9e6SYuval Mintz 	__le32 reserved1;
921fe56b9e6SYuval Mintz };
922fe56b9e6SYuval Mintz 
923fe56b9e6SYuval Mintz union igu_command {
924fe56b9e6SYuval Mintz 	struct igu_prod_cons_update	prod_cons_update;
925fe56b9e6SYuval Mintz 	struct igu_cleanup		cleanup;
926fe56b9e6SYuval Mintz };
927fe56b9e6SYuval Mintz 
928fe56b9e6SYuval Mintz struct igu_command_reg_ctrl {
929fe56b9e6SYuval Mintz 	__le16	opaque_fid;
930fe56b9e6SYuval Mintz 	__le16	igu_command_reg_ctrl_fields;
931fe56b9e6SYuval Mintz #define IGU_COMMAND_REG_CTRL_PXP_BAR_ADDR_MASK  0xFFF
932fe56b9e6SYuval Mintz #define IGU_COMMAND_REG_CTRL_PXP_BAR_ADDR_SHIFT 0
933fe56b9e6SYuval Mintz #define IGU_COMMAND_REG_CTRL_RESERVED_MASK      0x7
934fe56b9e6SYuval Mintz #define IGU_COMMAND_REG_CTRL_RESERVED_SHIFT     12
935fe56b9e6SYuval Mintz #define IGU_COMMAND_REG_CTRL_COMMAND_TYPE_MASK  0x1
936fe56b9e6SYuval Mintz #define IGU_COMMAND_REG_CTRL_COMMAND_TYPE_SHIFT 15
937fe56b9e6SYuval Mintz };
938fe56b9e6SYuval Mintz 
939fe56b9e6SYuval Mintz struct igu_mapping_line {
940fe56b9e6SYuval Mintz 	__le32 igu_mapping_line_fields;
941fe56b9e6SYuval Mintz #define IGU_MAPPING_LINE_VALID_MASK            0x1
942fe56b9e6SYuval Mintz #define IGU_MAPPING_LINE_VALID_SHIFT           0
943fe56b9e6SYuval Mintz #define IGU_MAPPING_LINE_VECTOR_NUMBER_MASK    0xFF
944fe56b9e6SYuval Mintz #define IGU_MAPPING_LINE_VECTOR_NUMBER_SHIFT   1
945fe56b9e6SYuval Mintz #define IGU_MAPPING_LINE_FUNCTION_NUMBER_MASK  0xFF
946fe56b9e6SYuval Mintz #define IGU_MAPPING_LINE_FUNCTION_NUMBER_SHIFT 9
947fe56b9e6SYuval Mintz #define IGU_MAPPING_LINE_PF_VALID_MASK         0x1      /* PF-1, VF-0 */
948fe56b9e6SYuval Mintz #define IGU_MAPPING_LINE_PF_VALID_SHIFT        17
949fe56b9e6SYuval Mintz #define IGU_MAPPING_LINE_IPS_GROUP_MASK        0x3F
950fe56b9e6SYuval Mintz #define IGU_MAPPING_LINE_IPS_GROUP_SHIFT       18
951fe56b9e6SYuval Mintz #define IGU_MAPPING_LINE_RESERVED_MASK         0xFF
952fe56b9e6SYuval Mintz #define IGU_MAPPING_LINE_RESERVED_SHIFT        24
953fe56b9e6SYuval Mintz };
954fe56b9e6SYuval Mintz 
955fe56b9e6SYuval Mintz struct igu_msix_vector {
956fe56b9e6SYuval Mintz 	struct regpair	address;
957fe56b9e6SYuval Mintz 	__le32		data;
958fe56b9e6SYuval Mintz 	__le32		msix_vector_fields;
959fe56b9e6SYuval Mintz #define IGU_MSIX_VECTOR_MASK_BIT_MASK      0x1
960fe56b9e6SYuval Mintz #define IGU_MSIX_VECTOR_MASK_BIT_SHIFT     0
961fe56b9e6SYuval Mintz #define IGU_MSIX_VECTOR_RESERVED0_MASK     0x7FFF
962fe56b9e6SYuval Mintz #define IGU_MSIX_VECTOR_RESERVED0_SHIFT    1
963fe56b9e6SYuval Mintz #define IGU_MSIX_VECTOR_STEERING_TAG_MASK  0xFF
964fe56b9e6SYuval Mintz #define IGU_MSIX_VECTOR_STEERING_TAG_SHIFT 16
965fe56b9e6SYuval Mintz #define IGU_MSIX_VECTOR_RESERVED1_MASK     0xFF
966fe56b9e6SYuval Mintz #define IGU_MSIX_VECTOR_RESERVED1_SHIFT    24
967fe56b9e6SYuval Mintz };
968fe56b9e6SYuval Mintz 
969fe56b9e6SYuval Mintz enum init_modes {
970fe56b9e6SYuval Mintz 	MODE_BB_A0,
97112e09c69SYuval Mintz 	MODE_BB_B0,
972fe56b9e6SYuval Mintz 	MODE_RESERVED2,
973fe56b9e6SYuval Mintz 	MODE_ASIC,
974fe56b9e6SYuval Mintz 	MODE_RESERVED3,
975fe56b9e6SYuval Mintz 	MODE_RESERVED4,
976fe56b9e6SYuval Mintz 	MODE_RESERVED5,
977fc48b7a6SYuval Mintz 	MODE_RESERVED6,
978fe56b9e6SYuval Mintz 	MODE_SF,
979fe56b9e6SYuval Mintz 	MODE_MF_SD,
980fe56b9e6SYuval Mintz 	MODE_MF_SI,
981fe56b9e6SYuval Mintz 	MODE_PORTS_PER_ENG_1,
982fe56b9e6SYuval Mintz 	MODE_PORTS_PER_ENG_2,
983fe56b9e6SYuval Mintz 	MODE_PORTS_PER_ENG_4,
984fe56b9e6SYuval Mintz 	MODE_100G,
985fe56b9e6SYuval Mintz 	MODE_EAGLE_ENG1_WORKAROUND,
986fe56b9e6SYuval Mintz 	MAX_INIT_MODES
987fe56b9e6SYuval Mintz };
988fe56b9e6SYuval Mintz 
989fe56b9e6SYuval Mintz enum init_phases {
990fe56b9e6SYuval Mintz 	PHASE_ENGINE,
991fe56b9e6SYuval Mintz 	PHASE_PORT,
992fe56b9e6SYuval Mintz 	PHASE_PF,
993fe56b9e6SYuval Mintz 	PHASE_RESERVED,
994fe56b9e6SYuval Mintz 	PHASE_QM_PF,
995fe56b9e6SYuval Mintz 	MAX_INIT_PHASES
996fe56b9e6SYuval Mintz };
997fe56b9e6SYuval Mintz 
998fe56b9e6SYuval Mintz /* per encapsulation type enabling flags */
999fe56b9e6SYuval Mintz struct prs_reg_encapsulation_type_en {
1000fe56b9e6SYuval Mintz 	u8 flags;
1001fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_ETH_OVER_GRE_ENABLE_MASK     0x1
1002fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_ETH_OVER_GRE_ENABLE_SHIFT    0
1003fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_IP_OVER_GRE_ENABLE_MASK      0x1
1004fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_IP_OVER_GRE_ENABLE_SHIFT     1
1005fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_VXLAN_ENABLE_MASK            0x1
1006fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_VXLAN_ENABLE_SHIFT           2
1007fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_T_TAG_ENABLE_MASK            0x1
1008fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_T_TAG_ENABLE_SHIFT           3
1009fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_ETH_OVER_GENEVE_ENABLE_MASK  0x1
1010fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_ETH_OVER_GENEVE_ENABLE_SHIFT 4
1011fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_IP_OVER_GENEVE_ENABLE_MASK   0x1
1012fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_IP_OVER_GENEVE_ENABLE_SHIFT  5
1013fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_RESERVED_MASK                0x3
1014fe56b9e6SYuval Mintz #define PRS_REG_ENCAPSULATION_TYPE_EN_RESERVED_SHIFT               6
1015fe56b9e6SYuval Mintz };
1016fe56b9e6SYuval Mintz 
1017fe56b9e6SYuval Mintz enum pxp_tph_st_hint {
1018fe56b9e6SYuval Mintz 	TPH_ST_HINT_BIDIR /* Read/Write access by Host and Device */,
1019fe56b9e6SYuval Mintz 	TPH_ST_HINT_REQUESTER /* Read/Write access by Device */,
1020fe56b9e6SYuval Mintz 	TPH_ST_HINT_TARGET,
1021fe56b9e6SYuval Mintz 	TPH_ST_HINT_TARGET_PRIO,
1022fe56b9e6SYuval Mintz 	MAX_PXP_TPH_ST_HINT
1023fe56b9e6SYuval Mintz };
1024fe56b9e6SYuval Mintz 
1025fe56b9e6SYuval Mintz /* QM hardware structure of enable bypass credit mask */
1026fe56b9e6SYuval Mintz struct qm_rf_bypass_mask {
1027fe56b9e6SYuval Mintz 	u8 flags;
1028fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_LINEVOQ_MASK    0x1
1029fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_LINEVOQ_SHIFT   0
1030fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_RESERVED0_MASK  0x1
1031fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_RESERVED0_SHIFT 1
1032fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_PFWFQ_MASK      0x1
1033fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_PFWFQ_SHIFT     2
1034fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_VPWFQ_MASK      0x1
1035fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_VPWFQ_SHIFT     3
1036fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_PFRL_MASK       0x1
1037fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_PFRL_SHIFT      4
1038fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_VPQCNRL_MASK    0x1
1039fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_VPQCNRL_SHIFT   5
1040fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_FWPAUSE_MASK    0x1
1041fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_FWPAUSE_SHIFT   6
1042fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_RESERVED1_MASK  0x1
1043fe56b9e6SYuval Mintz #define QM_RF_BYPASS_MASK_RESERVED1_SHIFT 7
1044fe56b9e6SYuval Mintz };
1045fe56b9e6SYuval Mintz 
1046fe56b9e6SYuval Mintz /* QM hardware structure of opportunistic credit mask */
1047fe56b9e6SYuval Mintz struct qm_rf_opportunistic_mask {
1048fe56b9e6SYuval Mintz 	__le16 flags;
1049fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_LINEVOQ_MASK     0x1
1050fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_LINEVOQ_SHIFT    0
1051fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_BYTEVOQ_MASK     0x1
1052fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_BYTEVOQ_SHIFT    1
1053fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_PFWFQ_MASK       0x1
1054fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_PFWFQ_SHIFT      2
1055fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_VPWFQ_MASK       0x1
1056fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_VPWFQ_SHIFT      3
1057fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_PFRL_MASK        0x1
1058fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_PFRL_SHIFT       4
1059fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_VPQCNRL_MASK     0x1
1060fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_VPQCNRL_SHIFT    5
1061fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_FWPAUSE_MASK     0x1
1062fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_FWPAUSE_SHIFT    6
1063fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_RESERVED0_MASK   0x1
1064fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_RESERVED0_SHIFT  7
1065fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_QUEUEEMPTY_MASK  0x1
1066fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_QUEUEEMPTY_SHIFT 8
1067fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_RESERVED1_MASK   0x7F
1068fe56b9e6SYuval Mintz #define QM_RF_OPPORTUNISTIC_MASK_RESERVED1_SHIFT  9
1069fe56b9e6SYuval Mintz };
1070fe56b9e6SYuval Mintz 
1071fe56b9e6SYuval Mintz /* QM hardware structure of QM map memory */
1072fe56b9e6SYuval Mintz struct qm_rf_pq_map {
1073fe56b9e6SYuval Mintz 	u32 reg;
1074fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_PQ_VALID_MASK          0x1         /* PQ active */
1075fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_PQ_VALID_SHIFT         0
1076fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_RL_ID_MASK             0xFF        /* RL ID */
1077fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_RL_ID_SHIFT            1
1078fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_VP_PQ_ID_MASK          0x1FF
1079fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_VP_PQ_ID_SHIFT         9
1080fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_VOQ_MASK               0x1F        /* VOQ */
1081fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_VOQ_SHIFT              18
1082fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_WRR_WEIGHT_GROUP_MASK  0x3         /* WRR weight */
1083fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_WRR_WEIGHT_GROUP_SHIFT 23
1084fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_RL_VALID_MASK          0x1         /* RL active */
1085fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_RL_VALID_SHIFT         25
1086fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_RESERVED_MASK          0x3F
1087fe56b9e6SYuval Mintz #define QM_RF_PQ_MAP_RESERVED_SHIFT         26
1088fe56b9e6SYuval Mintz };
1089fe56b9e6SYuval Mintz 
1090fc48b7a6SYuval Mintz /* Completion params for aggregated interrupt completion */
1091fc48b7a6SYuval Mintz struct sdm_agg_int_comp_params {
1092fc48b7a6SYuval Mintz 	__le16 params;
1093fc48b7a6SYuval Mintz #define SDM_AGG_INT_COMP_PARAMS_AGG_INT_INDEX_MASK      0x3F
1094fc48b7a6SYuval Mintz #define SDM_AGG_INT_COMP_PARAMS_AGG_INT_INDEX_SHIFT     0
1095fc48b7a6SYuval Mintz #define SDM_AGG_INT_COMP_PARAMS_AGG_VECTOR_ENABLE_MASK  0x1
1096fc48b7a6SYuval Mintz #define SDM_AGG_INT_COMP_PARAMS_AGG_VECTOR_ENABLE_SHIFT 6
1097fc48b7a6SYuval Mintz #define SDM_AGG_INT_COMP_PARAMS_AGG_VECTOR_BIT_MASK     0x1FF
1098fc48b7a6SYuval Mintz #define SDM_AGG_INT_COMP_PARAMS_AGG_VECTOR_BIT_SHIFT    7
1099fc48b7a6SYuval Mintz };
1100fc48b7a6SYuval Mintz 
1101fe56b9e6SYuval Mintz /* SDM operation gen command (generate aggregative interrupt) */
1102fe56b9e6SYuval Mintz struct sdm_op_gen {
1103fe56b9e6SYuval Mintz 	__le32 command;
1104fe56b9e6SYuval Mintz #define SDM_OP_GEN_COMP_PARAM_MASK  0xFFFF      /* completion parameters 0-15 */
1105fe56b9e6SYuval Mintz #define SDM_OP_GEN_COMP_PARAM_SHIFT 0
1106fe56b9e6SYuval Mintz #define SDM_OP_GEN_COMP_TYPE_MASK   0xF         /* completion type 16-19 */
1107fe56b9e6SYuval Mintz #define SDM_OP_GEN_COMP_TYPE_SHIFT  16
1108fe56b9e6SYuval Mintz #define SDM_OP_GEN_RESERVED_MASK    0xFFF       /* reserved 20-31 */
1109fe56b9e6SYuval Mintz #define SDM_OP_GEN_RESERVED_SHIFT   20
1110fe56b9e6SYuval Mintz };
1111fe56b9e6SYuval Mintz 
1112fe56b9e6SYuval Mintz /*********************************** Init ************************************/
1113fe56b9e6SYuval Mintz 
1114fe56b9e6SYuval Mintz /* Width of GRC address in bits (addresses are specified in dwords) */
1115fe56b9e6SYuval Mintz #define GRC_ADDR_BITS                   23
1116fe56b9e6SYuval Mintz #define MAX_GRC_ADDR                    ((1 << GRC_ADDR_BITS) - 1)
1117fe56b9e6SYuval Mintz 
1118fe56b9e6SYuval Mintz /* indicates an init that should be applied to any phase ID */
1119fe56b9e6SYuval Mintz #define ANY_PHASE_ID                    0xffff
1120fe56b9e6SYuval Mintz 
1121fe56b9e6SYuval Mintz /* init pattern size in bytes */
1122fe56b9e6SYuval Mintz #define INIT_PATTERN_SIZE_BITS  4
1123fe56b9e6SYuval Mintz #define MAX_INIT_PATTERN_SIZE	BIT(INIT_PATTERN_SIZE_BITS)
1124fe56b9e6SYuval Mintz 
1125fe56b9e6SYuval Mintz /* Max size in dwords of a zipped array */
1126fe56b9e6SYuval Mintz #define MAX_ZIPPED_SIZE                 8192
1127fe56b9e6SYuval Mintz 
1128fe56b9e6SYuval Mintz /* Global PXP window */
1129fe56b9e6SYuval Mintz #define NUM_OF_PXP_WIN                  19
1130fe56b9e6SYuval Mintz #define PXP_WIN_DWORD_SIZE_BITS 10
1131fe56b9e6SYuval Mintz #define PXP_WIN_DWORD_SIZE		BIT(PXP_WIN_DWORD_SIZE_BITS)
1132fe56b9e6SYuval Mintz #define PXP_WIN_BYTE_SIZE_BITS  (PXP_WIN_DWORD_SIZE_BITS + 2)
1133fe56b9e6SYuval Mintz #define PXP_WIN_BYTE_SIZE               (PXP_WIN_DWORD_SIZE * 4)
1134fe56b9e6SYuval Mintz 
1135fe56b9e6SYuval Mintz /********************************* GRC Dump **********************************/
1136fe56b9e6SYuval Mintz 
1137fe56b9e6SYuval Mintz /* width of GRC dump register sequence length in bits */
1138fe56b9e6SYuval Mintz #define DUMP_SEQ_LEN_BITS                       8
1139fe56b9e6SYuval Mintz #define DUMP_SEQ_LEN_MAX_VAL            ((1 << DUMP_SEQ_LEN_BITS) - 1)
1140fe56b9e6SYuval Mintz 
1141fe56b9e6SYuval Mintz /* width of GRC dump memory length in bits */
1142fe56b9e6SYuval Mintz #define DUMP_MEM_LEN_BITS                       18
1143fe56b9e6SYuval Mintz #define DUMP_MEM_LEN_MAX_VAL            ((1 << DUMP_MEM_LEN_BITS) - 1)
1144fe56b9e6SYuval Mintz 
1145fe56b9e6SYuval Mintz /* width of register type ID in bits */
1146fe56b9e6SYuval Mintz #define REG_TYPE_ID_BITS                        6
1147fe56b9e6SYuval Mintz #define REG_TYPE_ID_MAX_VAL                     ((1 << REG_TYPE_ID_BITS) - 1)
1148fe56b9e6SYuval Mintz 
1149fe56b9e6SYuval Mintz /* width of block ID in bits */
1150fe56b9e6SYuval Mintz #define BLOCK_ID_BITS                           8
1151fe56b9e6SYuval Mintz #define BLOCK_ID_MAX_VAL                        ((1 << BLOCK_ID_BITS) - 1)
1152fe56b9e6SYuval Mintz 
1153fe56b9e6SYuval Mintz /******************************** Idle Check *********************************/
1154fe56b9e6SYuval Mintz 
1155fe56b9e6SYuval Mintz /* max number of idle check predicate immediates */
1156fe56b9e6SYuval Mintz #define MAX_IDLE_CHK_PRED_IMM           3
1157fe56b9e6SYuval Mintz 
1158fe56b9e6SYuval Mintz /* max number of idle check argument registers */
1159fe56b9e6SYuval Mintz #define MAX_IDLE_CHK_READ_REGS          3
1160fe56b9e6SYuval Mintz 
1161fe56b9e6SYuval Mintz /* max number of idle check loops */
1162fe56b9e6SYuval Mintz #define MAX_IDLE_CHK_LOOPS                      0x10000
1163fe56b9e6SYuval Mintz 
1164fe56b9e6SYuval Mintz /* max idle check address increment */
1165fe56b9e6SYuval Mintz #define MAX_IDLE_CHK_INCREMENT          0x10000
1166fe56b9e6SYuval Mintz 
1167fe56b9e6SYuval Mintz /* inicates an undefined idle check line index */
1168fe56b9e6SYuval Mintz #define IDLE_CHK_UNDEFINED_LINE_IDX     0xffffff
1169fe56b9e6SYuval Mintz 
1170fe56b9e6SYuval Mintz /* max number of register values following the idle check header */
1171fe56b9e6SYuval Mintz #define IDLE_CHK_MAX_DUMP_REGS          2
1172fe56b9e6SYuval Mintz 
1173fe56b9e6SYuval Mintz /* arguments for IDLE_CHK_MACRO_TYPE_QM_RD_WR */
1174fe56b9e6SYuval Mintz #define IDLE_CHK_QM_RD_WR_PTR           0
1175fe56b9e6SYuval Mintz #define IDLE_CHK_QM_RD_WR_BANK          1
1176fe56b9e6SYuval Mintz 
1177fe56b9e6SYuval Mintz /**************************************/
1178fe56b9e6SYuval Mintz /* HSI Functions constants and macros */
1179fe56b9e6SYuval Mintz /**************************************/
1180fe56b9e6SYuval Mintz 
1181fe56b9e6SYuval Mintz /* Number of VLAN priorities */
1182fe56b9e6SYuval Mintz #define NUM_OF_VLAN_PRIORITIES                  8
1183fe56b9e6SYuval Mintz 
1184fe56b9e6SYuval Mintz /* the MCP Trace meta data signautre is duplicated in the perl script that
1185fe56b9e6SYuval Mintz  * generats the NVRAM images.
1186fe56b9e6SYuval Mintz  */
1187fe56b9e6SYuval Mintz #define MCP_TRACE_META_IMAGE_SIGNATURE  0x669955aa
1188fe56b9e6SYuval Mintz 
1189fe56b9e6SYuval Mintz /* Binary buffer header */
1190fe56b9e6SYuval Mintz struct bin_buffer_hdr {
1191fe56b9e6SYuval Mintz 	u32	offset;
1192fe56b9e6SYuval Mintz 	u32	length /* buffer length in bytes */;
1193fe56b9e6SYuval Mintz };
1194fe56b9e6SYuval Mintz 
1195fe56b9e6SYuval Mintz /* binary buffer types */
1196fe56b9e6SYuval Mintz enum bin_buffer_type {
1197fe56b9e6SYuval Mintz 	BIN_BUF_FW_VER_INFO /* fw_ver_info struct */,
1198fe56b9e6SYuval Mintz 	BIN_BUF_INIT_CMD /* init commands */,
1199fe56b9e6SYuval Mintz 	BIN_BUF_INIT_VAL /* init data */,
1200fe56b9e6SYuval Mintz 	BIN_BUF_INIT_MODE_TREE /* init modes tree */,
1201fe56b9e6SYuval Mintz 	BIN_BUF_IRO /* internal RAM offsets array */,
1202fe56b9e6SYuval Mintz 	MAX_BIN_BUFFER_TYPE
1203fe56b9e6SYuval Mintz };
1204fe56b9e6SYuval Mintz 
1205fe56b9e6SYuval Mintz /* Chip IDs */
1206fe56b9e6SYuval Mintz enum chip_ids {
1207fe56b9e6SYuval Mintz 	CHIP_BB_A0 /* BB A0 chip ID */,
1208fe56b9e6SYuval Mintz 	CHIP_BB_B0 /* BB B0 chip ID */,
1209fe56b9e6SYuval Mintz 	CHIP_K2 /* AH chip ID */,
1210fe56b9e6SYuval Mintz 	MAX_CHIP_IDS
1211fe56b9e6SYuval Mintz };
1212fe56b9e6SYuval Mintz 
1213fe56b9e6SYuval Mintz struct init_array_raw_hdr {
1214fe56b9e6SYuval Mintz 	__le32 data;
1215fe56b9e6SYuval Mintz #define INIT_ARRAY_RAW_HDR_TYPE_MASK    0xF
1216fe56b9e6SYuval Mintz #define INIT_ARRAY_RAW_HDR_TYPE_SHIFT   0
1217fe56b9e6SYuval Mintz #define INIT_ARRAY_RAW_HDR_PARAMS_MASK  0xFFFFFFF       /* init array params */
1218fe56b9e6SYuval Mintz #define INIT_ARRAY_RAW_HDR_PARAMS_SHIFT 4
1219fe56b9e6SYuval Mintz };
1220fe56b9e6SYuval Mintz 
1221fe56b9e6SYuval Mintz struct init_array_standard_hdr {
1222fe56b9e6SYuval Mintz 	__le32 data;
1223fe56b9e6SYuval Mintz #define INIT_ARRAY_STANDARD_HDR_TYPE_MASK  0xF
1224fe56b9e6SYuval Mintz #define INIT_ARRAY_STANDARD_HDR_TYPE_SHIFT 0
1225fe56b9e6SYuval Mintz #define INIT_ARRAY_STANDARD_HDR_SIZE_MASK  0xFFFFFFF
1226fe56b9e6SYuval Mintz #define INIT_ARRAY_STANDARD_HDR_SIZE_SHIFT 4
1227fe56b9e6SYuval Mintz };
1228fe56b9e6SYuval Mintz 
1229fe56b9e6SYuval Mintz struct init_array_zipped_hdr {
1230fe56b9e6SYuval Mintz 	__le32 data;
1231fe56b9e6SYuval Mintz #define INIT_ARRAY_ZIPPED_HDR_TYPE_MASK         0xF
1232fe56b9e6SYuval Mintz #define INIT_ARRAY_ZIPPED_HDR_TYPE_SHIFT        0
1233fe56b9e6SYuval Mintz #define INIT_ARRAY_ZIPPED_HDR_ZIPPED_SIZE_MASK  0xFFFFFFF
1234fe56b9e6SYuval Mintz #define INIT_ARRAY_ZIPPED_HDR_ZIPPED_SIZE_SHIFT 4
1235fe56b9e6SYuval Mintz };
1236fe56b9e6SYuval Mintz 
1237fe56b9e6SYuval Mintz struct init_array_pattern_hdr {
1238fe56b9e6SYuval Mintz 	__le32 data;
1239fe56b9e6SYuval Mintz #define INIT_ARRAY_PATTERN_HDR_TYPE_MASK          0xF
1240fe56b9e6SYuval Mintz #define INIT_ARRAY_PATTERN_HDR_TYPE_SHIFT         0
1241fe56b9e6SYuval Mintz #define INIT_ARRAY_PATTERN_HDR_PATTERN_SIZE_MASK  0xF
1242fe56b9e6SYuval Mintz #define INIT_ARRAY_PATTERN_HDR_PATTERN_SIZE_SHIFT 4
1243fe56b9e6SYuval Mintz #define INIT_ARRAY_PATTERN_HDR_REPETITIONS_MASK   0xFFFFFF
1244fe56b9e6SYuval Mintz #define INIT_ARRAY_PATTERN_HDR_REPETITIONS_SHIFT  8
1245fe56b9e6SYuval Mintz };
1246fe56b9e6SYuval Mintz 
1247fe56b9e6SYuval Mintz union init_array_hdr {
1248fe56b9e6SYuval Mintz 	struct init_array_raw_hdr	raw /* raw init array header */;
1249fe56b9e6SYuval Mintz 	struct init_array_standard_hdr	standard;
1250fe56b9e6SYuval Mintz 	struct init_array_zipped_hdr	zipped /* zipped init array header */;
1251fe56b9e6SYuval Mintz 	struct init_array_pattern_hdr	pattern /* pattern init array header */;
1252fe56b9e6SYuval Mintz };
1253fe56b9e6SYuval Mintz 
1254fe56b9e6SYuval Mintz enum init_array_types {
1255fe56b9e6SYuval Mintz 	INIT_ARR_STANDARD /* standard init array */,
1256fe56b9e6SYuval Mintz 	INIT_ARR_ZIPPED /* zipped init array */,
1257fe56b9e6SYuval Mintz 	INIT_ARR_PATTERN /* a repeated pattern */,
1258fe56b9e6SYuval Mintz 	MAX_INIT_ARRAY_TYPES
1259fe56b9e6SYuval Mintz };
1260fe56b9e6SYuval Mintz 
1261fe56b9e6SYuval Mintz /* init operation: callback */
1262fe56b9e6SYuval Mintz struct init_callback_op {
1263fe56b9e6SYuval Mintz 	__le32	op_data;
1264fe56b9e6SYuval Mintz #define INIT_CALLBACK_OP_OP_MASK        0xF
1265fe56b9e6SYuval Mintz #define INIT_CALLBACK_OP_OP_SHIFT       0
1266fe56b9e6SYuval Mintz #define INIT_CALLBACK_OP_RESERVED_MASK  0xFFFFFFF
1267fe56b9e6SYuval Mintz #define INIT_CALLBACK_OP_RESERVED_SHIFT 4
1268fe56b9e6SYuval Mintz 	__le16	callback_id /* Callback ID */;
1269fe56b9e6SYuval Mintz 	__le16	block_id /* Blocks ID */;
1270fe56b9e6SYuval Mintz };
1271fe56b9e6SYuval Mintz 
1272fe56b9e6SYuval Mintz /* init operation: delay */
1273fe56b9e6SYuval Mintz struct init_delay_op {
1274fe56b9e6SYuval Mintz 	__le32	op_data;
1275fe56b9e6SYuval Mintz #define INIT_DELAY_OP_OP_MASK        0xF
1276fe56b9e6SYuval Mintz #define INIT_DELAY_OP_OP_SHIFT       0
1277fe56b9e6SYuval Mintz #define INIT_DELAY_OP_RESERVED_MASK  0xFFFFFFF
1278fe56b9e6SYuval Mintz #define INIT_DELAY_OP_RESERVED_SHIFT 4
1279fe56b9e6SYuval Mintz 	__le32	delay /* delay in us */;
1280fe56b9e6SYuval Mintz };
1281fe56b9e6SYuval Mintz 
1282fe56b9e6SYuval Mintz /* init operation: if_mode */
1283fe56b9e6SYuval Mintz struct init_if_mode_op {
1284fe56b9e6SYuval Mintz 	__le32 op_data;
1285fe56b9e6SYuval Mintz #define INIT_IF_MODE_OP_OP_MASK          0xF
1286fe56b9e6SYuval Mintz #define INIT_IF_MODE_OP_OP_SHIFT         0
1287fe56b9e6SYuval Mintz #define INIT_IF_MODE_OP_RESERVED1_MASK   0xFFF
1288fe56b9e6SYuval Mintz #define INIT_IF_MODE_OP_RESERVED1_SHIFT  4
1289fe56b9e6SYuval Mintz #define INIT_IF_MODE_OP_CMD_OFFSET_MASK  0xFFFF
1290fe56b9e6SYuval Mintz #define INIT_IF_MODE_OP_CMD_OFFSET_SHIFT 16
1291fe56b9e6SYuval Mintz 	__le16	reserved2;
1292fe56b9e6SYuval Mintz 	__le16	modes_buf_offset;
1293fe56b9e6SYuval Mintz };
1294fe56b9e6SYuval Mintz 
1295fe56b9e6SYuval Mintz /*  init operation: if_phase */
1296fe56b9e6SYuval Mintz struct init_if_phase_op {
1297fe56b9e6SYuval Mintz 	__le32 op_data;
1298fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_OP_MASK           0xF
1299fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_OP_SHIFT          0
1300fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_DMAE_ENABLE_MASK  0x1
1301fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_DMAE_ENABLE_SHIFT 4
1302fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_RESERVED1_MASK    0x7FF
1303fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_RESERVED1_SHIFT   5
1304fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_CMD_OFFSET_MASK   0xFFFF
1305fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_CMD_OFFSET_SHIFT  16
1306fe56b9e6SYuval Mintz 	__le32 phase_data;
1307fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_PHASE_MASK        0xFF /* Init phase */
1308fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_PHASE_SHIFT       0
1309fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_RESERVED2_MASK    0xFF
1310fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_RESERVED2_SHIFT   8
1311fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_PHASE_ID_MASK     0xFFFF /* Init phase ID */
1312fe56b9e6SYuval Mintz #define INIT_IF_PHASE_OP_PHASE_ID_SHIFT    16
1313fe56b9e6SYuval Mintz };
1314fe56b9e6SYuval Mintz 
1315fe56b9e6SYuval Mintz /* init mode operators */
1316fe56b9e6SYuval Mintz enum init_mode_ops {
1317fe56b9e6SYuval Mintz 	INIT_MODE_OP_NOT /* init mode not operator */,
1318fe56b9e6SYuval Mintz 	INIT_MODE_OP_OR /* init mode or operator */,
1319fe56b9e6SYuval Mintz 	INIT_MODE_OP_AND /* init mode and operator */,
1320fe56b9e6SYuval Mintz 	MAX_INIT_MODE_OPS
1321fe56b9e6SYuval Mintz };
1322fe56b9e6SYuval Mintz 
1323fe56b9e6SYuval Mintz /* init operation: raw */
1324fe56b9e6SYuval Mintz struct init_raw_op {
1325fe56b9e6SYuval Mintz 	__le32	op_data;
1326fe56b9e6SYuval Mintz #define INIT_RAW_OP_OP_MASK      0xF
1327fe56b9e6SYuval Mintz #define INIT_RAW_OP_OP_SHIFT     0
1328fe56b9e6SYuval Mintz #define INIT_RAW_OP_PARAM1_MASK  0xFFFFFFF      /* init param 1 */
1329fe56b9e6SYuval Mintz #define INIT_RAW_OP_PARAM1_SHIFT 4
1330fe56b9e6SYuval Mintz 	__le32	param2 /* Init param 2 */;
1331fe56b9e6SYuval Mintz };
1332fe56b9e6SYuval Mintz 
1333fe56b9e6SYuval Mintz /* init array params */
1334fe56b9e6SYuval Mintz struct init_op_array_params {
1335fe56b9e6SYuval Mintz 	__le16	size /* array size in dwords */;
1336fe56b9e6SYuval Mintz 	__le16	offset /* array start offset in dwords */;
1337fe56b9e6SYuval Mintz };
1338fe56b9e6SYuval Mintz 
1339fe56b9e6SYuval Mintz /* Write init operation arguments */
1340fe56b9e6SYuval Mintz union init_write_args {
1341fe56b9e6SYuval Mintz 	__le32				inline_val;
1342fe56b9e6SYuval Mintz 	__le32				zeros_count;
1343fe56b9e6SYuval Mintz 	__le32				array_offset;
1344fe56b9e6SYuval Mintz 	struct init_op_array_params	runtime;
1345fe56b9e6SYuval Mintz };
1346fe56b9e6SYuval Mintz 
1347fe56b9e6SYuval Mintz /* init operation: write */
1348fe56b9e6SYuval Mintz struct init_write_op {
1349fe56b9e6SYuval Mintz 	__le32 data;
1350fe56b9e6SYuval Mintz #define INIT_WRITE_OP_OP_MASK        0xF
1351fe56b9e6SYuval Mintz #define INIT_WRITE_OP_OP_SHIFT       0
1352fe56b9e6SYuval Mintz #define INIT_WRITE_OP_SOURCE_MASK    0x7
1353fe56b9e6SYuval Mintz #define INIT_WRITE_OP_SOURCE_SHIFT   4
1354fe56b9e6SYuval Mintz #define INIT_WRITE_OP_RESERVED_MASK  0x1
1355fe56b9e6SYuval Mintz #define INIT_WRITE_OP_RESERVED_SHIFT 7
1356fe56b9e6SYuval Mintz #define INIT_WRITE_OP_WIDE_BUS_MASK  0x1
1357fe56b9e6SYuval Mintz #define INIT_WRITE_OP_WIDE_BUS_SHIFT 8
1358fe56b9e6SYuval Mintz #define INIT_WRITE_OP_ADDRESS_MASK   0x7FFFFF
1359fe56b9e6SYuval Mintz #define INIT_WRITE_OP_ADDRESS_SHIFT  9
1360fe56b9e6SYuval Mintz 	union init_write_args args /* Write init operation arguments */;
1361fe56b9e6SYuval Mintz };
1362fe56b9e6SYuval Mintz 
1363fe56b9e6SYuval Mintz /* init operation: read */
1364fe56b9e6SYuval Mintz struct init_read_op {
1365fe56b9e6SYuval Mintz 	__le32 op_data;
1366fe56b9e6SYuval Mintz #define INIT_READ_OP_OP_MASK         0xF
1367fe56b9e6SYuval Mintz #define INIT_READ_OP_OP_SHIFT        0
1368fc48b7a6SYuval Mintz #define INIT_READ_OP_POLL_TYPE_MASK  0xF
1369fc48b7a6SYuval Mintz #define INIT_READ_OP_POLL_TYPE_SHIFT 4
1370fe56b9e6SYuval Mintz #define INIT_READ_OP_RESERVED_MASK   0x1
1371fc48b7a6SYuval Mintz #define INIT_READ_OP_RESERVED_SHIFT  8
1372fe56b9e6SYuval Mintz #define INIT_READ_OP_ADDRESS_MASK    0x7FFFFF
1373fe56b9e6SYuval Mintz #define INIT_READ_OP_ADDRESS_SHIFT   9
1374fe56b9e6SYuval Mintz 	__le32 expected_val;
1375fe56b9e6SYuval Mintz };
1376fe56b9e6SYuval Mintz 
1377fe56b9e6SYuval Mintz /* Init operations union */
1378fe56b9e6SYuval Mintz union init_op {
1379fe56b9e6SYuval Mintz 	struct init_raw_op	raw /* raw init operation */;
1380fe56b9e6SYuval Mintz 	struct init_write_op	write /* write init operation */;
1381fe56b9e6SYuval Mintz 	struct init_read_op	read /* read init operation */;
1382fe56b9e6SYuval Mintz 	struct init_if_mode_op	if_mode /* if_mode init operation */;
1383fe56b9e6SYuval Mintz 	struct init_if_phase_op if_phase /* if_phase init operation */;
1384fe56b9e6SYuval Mintz 	struct init_callback_op callback /* callback init operation */;
1385fe56b9e6SYuval Mintz 	struct init_delay_op	delay /* delay init operation */;
1386fe56b9e6SYuval Mintz };
1387fe56b9e6SYuval Mintz 
1388fe56b9e6SYuval Mintz /* Init command operation types */
1389fe56b9e6SYuval Mintz enum init_op_types {
1390fe56b9e6SYuval Mintz 	INIT_OP_READ /* GRC read init command */,
1391fe56b9e6SYuval Mintz 	INIT_OP_WRITE /* GRC write init command */,
1392fe56b9e6SYuval Mintz 	INIT_OP_IF_MODE,
1393fe56b9e6SYuval Mintz 	INIT_OP_IF_PHASE,
1394fe56b9e6SYuval Mintz 	INIT_OP_DELAY /* delay init command */,
1395fe56b9e6SYuval Mintz 	INIT_OP_CALLBACK /* callback init command */,
1396fe56b9e6SYuval Mintz 	MAX_INIT_OP_TYPES
1397fe56b9e6SYuval Mintz };
1398fe56b9e6SYuval Mintz 
1399fc48b7a6SYuval Mintz enum init_poll_types {
1400fc48b7a6SYuval Mintz 	INIT_POLL_NONE /* No polling */,
1401fc48b7a6SYuval Mintz 	INIT_POLL_EQ /* init value is included in the init command */,
1402fc48b7a6SYuval Mintz 	INIT_POLL_OR /* init value is all zeros */,
1403fc48b7a6SYuval Mintz 	INIT_POLL_AND /* init value is an array of values */,
1404fc48b7a6SYuval Mintz 	MAX_INIT_POLL_TYPES
1405fc48b7a6SYuval Mintz };
1406fc48b7a6SYuval Mintz 
1407fe56b9e6SYuval Mintz /* init source types */
1408fe56b9e6SYuval Mintz enum init_source_types {
1409fe56b9e6SYuval Mintz 	INIT_SRC_INLINE /* init value is included in the init command */,
1410fe56b9e6SYuval Mintz 	INIT_SRC_ZEROS /* init value is all zeros */,
1411fe56b9e6SYuval Mintz 	INIT_SRC_ARRAY /* init value is an array of values */,
1412fe56b9e6SYuval Mintz 	INIT_SRC_RUNTIME /* init value is provided during runtime */,
1413fe56b9e6SYuval Mintz 	MAX_INIT_SOURCE_TYPES
1414fe56b9e6SYuval Mintz };
1415fe56b9e6SYuval Mintz 
1416fe56b9e6SYuval Mintz /* Internal RAM Offsets macro data */
1417fe56b9e6SYuval Mintz struct iro {
1418fe56b9e6SYuval Mintz 	u32	base /* RAM field offset */;
1419fe56b9e6SYuval Mintz 	u16	m1 /* multiplier 1 */;
1420fe56b9e6SYuval Mintz 	u16	m2 /* multiplier 2 */;
1421fe56b9e6SYuval Mintz 	u16	m3 /* multiplier 3 */;
1422fe56b9e6SYuval Mintz 	u16	size /* RAM field size */;
1423fe56b9e6SYuval Mintz };
1424fe56b9e6SYuval Mintz 
1425fe56b9e6SYuval Mintz /* QM per-port init parameters */
1426fe56b9e6SYuval Mintz struct init_qm_port_params {
1427fe56b9e6SYuval Mintz 	u8	active /* Indicates if this port is active */;
1428fe56b9e6SYuval Mintz 	u8	num_active_phys_tcs;
1429fe56b9e6SYuval Mintz 	u16	num_pbf_cmd_lines;
1430fe56b9e6SYuval Mintz 	u16	num_btb_blocks;
1431fe56b9e6SYuval Mintz 	__le16	reserved;
1432fe56b9e6SYuval Mintz };
1433fe56b9e6SYuval Mintz 
1434fe56b9e6SYuval Mintz /* QM per-PQ init parameters */
1435fe56b9e6SYuval Mintz struct init_qm_pq_params {
1436fe56b9e6SYuval Mintz 	u8	vport_id /* VPORT ID */;
1437fe56b9e6SYuval Mintz 	u8	tc_id /* TC ID */;
1438fe56b9e6SYuval Mintz 	u8	wrr_group /* WRR group */;
1439fe56b9e6SYuval Mintz 	u8	reserved;
1440fe56b9e6SYuval Mintz };
1441fe56b9e6SYuval Mintz 
1442fe56b9e6SYuval Mintz /* QM per-vport init parameters */
1443fe56b9e6SYuval Mintz struct init_qm_vport_params {
1444fe56b9e6SYuval Mintz 	u32	vport_rl;
1445fe56b9e6SYuval Mintz 	u16	vport_wfq;
1446fe56b9e6SYuval Mintz 	u16	first_tx_pq_id[NUM_OF_TCS];
1447fe56b9e6SYuval Mintz };
1448fe56b9e6SYuval Mintz 
1449fe56b9e6SYuval Mintz /* Win 2 */
1450fe56b9e6SYuval Mintz #define GTT_BAR0_MAP_REG_IGU_CMD \
1451fe56b9e6SYuval Mintz 	0x00f000UL
1452fe56b9e6SYuval Mintz /* Win 3 */
1453fe56b9e6SYuval Mintz #define GTT_BAR0_MAP_REG_TSDM_RAM \
1454fe56b9e6SYuval Mintz 	0x010000UL
1455fe56b9e6SYuval Mintz /* Win 4 */
1456fe56b9e6SYuval Mintz #define GTT_BAR0_MAP_REG_MSDM_RAM \
1457fe56b9e6SYuval Mintz 	0x011000UL
1458fe56b9e6SYuval Mintz /* Win 5 */
1459fe56b9e6SYuval Mintz #define GTT_BAR0_MAP_REG_MSDM_RAM_1024 \
1460fe56b9e6SYuval Mintz 	0x012000UL
1461fe56b9e6SYuval Mintz /* Win 6 */
1462fe56b9e6SYuval Mintz #define GTT_BAR0_MAP_REG_USDM_RAM \
1463fe56b9e6SYuval Mintz 	0x013000UL
1464fe56b9e6SYuval Mintz /* Win 7 */
1465fe56b9e6SYuval Mintz #define GTT_BAR0_MAP_REG_USDM_RAM_1024 \
1466fe56b9e6SYuval Mintz 	0x014000UL
1467fe56b9e6SYuval Mintz /* Win 8 */
1468fe56b9e6SYuval Mintz #define GTT_BAR0_MAP_REG_USDM_RAM_2048 \
1469fe56b9e6SYuval Mintz 	0x015000UL
1470fe56b9e6SYuval Mintz /* Win 9 */
1471fe56b9e6SYuval Mintz #define GTT_BAR0_MAP_REG_XSDM_RAM \
1472fe56b9e6SYuval Mintz 	0x016000UL
1473fe56b9e6SYuval Mintz /* Win 10 */
1474fe56b9e6SYuval Mintz #define GTT_BAR0_MAP_REG_YSDM_RAM \
1475fe56b9e6SYuval Mintz 	0x017000UL
1476fe56b9e6SYuval Mintz /* Win 11 */
1477fe56b9e6SYuval Mintz #define GTT_BAR0_MAP_REG_PSDM_RAM \
1478fe56b9e6SYuval Mintz 	0x018000UL
1479fe56b9e6SYuval Mintz 
1480fe56b9e6SYuval Mintz /**
1481fe56b9e6SYuval Mintz  * @brief qed_qm_pf_mem_size - prepare QM ILT sizes
1482fe56b9e6SYuval Mintz  *
1483fe56b9e6SYuval Mintz  * Returns the required host memory size in 4KB units.
1484fe56b9e6SYuval Mintz  * Must be called before all QM init HSI functions.
1485fe56b9e6SYuval Mintz  *
1486fe56b9e6SYuval Mintz  * @param pf_id			- physical function ID
1487fe56b9e6SYuval Mintz  * @param num_pf_cids	- number of connections used by this PF
1488fe56b9e6SYuval Mintz  * @param num_vf_cids	- number of connections used by VFs of this PF
1489fe56b9e6SYuval Mintz  * @param num_tids		- number of tasks used by this PF
1490fe56b9e6SYuval Mintz  * @param num_pf_pqs	- number of PQs used by this PF
1491fe56b9e6SYuval Mintz  * @param num_vf_pqs	- number of PQs used by VFs of this PF
1492fe56b9e6SYuval Mintz  *
1493fe56b9e6SYuval Mintz  * @return The required host memory size in 4KB units.
1494fe56b9e6SYuval Mintz  */
1495fe56b9e6SYuval Mintz u32 qed_qm_pf_mem_size(u8	pf_id,
1496fe56b9e6SYuval Mintz 		       u32	num_pf_cids,
1497fe56b9e6SYuval Mintz 		       u32	num_vf_cids,
1498fe56b9e6SYuval Mintz 		       u32	num_tids,
1499fe56b9e6SYuval Mintz 		       u16	num_pf_pqs,
1500fe56b9e6SYuval Mintz 		       u16	num_vf_pqs);
1501fe56b9e6SYuval Mintz 
1502fe56b9e6SYuval Mintz struct qed_qm_common_rt_init_params {
1503fe56b9e6SYuval Mintz 	u8				max_ports_per_engine;
1504fe56b9e6SYuval Mintz 	u8				max_phys_tcs_per_port;
1505fe56b9e6SYuval Mintz 	bool				pf_rl_en;
1506fe56b9e6SYuval Mintz 	bool				pf_wfq_en;
1507fe56b9e6SYuval Mintz 	bool				vport_rl_en;
1508fe56b9e6SYuval Mintz 	bool				vport_wfq_en;
1509fe56b9e6SYuval Mintz 	struct init_qm_port_params	*port_params;
1510fe56b9e6SYuval Mintz };
1511fe56b9e6SYuval Mintz 
1512fe56b9e6SYuval Mintz /**
1513fe56b9e6SYuval Mintz  * @brief qed_qm_common_rt_init - Prepare QM runtime init values for the
1514fe56b9e6SYuval Mintz  * engine phase.
1515fe56b9e6SYuval Mintz  *
1516fe56b9e6SYuval Mintz  * @param p_hwfn
1517fe56b9e6SYuval Mintz  * @param max_ports_per_engine	- max number of ports per engine in HW
1518fe56b9e6SYuval Mintz  * @param max_phys_tcs_per_port	- max number of physical TCs per port in HW
1519fe56b9e6SYuval Mintz  * @param pf_rl_en				- enable per-PF rate limiters
1520fe56b9e6SYuval Mintz  * @param pf_wfq_en				- enable per-PF WFQ
1521fe56b9e6SYuval Mintz  * @param vport_rl_en			- enable per-VPORT rate limiters
1522fe56b9e6SYuval Mintz  * @param vport_wfq_en			- enable per-VPORT WFQ
1523fe56b9e6SYuval Mintz  * @param port_params			- array of size MAX_NUM_PORTS with
1524fe56b9e6SYuval Mintz  *						arameters for each port
1525fe56b9e6SYuval Mintz  *
1526fe56b9e6SYuval Mintz  * @return 0 on success, -1 on error.
1527fe56b9e6SYuval Mintz  */
1528fe56b9e6SYuval Mintz int qed_qm_common_rt_init(
1529fe56b9e6SYuval Mintz 	struct qed_hwfn				*p_hwfn,
1530fe56b9e6SYuval Mintz 	struct qed_qm_common_rt_init_params	*p_params);
1531fe56b9e6SYuval Mintz 
1532fe56b9e6SYuval Mintz struct qed_qm_pf_rt_init_params {
1533fe56b9e6SYuval Mintz 	u8				port_id;
1534fe56b9e6SYuval Mintz 	u8				pf_id;
1535fe56b9e6SYuval Mintz 	u8				max_phys_tcs_per_port;
1536fe56b9e6SYuval Mintz 	bool				is_first_pf;
1537fe56b9e6SYuval Mintz 	u32				num_pf_cids;
1538fe56b9e6SYuval Mintz 	u32				num_vf_cids;
1539fe56b9e6SYuval Mintz 	u32				num_tids;
1540fe56b9e6SYuval Mintz 	u16				start_pq;
1541fe56b9e6SYuval Mintz 	u16				num_pf_pqs;
1542fe56b9e6SYuval Mintz 	u16				num_vf_pqs;
1543fe56b9e6SYuval Mintz 	u8				start_vport;
1544fe56b9e6SYuval Mintz 	u8				num_vports;
1545fe56b9e6SYuval Mintz 	u8				pf_wfq;
1546fe56b9e6SYuval Mintz 	u32				pf_rl;
1547fe56b9e6SYuval Mintz 	struct init_qm_pq_params	*pq_params;
1548fe56b9e6SYuval Mintz 	struct init_qm_vport_params	*vport_params;
1549fe56b9e6SYuval Mintz };
1550fe56b9e6SYuval Mintz 
1551fe56b9e6SYuval Mintz int qed_qm_pf_rt_init(struct qed_hwfn			*p_hwfn,
1552fe56b9e6SYuval Mintz 		      struct qed_ptt			*p_ptt,
1553fe56b9e6SYuval Mintz 		      struct qed_qm_pf_rt_init_params	*p_params);
1554fe56b9e6SYuval Mintz 
1555fe56b9e6SYuval Mintz /**
1556fe56b9e6SYuval Mintz  * @brief qed_init_pf_rl  Initializes the rate limit of the specified PF
1557fe56b9e6SYuval Mintz  *
1558fe56b9e6SYuval Mintz  * @param p_hwfn
1559fe56b9e6SYuval Mintz  * @param p_ptt	- ptt window used for writing the registers
1560fe56b9e6SYuval Mintz  * @param pf_id	- PF ID
1561fe56b9e6SYuval Mintz  * @param pf_rl	- rate limit in Mb/sec units
1562fe56b9e6SYuval Mintz  *
1563fe56b9e6SYuval Mintz  * @return 0 on success, -1 on error.
1564fe56b9e6SYuval Mintz  */
1565fe56b9e6SYuval Mintz int qed_init_pf_rl(struct qed_hwfn	*p_hwfn,
1566fe56b9e6SYuval Mintz 		   struct qed_ptt	*p_ptt,
1567fe56b9e6SYuval Mintz 		   u8			pf_id,
1568fe56b9e6SYuval Mintz 		   u32			pf_rl);
1569fe56b9e6SYuval Mintz 
1570fe56b9e6SYuval Mintz /**
1571fe56b9e6SYuval Mintz  * @brief qed_init_vport_rl  Initializes the rate limit of the specified VPORT
1572fe56b9e6SYuval Mintz  *
1573fe56b9e6SYuval Mintz  * @param p_hwfn
1574fe56b9e6SYuval Mintz  * @param p_ptt		- ptt window used for writing the registers
1575fe56b9e6SYuval Mintz  * @param vport_id	- VPORT ID
1576fe56b9e6SYuval Mintz  * @param vport_rl	- rate limit in Mb/sec units
1577fe56b9e6SYuval Mintz  *
1578fe56b9e6SYuval Mintz  * @return 0 on success, -1 on error.
1579fe56b9e6SYuval Mintz  */
1580fe56b9e6SYuval Mintz 
1581fe56b9e6SYuval Mintz int qed_init_vport_rl(struct qed_hwfn	*p_hwfn,
1582fe56b9e6SYuval Mintz 		      struct qed_ptt	*p_ptt,
1583fe56b9e6SYuval Mintz 		      u8		vport_id,
1584fe56b9e6SYuval Mintz 		      u32		vport_rl);
1585fe56b9e6SYuval Mintz /**
1586fe56b9e6SYuval Mintz  * @brief qed_send_qm_stop_cmd  Sends a stop command to the QM
1587fe56b9e6SYuval Mintz  *
1588fe56b9e6SYuval Mintz  * @param p_hwfn
1589fe56b9e6SYuval Mintz  * @param p_ptt	         - ptt window used for writing the registers
1590fe56b9e6SYuval Mintz  * @param is_release_cmd - true for release, false for stop.
1591fe56b9e6SYuval Mintz  * @param is_tx_pq       - true for Tx PQs, false for Other PQs.
1592fe56b9e6SYuval Mintz  * @param start_pq       - first PQ ID to stop
1593fe56b9e6SYuval Mintz  * @param num_pqs        - Number of PQs to stop, starting from start_pq.
1594fe56b9e6SYuval Mintz  *
1595fe56b9e6SYuval Mintz  * @return bool, true if successful, false if timeout occurred while waiting
1596fe56b9e6SYuval Mintz  *					for QM command done.
1597fe56b9e6SYuval Mintz  */
1598fe56b9e6SYuval Mintz 
1599fe56b9e6SYuval Mintz bool qed_send_qm_stop_cmd(struct qed_hwfn	*p_hwfn,
1600fe56b9e6SYuval Mintz 			  struct qed_ptt	*p_ptt,
1601fe56b9e6SYuval Mintz 			  bool			is_release_cmd,
1602fe56b9e6SYuval Mintz 			  bool			is_tx_pq,
1603fe56b9e6SYuval Mintz 			  u16			start_pq,
1604fe56b9e6SYuval Mintz 			  u16			num_pqs);
1605fe56b9e6SYuval Mintz 
1606fe56b9e6SYuval Mintz /* Ystorm flow control mode. Use enum fw_flow_ctrl_mode */
1607fe56b9e6SYuval Mintz #define YSTORM_FLOW_CONTROL_MODE_OFFSET  (IRO[0].base)
1608fe56b9e6SYuval Mintz #define YSTORM_FLOW_CONTROL_MODE_SIZE    (IRO[0].size)
1609fe56b9e6SYuval Mintz /* Tstorm port statistics */
1610fc48b7a6SYuval Mintz #define TSTORM_PORT_STAT_OFFSET(port_id) (IRO[1].base + ((port_id) * IRO[1].m1))
1611fe56b9e6SYuval Mintz #define TSTORM_PORT_STAT_SIZE            (IRO[1].size)
1612fc48b7a6SYuval Mintz /* Tstorm ll2 port statistics */
1613fc48b7a6SYuval Mintz #define TSTORM_LL2_PORT_STAT_OFFSET(port_id) \
1614fc48b7a6SYuval Mintz 				(IRO[2].base + ((port_id) * IRO[2].m1))
1615fc48b7a6SYuval Mintz #define TSTORM_LL2_PORT_STAT_SIZE            (IRO[2].size)
1616fe56b9e6SYuval Mintz /* Ustorm VF-PF Channel ready flag */
1617fc48b7a6SYuval Mintz #define USTORM_VF_PF_CHANNEL_READY_OFFSET(vf_id) \
1618fc48b7a6SYuval Mintz 				(IRO[3].base +	((vf_id) * IRO[3].m1))
1619fc48b7a6SYuval Mintz #define USTORM_VF_PF_CHANNEL_READY_SIZE          (IRO[3].size)
1620fe56b9e6SYuval Mintz /* Ustorm Final flr cleanup ack */
1621fc48b7a6SYuval Mintz #define USTORM_FLR_FINAL_ACK_OFFSET(pf_id) (IRO[4].base + ((pf_id) * IRO[4].m1))
1622fc48b7a6SYuval Mintz #define USTORM_FLR_FINAL_ACK_SIZE          (IRO[4].size)
1623fe56b9e6SYuval Mintz /* Ustorm Event ring consumer */
1624fc48b7a6SYuval Mintz #define USTORM_EQE_CONS_OFFSET(pf_id)    (IRO[5].base +	((pf_id) * IRO[5].m1))
1625fc48b7a6SYuval Mintz #define USTORM_EQE_CONS_SIZE             (IRO[5].size)
1626fc48b7a6SYuval Mintz /* Ustorm Common Queue ring consumer */
1627fc48b7a6SYuval Mintz #define USTORM_COMMON_QUEUE_CONS_OFFSET(global_queue_id) \
1628fc48b7a6SYuval Mintz 			(IRO[6].base + ((global_queue_id) * IRO[6].m1))
1629fc48b7a6SYuval Mintz #define USTORM_COMMON_QUEUE_CONS_SIZE    (IRO[6].size)
1630fe56b9e6SYuval Mintz /* Xstorm Integration Test Data */
1631fc48b7a6SYuval Mintz #define XSTORM_INTEG_TEST_DATA_OFFSET    (IRO[7].base)
1632fc48b7a6SYuval Mintz #define XSTORM_INTEG_TEST_DATA_SIZE      (IRO[7].size)
1633fe56b9e6SYuval Mintz /* Ystorm Integration Test Data */
1634fc48b7a6SYuval Mintz #define YSTORM_INTEG_TEST_DATA_OFFSET    (IRO[8].base)
1635fc48b7a6SYuval Mintz #define YSTORM_INTEG_TEST_DATA_SIZE      (IRO[8].size)
1636fe56b9e6SYuval Mintz /* Pstorm Integration Test Data */
1637fc48b7a6SYuval Mintz #define PSTORM_INTEG_TEST_DATA_OFFSET    (IRO[9].base)
1638fc48b7a6SYuval Mintz #define PSTORM_INTEG_TEST_DATA_SIZE      (IRO[9].size)
1639fe56b9e6SYuval Mintz /* Tstorm Integration Test Data */
1640fc48b7a6SYuval Mintz #define TSTORM_INTEG_TEST_DATA_OFFSET    (IRO[10].base)
1641fc48b7a6SYuval Mintz #define TSTORM_INTEG_TEST_DATA_SIZE      (IRO[10].size)
1642fe56b9e6SYuval Mintz /* Mstorm Integration Test Data */
1643fc48b7a6SYuval Mintz #define MSTORM_INTEG_TEST_DATA_OFFSET    (IRO[11].base)
1644fc48b7a6SYuval Mintz #define MSTORM_INTEG_TEST_DATA_SIZE      (IRO[11].size)
1645fe56b9e6SYuval Mintz /* Ustorm Integration Test Data */
1646fc48b7a6SYuval Mintz #define USTORM_INTEG_TEST_DATA_OFFSET    (IRO[12].base)
1647fc48b7a6SYuval Mintz #define USTORM_INTEG_TEST_DATA_SIZE      (IRO[12].size)
1648fe56b9e6SYuval Mintz /* Tstorm producers */
1649fc48b7a6SYuval Mintz #define TSTORM_LL2_RX_PRODS_OFFSET(core_rx_queue_id) \
1650fc48b7a6SYuval Mintz 			(IRO[13].base + ((core_rx_queue_id) * IRO[13].m1))
1651fc48b7a6SYuval Mintz #define TSTORM_LL2_RX_PRODS_SIZE         (IRO[13].size)
1652fc48b7a6SYuval Mintz /* Tstorm LightL2 queue statistics */
1653fc48b7a6SYuval Mintz #define CORE_LL2_TSTORM_PER_QUEUE_STAT_OFFSET(core_rx_queue_id) \
1654fc48b7a6SYuval Mintz 			(IRO[14].base + ((core_rx_queue_id) * IRO[14].m1))
1655fc48b7a6SYuval Mintz #define CORE_LL2_TSTORM_PER_QUEUE_STAT_SIZE    (IRO[14].size)
1656fe56b9e6SYuval Mintz /* Ustorm LiteL2 queue statistics */
1657fc48b7a6SYuval Mintz #define CORE_LL2_USTORM_PER_QUEUE_STAT_OFFSET(core_rx_queue_id) \
1658fc48b7a6SYuval Mintz 			(IRO[15].base +	((core_rx_queue_id) * IRO[15].m1))
1659fc48b7a6SYuval Mintz #define CORE_LL2_USTORM_PER_QUEUE_STAT_SIZE    (IRO[15].size)
1660fe56b9e6SYuval Mintz /* Pstorm LiteL2 queue statistics */
1661fc48b7a6SYuval Mintz #define CORE_LL2_PSTORM_PER_QUEUE_STAT_OFFSET(core_tx_stats_id) \
1662fc48b7a6SYuval Mintz 			(IRO[16].base +	((core_tx_stats_id) * IRO[16].m1))
1663fc48b7a6SYuval Mintz #define CORE_LL2_PSTORM_PER_QUEUE_STAT_SIZE    (IRO[16].size)
1664fe56b9e6SYuval Mintz /* Mstorm queue statistics */
1665fc48b7a6SYuval Mintz #define MSTORM_QUEUE_STAT_OFFSET(stat_counter_id) \
1666fc48b7a6SYuval Mintz 			(IRO[17].base + ((stat_counter_id) * IRO[17].m1))
1667fc48b7a6SYuval Mintz #define MSTORM_QUEUE_STAT_SIZE                 (IRO[17].size)
1668fe56b9e6SYuval Mintz /* Mstorm producers */
1669fc48b7a6SYuval Mintz #define MSTORM_PRODS_OFFSET(queue_id) (IRO[18].base + ((queue_id) * IRO[18].m1))
1670fc48b7a6SYuval Mintz #define MSTORM_PRODS_SIZE             (IRO[18].size)
1671fe56b9e6SYuval Mintz /* TPA agregation timeout in us resolution (on ASIC) */
1672fc48b7a6SYuval Mintz #define MSTORM_TPA_TIMEOUT_US_OFFSET  (IRO[19].base)
1673fc48b7a6SYuval Mintz #define MSTORM_TPA_TIMEOUT_US_SIZE    (IRO[19].size)
1674fe56b9e6SYuval Mintz /* Ustorm queue statistics */
1675fc48b7a6SYuval Mintz #define USTORM_QUEUE_STAT_OFFSET(stat_counter_id) \
1676fc48b7a6SYuval Mintz 			(IRO[20].base + ((stat_counter_id) * IRO[20].m1))
1677fc48b7a6SYuval Mintz #define USTORM_QUEUE_STAT_SIZE        (IRO[20].size)
1678fe56b9e6SYuval Mintz /* Ustorm queue zone */
1679fc48b7a6SYuval Mintz #define USTORM_ETH_QUEUE_ZONE_OFFSET(queue_id) \
1680fc48b7a6SYuval Mintz 			(IRO[21].base +	((queue_id) * IRO[21].m1))
1681fc48b7a6SYuval Mintz #define USTORM_ETH_QUEUE_ZONE_SIZE    (IRO[21].size)
1682fe56b9e6SYuval Mintz /* Pstorm queue statistics */
1683fc48b7a6SYuval Mintz #define PSTORM_QUEUE_STAT_OFFSET(stat_counter_id) \
1684fc48b7a6SYuval Mintz 		(IRO[22].base + ((stat_counter_id) * IRO[22].m1))
1685fc48b7a6SYuval Mintz #define PSTORM_QUEUE_STAT_SIZE        (IRO[22].size)
1686fe56b9e6SYuval Mintz /* Tstorm last parser message */
1687fc48b7a6SYuval Mintz #define TSTORM_ETH_PRS_INPUT_OFFSET  (IRO[23].base)
1688fc48b7a6SYuval Mintz #define TSTORM_ETH_PRS_INPUT_SIZE    (IRO[23].size)
1689fc48b7a6SYuval Mintz /* Tstorm Eth limit Rx rate */
1690fc48b7a6SYuval Mintz #define ETH_RX_RATE_LIMIT_OFFSET(pf_id) (IRO[24].base +	((pf_id) * IRO[24].m1))
1691fc48b7a6SYuval Mintz #define ETH_RX_RATE_LIMIT_SIZE       (IRO[24].size)
1692fe56b9e6SYuval Mintz /* Ystorm queue zone */
1693fc48b7a6SYuval Mintz #define YSTORM_ETH_QUEUE_ZONE_OFFSET(queue_id) \
1694fc48b7a6SYuval Mintz 			(IRO[25].base +	((queue_id) * IRO[25].m1))
1695fc48b7a6SYuval Mintz #define YSTORM_ETH_QUEUE_ZONE_SIZE   (IRO[25].size)
1696fe56b9e6SYuval Mintz /* Ystorm cqe producer */
1697fc48b7a6SYuval Mintz #define YSTORM_TOE_CQ_PROD_OFFSET(rss_id) \
1698fc48b7a6SYuval Mintz 			(IRO[26].base + ((rss_id) * IRO[26].m1))
1699fc48b7a6SYuval Mintz #define YSTORM_TOE_CQ_PROD_SIZE      (IRO[26].size)
1700fe56b9e6SYuval Mintz /* Ustorm cqe producer */
1701fc48b7a6SYuval Mintz #define USTORM_TOE_CQ_PROD_OFFSET(rss_id) \
1702fc48b7a6SYuval Mintz 			(IRO[27].base + ((rss_id) * IRO[27].m1))
1703fc48b7a6SYuval Mintz #define USTORM_TOE_CQ_PROD_SIZE      (IRO[27].size)
1704fe56b9e6SYuval Mintz /* Ustorm grq producer */
1705fc48b7a6SYuval Mintz #define USTORM_TOE_GRQ_PROD_OFFSET(pf_id) \
1706fc48b7a6SYuval Mintz 			(IRO[28].base + ((pf_id) * IRO[28].m1))
1707fc48b7a6SYuval Mintz #define USTORM_TOE_GRQ_PROD_SIZE     (IRO[28].size)
1708fe56b9e6SYuval Mintz /* Tstorm cmdq-cons of given command queue-id */
1709fc48b7a6SYuval Mintz #define TSTORM_SCSI_CMDQ_CONS_OFFSET(cmdq_queue_id) \
1710fc48b7a6SYuval Mintz 			(IRO[29].base + ((cmdq_queue_id) * IRO[29].m1))
1711fc48b7a6SYuval Mintz #define TSTORM_SCSI_CMDQ_CONS_SIZE   (IRO[29].size)
1712fe56b9e6SYuval Mintz /* Mstorm rq-cons of given queue-id */
1713fc48b7a6SYuval Mintz #define MSTORM_SCSI_RQ_CONS_OFFSET(rq_queue_id) \
1714fc48b7a6SYuval Mintz 		(IRO[30].base + ((rq_queue_id) * IRO[30].m1))
1715fc48b7a6SYuval Mintz #define MSTORM_SCSI_RQ_CONS_SIZE     (IRO[30].size)
1716fc48b7a6SYuval Mintz /* Mstorm bdq-external-producer of given BDQ function ID, BDqueue-id */
1717fc48b7a6SYuval Mintz #define MSTORM_SCSI_BDQ_EXT_PROD_OFFSET(func_id, bdq_id) \
1718fc48b7a6SYuval Mintz 	(IRO[31].base + ((func_id) * IRO[31].m1) + ((bdq_id) * IRO[31].m2))
1719fc48b7a6SYuval Mintz #define MSTORM_SCSI_BDQ_EXT_PROD_SIZE (IRO[31].size)
1720fc48b7a6SYuval Mintz /* Tstorm (reflects M-Storm) bdq-external-producer of given fn ID, BDqueue-id */
1721fc48b7a6SYuval Mintz #define TSTORM_SCSI_BDQ_EXT_PROD_OFFSET(func_id, bdq_id) \
1722fc48b7a6SYuval Mintz 	(IRO[32].base + ((func_id) * IRO[32].m1) + ((bdq_id) * IRO[32].m2))
1723fc48b7a6SYuval Mintz #define TSTORM_SCSI_BDQ_EXT_PROD_SIZE (IRO[32].size)
1724fc48b7a6SYuval Mintz /* Tstorm iSCSI RX stats */
1725fc48b7a6SYuval Mintz #define TSTORM_ISCSI_RX_STATS_OFFSET(pf_id) \
1726fc48b7a6SYuval Mintz 				(IRO[33].base + ((pf_id) * IRO[33].m1))
1727fc48b7a6SYuval Mintz #define TSTORM_ISCSI_RX_STATS_SIZE    (IRO[33].size)
1728fc48b7a6SYuval Mintz /* Mstorm iSCSI RX stats */
1729fc48b7a6SYuval Mintz #define MSTORM_ISCSI_RX_STATS_OFFSET(pf_id) \
1730fc48b7a6SYuval Mintz 				(IRO[34].base + ((pf_id) * IRO[34].m1))
1731fc48b7a6SYuval Mintz #define MSTORM_ISCSI_RX_STATS_SIZE    (IRO[34].size)
1732fc48b7a6SYuval Mintz /* Ustorm iSCSI RX stats */
1733fc48b7a6SYuval Mintz #define USTORM_ISCSI_RX_STATS_OFFSET(pf_id) \
1734fc48b7a6SYuval Mintz 				(IRO[35].base +	((pf_id) * IRO[35].m1))
1735fc48b7a6SYuval Mintz #define USTORM_ISCSI_RX_STATS_SIZE    (IRO[35].size)
1736fc48b7a6SYuval Mintz /* Xstorm iSCSI TX stats */
1737fc48b7a6SYuval Mintz #define XSTORM_ISCSI_TX_STATS_OFFSET(pf_id) \
1738fc48b7a6SYuval Mintz 				(IRO[36].base +	((pf_id) * IRO[36].m1))
1739fc48b7a6SYuval Mintz #define XSTORM_ISCSI_TX_STATS_SIZE    (IRO[36].size)
1740fc48b7a6SYuval Mintz /* Ystorm iSCSI TX stats */
1741fc48b7a6SYuval Mintz #define YSTORM_ISCSI_TX_STATS_OFFSET(pf_id) \
1742fc48b7a6SYuval Mintz 				(IRO[37].base +	((pf_id) * IRO[37].m1))
1743fc48b7a6SYuval Mintz #define YSTORM_ISCSI_TX_STATS_SIZE    (IRO[37].size)
1744fc48b7a6SYuval Mintz /* Pstorm iSCSI TX stats */
1745fc48b7a6SYuval Mintz #define PSTORM_ISCSI_TX_STATS_OFFSET(pf_id) \
1746fc48b7a6SYuval Mintz 				(IRO[38].base +	((pf_id) * IRO[38].m1))
1747fc48b7a6SYuval Mintz #define PSTORM_ISCSI_TX_STATS_SIZE    (IRO[38].size)
1748fc48b7a6SYuval Mintz /* Tstorm FCoE RX stats */
1749fc48b7a6SYuval Mintz #define TSTORM_FCOE_RX_STATS_OFFSET(pf_id) \
1750fc48b7a6SYuval Mintz 				(IRO[39].base +	((pf_id) * IRO[39].m1))
1751fc48b7a6SYuval Mintz #define TSTORM_FCOE_RX_STATS_SIZE      (IRO[39].size)
1752fc48b7a6SYuval Mintz /* Mstorm FCoE RX stats */
1753fc48b7a6SYuval Mintz #define MSTORM_FCOE_RX_STATS_OFFSET(pf_id) \
1754fc48b7a6SYuval Mintz 				(IRO[40].base +	((pf_id) * IRO[40].m1))
1755fc48b7a6SYuval Mintz #define MSTORM_FCOE_RX_STATS_SIZE      (IRO[40].size)
1756fc48b7a6SYuval Mintz /* Pstorm FCoE TX stats */
1757fc48b7a6SYuval Mintz #define PSTORM_FCOE_TX_STATS_OFFSET(pf_id) \
1758fc48b7a6SYuval Mintz 				(IRO[41].base +	((pf_id) * IRO[41].m1))
1759fc48b7a6SYuval Mintz #define PSTORM_FCOE_TX_STATS_SIZE      (IRO[41].size)
1760fe56b9e6SYuval Mintz /* Pstorm RoCE statistics */
1761fc48b7a6SYuval Mintz #define PSTORM_ROCE_STAT_OFFSET(stat_counter_id) \
1762fc48b7a6SYuval Mintz 			(IRO[42].base + ((stat_counter_id) * IRO[42].m1))
1763fc48b7a6SYuval Mintz #define PSTORM_ROCE_STAT_SIZE          (IRO[42].size)
1764fe56b9e6SYuval Mintz /* Tstorm RoCE statistics */
1765fc48b7a6SYuval Mintz #define TSTORM_ROCE_STAT_OFFSET(stat_counter_id) \
1766fc48b7a6SYuval Mintz 			(IRO[43].base + ((stat_counter_id) * IRO[43].m1))
1767fc48b7a6SYuval Mintz #define TSTORM_ROCE_STAT_SIZE          (IRO[43].size)
1768fe56b9e6SYuval Mintz 
1769fc48b7a6SYuval Mintz static const struct iro iro_arr[44] = {
1770fe56b9e6SYuval Mintz 	{ 0x10,	   0x0,	   0x0,	   0x0,	   0x8	    },
1771fc48b7a6SYuval Mintz 	{ 0x47c8,  0x60,   0x0,	   0x0,	   0x60	    },
1772fc48b7a6SYuval Mintz 	{ 0x5e30,  0x20,   0x0,	   0x0,	   0x20	    },
1773fc48b7a6SYuval Mintz 	{ 0x510,   0x8,	   0x0,	   0x0,	   0x4	    },
1774fc48b7a6SYuval Mintz 	{ 0x490,   0x8,	   0x0,	   0x0,	   0x4	    },
1775fe56b9e6SYuval Mintz 	{ 0x10,	   0x8,	   0x0,	   0x0,	   0x2	    },
1776fe56b9e6SYuval Mintz 	{ 0x90,	   0x8,	   0x0,	   0x0,	   0x2	    },
1777fc48b7a6SYuval Mintz 	{ 0x4940,  0x0,	   0x0,	   0x0,	   0x78	    },
1778fc48b7a6SYuval Mintz 	{ 0x3de0,  0x0,	   0x0,	   0x0,	   0x78	    },
1779fc48b7a6SYuval Mintz 	{ 0x2998,  0x0,	   0x0,	   0x0,	   0x78	    },
1780fc48b7a6SYuval Mintz 	{ 0x4750,  0x0,	   0x0,	   0x0,	   0x78	    },
1781fc48b7a6SYuval Mintz 	{ 0x56d0,  0x0,	   0x0,	   0x0,	   0x78	    },
1782fc48b7a6SYuval Mintz 	{ 0x7e50,  0x0,	   0x0,	   0x0,	   0x78	    },
1783fe56b9e6SYuval Mintz 	{ 0x100,   0x8,	   0x0,	   0x0,	   0x8	    },
1784fc48b7a6SYuval Mintz 	{ 0x5c10,  0x10,   0x0,	   0x0,	   0x10	    },
1785fc48b7a6SYuval Mintz 	{ 0xb508,  0x30,   0x0,	   0x0,	   0x30	    },
1786fe56b9e6SYuval Mintz 	{ 0x95c0,  0x30,   0x0,	   0x0,	   0x30	    },
1787fc48b7a6SYuval Mintz 	{ 0x58a0,  0x40,   0x0,	   0x0,	   0x40	    },
1788fe56b9e6SYuval Mintz 	{ 0x200,   0x10,   0x0,	   0x0,	   0x8	    },
1789fc48b7a6SYuval Mintz 	{ 0xa230,  0x0,	   0x0,	   0x0,	   0x4	    },
1790fc48b7a6SYuval Mintz 	{ 0x8058,  0x40,   0x0,	   0x0,	   0x30	    },
1791fe56b9e6SYuval Mintz 	{ 0xd00,   0x8,	   0x0,	   0x0,	   0x8	    },
1792fc48b7a6SYuval Mintz 	{ 0x2b30,  0x80,   0x0,	   0x0,	   0x38	    },
1793fc48b7a6SYuval Mintz 	{ 0xa808,  0x0,	   0x0,	   0x0,	   0xf0	    },
1794fc48b7a6SYuval Mintz 	{ 0xa8f8,  0x8,	   0x0,	   0x0,	   0x8	    },
1795fe56b9e6SYuval Mintz 	{ 0x80,	   0x8,	   0x0,	   0x0,	   0x8	    },
1796fe56b9e6SYuval Mintz 	{ 0xac0,   0x8,	   0x0,	   0x0,	   0x8	    },
1797fe56b9e6SYuval Mintz 	{ 0x2580,  0x8,	   0x0,	   0x0,	   0x8	    },
1798fe56b9e6SYuval Mintz 	{ 0x2500,  0x8,	   0x0,	   0x0,	   0x8	    },
1799fe56b9e6SYuval Mintz 	{ 0x440,   0x8,	   0x0,	   0x0,	   0x2	    },
1800fe56b9e6SYuval Mintz 	{ 0x1800,  0x8,	   0x0,	   0x0,	   0x2	    },
1801fc48b7a6SYuval Mintz 	{ 0x1a00,  0x10,   0x8,	   0x0,	   0x2	    },
1802fc48b7a6SYuval Mintz 	{ 0x640,   0x10,   0x8,	   0x0,	   0x2	    },
1803fc48b7a6SYuval Mintz 	{ 0xd9b8,  0x38,   0x0,	   0x0,	   0x24	    },
1804fc48b7a6SYuval Mintz 	{ 0x11048, 0x10,   0x0,	   0x0,	   0x8	    },
1805fc48b7a6SYuval Mintz 	{ 0x11678, 0x38,   0x0,	   0x0,	   0x18	    },
1806fc48b7a6SYuval Mintz 	{ 0xaec0,  0x30,   0x0,	   0x0,	   0x10	    },
1807fc48b7a6SYuval Mintz 	{ 0x8700,  0x28,   0x0,	   0x0,	   0x18	    },
1808fc48b7a6SYuval Mintz 	{ 0xec00,  0x10,   0x0,	   0x0,	   0x10	    },
1809fc48b7a6SYuval Mintz 	{ 0xde38,  0x40,   0x0,	   0x0,	   0x30	    },
1810fc48b7a6SYuval Mintz 	{ 0x121a8, 0x38,   0x0,	   0x0,	   0x8	    },
1811fc48b7a6SYuval Mintz 	{ 0xf068,  0x20,   0x0,	   0x0,	   0x20	    },
1812fc48b7a6SYuval Mintz 	{ 0x2b68,  0x80,   0x0,	   0x0,	   0x10	    },
1813fc48b7a6SYuval Mintz 	{ 0x4ab8,  0x10,   0x0,	   0x0,	   0x10	    },
1814fe56b9e6SYuval Mintz };
1815fe56b9e6SYuval Mintz 
1816fe56b9e6SYuval Mintz /* Runtime array offsets */
1817fe56b9e6SYuval Mintz #define DORQ_REG_PF_MAX_ICID_0_RT_OFFSET                                0
1818fe56b9e6SYuval Mintz #define DORQ_REG_PF_MAX_ICID_1_RT_OFFSET                                1
1819fe56b9e6SYuval Mintz #define DORQ_REG_PF_MAX_ICID_2_RT_OFFSET                                2
1820fe56b9e6SYuval Mintz #define DORQ_REG_PF_MAX_ICID_3_RT_OFFSET                                3
1821fe56b9e6SYuval Mintz #define DORQ_REG_PF_MAX_ICID_4_RT_OFFSET                                4
1822fe56b9e6SYuval Mintz #define DORQ_REG_PF_MAX_ICID_5_RT_OFFSET                                5
1823fe56b9e6SYuval Mintz #define DORQ_REG_PF_MAX_ICID_6_RT_OFFSET                                6
1824fe56b9e6SYuval Mintz #define DORQ_REG_PF_MAX_ICID_7_RT_OFFSET                                7
1825fe56b9e6SYuval Mintz #define DORQ_REG_VF_MAX_ICID_0_RT_OFFSET                                8
1826fe56b9e6SYuval Mintz #define DORQ_REG_VF_MAX_ICID_1_RT_OFFSET                                9
1827fe56b9e6SYuval Mintz #define DORQ_REG_VF_MAX_ICID_2_RT_OFFSET                                10
1828fe56b9e6SYuval Mintz #define DORQ_REG_VF_MAX_ICID_3_RT_OFFSET                                11
1829fe56b9e6SYuval Mintz #define DORQ_REG_VF_MAX_ICID_4_RT_OFFSET                                12
1830fe56b9e6SYuval Mintz #define DORQ_REG_VF_MAX_ICID_5_RT_OFFSET                                13
1831fe56b9e6SYuval Mintz #define DORQ_REG_VF_MAX_ICID_6_RT_OFFSET                                14
1832fe56b9e6SYuval Mintz #define DORQ_REG_VF_MAX_ICID_7_RT_OFFSET                                15
1833fe56b9e6SYuval Mintz #define DORQ_REG_PF_WAKE_ALL_RT_OFFSET                                  16
1834fc48b7a6SYuval Mintz #define DORQ_REG_TAG1_ETHERTYPE_RT_OFFSET                               17
1835fc48b7a6SYuval Mintz #define IGU_REG_PF_CONFIGURATION_RT_OFFSET                              18
1836fc48b7a6SYuval Mintz #define IGU_REG_VF_CONFIGURATION_RT_OFFSET                              19
1837fc48b7a6SYuval Mintz #define IGU_REG_ATTN_MSG_ADDR_L_RT_OFFSET                               20
1838fc48b7a6SYuval Mintz #define IGU_REG_ATTN_MSG_ADDR_H_RT_OFFSET                               21
1839fc48b7a6SYuval Mintz #define IGU_REG_LEADING_EDGE_LATCH_RT_OFFSET                            22
1840fc48b7a6SYuval Mintz #define IGU_REG_TRAILING_EDGE_LATCH_RT_OFFSET                           23
1841fc48b7a6SYuval Mintz #define CAU_REG_CQE_AGG_UNIT_SIZE_RT_OFFSET                             24
1842fc48b7a6SYuval Mintz #define CAU_REG_SB_VAR_MEMORY_RT_OFFSET                                 761
1843fe56b9e6SYuval Mintz #define CAU_REG_SB_VAR_MEMORY_RT_SIZE                                   736
1844fc48b7a6SYuval Mintz #define CAU_REG_SB_VAR_MEMORY_RT_OFFSET                                 761
1845fe56b9e6SYuval Mintz #define CAU_REG_SB_VAR_MEMORY_RT_SIZE                                   736
1846fc48b7a6SYuval Mintz #define CAU_REG_SB_ADDR_MEMORY_RT_OFFSET                                1497
1847fe56b9e6SYuval Mintz #define CAU_REG_SB_ADDR_MEMORY_RT_SIZE                                  736
1848fc48b7a6SYuval Mintz #define CAU_REG_PI_MEMORY_RT_OFFSET                                     2233
1849fe56b9e6SYuval Mintz #define CAU_REG_PI_MEMORY_RT_SIZE                                       4416
1850fc48b7a6SYuval Mintz #define PRS_REG_SEARCH_RESP_INITIATOR_TYPE_RT_OFFSET                    6649
1851fc48b7a6SYuval Mintz #define PRS_REG_TASK_ID_MAX_INITIATOR_PF_RT_OFFSET                      6650
1852fc48b7a6SYuval Mintz #define PRS_REG_TASK_ID_MAX_INITIATOR_VF_RT_OFFSET                      6651
1853fc48b7a6SYuval Mintz #define PRS_REG_TASK_ID_MAX_TARGET_PF_RT_OFFSET                         6652
1854fc48b7a6SYuval Mintz #define PRS_REG_TASK_ID_MAX_TARGET_VF_RT_OFFSET                         6653
1855fc48b7a6SYuval Mintz #define PRS_REG_SEARCH_TCP_RT_OFFSET                                    6654
1856fc48b7a6SYuval Mintz #define PRS_REG_SEARCH_FCOE_RT_OFFSET                                   6655
1857fc48b7a6SYuval Mintz #define PRS_REG_SEARCH_ROCE_RT_OFFSET                                   6656
1858fc48b7a6SYuval Mintz #define PRS_REG_ROCE_DEST_QP_MAX_VF_RT_OFFSET                           6657
1859fc48b7a6SYuval Mintz #define PRS_REG_ROCE_DEST_QP_MAX_PF_RT_OFFSET                           6658
1860fc48b7a6SYuval Mintz #define PRS_REG_SEARCH_OPENFLOW_RT_OFFSET                               6659
1861fc48b7a6SYuval Mintz #define PRS_REG_SEARCH_NON_IP_AS_OPENFLOW_RT_OFFSET                     6660
1862fc48b7a6SYuval Mintz #define PRS_REG_OPENFLOW_SUPPORT_ONLY_KNOWN_OVER_IP_RT_OFFSET           6661
1863fc48b7a6SYuval Mintz #define PRS_REG_OPENFLOW_SEARCH_KEY_MASK_RT_OFFSET                      6662
1864fc48b7a6SYuval Mintz #define PRS_REG_TAG_ETHERTYPE_0_RT_OFFSET                               6663
1865fc48b7a6SYuval Mintz #define PRS_REG_LIGHT_L2_ETHERTYPE_EN_RT_OFFSET                         6664
1866fc48b7a6SYuval Mintz #define SRC_REG_FIRSTFREE_RT_OFFSET                                     6665
1867fe56b9e6SYuval Mintz #define SRC_REG_FIRSTFREE_RT_SIZE                                       2
1868fc48b7a6SYuval Mintz #define SRC_REG_LASTFREE_RT_OFFSET                                      6667
1869fe56b9e6SYuval Mintz #define SRC_REG_LASTFREE_RT_SIZE                                        2
1870fc48b7a6SYuval Mintz #define SRC_REG_COUNTFREE_RT_OFFSET                                     6669
1871fc48b7a6SYuval Mintz #define SRC_REG_NUMBER_HASH_BITS_RT_OFFSET                              6670
1872fc48b7a6SYuval Mintz #define PSWRQ2_REG_CDUT_P_SIZE_RT_OFFSET                                6671
1873fc48b7a6SYuval Mintz #define PSWRQ2_REG_CDUC_P_SIZE_RT_OFFSET                                6672
1874fc48b7a6SYuval Mintz #define PSWRQ2_REG_TM_P_SIZE_RT_OFFSET                                  6673
1875fc48b7a6SYuval Mintz #define PSWRQ2_REG_QM_P_SIZE_RT_OFFSET                                  6674
1876fc48b7a6SYuval Mintz #define PSWRQ2_REG_SRC_P_SIZE_RT_OFFSET                                 6675
1877fc48b7a6SYuval Mintz #define PSWRQ2_REG_TM_FIRST_ILT_RT_OFFSET                               6676
1878fc48b7a6SYuval Mintz #define PSWRQ2_REG_TM_LAST_ILT_RT_OFFSET                                6677
1879fc48b7a6SYuval Mintz #define PSWRQ2_REG_QM_FIRST_ILT_RT_OFFSET                               6678
1880fc48b7a6SYuval Mintz #define PSWRQ2_REG_QM_LAST_ILT_RT_OFFSET                                6679
1881fc48b7a6SYuval Mintz #define PSWRQ2_REG_SRC_FIRST_ILT_RT_OFFSET                              6680
1882fc48b7a6SYuval Mintz #define PSWRQ2_REG_SRC_LAST_ILT_RT_OFFSET                               6681
1883fc48b7a6SYuval Mintz #define PSWRQ2_REG_CDUC_FIRST_ILT_RT_OFFSET                             6682
1884fc48b7a6SYuval Mintz #define PSWRQ2_REG_CDUC_LAST_ILT_RT_OFFSET                              6683
1885fc48b7a6SYuval Mintz #define PSWRQ2_REG_CDUT_FIRST_ILT_RT_OFFSET                             6684
1886fc48b7a6SYuval Mintz #define PSWRQ2_REG_CDUT_LAST_ILT_RT_OFFSET                              6685
1887fc48b7a6SYuval Mintz #define PSWRQ2_REG_TSDM_FIRST_ILT_RT_OFFSET                             6686
1888fc48b7a6SYuval Mintz #define PSWRQ2_REG_TSDM_LAST_ILT_RT_OFFSET                              6687
1889fc48b7a6SYuval Mintz #define PSWRQ2_REG_TM_NUMBER_OF_PF_BLOCKS_RT_OFFSET                     6688
1890fc48b7a6SYuval Mintz #define PSWRQ2_REG_CDUT_NUMBER_OF_PF_BLOCKS_RT_OFFSET                   6689
1891fc48b7a6SYuval Mintz #define PSWRQ2_REG_CDUC_NUMBER_OF_PF_BLOCKS_RT_OFFSET                   6690
1892fc48b7a6SYuval Mintz #define PSWRQ2_REG_TM_VF_BLOCKS_RT_OFFSET                               6691
1893fc48b7a6SYuval Mintz #define PSWRQ2_REG_CDUT_VF_BLOCKS_RT_OFFSET                             6692
1894fc48b7a6SYuval Mintz #define PSWRQ2_REG_CDUC_VF_BLOCKS_RT_OFFSET                             6693
1895fc48b7a6SYuval Mintz #define PSWRQ2_REG_TM_BLOCKS_FACTOR_RT_OFFSET                           6694
1896fc48b7a6SYuval Mintz #define PSWRQ2_REG_CDUT_BLOCKS_FACTOR_RT_OFFSET                         6695
1897fc48b7a6SYuval Mintz #define PSWRQ2_REG_CDUC_BLOCKS_FACTOR_RT_OFFSET                         6696
1898fc48b7a6SYuval Mintz #define PSWRQ2_REG_VF_BASE_RT_OFFSET                                    6697
1899fc48b7a6SYuval Mintz #define PSWRQ2_REG_VF_LAST_ILT_RT_OFFSET                                6698
1900fc48b7a6SYuval Mintz #define PSWRQ2_REG_WR_MBS0_RT_OFFSET                                    6699
1901fc48b7a6SYuval Mintz #define PSWRQ2_REG_RD_MBS0_RT_OFFSET                                    6700
1902fc48b7a6SYuval Mintz #define PSWRQ2_REG_DRAM_ALIGN_WR_RT_OFFSET                              6701
1903fc48b7a6SYuval Mintz #define PSWRQ2_REG_DRAM_ALIGN_RD_RT_OFFSET                              6702
1904fc48b7a6SYuval Mintz #define PSWRQ2_REG_ILT_MEMORY_RT_OFFSET                                 6703
1905fe56b9e6SYuval Mintz #define PSWRQ2_REG_ILT_MEMORY_RT_SIZE                                   22000
1906fc48b7a6SYuval Mintz #define PGLUE_REG_B_VF_BASE_RT_OFFSET                                   28703
1907fc48b7a6SYuval Mintz #define PGLUE_REG_B_CACHE_LINE_SIZE_RT_OFFSET                           28704
1908fc48b7a6SYuval Mintz #define PGLUE_REG_B_PF_BAR0_SIZE_RT_OFFSET                              28705
1909fc48b7a6SYuval Mintz #define PGLUE_REG_B_PF_BAR1_SIZE_RT_OFFSET                              28706
1910fc48b7a6SYuval Mintz #define PGLUE_REG_B_VF_BAR1_SIZE_RT_OFFSET                              28707
1911fc48b7a6SYuval Mintz #define TM_REG_VF_ENABLE_CONN_RT_OFFSET                                 28708
1912fc48b7a6SYuval Mintz #define TM_REG_PF_ENABLE_CONN_RT_OFFSET                                 28709
1913fc48b7a6SYuval Mintz #define TM_REG_PF_ENABLE_TASK_RT_OFFSET                                 28710
1914fc48b7a6SYuval Mintz #define TM_REG_GROUP_SIZE_RESOLUTION_CONN_RT_OFFSET                     28711
1915fc48b7a6SYuval Mintz #define TM_REG_GROUP_SIZE_RESOLUTION_TASK_RT_OFFSET                     28712
1916fc48b7a6SYuval Mintz #define TM_REG_CONFIG_CONN_MEM_RT_OFFSET                                28713
1917fe56b9e6SYuval Mintz #define TM_REG_CONFIG_CONN_MEM_RT_SIZE                                  416
1918fc48b7a6SYuval Mintz #define TM_REG_CONFIG_TASK_MEM_RT_OFFSET                                29129
1919fe56b9e6SYuval Mintz #define TM_REG_CONFIG_TASK_MEM_RT_SIZE                                  512
1920fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZE_0_RT_OFFSET                                    29641
1921fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZE_1_RT_OFFSET                                    29642
1922fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZE_2_RT_OFFSET                                    29643
1923fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_0_RT_OFFSET                               29644
1924fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_1_RT_OFFSET                               29645
1925fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_2_RT_OFFSET                               29646
1926fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_3_RT_OFFSET                               29647
1927fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_4_RT_OFFSET                               29648
1928fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_5_RT_OFFSET                               29649
1929fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_6_RT_OFFSET                               29650
1930fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_7_RT_OFFSET                               29651
1931fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_8_RT_OFFSET                               29652
1932fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_9_RT_OFFSET                               29653
1933fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_10_RT_OFFSET                              29654
1934fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_11_RT_OFFSET                              29655
1935fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_12_RT_OFFSET                              29656
1936fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_13_RT_OFFSET                              29657
1937fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_14_RT_OFFSET                              29658
1938fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_15_RT_OFFSET                              29659
1939fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_16_RT_OFFSET                              29660
1940fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_17_RT_OFFSET                              29661
1941fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_18_RT_OFFSET                              29662
1942fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_19_RT_OFFSET                              29663
1943fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_20_RT_OFFSET                              29664
1944fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_21_RT_OFFSET                              29665
1945fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_22_RT_OFFSET                              29666
1946fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_23_RT_OFFSET                              29667
1947fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_24_RT_OFFSET                              29668
1948fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_25_RT_OFFSET                              29669
1949fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_26_RT_OFFSET                              29670
1950fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_27_RT_OFFSET                              29671
1951fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_28_RT_OFFSET                              29672
1952fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_29_RT_OFFSET                              29673
1953fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_30_RT_OFFSET                              29674
1954fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_31_RT_OFFSET                              29675
1955fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_32_RT_OFFSET                              29676
1956fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_33_RT_OFFSET                              29677
1957fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_34_RT_OFFSET                              29678
1958fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_35_RT_OFFSET                              29679
1959fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_36_RT_OFFSET                              29680
1960fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_37_RT_OFFSET                              29681
1961fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_38_RT_OFFSET                              29682
1962fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_39_RT_OFFSET                              29683
1963fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_40_RT_OFFSET                              29684
1964fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_41_RT_OFFSET                              29685
1965fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_42_RT_OFFSET                              29686
1966fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_43_RT_OFFSET                              29687
1967fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_44_RT_OFFSET                              29688
1968fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_45_RT_OFFSET                              29689
1969fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_46_RT_OFFSET                              29690
1970fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_47_RT_OFFSET                              29691
1971fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_48_RT_OFFSET                              29692
1972fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_49_RT_OFFSET                              29693
1973fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_50_RT_OFFSET                              29694
1974fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_51_RT_OFFSET                              29695
1975fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_52_RT_OFFSET                              29696
1976fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_53_RT_OFFSET                              29697
1977fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_54_RT_OFFSET                              29698
1978fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_55_RT_OFFSET                              29699
1979fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_56_RT_OFFSET                              29700
1980fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_57_RT_OFFSET                              29701
1981fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_58_RT_OFFSET                              29702
1982fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_59_RT_OFFSET                              29703
1983fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_60_RT_OFFSET                              29704
1984fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_61_RT_OFFSET                              29705
1985fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_62_RT_OFFSET                              29706
1986fc48b7a6SYuval Mintz #define QM_REG_MAXPQSIZETXSEL_63_RT_OFFSET                              29707
1987fc48b7a6SYuval Mintz #define QM_REG_BASEADDROTHERPQ_RT_OFFSET                                29708
1988fe56b9e6SYuval Mintz #define QM_REG_BASEADDROTHERPQ_RT_SIZE                                  128
1989fc48b7a6SYuval Mintz #define QM_REG_VOQCRDLINE_RT_OFFSET                                     29836
1990fe56b9e6SYuval Mintz #define QM_REG_VOQCRDLINE_RT_SIZE                                       20
1991fc48b7a6SYuval Mintz #define QM_REG_VOQINITCRDLINE_RT_OFFSET                                 29856
1992fe56b9e6SYuval Mintz #define QM_REG_VOQINITCRDLINE_RT_SIZE                                   20
1993fc48b7a6SYuval Mintz #define QM_REG_AFULLQMBYPTHRPFWFQ_RT_OFFSET                             29876
1994fc48b7a6SYuval Mintz #define QM_REG_AFULLQMBYPTHRVPWFQ_RT_OFFSET                             29877
1995fc48b7a6SYuval Mintz #define QM_REG_AFULLQMBYPTHRPFRL_RT_OFFSET                              29878
1996fc48b7a6SYuval Mintz #define QM_REG_AFULLQMBYPTHRGLBLRL_RT_OFFSET                            29879
1997fc48b7a6SYuval Mintz #define QM_REG_AFULLOPRTNSTCCRDMASK_RT_OFFSET                           29880
1998fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_0_RT_OFFSET                                29881
1999fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_1_RT_OFFSET                                29882
2000fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_2_RT_OFFSET                                29883
2001fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_3_RT_OFFSET                                29884
2002fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_4_RT_OFFSET                                29885
2003fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_5_RT_OFFSET                                29886
2004fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_6_RT_OFFSET                                29887
2005fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_7_RT_OFFSET                                29888
2006fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_8_RT_OFFSET                                29889
2007fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_9_RT_OFFSET                                29890
2008fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_10_RT_OFFSET                               29891
2009fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_11_RT_OFFSET                               29892
2010fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_12_RT_OFFSET                               29893
2011fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_13_RT_OFFSET                               29894
2012fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_14_RT_OFFSET                               29895
2013fc48b7a6SYuval Mintz #define QM_REG_WRROTHERPQGRP_15_RT_OFFSET                               29896
2014fc48b7a6SYuval Mintz #define QM_REG_WRROTHERGRPWEIGHT_0_RT_OFFSET                            29897
2015fc48b7a6SYuval Mintz #define QM_REG_WRROTHERGRPWEIGHT_1_RT_OFFSET                            29898
2016fc48b7a6SYuval Mintz #define QM_REG_WRROTHERGRPWEIGHT_2_RT_OFFSET                            29899
2017fc48b7a6SYuval Mintz #define QM_REG_WRROTHERGRPWEIGHT_3_RT_OFFSET                            29900
2018fc48b7a6SYuval Mintz #define QM_REG_WRRTXGRPWEIGHT_0_RT_OFFSET                               29901
2019fc48b7a6SYuval Mintz #define QM_REG_WRRTXGRPWEIGHT_1_RT_OFFSET                               29902
2020fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_0_RT_OFFSET                                      29903
2021fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_1_RT_OFFSET                                      29904
2022fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_2_RT_OFFSET                                      29905
2023fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_3_RT_OFFSET                                      29906
2024fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_4_RT_OFFSET                                      29907
2025fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_5_RT_OFFSET                                      29908
2026fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_6_RT_OFFSET                                      29909
2027fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_7_RT_OFFSET                                      29910
2028fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_8_RT_OFFSET                                      29911
2029fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_9_RT_OFFSET                                      29912
2030fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_10_RT_OFFSET                                     29913
2031fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_11_RT_OFFSET                                     29914
2032fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_12_RT_OFFSET                                     29915
2033fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_13_RT_OFFSET                                     29916
2034fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_14_RT_OFFSET                                     29917
2035fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_15_RT_OFFSET                                     29918
2036fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_16_RT_OFFSET                                     29919
2037fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_17_RT_OFFSET                                     29920
2038fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_18_RT_OFFSET                                     29921
2039fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_19_RT_OFFSET                                     29922
2040fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_20_RT_OFFSET                                     29923
2041fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_21_RT_OFFSET                                     29924
2042fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_22_RT_OFFSET                                     29925
2043fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_23_RT_OFFSET                                     29926
2044fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_24_RT_OFFSET                                     29927
2045fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_25_RT_OFFSET                                     29928
2046fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_26_RT_OFFSET                                     29929
2047fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_27_RT_OFFSET                                     29930
2048fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_28_RT_OFFSET                                     29931
2049fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_29_RT_OFFSET                                     29932
2050fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_30_RT_OFFSET                                     29933
2051fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_31_RT_OFFSET                                     29934
2052fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_32_RT_OFFSET                                     29935
2053fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_33_RT_OFFSET                                     29936
2054fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_34_RT_OFFSET                                     29937
2055fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_35_RT_OFFSET                                     29938
2056fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_36_RT_OFFSET                                     29939
2057fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_37_RT_OFFSET                                     29940
2058fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_38_RT_OFFSET                                     29941
2059fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_39_RT_OFFSET                                     29942
2060fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_40_RT_OFFSET                                     29943
2061fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_41_RT_OFFSET                                     29944
2062fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_42_RT_OFFSET                                     29945
2063fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_43_RT_OFFSET                                     29946
2064fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_44_RT_OFFSET                                     29947
2065fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_45_RT_OFFSET                                     29948
2066fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_46_RT_OFFSET                                     29949
2067fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_47_RT_OFFSET                                     29950
2068fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_48_RT_OFFSET                                     29951
2069fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_49_RT_OFFSET                                     29952
2070fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_50_RT_OFFSET                                     29953
2071fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_51_RT_OFFSET                                     29954
2072fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_52_RT_OFFSET                                     29955
2073fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_53_RT_OFFSET                                     29956
2074fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_54_RT_OFFSET                                     29957
2075fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_55_RT_OFFSET                                     29958
2076fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_56_RT_OFFSET                                     29959
2077fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_57_RT_OFFSET                                     29960
2078fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_58_RT_OFFSET                                     29961
2079fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_59_RT_OFFSET                                     29962
2080fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_60_RT_OFFSET                                     29963
2081fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_61_RT_OFFSET                                     29964
2082fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_62_RT_OFFSET                                     29965
2083fc48b7a6SYuval Mintz #define QM_REG_PQTX2PF_63_RT_OFFSET                                     29966
2084fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_0_RT_OFFSET                                   29967
2085fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_1_RT_OFFSET                                   29968
2086fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_2_RT_OFFSET                                   29969
2087fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_3_RT_OFFSET                                   29970
2088fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_4_RT_OFFSET                                   29971
2089fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_5_RT_OFFSET                                   29972
2090fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_6_RT_OFFSET                                   29973
2091fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_7_RT_OFFSET                                   29974
2092fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_8_RT_OFFSET                                   29975
2093fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_9_RT_OFFSET                                   29976
2094fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_10_RT_OFFSET                                  29977
2095fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_11_RT_OFFSET                                  29978
2096fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_12_RT_OFFSET                                  29979
2097fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_13_RT_OFFSET                                  29980
2098fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_14_RT_OFFSET                                  29981
2099fc48b7a6SYuval Mintz #define QM_REG_PQOTHER2PF_15_RT_OFFSET                                  29982
2100fc48b7a6SYuval Mintz #define QM_REG_RLGLBLPERIOD_0_RT_OFFSET                                 29983
2101fc48b7a6SYuval Mintz #define QM_REG_RLGLBLPERIOD_1_RT_OFFSET                                 29984
2102fc48b7a6SYuval Mintz #define QM_REG_RLGLBLPERIODTIMER_0_RT_OFFSET                            29985
2103fc48b7a6SYuval Mintz #define QM_REG_RLGLBLPERIODTIMER_1_RT_OFFSET                            29986
2104fc48b7a6SYuval Mintz #define QM_REG_RLGLBLPERIODSEL_0_RT_OFFSET                              29987
2105fc48b7a6SYuval Mintz #define QM_REG_RLGLBLPERIODSEL_1_RT_OFFSET                              29988
2106fc48b7a6SYuval Mintz #define QM_REG_RLGLBLPERIODSEL_2_RT_OFFSET                              29989
2107fc48b7a6SYuval Mintz #define QM_REG_RLGLBLPERIODSEL_3_RT_OFFSET                              29990
2108fc48b7a6SYuval Mintz #define QM_REG_RLGLBLPERIODSEL_4_RT_OFFSET                              29991
2109fc48b7a6SYuval Mintz #define QM_REG_RLGLBLPERIODSEL_5_RT_OFFSET                              29992
2110fc48b7a6SYuval Mintz #define QM_REG_RLGLBLPERIODSEL_6_RT_OFFSET                              29993
2111fc48b7a6SYuval Mintz #define QM_REG_RLGLBLPERIODSEL_7_RT_OFFSET                              29994
2112fc48b7a6SYuval Mintz #define QM_REG_RLGLBLINCVAL_RT_OFFSET                                   29995
2113fe56b9e6SYuval Mintz #define QM_REG_RLGLBLINCVAL_RT_SIZE                                     256
2114fc48b7a6SYuval Mintz #define QM_REG_RLGLBLUPPERBOUND_RT_OFFSET                               30251
2115fe56b9e6SYuval Mintz #define QM_REG_RLGLBLUPPERBOUND_RT_SIZE                                 256
2116fc48b7a6SYuval Mintz #define QM_REG_RLGLBLCRD_RT_OFFSET                                      30507
2117fe56b9e6SYuval Mintz #define QM_REG_RLGLBLCRD_RT_SIZE                                        256
2118fc48b7a6SYuval Mintz #define QM_REG_RLGLBLENABLE_RT_OFFSET                                   30763
2119fc48b7a6SYuval Mintz #define QM_REG_RLPFPERIOD_RT_OFFSET                                     30764
2120fc48b7a6SYuval Mintz #define QM_REG_RLPFPERIODTIMER_RT_OFFSET                                30765
2121fc48b7a6SYuval Mintz #define QM_REG_RLPFINCVAL_RT_OFFSET                                     30766
2122fe56b9e6SYuval Mintz #define QM_REG_RLPFINCVAL_RT_SIZE                                       16
2123fc48b7a6SYuval Mintz #define QM_REG_RLPFUPPERBOUND_RT_OFFSET                                 30782
2124fe56b9e6SYuval Mintz #define QM_REG_RLPFUPPERBOUND_RT_SIZE                                   16
2125fc48b7a6SYuval Mintz #define QM_REG_RLPFCRD_RT_OFFSET                                        30798
2126fe56b9e6SYuval Mintz #define QM_REG_RLPFCRD_RT_SIZE                                          16
2127fc48b7a6SYuval Mintz #define QM_REG_RLPFENABLE_RT_OFFSET                                     30814
2128fc48b7a6SYuval Mintz #define QM_REG_RLPFVOQENABLE_RT_OFFSET                                  30815
2129fc48b7a6SYuval Mintz #define QM_REG_WFQPFWEIGHT_RT_OFFSET                                    30816
2130fe56b9e6SYuval Mintz #define QM_REG_WFQPFWEIGHT_RT_SIZE                                      16
2131fc48b7a6SYuval Mintz #define QM_REG_WFQPFUPPERBOUND_RT_OFFSET                                30832
2132fe56b9e6SYuval Mintz #define QM_REG_WFQPFUPPERBOUND_RT_SIZE                                  16
2133fc48b7a6SYuval Mintz #define QM_REG_WFQPFCRD_RT_OFFSET                                       30848
2134fe56b9e6SYuval Mintz #define QM_REG_WFQPFCRD_RT_SIZE                                         160
2135fc48b7a6SYuval Mintz #define QM_REG_WFQPFENABLE_RT_OFFSET                                    31008
2136fc48b7a6SYuval Mintz #define QM_REG_WFQVPENABLE_RT_OFFSET                                    31009
2137fc48b7a6SYuval Mintz #define QM_REG_BASEADDRTXPQ_RT_OFFSET                                   31010
2138fe56b9e6SYuval Mintz #define QM_REG_BASEADDRTXPQ_RT_SIZE                                     512
2139fc48b7a6SYuval Mintz #define QM_REG_TXPQMAP_RT_OFFSET                                        31522
2140fe56b9e6SYuval Mintz #define QM_REG_TXPQMAP_RT_SIZE                                          512
2141fc48b7a6SYuval Mintz #define QM_REG_WFQVPWEIGHT_RT_OFFSET                                    32034
2142fe56b9e6SYuval Mintz #define QM_REG_WFQVPWEIGHT_RT_SIZE                                      512
2143fc48b7a6SYuval Mintz #define QM_REG_WFQVPCRD_RT_OFFSET                                       32546
2144fe56b9e6SYuval Mintz #define QM_REG_WFQVPCRD_RT_SIZE                                         512
2145fc48b7a6SYuval Mintz #define QM_REG_WFQVPMAP_RT_OFFSET                                       33058
2146fe56b9e6SYuval Mintz #define QM_REG_WFQVPMAP_RT_SIZE                                         512
2147fc48b7a6SYuval Mintz #define QM_REG_WFQPFCRD_MSB_RT_OFFSET                                   33570
2148fe56b9e6SYuval Mintz #define QM_REG_WFQPFCRD_MSB_RT_SIZE                                     160
2149fc48b7a6SYuval Mintz #define NIG_REG_TAG_ETHERTYPE_0_RT_OFFSET                               33730
2150fc48b7a6SYuval Mintz #define NIG_REG_OUTER_TAG_VALUE_LIST0_RT_OFFSET                         33731
2151fc48b7a6SYuval Mintz #define NIG_REG_OUTER_TAG_VALUE_LIST1_RT_OFFSET                         33732
2152fc48b7a6SYuval Mintz #define NIG_REG_OUTER_TAG_VALUE_LIST2_RT_OFFSET                         33733
2153fc48b7a6SYuval Mintz #define NIG_REG_OUTER_TAG_VALUE_LIST3_RT_OFFSET                         33734
2154fc48b7a6SYuval Mintz #define NIG_REG_OUTER_TAG_VALUE_MASK_RT_OFFSET                          33735
2155fc48b7a6SYuval Mintz #define NIG_REG_LLH_FUNC_TAGMAC_CLS_TYPE_RT_OFFSET                      33736
2156fc48b7a6SYuval Mintz #define NIG_REG_LLH_FUNC_TAG_EN_RT_OFFSET                               33737
2157fe56b9e6SYuval Mintz #define NIG_REG_LLH_FUNC_TAG_EN_RT_SIZE                                 4
2158fc48b7a6SYuval Mintz #define NIG_REG_LLH_FUNC_TAG_HDR_SEL_RT_OFFSET                          33741
2159fe56b9e6SYuval Mintz #define NIG_REG_LLH_FUNC_TAG_HDR_SEL_RT_SIZE                            4
2160fc48b7a6SYuval Mintz #define NIG_REG_LLH_FUNC_TAG_VALUE_RT_OFFSET                            33745
2161fe56b9e6SYuval Mintz #define NIG_REG_LLH_FUNC_TAG_VALUE_RT_SIZE                              4
2162fc48b7a6SYuval Mintz #define NIG_REG_LLH_FUNC_NO_TAG_RT_OFFSET                               33749
2163fc48b7a6SYuval Mintz #define NIG_REG_LLH_FUNC_FILTER_VALUE_RT_OFFSET                         33750
2164fe56b9e6SYuval Mintz #define NIG_REG_LLH_FUNC_FILTER_VALUE_RT_SIZE                           32
2165fc48b7a6SYuval Mintz #define NIG_REG_LLH_FUNC_FILTER_EN_RT_OFFSET                            33782
2166fe56b9e6SYuval Mintz #define NIG_REG_LLH_FUNC_FILTER_EN_RT_SIZE                              16
2167fc48b7a6SYuval Mintz #define NIG_REG_LLH_FUNC_FILTER_MODE_RT_OFFSET                          33798
2168fe56b9e6SYuval Mintz #define NIG_REG_LLH_FUNC_FILTER_MODE_RT_SIZE                            16
2169fc48b7a6SYuval Mintz #define NIG_REG_LLH_FUNC_FILTER_PROTOCOL_TYPE_RT_OFFSET                 33814
2170fe56b9e6SYuval Mintz #define NIG_REG_LLH_FUNC_FILTER_PROTOCOL_TYPE_RT_SIZE                   16
2171fc48b7a6SYuval Mintz #define NIG_REG_LLH_FUNC_FILTER_HDR_SEL_RT_OFFSET                       33830
2172fe56b9e6SYuval Mintz #define NIG_REG_LLH_FUNC_FILTER_HDR_SEL_RT_SIZE                         16
2173fc48b7a6SYuval Mintz #define NIG_REG_TX_EDPM_CTRL_RT_OFFSET                                  33846
2174fc48b7a6SYuval Mintz #define CDU_REG_CID_ADDR_PARAMS_RT_OFFSET                               33847
2175fc48b7a6SYuval Mintz #define CDU_REG_SEGMENT0_PARAMS_RT_OFFSET                               33848
2176fc48b7a6SYuval Mintz #define CDU_REG_SEGMENT1_PARAMS_RT_OFFSET                               33849
2177fc48b7a6SYuval Mintz #define CDU_REG_PF_SEG0_TYPE_OFFSET_RT_OFFSET                           33850
2178fc48b7a6SYuval Mintz #define CDU_REG_PF_SEG1_TYPE_OFFSET_RT_OFFSET                           33851
2179fc48b7a6SYuval Mintz #define CDU_REG_PF_SEG2_TYPE_OFFSET_RT_OFFSET                           33852
2180fc48b7a6SYuval Mintz #define CDU_REG_PF_SEG3_TYPE_OFFSET_RT_OFFSET                           33853
2181fc48b7a6SYuval Mintz #define CDU_REG_PF_FL_SEG0_TYPE_OFFSET_RT_OFFSET                        33854
2182fc48b7a6SYuval Mintz #define CDU_REG_PF_FL_SEG1_TYPE_OFFSET_RT_OFFSET                        33855
2183fc48b7a6SYuval Mintz #define CDU_REG_PF_FL_SEG2_TYPE_OFFSET_RT_OFFSET                        33856
2184fc48b7a6SYuval Mintz #define CDU_REG_PF_FL_SEG3_TYPE_OFFSET_RT_OFFSET                        33857
2185fc48b7a6SYuval Mintz #define CDU_REG_VF_SEG_TYPE_OFFSET_RT_OFFSET                            33858
2186fc48b7a6SYuval Mintz #define CDU_REG_VF_FL_SEG_TYPE_OFFSET_RT_OFFSET                         33859
2187fc48b7a6SYuval Mintz #define PBF_REG_TAG_ETHERTYPE_0_RT_OFFSET                               33860
2188fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SIZE_RT_OFFSET                          33861
2189fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ0_RT_OFFSET                        33862
2190fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ0_RT_OFFSET                           33863
2191fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ0_RT_OFFSET                    33864
2192fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ1_RT_OFFSET                        33865
2193fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ1_RT_OFFSET                           33866
2194fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ1_RT_OFFSET                    33867
2195fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ2_RT_OFFSET                        33868
2196fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ2_RT_OFFSET                           33869
2197fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ2_RT_OFFSET                    33870
2198fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ3_RT_OFFSET                        33871
2199fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ3_RT_OFFSET                           33872
2200fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ3_RT_OFFSET                    33873
2201fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ4_RT_OFFSET                        33874
2202fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ4_RT_OFFSET                           33875
2203fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ4_RT_OFFSET                    33876
2204fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ5_RT_OFFSET                        33877
2205fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ5_RT_OFFSET                           33878
2206fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ5_RT_OFFSET                    33879
2207fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ6_RT_OFFSET                        33880
2208fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ6_RT_OFFSET                           33881
2209fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ6_RT_OFFSET                    33882
2210fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ7_RT_OFFSET                        33883
2211fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ7_RT_OFFSET                           33884
2212fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ7_RT_OFFSET                    33885
2213fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ8_RT_OFFSET                        33886
2214fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ8_RT_OFFSET                           33887
2215fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ8_RT_OFFSET                    33888
2216fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ9_RT_OFFSET                        33889
2217fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ9_RT_OFFSET                           33890
2218fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ9_RT_OFFSET                    33891
2219fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ10_RT_OFFSET                       33892
2220fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ10_RT_OFFSET                          33893
2221fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ10_RT_OFFSET                   33894
2222fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ11_RT_OFFSET                       33895
2223fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ11_RT_OFFSET                          33896
2224fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ11_RT_OFFSET                   33897
2225fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ12_RT_OFFSET                       33898
2226fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ12_RT_OFFSET                          33899
2227fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ12_RT_OFFSET                   33900
2228fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ13_RT_OFFSET                       33901
2229fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ13_RT_OFFSET                          33902
2230fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ13_RT_OFFSET                   33903
2231fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ14_RT_OFFSET                       33904
2232fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ14_RT_OFFSET                          33905
2233fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ14_RT_OFFSET                   33906
2234fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ15_RT_OFFSET                       33907
2235fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ15_RT_OFFSET                          33908
2236fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ15_RT_OFFSET                   33909
2237fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ16_RT_OFFSET                       33910
2238fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ16_RT_OFFSET                          33911
2239fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ16_RT_OFFSET                   33912
2240fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ17_RT_OFFSET                       33913
2241fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ17_RT_OFFSET                          33914
2242fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ17_RT_OFFSET                   33915
2243fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ18_RT_OFFSET                       33916
2244fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ18_RT_OFFSET                          33917
2245fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ18_RT_OFFSET                   33918
2246fc48b7a6SYuval Mintz #define PBF_REG_YCMD_QS_NUM_LINES_VOQ19_RT_OFFSET                       33919
2247fc48b7a6SYuval Mintz #define PBF_REG_BTB_GUARANTEED_VOQ19_RT_OFFSET                          33920
2248fc48b7a6SYuval Mintz #define PBF_REG_BTB_SHARED_AREA_SETUP_VOQ19_RT_OFFSET                   33921
2249fc48b7a6SYuval Mintz #define XCM_REG_CON_PHY_Q3_RT_OFFSET                                    33922
2250fe56b9e6SYuval Mintz 
2251fc48b7a6SYuval Mintz #define RUNTIME_ARRAY_SIZE 33923
2252fe56b9e6SYuval Mintz 
2253fc48b7a6SYuval Mintz /* The eth storm context for the Tstorm */
2254fc48b7a6SYuval Mintz struct tstorm_eth_conn_st_ctx {
2255fe56b9e6SYuval Mintz 	__le32 reserved[4];
2256fe56b9e6SYuval Mintz };
2257fe56b9e6SYuval Mintz 
2258fe56b9e6SYuval Mintz /* The eth storm context for the Pstorm */
2259fe56b9e6SYuval Mintz struct pstorm_eth_conn_st_ctx {
2260fe56b9e6SYuval Mintz 	__le32 reserved[8];
2261fe56b9e6SYuval Mintz };
2262fe56b9e6SYuval Mintz 
2263fe56b9e6SYuval Mintz /* The eth storm context for the Xstorm */
2264fe56b9e6SYuval Mintz struct xstorm_eth_conn_st_ctx {
2265fe56b9e6SYuval Mintz 	__le32 reserved[60];
2266fe56b9e6SYuval Mintz };
2267fe56b9e6SYuval Mintz 
2268fe56b9e6SYuval Mintz struct xstorm_eth_conn_ag_ctx {
2269fe56b9e6SYuval Mintz 	u8	reserved0 /* cdu_validation */;
2270fe56b9e6SYuval Mintz 	u8	eth_state /* state */;
2271fe56b9e6SYuval Mintz 	u8	flags0;
2272fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_EXIST_IN_QM0_MASK            0x1
2273fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_EXIST_IN_QM0_SHIFT           0
2274fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED1_MASK               0x1
2275fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED1_SHIFT              1
2276fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED2_MASK               0x1
2277fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED2_SHIFT              2
2278fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_EXIST_IN_QM3_MASK            0x1
2279fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_EXIST_IN_QM3_SHIFT           3
2280fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED3_MASK               0x1 /* bit4 */
2281fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED3_SHIFT              4
2282fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED4_MASK               0x1
2283fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED4_SHIFT              5
2284fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED5_MASK               0x1 /* bit6 */
2285fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED5_SHIFT              6
2286fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED6_MASK               0x1 /* bit7 */
2287fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED6_SHIFT              7
2288fe56b9e6SYuval Mintz 	u8 flags1;
2289fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED7_MASK               0x1 /* bit8 */
2290fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED7_SHIFT              0
2291fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED8_MASK               0x1 /* bit9 */
2292fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED8_SHIFT              1
2293fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED9_MASK               0x1 /* bit10 */
2294fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED9_SHIFT              2
2295fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_BIT11_MASK                   0x1 /* bit11 */
2296fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_BIT11_SHIFT                  3
2297fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_BIT12_MASK                   0x1 /* bit12 */
2298fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_BIT12_SHIFT                  4
2299fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_BIT13_MASK                   0x1 /* bit13 */
2300fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_BIT13_SHIFT                  5
2301fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_TX_RULE_ACTIVE_MASK          0x1 /* bit14 */
2302fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_TX_RULE_ACTIVE_SHIFT         6
2303fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_DQ_CF_ACTIVE_MASK            0x1 /* bit15 */
2304fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_DQ_CF_ACTIVE_SHIFT           7
2305fe56b9e6SYuval Mintz 	u8 flags2;
2306fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF0_MASK                     0x3 /* timer0cf */
2307fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF0_SHIFT                    0
2308fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF1_MASK                     0x3 /* timer1cf */
2309fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF1_SHIFT                    2
2310fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF2_MASK                     0x3 /* timer2cf */
2311fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF2_SHIFT                    4
2312fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF3_MASK                     0x3
2313fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF3_SHIFT                    6
2314fe56b9e6SYuval Mintz 	u8 flags3;
2315fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF4_MASK                     0x3 /* cf4 */
2316fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF4_SHIFT                    0
2317fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF5_MASK                     0x3 /* cf5 */
2318fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF5_SHIFT                    2
2319fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF6_MASK                     0x3 /* cf6 */
2320fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF6_SHIFT                    4
2321fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF7_MASK                     0x3 /* cf7 */
2322fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF7_SHIFT                    6
2323fe56b9e6SYuval Mintz 	u8 flags4;
2324fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF8_MASK                     0x3 /* cf8 */
2325fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF8_SHIFT                    0
2326fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF9_MASK                     0x3 /* cf9 */
2327fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF9_SHIFT                    2
2328fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF10_MASK                    0x3 /* cf10 */
2329fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF10_SHIFT                   4
2330fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF11_MASK                    0x3 /* cf11 */
2331fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF11_SHIFT                   6
2332fe56b9e6SYuval Mintz 	u8 flags5;
2333fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF12_MASK                    0x3 /* cf12 */
2334fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF12_SHIFT                   0
2335fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF13_MASK                    0x3 /* cf13 */
2336fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF13_SHIFT                   2
2337fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF14_MASK                    0x3 /* cf14 */
2338fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF14_SHIFT                   4
2339fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF15_MASK                    0x3 /* cf15 */
2340fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF15_SHIFT                   6
2341fe56b9e6SYuval Mintz 	u8 flags6;
2342fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_GO_TO_BD_CONS_CF_MASK        0x3 /* cf16 */
2343fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_GO_TO_BD_CONS_CF_SHIFT       0
2344fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_MULTI_UNICAST_CF_MASK        0x3
2345fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_MULTI_UNICAST_CF_SHIFT       2
2346fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_DQ_CF_MASK                   0x3 /* cf18 */
2347fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_DQ_CF_SHIFT                  4
2348fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_TERMINATE_CF_MASK            0x3 /* cf19 */
2349fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_TERMINATE_CF_SHIFT           6
2350fe56b9e6SYuval Mintz 	u8 flags7;
2351fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_FLUSH_Q0_MASK                0x3 /* cf20 */
2352fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_FLUSH_Q0_SHIFT               0
2353fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED10_MASK              0x3 /* cf21 */
2354fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED10_SHIFT             2
2355fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_SLOW_PATH_MASK               0x3 /* cf22 */
2356fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_SLOW_PATH_SHIFT              4
2357fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF0EN_MASK                   0x1 /* cf0en */
2358fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF0EN_SHIFT                  6
2359fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF1EN_MASK                   0x1 /* cf1en */
2360fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF1EN_SHIFT                  7
2361fe56b9e6SYuval Mintz 	u8 flags8;
2362fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF2EN_MASK                   0x1 /* cf2en */
2363fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF2EN_SHIFT                  0
2364fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF3EN_MASK                   0x1 /* cf3en */
2365fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF3EN_SHIFT                  1
2366fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF4EN_MASK                   0x1 /* cf4en */
2367fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF4EN_SHIFT                  2
2368fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF5EN_MASK                   0x1 /* cf5en */
2369fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF5EN_SHIFT                  3
2370fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF6EN_MASK                   0x1 /* cf6en */
2371fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF6EN_SHIFT                  4
2372fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF7EN_MASK                   0x1 /* cf7en */
2373fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF7EN_SHIFT                  5
2374fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF8EN_MASK                   0x1 /* cf8en */
2375fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF8EN_SHIFT                  6
2376fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF9EN_MASK                   0x1 /* cf9en */
2377fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF9EN_SHIFT                  7
2378fe56b9e6SYuval Mintz 	u8 flags9;
2379fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF10EN_MASK                  0x1 /* cf10en */
2380fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF10EN_SHIFT                 0
2381fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF11EN_MASK                  0x1 /* cf11en */
2382fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF11EN_SHIFT                 1
2383fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF12EN_MASK                  0x1 /* cf12en */
2384fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF12EN_SHIFT                 2
2385fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF13EN_MASK                  0x1 /* cf13en */
2386fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF13EN_SHIFT                 3
2387fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF14EN_MASK                  0x1 /* cf14en */
2388fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF14EN_SHIFT                 4
2389fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF15EN_MASK                  0x1 /* cf15en */
2390fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_CF15EN_SHIFT                 5
2391fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_GO_TO_BD_CONS_CF_EN_MASK     0x1 /* cf16en */
2392fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_GO_TO_BD_CONS_CF_EN_SHIFT    6
2393fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_MULTI_UNICAST_CF_EN_MASK     0x1
2394fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_MULTI_UNICAST_CF_EN_SHIFT    7
2395fe56b9e6SYuval Mintz 	u8 flags10;
2396fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_DQ_CF_EN_MASK                0x1 /* cf18en */
2397fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_DQ_CF_EN_SHIFT               0
2398fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_TERMINATE_CF_EN_MASK         0x1 /* cf19en */
2399fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_TERMINATE_CF_EN_SHIFT        1
2400fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_FLUSH_Q0_EN_MASK             0x1 /* cf20en */
2401fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_FLUSH_Q0_EN_SHIFT            2
2402fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED11_MASK              0x1 /* cf21en */
2403fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED11_SHIFT             3
2404fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_SLOW_PATH_EN_MASK            0x1 /* cf22en */
2405fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_SLOW_PATH_EN_SHIFT           4
2406fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_TPH_ENABLE_EN_RESERVED_MASK  0x1 /* cf23en */
2407fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_TPH_ENABLE_EN_RESERVED_SHIFT 5
2408fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED12_MASK              0x1 /* rule0en */
2409fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED12_SHIFT             6
2410fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED13_MASK              0x1 /* rule1en */
2411fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED13_SHIFT             7
2412fe56b9e6SYuval Mintz 	u8 flags11;
2413fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED14_MASK              0x1 /* rule2en */
2414fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED14_SHIFT             0
2415fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED15_MASK              0x1 /* rule3en */
2416fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RESERVED15_SHIFT             1
2417fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_TX_DEC_RULE_EN_MASK          0x1 /* rule4en */
2418fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_TX_DEC_RULE_EN_SHIFT         2
2419fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE5EN_MASK                 0x1 /* rule5en */
2420fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE5EN_SHIFT                3
2421fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE6EN_MASK                 0x1 /* rule6en */
2422fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE6EN_SHIFT                4
2423fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE7EN_MASK                 0x1 /* rule7en */
2424fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE7EN_SHIFT                5
2425fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED1_MASK            0x1 /* rule8en */
2426fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED1_SHIFT           6
2427fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE9EN_MASK                 0x1 /* rule9en */
2428fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE9EN_SHIFT                7
2429fe56b9e6SYuval Mintz 	u8 flags12;
2430fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE10EN_MASK                0x1 /* rule10en */
2431fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE10EN_SHIFT               0
2432fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE11EN_MASK                0x1 /* rule11en */
2433fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE11EN_SHIFT               1
2434fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED2_MASK            0x1 /* rule12en */
2435fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED2_SHIFT           2
2436fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED3_MASK            0x1 /* rule13en */
2437fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED3_SHIFT           3
2438fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE14EN_MASK                0x1 /* rule14en */
2439fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE14EN_SHIFT               4
2440fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE15EN_MASK                0x1 /* rule15en */
2441fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE15EN_SHIFT               5
2442fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE16EN_MASK                0x1 /* rule16en */
2443fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE16EN_SHIFT               6
2444fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE17EN_MASK                0x1 /* rule17en */
2445fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE17EN_SHIFT               7
2446fe56b9e6SYuval Mintz 	u8 flags13;
2447fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE18EN_MASK                0x1 /* rule18en */
2448fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE18EN_SHIFT               0
2449fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE19EN_MASK                0x1 /* rule19en */
2450fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_RULE19EN_SHIFT               1
2451fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED4_MASK            0x1 /* rule20en */
2452fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED4_SHIFT           2
2453fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED5_MASK            0x1 /* rule21en */
2454fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED5_SHIFT           3
2455fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED6_MASK            0x1 /* rule22en */
2456fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED6_SHIFT           4
2457fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED7_MASK            0x1 /* rule23en */
2458fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED7_SHIFT           5
2459fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED8_MASK            0x1 /* rule24en */
2460fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED8_SHIFT           6
2461fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED9_MASK            0x1 /* rule25en */
2462fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_A0_RESERVED9_SHIFT           7
2463fe56b9e6SYuval Mintz 	u8 flags14;
2464fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_EDPM_USE_EXT_HDR_MASK        0x1 /* bit16 */
2465fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_EDPM_USE_EXT_HDR_SHIFT       0
2466fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_EDPM_SEND_RAW_L3L4_MASK      0x1 /* bit17 */
2467fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_EDPM_SEND_RAW_L3L4_SHIFT     1
2468fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_EDPM_INBAND_PROP_HDR_MASK    0x1 /* bit18 */
2469fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_EDPM_INBAND_PROP_HDR_SHIFT   2
2470fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_EDPM_SEND_EXT_TUNNEL_MASK    0x1 /* bit19 */
2471fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_EDPM_SEND_EXT_TUNNEL_SHIFT   3
2472fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_L2_EDPM_ENABLE_MASK          0x1 /* bit20 */
2473fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_L2_EDPM_ENABLE_SHIFT         4
2474fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_ROCE_EDPM_ENABLE_MASK        0x1 /* bit21 */
2475fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_ROCE_EDPM_ENABLE_SHIFT       5
2476fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_TPH_ENABLE_MASK              0x3 /* cf23 */
2477fe56b9e6SYuval Mintz #define XSTORM_ETH_CONN_AG_CTX_TPH_ENABLE_SHIFT             6
2478fe56b9e6SYuval Mintz 	u8	edpm_event_id /* byte2 */;
2479fe56b9e6SYuval Mintz 	__le16	physical_q0 /* physical_q0 */;
2480fe56b9e6SYuval Mintz 	__le16	word1 /* physical_q1 */;
2481fe56b9e6SYuval Mintz 	__le16	edpm_num_bds /* physical_q2 */;
2482fe56b9e6SYuval Mintz 	__le16	tx_bd_cons /* word3 */;
2483fe56b9e6SYuval Mintz 	__le16	tx_bd_prod /* word4 */;
2484fe56b9e6SYuval Mintz 	__le16	go_to_bd_cons /* word5 */;
2485fe56b9e6SYuval Mintz 	__le16	conn_dpi /* conn_dpi */;
2486fe56b9e6SYuval Mintz 	u8	byte3 /* byte3 */;
2487fe56b9e6SYuval Mintz 	u8	byte4 /* byte4 */;
2488fe56b9e6SYuval Mintz 	u8	byte5 /* byte5 */;
2489fe56b9e6SYuval Mintz 	u8	byte6 /* byte6 */;
2490fe56b9e6SYuval Mintz 	__le32	reg0 /* reg0 */;
2491fe56b9e6SYuval Mintz 	__le32	reg1 /* reg1 */;
2492fe56b9e6SYuval Mintz 	__le32	reg2 /* reg2 */;
2493fe56b9e6SYuval Mintz 	__le32	reg3 /* reg3 */;
2494fe56b9e6SYuval Mintz 	__le32	reg4 /* reg4 */;
2495fe56b9e6SYuval Mintz 	__le32	reg5 /* cf_array0 */;
2496fe56b9e6SYuval Mintz 	__le32	reg6 /* cf_array1 */;
2497fe56b9e6SYuval Mintz 	__le16	word7 /* word7 */;
2498fe56b9e6SYuval Mintz 	__le16	word8 /* word8 */;
2499fe56b9e6SYuval Mintz 	__le16	word9 /* word9 */;
2500fe56b9e6SYuval Mintz 	__le16	word10 /* word10 */;
2501fe56b9e6SYuval Mintz 	__le32	reg7 /* reg7 */;
2502fe56b9e6SYuval Mintz 	__le32	reg8 /* reg8 */;
2503fe56b9e6SYuval Mintz 	__le32	reg9 /* reg9 */;
2504fe56b9e6SYuval Mintz 	u8	byte7 /* byte7 */;
2505fe56b9e6SYuval Mintz 	u8	byte8 /* byte8 */;
2506fe56b9e6SYuval Mintz 	u8	byte9 /* byte9 */;
2507fe56b9e6SYuval Mintz 	u8	byte10 /* byte10 */;
2508fe56b9e6SYuval Mintz 	u8	byte11 /* byte11 */;
2509fe56b9e6SYuval Mintz 	u8	byte12 /* byte12 */;
2510fe56b9e6SYuval Mintz 	u8	byte13 /* byte13 */;
2511fe56b9e6SYuval Mintz 	u8	byte14 /* byte14 */;
2512fe56b9e6SYuval Mintz 	u8	byte15 /* byte15 */;
2513fe56b9e6SYuval Mintz 	u8	byte16 /* byte16 */;
2514fe56b9e6SYuval Mintz 	__le16	word11 /* word11 */;
2515fe56b9e6SYuval Mintz 	__le32	reg10 /* reg10 */;
2516fe56b9e6SYuval Mintz 	__le32	reg11 /* reg11 */;
2517fe56b9e6SYuval Mintz 	__le32	reg12 /* reg12 */;
2518fe56b9e6SYuval Mintz 	__le32	reg13 /* reg13 */;
2519fe56b9e6SYuval Mintz 	__le32	reg14 /* reg14 */;
2520fe56b9e6SYuval Mintz 	__le32	reg15 /* reg15 */;
2521fe56b9e6SYuval Mintz 	__le32	reg16 /* reg16 */;
2522fe56b9e6SYuval Mintz 	__le32	reg17 /* reg17 */;
2523fe56b9e6SYuval Mintz 	__le32	reg18 /* reg18 */;
2524fe56b9e6SYuval Mintz 	__le32	reg19 /* reg19 */;
2525fe56b9e6SYuval Mintz 	__le16	word12 /* word12 */;
2526fe56b9e6SYuval Mintz 	__le16	word13 /* word13 */;
2527fe56b9e6SYuval Mintz 	__le16	word14 /* word14 */;
2528fe56b9e6SYuval Mintz 	__le16	word15 /* word15 */;
2529fe56b9e6SYuval Mintz };
2530fe56b9e6SYuval Mintz 
2531fc48b7a6SYuval Mintz /* The eth storm context for the Ystorm */
2532fc48b7a6SYuval Mintz struct ystorm_eth_conn_st_ctx {
2533fe56b9e6SYuval Mintz 	__le32 reserved[8];
2534fe56b9e6SYuval Mintz };
2535fe56b9e6SYuval Mintz 
2536fc48b7a6SYuval Mintz struct ystorm_eth_conn_ag_ctx {
2537fe56b9e6SYuval Mintz 	u8	byte0 /* cdu_validation */;
2538fe56b9e6SYuval Mintz 	u8	byte1 /* state */;
2539fe56b9e6SYuval Mintz 	u8	flags0;
2540fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_BIT0_MASK                  0x1 /* exist_in_qm0 */
2541fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_BIT0_SHIFT                 0
2542fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_BIT1_MASK                  0x1 /* exist_in_qm1 */
2543fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_BIT1_SHIFT                 1
2544fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_MASK     0x3   /* cf0 */
2545fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_SHIFT    2
2546fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_PMD_TERMINATE_CF_MASK      0x3   /* cf1 */
2547fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_PMD_TERMINATE_CF_SHIFT     4
2548fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_CF2_MASK                   0x3   /* cf2 */
2549fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_CF2_SHIFT                  6
2550fe56b9e6SYuval Mintz 	u8 flags1;
2551fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_EN_MASK  0x1   /* cf0en */
2552fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_EN_SHIFT 0
2553fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_PMD_TERMINATE_CF_EN_MASK   0x1   /* cf1en */
2554fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_PMD_TERMINATE_CF_EN_SHIFT  1
2555fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_CF2EN_MASK                 0x1   /* cf2en */
2556fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_CF2EN_SHIFT                2
2557fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_RULE0EN_MASK               0x1   /* rule0en */
2558fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_RULE0EN_SHIFT              3
2559fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_RULE1EN_MASK               0x1   /* rule1en */
2560fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_RULE1EN_SHIFT              4
2561fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_RULE2EN_MASK               0x1   /* rule2en */
2562fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_RULE2EN_SHIFT              5
2563fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_RULE3EN_MASK               0x1   /* rule3en */
2564fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_RULE3EN_SHIFT              6
2565fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_RULE4EN_MASK               0x1   /* rule4en */
2566fc48b7a6SYuval Mintz #define YSTORM_ETH_CONN_AG_CTX_RULE4EN_SHIFT              7
2567fc48b7a6SYuval Mintz 	u8	byte2 /* byte2 */;
2568fc48b7a6SYuval Mintz 	u8	byte3 /* byte3 */;
2569fe56b9e6SYuval Mintz 	__le16	word0 /* word0 */;
2570fc48b7a6SYuval Mintz 	__le32	terminate_spqe /* reg0 */;
2571fe56b9e6SYuval Mintz 	__le32	reg1 /* reg1 */;
2572fc48b7a6SYuval Mintz 	__le16	tx_bd_cons_upd /* word1 */;
2573fc48b7a6SYuval Mintz 	__le16	word2 /* word2 */;
2574fc48b7a6SYuval Mintz 	__le16	word3 /* word3 */;
2575fc48b7a6SYuval Mintz 	__le16	word4 /* word4 */;
2576fc48b7a6SYuval Mintz 	__le32	reg2 /* reg2 */;
2577fc48b7a6SYuval Mintz 	__le32	reg3 /* reg3 */;
2578fe56b9e6SYuval Mintz };
2579fe56b9e6SYuval Mintz 
2580fe56b9e6SYuval Mintz struct tstorm_eth_conn_ag_ctx {
2581fe56b9e6SYuval Mintz 	u8	byte0 /* cdu_validation */;
2582fe56b9e6SYuval Mintz 	u8	byte1 /* state */;
2583fe56b9e6SYuval Mintz 	u8	flags0;
2584fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_BIT0_MASK      0x1       /* exist_in_qm0 */
2585fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_BIT0_SHIFT     0
2586fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_BIT1_MASK      0x1       /* exist_in_qm1 */
2587fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_BIT1_SHIFT     1
2588fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_BIT2_MASK      0x1       /* bit2 */
2589fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_BIT2_SHIFT     2
2590fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_BIT3_MASK      0x1       /* bit3 */
2591fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_BIT3_SHIFT     3
2592fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_BIT4_MASK      0x1       /* bit4 */
2593fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_BIT4_SHIFT     4
2594fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_BIT5_MASK      0x1       /* bit5 */
2595fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_BIT5_SHIFT     5
2596fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF0_MASK       0x3       /* timer0cf */
2597fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF0_SHIFT      6
2598fe56b9e6SYuval Mintz 	u8 flags1;
2599fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF1_MASK       0x3       /* timer1cf */
2600fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF1_SHIFT      0
2601fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF2_MASK       0x3       /* timer2cf */
2602fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF2_SHIFT      2
2603fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF3_MASK       0x3       /* timer_stop_all */
2604fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF3_SHIFT      4
2605fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF4_MASK       0x3       /* cf4 */
2606fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF4_SHIFT      6
2607fe56b9e6SYuval Mintz 	u8 flags2;
2608fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF5_MASK       0x3       /* cf5 */
2609fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF5_SHIFT      0
2610fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF6_MASK       0x3       /* cf6 */
2611fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF6_SHIFT      2
2612fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF7_MASK       0x3       /* cf7 */
2613fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF7_SHIFT      4
2614fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF8_MASK       0x3       /* cf8 */
2615fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF8_SHIFT      6
2616fe56b9e6SYuval Mintz 	u8 flags3;
2617fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF9_MASK       0x3       /* cf9 */
2618fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF9_SHIFT      0
2619fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF10_MASK      0x3       /* cf10 */
2620fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF10_SHIFT     2
2621fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF0EN_MASK     0x1       /* cf0en */
2622fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF0EN_SHIFT    4
2623fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF1EN_MASK     0x1       /* cf1en */
2624fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF1EN_SHIFT    5
2625fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF2EN_MASK     0x1       /* cf2en */
2626fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF2EN_SHIFT    6
2627fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF3EN_MASK     0x1       /* cf3en */
2628fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF3EN_SHIFT    7
2629fe56b9e6SYuval Mintz 	u8 flags4;
2630fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF4EN_MASK     0x1       /* cf4en */
2631fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF4EN_SHIFT    0
2632fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF5EN_MASK     0x1       /* cf5en */
2633fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF5EN_SHIFT    1
2634fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF6EN_MASK     0x1       /* cf6en */
2635fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF6EN_SHIFT    2
2636fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF7EN_MASK     0x1       /* cf7en */
2637fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF7EN_SHIFT    3
2638fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF8EN_MASK     0x1       /* cf8en */
2639fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF8EN_SHIFT    4
2640fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF9EN_MASK     0x1       /* cf9en */
2641fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF9EN_SHIFT    5
2642fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF10EN_MASK    0x1       /* cf10en */
2643fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_CF10EN_SHIFT   6
2644fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE0EN_MASK   0x1       /* rule0en */
2645fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE0EN_SHIFT  7
2646fe56b9e6SYuval Mintz 	u8 flags5;
2647fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE1EN_MASK   0x1       /* rule1en */
2648fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE1EN_SHIFT  0
2649fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE2EN_MASK   0x1       /* rule2en */
2650fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE2EN_SHIFT  1
2651fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE3EN_MASK   0x1       /* rule3en */
2652fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE3EN_SHIFT  2
2653fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE4EN_MASK   0x1       /* rule4en */
2654fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE4EN_SHIFT  3
2655fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE5EN_MASK   0x1       /* rule5en */
2656fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE5EN_SHIFT  4
2657fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RX_BD_EN_MASK  0x1       /* rule6en */
2658fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RX_BD_EN_SHIFT 5
2659fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE7EN_MASK   0x1       /* rule7en */
2660fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE7EN_SHIFT  6
2661fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE8EN_MASK   0x1       /* rule8en */
2662fe56b9e6SYuval Mintz #define TSTORM_ETH_CONN_AG_CTX_RULE8EN_SHIFT  7
2663fe56b9e6SYuval Mintz 	__le32	reg0 /* reg0 */;
2664fe56b9e6SYuval Mintz 	__le32	reg1 /* reg1 */;
2665fe56b9e6SYuval Mintz 	__le32	reg2 /* reg2 */;
2666fe56b9e6SYuval Mintz 	__le32	reg3 /* reg3 */;
2667fe56b9e6SYuval Mintz 	__le32	reg4 /* reg4 */;
2668fe56b9e6SYuval Mintz 	__le32	reg5 /* reg5 */;
2669fe56b9e6SYuval Mintz 	__le32	reg6 /* reg6 */;
2670fe56b9e6SYuval Mintz 	__le32	reg7 /* reg7 */;
2671fe56b9e6SYuval Mintz 	__le32	reg8 /* reg8 */;
2672fe56b9e6SYuval Mintz 	u8	byte2 /* byte2 */;
2673fe56b9e6SYuval Mintz 	u8	byte3 /* byte3 */;
2674fe56b9e6SYuval Mintz 	__le16	rx_bd_cons /* word0 */;
2675fe56b9e6SYuval Mintz 	u8	byte4 /* byte4 */;
2676fe56b9e6SYuval Mintz 	u8	byte5 /* byte5 */;
2677fe56b9e6SYuval Mintz 	__le16	rx_bd_prod /* word1 */;
2678fe56b9e6SYuval Mintz 	__le16	word2 /* conn_dpi */;
2679fe56b9e6SYuval Mintz 	__le16	word3 /* word3 */;
2680fe56b9e6SYuval Mintz 	__le32	reg9 /* reg9 */;
2681fe56b9e6SYuval Mintz 	__le32	reg10 /* reg10 */;
2682fe56b9e6SYuval Mintz };
2683fe56b9e6SYuval Mintz 
2684fe56b9e6SYuval Mintz struct ustorm_eth_conn_ag_ctx {
2685fe56b9e6SYuval Mintz 	u8	byte0 /* cdu_validation */;
2686fe56b9e6SYuval Mintz 	u8	byte1 /* state */;
2687fe56b9e6SYuval Mintz 	u8	flags0;
2688fc48b7a6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_BIT0_MASK                  0x1 /* exist_in_qm0 */
2689fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_BIT0_SHIFT                 0
2690fc48b7a6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_BIT1_MASK                  0x1 /* exist_in_qm1 */
2691fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_BIT1_SHIFT                 1
2692fc48b7a6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_TX_PMD_TERMINATE_CF_MASK   0x3 /* timer0cf */
2693fc48b7a6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_TX_PMD_TERMINATE_CF_SHIFT  2
2694fc48b7a6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RX_PMD_TERMINATE_CF_MASK   0x3 /* timer1cf */
2695fc48b7a6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RX_PMD_TERMINATE_CF_SHIFT  4
2696fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_CF2_MASK                   0x3 /* timer2cf */
2697fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_CF2_SHIFT                  6
2698fe56b9e6SYuval Mintz 	u8 flags1;
2699fc48b7a6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_CF3_MASK                 0x3 /* timer_stop_all */
2700fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_CF3_SHIFT                0
2701fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_TX_ARM_CF_MASK           0x3 /* cf4 */
2702fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_TX_ARM_CF_SHIFT          2
2703fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RX_ARM_CF_MASK           0x3 /* cf5 */
2704fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RX_ARM_CF_SHIFT          4
2705fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_MASK   0x3 /* cf6 */
2706fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_SHIFT  6
2707fe56b9e6SYuval Mintz 	u8 flags2;
2708fc48b7a6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_TX_PMD_TERMINATE_CF_EN_MASK  0x1 /* cf0en */
2709fc48b7a6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_TX_PMD_TERMINATE_CF_EN_SHIFT 0
2710fc48b7a6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RX_PMD_TERMINATE_CF_EN_MASK  0x1 /* cf1en */
2711fc48b7a6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RX_PMD_TERMINATE_CF_EN_SHIFT 1
2712fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_CF2EN_MASK                   0x1 /* cf2en */
2713fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_CF2EN_SHIFT                  2
2714fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_CF3EN_MASK                   0x1 /* cf3en */
2715fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_CF3EN_SHIFT                  3
2716fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_TX_ARM_CF_EN_MASK            0x1 /* cf4en */
2717fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_TX_ARM_CF_EN_SHIFT           4
2718fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RX_ARM_CF_EN_MASK            0x1 /* cf5en */
2719fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RX_ARM_CF_EN_SHIFT           5
2720fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_EN_MASK    0x1 /* cf6en */
2721fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_TX_BD_CONS_UPD_CF_EN_SHIFT   6
2722fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE0EN_MASK                 0x1 /* rule0en */
2723fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE0EN_SHIFT                7
2724fe56b9e6SYuval Mintz 	u8 flags3;
2725fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE1EN_MASK                 0x1 /* rule1en */
2726fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE1EN_SHIFT                0
2727fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE2EN_MASK                 0x1 /* rule2en */
2728fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE2EN_SHIFT                1
2729fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE3EN_MASK                 0x1 /* rule3en */
2730fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE3EN_SHIFT                2
2731fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE4EN_MASK                 0x1 /* rule4en */
2732fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE4EN_SHIFT                3
2733fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE5EN_MASK                 0x1 /* rule5en */
2734fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE5EN_SHIFT                4
2735fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE6EN_MASK                 0x1 /* rule6en */
2736fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE6EN_SHIFT                5
2737fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE7EN_MASK                 0x1 /* rule7en */
2738fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE7EN_SHIFT                6
2739fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE8EN_MASK                 0x1 /* rule8en */
2740fe56b9e6SYuval Mintz #define USTORM_ETH_CONN_AG_CTX_RULE8EN_SHIFT                7
2741fe56b9e6SYuval Mintz 	u8	byte2 /* byte2 */;
2742fe56b9e6SYuval Mintz 	u8	byte3 /* byte3 */;
2743fe56b9e6SYuval Mintz 	__le16	word0 /* conn_dpi */;
2744fe56b9e6SYuval Mintz 	__le16	tx_bd_cons /* word1 */;
2745fe56b9e6SYuval Mintz 	__le32	reg0 /* reg0 */;
2746fe56b9e6SYuval Mintz 	__le32	reg1 /* reg1 */;
2747fe56b9e6SYuval Mintz 	__le32	reg2 /* reg2 */;
2748fc48b7a6SYuval Mintz 	__le32	tx_int_coallecing_timeset /* reg3 */;
2749fe56b9e6SYuval Mintz 	__le16	tx_drv_bd_cons /* word2 */;
2750fe56b9e6SYuval Mintz 	__le16	rx_drv_cqe_cons /* word3 */;
2751fe56b9e6SYuval Mintz };
2752fe56b9e6SYuval Mintz 
2753fc48b7a6SYuval Mintz /* The eth storm context for the Ustorm */
2754fc48b7a6SYuval Mintz struct ustorm_eth_conn_st_ctx {
2755fc48b7a6SYuval Mintz 	__le32 reserved[40];
2756fc48b7a6SYuval Mintz };
2757fc48b7a6SYuval Mintz 
2758fc48b7a6SYuval Mintz /* The eth storm context for the Mstorm */
2759fc48b7a6SYuval Mintz struct mstorm_eth_conn_st_ctx {
2760fc48b7a6SYuval Mintz 	__le32 reserved[8];
2761fc48b7a6SYuval Mintz };
2762fc48b7a6SYuval Mintz 
2763fc48b7a6SYuval Mintz /* eth connection context */
2764fc48b7a6SYuval Mintz struct eth_conn_context {
2765fc48b7a6SYuval Mintz 	struct tstorm_eth_conn_st_ctx	tstorm_st_context;
2766fc48b7a6SYuval Mintz 	struct regpair			tstorm_st_padding[2];
2767fc48b7a6SYuval Mintz 	struct pstorm_eth_conn_st_ctx	pstorm_st_context;
2768fc48b7a6SYuval Mintz 	struct xstorm_eth_conn_st_ctx	xstorm_st_context;
2769fc48b7a6SYuval Mintz 	struct xstorm_eth_conn_ag_ctx	xstorm_ag_context;
2770fc48b7a6SYuval Mintz 	struct ystorm_eth_conn_st_ctx	ystorm_st_context;
2771fc48b7a6SYuval Mintz 	struct ystorm_eth_conn_ag_ctx	ystorm_ag_context;
2772fc48b7a6SYuval Mintz 	struct tstorm_eth_conn_ag_ctx	tstorm_ag_context;
2773fc48b7a6SYuval Mintz 	struct ustorm_eth_conn_ag_ctx	ustorm_ag_context;
2774fc48b7a6SYuval Mintz 	struct ustorm_eth_conn_st_ctx	ustorm_st_context;
2775fc48b7a6SYuval Mintz 	struct mstorm_eth_conn_st_ctx	mstorm_st_context;
2776fc48b7a6SYuval Mintz };
2777fc48b7a6SYuval Mintz 
2778fc48b7a6SYuval Mintz enum eth_filter_action {
2779fc48b7a6SYuval Mintz 	ETH_FILTER_ACTION_REMOVE,
2780fc48b7a6SYuval Mintz 	ETH_FILTER_ACTION_ADD,
2781fc48b7a6SYuval Mintz 	ETH_FILTER_ACTION_REMOVE_ALL,
2782fc48b7a6SYuval Mintz 	MAX_ETH_FILTER_ACTION
2783fc48b7a6SYuval Mintz };
2784fc48b7a6SYuval Mintz 
2785fc48b7a6SYuval Mintz struct eth_filter_cmd {
2786fc48b7a6SYuval Mintz 	u8      type /* Filter Type (MAC/VLAN/Pair/VNI) */;
2787fc48b7a6SYuval Mintz 	u8      vport_id /* the vport id */;
2788fc48b7a6SYuval Mintz 	u8      action /* filter command action: add/remove/replace */;
2789fc48b7a6SYuval Mintz 	u8      reserved0;
2790fc48b7a6SYuval Mintz 	__le32  vni;
2791fc48b7a6SYuval Mintz 	__le16  mac_lsb;
2792fc48b7a6SYuval Mintz 	__le16  mac_mid;
2793fc48b7a6SYuval Mintz 	__le16  mac_msb;
2794fc48b7a6SYuval Mintz 	__le16  vlan_id;
2795fc48b7a6SYuval Mintz };
2796fc48b7a6SYuval Mintz 
2797fc48b7a6SYuval Mintz struct eth_filter_cmd_header {
2798fc48b7a6SYuval Mintz 	u8      rx;
2799fc48b7a6SYuval Mintz 	u8      tx;
2800fc48b7a6SYuval Mintz 	u8      cmd_cnt;
2801fc48b7a6SYuval Mintz 	u8      assert_on_error;
2802fc48b7a6SYuval Mintz 	u8      reserved1[4];
2803fc48b7a6SYuval Mintz };
2804fc48b7a6SYuval Mintz 
2805fc48b7a6SYuval Mintz enum eth_filter_type {
2806fc48b7a6SYuval Mintz 	ETH_FILTER_TYPE_MAC,
2807fc48b7a6SYuval Mintz 	ETH_FILTER_TYPE_VLAN,
2808fc48b7a6SYuval Mintz 	ETH_FILTER_TYPE_PAIR,
2809fc48b7a6SYuval Mintz 	ETH_FILTER_TYPE_INNER_MAC,
2810fc48b7a6SYuval Mintz 	ETH_FILTER_TYPE_INNER_VLAN,
2811fc48b7a6SYuval Mintz 	ETH_FILTER_TYPE_INNER_PAIR,
2812fc48b7a6SYuval Mintz 	ETH_FILTER_TYPE_INNER_MAC_VNI_PAIR,
2813fc48b7a6SYuval Mintz 	ETH_FILTER_TYPE_MAC_VNI_PAIR,
2814fc48b7a6SYuval Mintz 	ETH_FILTER_TYPE_VNI,
2815fc48b7a6SYuval Mintz 	MAX_ETH_FILTER_TYPE
2816fc48b7a6SYuval Mintz };
2817fc48b7a6SYuval Mintz 
2818fc48b7a6SYuval Mintz enum eth_ramrod_cmd_id {
2819fc48b7a6SYuval Mintz 	ETH_RAMROD_UNUSED,
2820fc48b7a6SYuval Mintz 	ETH_RAMROD_VPORT_START /* VPort Start Ramrod */,
2821fc48b7a6SYuval Mintz 	ETH_RAMROD_VPORT_UPDATE /* VPort Update Ramrod */,
2822fc48b7a6SYuval Mintz 	ETH_RAMROD_VPORT_STOP /* VPort Stop Ramrod */,
2823fc48b7a6SYuval Mintz 	ETH_RAMROD_RX_QUEUE_START /* RX Queue Start Ramrod */,
2824fc48b7a6SYuval Mintz 	ETH_RAMROD_RX_QUEUE_STOP /* RX Queue Stop Ramrod */,
2825fc48b7a6SYuval Mintz 	ETH_RAMROD_TX_QUEUE_START /* TX Queue Start Ramrod */,
2826fc48b7a6SYuval Mintz 	ETH_RAMROD_TX_QUEUE_STOP /* TX Queue Stop Ramrod */,
2827fc48b7a6SYuval Mintz 	ETH_RAMROD_FILTERS_UPDATE /* Add or Remove Mac/Vlan/Pair filters */,
2828fc48b7a6SYuval Mintz 	ETH_RAMROD_RX_QUEUE_UPDATE /* RX Queue Update Ramrod */,
2829fc48b7a6SYuval Mintz 	ETH_RAMROD_RESERVED,
2830fc48b7a6SYuval Mintz 	ETH_RAMROD_RESERVED2,
2831fc48b7a6SYuval Mintz 	ETH_RAMROD_RESERVED3,
2832fc48b7a6SYuval Mintz 	ETH_RAMROD_RESERVED4,
2833fc48b7a6SYuval Mintz 	ETH_RAMROD_RESERVED5,
2834fc48b7a6SYuval Mintz 	ETH_RAMROD_RESERVED6,
2835fc48b7a6SYuval Mintz 	ETH_RAMROD_RESERVED7,
2836fc48b7a6SYuval Mintz 	ETH_RAMROD_RESERVED8,
2837fc48b7a6SYuval Mintz 	MAX_ETH_RAMROD_CMD_ID
2838fc48b7a6SYuval Mintz };
2839fc48b7a6SYuval Mintz 
2840fc48b7a6SYuval Mintz enum eth_tx_err {
2841fc48b7a6SYuval Mintz 	ETH_TX_ERR_DROP /* Drop erronous packet. */,
2842fc48b7a6SYuval Mintz 	ETH_TX_ERR_ASSERT_MALICIOUS,
2843fc48b7a6SYuval Mintz 	MAX_ETH_TX_ERR
2844fc48b7a6SYuval Mintz };
2845fc48b7a6SYuval Mintz 
2846fc48b7a6SYuval Mintz struct eth_tx_err_vals {
2847fc48b7a6SYuval Mintz 	__le16 values;
2848fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_ILLEGAL_VLAN_MODE_MASK            0x1
2849fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_ILLEGAL_VLAN_MODE_SHIFT           0
2850fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_PACKET_TOO_SMALL_MASK             0x1
2851fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_PACKET_TOO_SMALL_SHIFT            1
2852fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_ANTI_SPOOFING_ERR_MASK            0x1
2853fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_ANTI_SPOOFING_ERR_SHIFT           2
2854fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_ILLEGAL_INBAND_TAGS_MASK          0x1
2855fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_ILLEGAL_INBAND_TAGS_SHIFT         3
2856fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_VLAN_INSERTION_W_INBAND_TAG_MASK  0x1
2857fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_VLAN_INSERTION_W_INBAND_TAG_SHIFT 4
2858fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_MTU_VIOLATION_MASK                0x1
2859fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_MTU_VIOLATION_SHIFT               5
2860fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_ILLEGAL_CONTROL_FRAME_MASK        0x1
2861fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_ILLEGAL_CONTROL_FRAME_SHIFT       6
2862fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_RESERVED_MASK                     0x1FF
2863fc48b7a6SYuval Mintz #define ETH_TX_ERR_VALS_RESERVED_SHIFT                    7
2864fc48b7a6SYuval Mintz };
2865fc48b7a6SYuval Mintz 
2866fc48b7a6SYuval Mintz struct eth_vport_rss_config {
2867fc48b7a6SYuval Mintz 	__le16 capabilities;
2868fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_IPV4_CAPABILITY_MASK	0x1
2869fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_IPV4_CAPABILITY_SHIFT       0
2870fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_IPV6_CAPABILITY_MASK	0x1
2871fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_IPV6_CAPABILITY_SHIFT       1
2872fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_IPV4_TCP_CAPABILITY_MASK    0x1
2873fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_IPV4_TCP_CAPABILITY_SHIFT   2
2874fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_IPV6_TCP_CAPABILITY_MASK    0x1
2875fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_IPV6_TCP_CAPABILITY_SHIFT   3
2876fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_IPV4_UDP_CAPABILITY_MASK    0x1
2877fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_IPV4_UDP_CAPABILITY_SHIFT   4
2878fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_IPV6_UDP_CAPABILITY_MASK    0x1
2879fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_IPV6_UDP_CAPABILITY_SHIFT   5
2880fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_EN_5_TUPLE_CAPABILITY_MASK  0x1
2881fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_EN_5_TUPLE_CAPABILITY_SHIFT 6
2882fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_RESERVED0_MASK	      0x1FF
2883fc48b7a6SYuval Mintz #define ETH_VPORT_RSS_CONFIG_RESERVED0_SHIFT	     7
2884fc48b7a6SYuval Mintz 	u8      rss_id;
2885fc48b7a6SYuval Mintz 	u8      rss_mode;
2886fc48b7a6SYuval Mintz 	u8      update_rss_key;
2887fc48b7a6SYuval Mintz 	u8      update_rss_ind_table;
2888fc48b7a6SYuval Mintz 	u8      update_rss_capabilities;
2889fc48b7a6SYuval Mintz 	u8      tbl_size;
2890fc48b7a6SYuval Mintz 	__le32  reserved2[2];
2891fc48b7a6SYuval Mintz 	__le16  indirection_table[ETH_RSS_IND_TABLE_ENTRIES_NUM];
2892fc48b7a6SYuval Mintz 	__le32  rss_key[ETH_RSS_KEY_SIZE_REGS];
2893fc48b7a6SYuval Mintz 	__le32  reserved3[2];
2894fc48b7a6SYuval Mintz };
2895fc48b7a6SYuval Mintz 
2896fc48b7a6SYuval Mintz enum eth_vport_rss_mode {
2897fc48b7a6SYuval Mintz 	ETH_VPORT_RSS_MODE_DISABLED,
2898fc48b7a6SYuval Mintz 	ETH_VPORT_RSS_MODE_REGULAR,
2899fc48b7a6SYuval Mintz 	MAX_ETH_VPORT_RSS_MODE
2900fc48b7a6SYuval Mintz };
2901fc48b7a6SYuval Mintz 
2902fc48b7a6SYuval Mintz struct eth_vport_rx_mode {
2903fc48b7a6SYuval Mintz 	__le16 state;
2904fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_UCAST_DROP_ALL_MASK	  0x1
2905fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_UCAST_DROP_ALL_SHIFT	 0
2906fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_UCAST_ACCEPT_ALL_MASK	0x1
2907fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_UCAST_ACCEPT_ALL_SHIFT       1
2908fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_UCAST_ACCEPT_UNMATCHED_MASK  0x1
2909fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_UCAST_ACCEPT_UNMATCHED_SHIFT 2
2910fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_MCAST_DROP_ALL_MASK	  0x1
2911fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_MCAST_DROP_ALL_SHIFT	 3
2912fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_MCAST_ACCEPT_ALL_MASK	0x1
2913fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_MCAST_ACCEPT_ALL_SHIFT       4
2914fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_BCAST_ACCEPT_ALL_MASK	0x1
2915fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_BCAST_ACCEPT_ALL_SHIFT       5
2916fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_RESERVED1_MASK	       0x3FF
2917fc48b7a6SYuval Mintz #define ETH_VPORT_RX_MODE_RESERVED1_SHIFT	      6
2918fc48b7a6SYuval Mintz 	__le16 reserved2[3];
2919fc48b7a6SYuval Mintz };
2920fc48b7a6SYuval Mintz 
2921fc48b7a6SYuval Mintz struct eth_vport_tpa_param {
2922088c8618SManish Chopra 	u8	tpa_ipv4_en_flg;
2923088c8618SManish Chopra 	u8	tpa_ipv6_en_flg;
2924088c8618SManish Chopra 	u8	tpa_ipv4_tunn_en_flg;
2925088c8618SManish Chopra 	u8	tpa_ipv6_tunn_en_flg;
2926088c8618SManish Chopra 	u8	tpa_pkt_split_flg;
2927088c8618SManish Chopra 	u8	tpa_hdr_data_split_flg;
2928088c8618SManish Chopra 	u8	tpa_gro_consistent_flg;
2929088c8618SManish Chopra 	u8	tpa_max_aggs_num;
2930088c8618SManish Chopra 	u16	tpa_max_size;
2931088c8618SManish Chopra 	u16	tpa_min_size_to_start;
2932088c8618SManish Chopra 	u16	tpa_min_size_to_cont;
2933088c8618SManish Chopra 	u8	max_buff_num;
2934088c8618SManish Chopra 	u8	reserved;
2935fc48b7a6SYuval Mintz };
2936fc48b7a6SYuval Mintz 
2937fc48b7a6SYuval Mintz struct eth_vport_tx_mode {
2938fc48b7a6SYuval Mintz 	__le16 state;
2939fc48b7a6SYuval Mintz #define ETH_VPORT_TX_MODE_UCAST_DROP_ALL_MASK    0x1
2940fc48b7a6SYuval Mintz #define ETH_VPORT_TX_MODE_UCAST_DROP_ALL_SHIFT   0
2941fc48b7a6SYuval Mintz #define ETH_VPORT_TX_MODE_UCAST_ACCEPT_ALL_MASK  0x1
2942fc48b7a6SYuval Mintz #define ETH_VPORT_TX_MODE_UCAST_ACCEPT_ALL_SHIFT 1
2943fc48b7a6SYuval Mintz #define ETH_VPORT_TX_MODE_MCAST_DROP_ALL_MASK    0x1
2944fc48b7a6SYuval Mintz #define ETH_VPORT_TX_MODE_MCAST_DROP_ALL_SHIFT   2
2945fc48b7a6SYuval Mintz #define ETH_VPORT_TX_MODE_MCAST_ACCEPT_ALL_MASK  0x1
2946fc48b7a6SYuval Mintz #define ETH_VPORT_TX_MODE_MCAST_ACCEPT_ALL_SHIFT 3
2947fc48b7a6SYuval Mintz #define ETH_VPORT_TX_MODE_BCAST_ACCEPT_ALL_MASK  0x1
2948fc48b7a6SYuval Mintz #define ETH_VPORT_TX_MODE_BCAST_ACCEPT_ALL_SHIFT 4
2949fc48b7a6SYuval Mintz #define ETH_VPORT_TX_MODE_RESERVED1_MASK	 0x7FF
2950fc48b7a6SYuval Mintz #define ETH_VPORT_TX_MODE_RESERVED1_SHIFT	5
2951fc48b7a6SYuval Mintz 	__le16 reserved2[3];
2952fc48b7a6SYuval Mintz };
2953fc48b7a6SYuval Mintz 
2954fc48b7a6SYuval Mintz struct rx_queue_start_ramrod_data {
2955fc48b7a6SYuval Mintz 	__le16	  rx_queue_id;
2956fc48b7a6SYuval Mintz 	__le16	  num_of_pbl_pages;
2957fc48b7a6SYuval Mintz 	__le16	  bd_max_bytes;
2958fc48b7a6SYuval Mintz 	__le16	  sb_id;
2959fc48b7a6SYuval Mintz 	u8	      sb_index;
2960fc48b7a6SYuval Mintz 	u8	      vport_id;
2961fc48b7a6SYuval Mintz 	u8	      default_rss_queue_flg;
2962fc48b7a6SYuval Mintz 	u8	      complete_cqe_flg;
2963fc48b7a6SYuval Mintz 	u8	      complete_event_flg;
2964fc48b7a6SYuval Mintz 	u8	      stats_counter_id;
2965fc48b7a6SYuval Mintz 	u8	      pin_context;
2966fc48b7a6SYuval Mintz 	u8	      pxp_tph_valid_bd;
2967fc48b7a6SYuval Mintz 	u8	      pxp_tph_valid_pkt;
2968fc48b7a6SYuval Mintz 	u8	      pxp_st_hint;
2969fc48b7a6SYuval Mintz 	__le16	  pxp_st_index;
2970fc48b7a6SYuval Mintz 	u8		pmd_mode;
2971fc48b7a6SYuval Mintz 	u8		notify_en;
2972fc48b7a6SYuval Mintz 	u8		toggle_val;
2973fc48b7a6SYuval Mintz 	u8		reserved[7];
2974fc48b7a6SYuval Mintz 	__le16		reserved1;
2975fc48b7a6SYuval Mintz 	struct regpair	cqe_pbl_addr;
2976fc48b7a6SYuval Mintz 	struct regpair	bd_base;
2977fc48b7a6SYuval Mintz 	struct regpair	reserved2;
2978fc48b7a6SYuval Mintz };
2979fc48b7a6SYuval Mintz 
2980fc48b7a6SYuval Mintz struct rx_queue_stop_ramrod_data {
2981fc48b7a6SYuval Mintz 	__le16  rx_queue_id;
2982fc48b7a6SYuval Mintz 	u8      complete_cqe_flg;
2983fc48b7a6SYuval Mintz 	u8      complete_event_flg;
2984fc48b7a6SYuval Mintz 	u8      vport_id;
2985fc48b7a6SYuval Mintz 	u8      reserved[3];
2986fc48b7a6SYuval Mintz };
2987fc48b7a6SYuval Mintz 
2988fc48b7a6SYuval Mintz struct rx_queue_update_ramrod_data {
2989fc48b7a6SYuval Mintz 	__le16	rx_queue_id;
2990fc48b7a6SYuval Mintz 	u8	complete_cqe_flg;
2991fc48b7a6SYuval Mintz 	u8	complete_event_flg;
2992fc48b7a6SYuval Mintz 	u8	vport_id;
2993fc48b7a6SYuval Mintz 	u8	reserved[4];
2994fc48b7a6SYuval Mintz 	u8	reserved1;
2995fc48b7a6SYuval Mintz 	u8	reserved2;
2996fc48b7a6SYuval Mintz 	u8	reserved3;
2997fc48b7a6SYuval Mintz 	__le16	reserved4;
2998fc48b7a6SYuval Mintz 	__le16	reserved5;
2999fc48b7a6SYuval Mintz 	struct regpair reserved6;
3000fc48b7a6SYuval Mintz };
3001fc48b7a6SYuval Mintz 
3002fc48b7a6SYuval Mintz struct tx_queue_start_ramrod_data {
3003fc48b7a6SYuval Mintz 	__le16  sb_id;
3004fc48b7a6SYuval Mintz 	u8      sb_index;
3005fc48b7a6SYuval Mintz 	u8      vport_id;
3006fc48b7a6SYuval Mintz 	u8      reserved0;
3007fc48b7a6SYuval Mintz 	u8      stats_counter_id;
3008fc48b7a6SYuval Mintz 	__le16  qm_pq_id;
3009fc48b7a6SYuval Mintz 	u8      flags;
3010fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_DISABLE_OPPORTUNISTIC_MASK  0x1
3011fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_DISABLE_OPPORTUNISTIC_SHIFT 0
3012fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_TEST_MODE_PKT_DUP_MASK      0x1
3013fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_TEST_MODE_PKT_DUP_SHIFT     1
3014fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_TEST_MODE_TX_DEST_MASK      0x1
3015fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_TEST_MODE_TX_DEST_SHIFT     2
3016fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_PMD_MODE_MASK               0x1
3017fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_PMD_MODE_SHIFT              3
3018fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_NOTIFY_EN_MASK              0x1
3019fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_NOTIFY_EN_SHIFT             4
3020fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_PIN_CONTEXT_MASK            0x1
3021fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_PIN_CONTEXT_SHIFT           5
3022fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_RESERVED1_MASK              0x3
3023fc48b7a6SYuval Mintz #define TX_QUEUE_START_RAMROD_DATA_RESERVED1_SHIFT             6
3024fc48b7a6SYuval Mintz 	u8	pxp_st_hint;
3025fc48b7a6SYuval Mintz 	u8	pxp_tph_valid_bd;
3026fc48b7a6SYuval Mintz 	u8	pxp_tph_valid_pkt;
3027fc48b7a6SYuval Mintz 	__le16	pxp_st_index;
3028fc48b7a6SYuval Mintz 	__le16	comp_agg_size;
3029fc48b7a6SYuval Mintz 	__le16	queue_zone_id;
3030fc48b7a6SYuval Mintz 	__le16	test_dup_count;
3031fc48b7a6SYuval Mintz 	__le16	pbl_size;
3032fc48b7a6SYuval Mintz 	__le16	tx_queue_id;
3033fc48b7a6SYuval Mintz 	struct regpair	pbl_base_addr;
3034fc48b7a6SYuval Mintz 	struct regpair	bd_cons_address;
3035fc48b7a6SYuval Mintz };
3036fc48b7a6SYuval Mintz 
3037fc48b7a6SYuval Mintz struct tx_queue_stop_ramrod_data {
3038fc48b7a6SYuval Mintz 	__le16 reserved[4];
3039fc48b7a6SYuval Mintz };
3040fc48b7a6SYuval Mintz 
3041fc48b7a6SYuval Mintz struct vport_filter_update_ramrod_data {
3042fc48b7a6SYuval Mintz 	struct eth_filter_cmd_header    filter_cmd_hdr;
3043fc48b7a6SYuval Mintz 	struct eth_filter_cmd	   filter_cmds[ETH_FILTER_RULES_COUNT];
3044fc48b7a6SYuval Mintz };
3045fc48b7a6SYuval Mintz 
3046fc48b7a6SYuval Mintz struct vport_start_ramrod_data {
3047fc48b7a6SYuval Mintz 	u8			      vport_id;
3048fc48b7a6SYuval Mintz 	u8			      sw_fid;
3049fc48b7a6SYuval Mintz 	__le16			  mtu;
3050fc48b7a6SYuval Mintz 	u8			      drop_ttl0_en;
3051fc48b7a6SYuval Mintz 	u8			      inner_vlan_removal_en;
3052fc48b7a6SYuval Mintz 	struct eth_vport_rx_mode	rx_mode;
3053fc48b7a6SYuval Mintz 	struct eth_vport_tx_mode	tx_mode;
3054fc48b7a6SYuval Mintz 	struct eth_vport_tpa_param      tpa_param;
3055fc48b7a6SYuval Mintz 	__le16				default_vlan;
3056fc48b7a6SYuval Mintz 	u8				tx_switching_en;
3057fc48b7a6SYuval Mintz 	u8				anti_spoofing_en;
3058fc48b7a6SYuval Mintz 	u8				default_vlan_en;
3059fc48b7a6SYuval Mintz 	u8				handle_ptp_pkts;
3060fc48b7a6SYuval Mintz 	u8				silent_vlan_removal_en;
3061fc48b7a6SYuval Mintz 	u8				untagged;
3062fc48b7a6SYuval Mintz 	struct eth_tx_err_vals		tx_err_behav;
3063fc48b7a6SYuval Mintz 	u8				zero_placement_offset;
3064fc48b7a6SYuval Mintz 	u8				reserved[7];
3065fc48b7a6SYuval Mintz };
3066fc48b7a6SYuval Mintz 
3067fc48b7a6SYuval Mintz struct vport_stop_ramrod_data {
3068fc48b7a6SYuval Mintz 	u8      vport_id;
3069fc48b7a6SYuval Mintz 	u8      reserved[7];
3070fc48b7a6SYuval Mintz };
3071fc48b7a6SYuval Mintz 
3072fc48b7a6SYuval Mintz struct vport_update_ramrod_data_cmn {
3073fc48b7a6SYuval Mintz 	u8	vport_id;
3074fc48b7a6SYuval Mintz 	u8	update_rx_active_flg;
3075fc48b7a6SYuval Mintz 	u8	rx_active_flg;
3076fc48b7a6SYuval Mintz 	u8	update_tx_active_flg;
3077fc48b7a6SYuval Mintz 	u8	tx_active_flg;
3078fc48b7a6SYuval Mintz 	u8	update_rx_mode_flg;
3079fc48b7a6SYuval Mintz 	u8	update_tx_mode_flg;
3080fc48b7a6SYuval Mintz 	u8	update_approx_mcast_flg;
3081fc48b7a6SYuval Mintz 	u8	update_rss_flg;
3082fc48b7a6SYuval Mintz 	u8	update_inner_vlan_removal_en_flg;
3083fc48b7a6SYuval Mintz 	u8	inner_vlan_removal_en;
3084fc48b7a6SYuval Mintz 	u8	update_tpa_param_flg;
3085fc48b7a6SYuval Mintz 	u8	update_tpa_en_flg;
3086fc48b7a6SYuval Mintz 	u8	update_tx_switching_en_flg;
3087fc48b7a6SYuval Mintz 	u8	tx_switching_en;
3088fc48b7a6SYuval Mintz 	u8	update_anti_spoofing_en_flg;
3089fc48b7a6SYuval Mintz 	u8	anti_spoofing_en;
3090fc48b7a6SYuval Mintz 	u8	update_handle_ptp_pkts;
3091fc48b7a6SYuval Mintz 	u8	handle_ptp_pkts;
3092fc48b7a6SYuval Mintz 	u8	update_default_vlan_en_flg;
3093fc48b7a6SYuval Mintz 	u8	default_vlan_en;
3094fc48b7a6SYuval Mintz 	u8	update_default_vlan_flg;
3095fc48b7a6SYuval Mintz 	__le16	default_vlan;
3096fc48b7a6SYuval Mintz 	u8	update_accept_any_vlan_flg;
3097fc48b7a6SYuval Mintz 	u8	accept_any_vlan;
3098fc48b7a6SYuval Mintz 	u8	silent_vlan_removal_en;
3099fc48b7a6SYuval Mintz 	u8	update_mtu_flg;
3100fc48b7a6SYuval Mintz 	__le16	mtu;
3101fc48b7a6SYuval Mintz 	u8	reserved[2];
3102fc48b7a6SYuval Mintz };
3103fc48b7a6SYuval Mintz 
3104fc48b7a6SYuval Mintz struct vport_update_ramrod_mcast {
3105fc48b7a6SYuval Mintz 	__le32 bins[ETH_MULTICAST_MAC_BINS_IN_REGS];
3106fc48b7a6SYuval Mintz };
3107fc48b7a6SYuval Mintz 
3108fc48b7a6SYuval Mintz struct vport_update_ramrod_data {
3109fc48b7a6SYuval Mintz 	struct vport_update_ramrod_data_cmn     common;
3110fc48b7a6SYuval Mintz 	struct eth_vport_rx_mode		rx_mode;
3111fc48b7a6SYuval Mintz 	struct eth_vport_tx_mode		tx_mode;
3112fc48b7a6SYuval Mintz 	struct eth_vport_tpa_param	      tpa_param;
3113fc48b7a6SYuval Mintz 	struct vport_update_ramrod_mcast	approx_mcast;
3114fc48b7a6SYuval Mintz 	struct eth_vport_rss_config	     rss_config;
3115fe56b9e6SYuval Mintz };
3116fe56b9e6SYuval Mintz 
3117fe56b9e6SYuval Mintz #define VF_MAX_STATIC 192       /* In case of K2 */
3118fe56b9e6SYuval Mintz 
3119fe56b9e6SYuval Mintz #define MCP_GLOB_PATH_MAX       2
3120fe56b9e6SYuval Mintz #define MCP_PORT_MAX            2       /* Global */
3121fe56b9e6SYuval Mintz #define MCP_GLOB_PORT_MAX       4       /* Global */
3122fe56b9e6SYuval Mintz #define MCP_GLOB_FUNC_MAX       16      /* Global */
3123fe56b9e6SYuval Mintz 
3124fe56b9e6SYuval Mintz typedef u32 offsize_t;                  /* In DWORDS !!! */
3125fe56b9e6SYuval Mintz /* Offset from the beginning of the MCP scratchpad */
3126fe56b9e6SYuval Mintz #define OFFSIZE_OFFSET_SHIFT    0
3127fe56b9e6SYuval Mintz #define OFFSIZE_OFFSET_MASK     0x0000ffff
3128fe56b9e6SYuval Mintz /* Size of specific element (not the whole array if any) */
3129fe56b9e6SYuval Mintz #define OFFSIZE_SIZE_SHIFT      16
3130fe56b9e6SYuval Mintz #define OFFSIZE_SIZE_MASK       0xffff0000
3131fe56b9e6SYuval Mintz 
3132fe56b9e6SYuval Mintz /* SECTION_OFFSET is calculating the offset in bytes out of offsize */
3133fe56b9e6SYuval Mintz #define SECTION_OFFSET(_offsize)        ((((_offsize &		    \
3134fe56b9e6SYuval Mintz 					    OFFSIZE_OFFSET_MASK) >> \
3135fe56b9e6SYuval Mintz 					   OFFSIZE_OFFSET_SHIFT) << 2))
3136fe56b9e6SYuval Mintz 
3137fe56b9e6SYuval Mintz /* QED_SECTION_SIZE is calculating the size in bytes out of offsize */
3138fe56b9e6SYuval Mintz #define QED_SECTION_SIZE(_offsize)              (((_offsize &		 \
3139fe56b9e6SYuval Mintz 						   OFFSIZE_SIZE_MASK) >> \
3140fe56b9e6SYuval Mintz 						  OFFSIZE_SIZE_SHIFT) << 2)
3141fe56b9e6SYuval Mintz 
3142fe56b9e6SYuval Mintz /* SECTION_ADDR returns the GRC addr of a section, given offsize and index
3143fe56b9e6SYuval Mintz  * within section.
3144fe56b9e6SYuval Mintz  */
3145fe56b9e6SYuval Mintz #define SECTION_ADDR(_offsize, idx)     (MCP_REG_SCRATCH +	    \
3146fe56b9e6SYuval Mintz 					 SECTION_OFFSET(_offsize) + \
3147fe56b9e6SYuval Mintz 					 (QED_SECTION_SIZE(_offsize) * idx))
3148fe56b9e6SYuval Mintz 
3149fe56b9e6SYuval Mintz /* SECTION_OFFSIZE_ADDR returns the GRC addr to the offsize address.
3150fe56b9e6SYuval Mintz  * Use offsetof, since the OFFSETUP collide with the firmware definition
3151fe56b9e6SYuval Mintz  */
3152fe56b9e6SYuval Mintz #define SECTION_OFFSIZE_ADDR(_pub_base, _section) (_pub_base +		     \
3153fe56b9e6SYuval Mintz 						   offsetof(struct	     \
3154fe56b9e6SYuval Mintz 							    mcp_public_data, \
3155fe56b9e6SYuval Mintz 							    sections[_section]))
3156fe56b9e6SYuval Mintz /* PHY configuration */
3157fe56b9e6SYuval Mintz struct pmm_phy_cfg {
3158fe56b9e6SYuval Mintz 	u32	speed;
3159fe56b9e6SYuval Mintz #define PMM_SPEED_AUTONEG   0
3160fe56b9e6SYuval Mintz 
3161fe56b9e6SYuval Mintz 	u32	pause;  /* bitmask */
3162fe56b9e6SYuval Mintz #define PMM_PAUSE_NONE          0x0
3163fe56b9e6SYuval Mintz #define PMM_PAUSE_AUTONEG       0x1
3164fe56b9e6SYuval Mintz #define PMM_PAUSE_RX            0x2
3165fe56b9e6SYuval Mintz #define PMM_PAUSE_TX            0x4
3166fe56b9e6SYuval Mintz 
3167fe56b9e6SYuval Mintz 	u32	adv_speed;  /* Default should be the speed_cap_mask */
3168fe56b9e6SYuval Mintz 	u32	loopback_mode;
3169fe56b9e6SYuval Mintz #define PMM_LOOPBACK_NONE               0
3170fe56b9e6SYuval Mintz #define PMM_LOOPBACK_INT_PHY    1
3171fe56b9e6SYuval Mintz #define PMM_LOOPBACK_EXT_PHY    2
3172fe56b9e6SYuval Mintz #define PMM_LOOPBACK_EXT                3
3173fe56b9e6SYuval Mintz #define PMM_LOOPBACK_MAC                4
3174fe56b9e6SYuval Mintz 
3175fe56b9e6SYuval Mintz 	/* features */
3176fe56b9e6SYuval Mintz 	u32 feature_config_flags;
3177fe56b9e6SYuval Mintz };
3178fe56b9e6SYuval Mintz 
3179fe56b9e6SYuval Mintz struct port_mf_cfg {
3180fe56b9e6SYuval Mintz 	u32	dynamic_cfg; /* device control channel */
3181fe56b9e6SYuval Mintz #define PORT_MF_CFG_OV_TAG_MASK              0x0000ffff
3182fe56b9e6SYuval Mintz #define PORT_MF_CFG_OV_TAG_SHIFT             0
3183fe56b9e6SYuval Mintz #define PORT_MF_CFG_OV_TAG_DEFAULT         PORT_MF_CFG_OV_TAG_MASK
3184fe56b9e6SYuval Mintz 
3185fe56b9e6SYuval Mintz 	u32	reserved[1];
3186fe56b9e6SYuval Mintz };
3187fe56b9e6SYuval Mintz 
3188fe56b9e6SYuval Mintz /* DO NOT add new fields in the middle
3189fe56b9e6SYuval Mintz  * MUST be synced with struct pmm_stats_map
3190fe56b9e6SYuval Mintz  */
3191fe56b9e6SYuval Mintz struct pmm_stats {
3192fe56b9e6SYuval Mintz 	u64	r64;    /* 0x00 (Offset 0x00 ) RX 64-byte frame counter*/
3193fe56b9e6SYuval Mintz 	u64	r127;   /* 0x01 (Offset 0x08 ) RX 65 to 127 byte frame counter*/
3194fe56b9e6SYuval Mintz 	u64	r255;
3195fe56b9e6SYuval Mintz 	u64	r511;
3196fe56b9e6SYuval Mintz 	u64	r1023;
3197fe56b9e6SYuval Mintz 	u64	r1518;
3198fe56b9e6SYuval Mintz 	u64	r1522;
3199fe56b9e6SYuval Mintz 	u64	r2047;
3200fe56b9e6SYuval Mintz 	u64	r4095;
3201fe56b9e6SYuval Mintz 	u64	r9216;
3202fe56b9e6SYuval Mintz 	u64	r16383;
3203fe56b9e6SYuval Mintz 	u64	rfcs;   /* 0x0F (Offset 0x58 ) RX FCS error frame counter*/
3204fe56b9e6SYuval Mintz 	u64	rxcf;   /* 0x10 (Offset 0x60 ) RX control frame counter*/
3205fe56b9e6SYuval Mintz 	u64	rxpf;   /* 0x11 (Offset 0x68 ) RX pause frame counter*/
3206fe56b9e6SYuval Mintz 	u64	rxpp;   /* 0x12 (Offset 0x70 ) RX PFC frame counter*/
3207fe56b9e6SYuval Mintz 	u64	raln;   /* 0x16 (Offset 0x78 ) RX alignment error counter*/
3208fe56b9e6SYuval Mintz 	u64	rfcr;   /* 0x19 (Offset 0x80 ) RX false carrier counter */
3209fe56b9e6SYuval Mintz 	u64	rovr;   /* 0x1A (Offset 0x88 ) RX oversized frame counter*/
3210fe56b9e6SYuval Mintz 	u64	rjbr;   /* 0x1B (Offset 0x90 ) RX jabber frame counter */
3211fe56b9e6SYuval Mintz 	u64	rund;   /* 0x34 (Offset 0x98 ) RX undersized frame counter */
3212fe56b9e6SYuval Mintz 	u64	rfrg;   /* 0x35 (Offset 0xa0 ) RX fragment counter */
3213fe56b9e6SYuval Mintz 	u64	t64;    /* 0x40 (Offset 0xa8 ) TX 64-byte frame counter */
3214fe56b9e6SYuval Mintz 	u64	t127;
3215fe56b9e6SYuval Mintz 	u64	t255;
3216fe56b9e6SYuval Mintz 	u64	t511;
3217fe56b9e6SYuval Mintz 	u64	t1023;
3218fe56b9e6SYuval Mintz 	u64	t1518;
3219fe56b9e6SYuval Mintz 	u64	t2047;
3220fe56b9e6SYuval Mintz 	u64	t4095;
3221fe56b9e6SYuval Mintz 	u64	t9216;
3222fe56b9e6SYuval Mintz 	u64	t16383;
3223fe56b9e6SYuval Mintz 	u64	txpf;   /* 0x50 (Offset 0xf8 ) TX pause frame counter */
3224fe56b9e6SYuval Mintz 	u64	txpp;   /* 0x51 (Offset 0x100) TX PFC frame counter */
3225fe56b9e6SYuval Mintz 	u64	tlpiec;
3226fe56b9e6SYuval Mintz 	u64	tncl;
3227fe56b9e6SYuval Mintz 	u64	rbyte;  /* 0x3d (Offset 0x118) RX byte counter */
3228fe56b9e6SYuval Mintz 	u64	rxuca;  /* 0x0c (Offset 0x120) RX UC frame counter */
3229fe56b9e6SYuval Mintz 	u64	rxmca;  /* 0x0d (Offset 0x128) RX MC frame counter */
3230fe56b9e6SYuval Mintz 	u64	rxbca;  /* 0x0e (Offset 0x130) RX BC frame counter */
3231fe56b9e6SYuval Mintz 	u64	rxpok;
3232fe56b9e6SYuval Mintz 	u64	tbyte;  /* 0x6f (Offset 0x140) TX byte counter */
3233fe56b9e6SYuval Mintz 	u64	txuca;  /* 0x4d (Offset 0x148) TX UC frame counter */
3234fe56b9e6SYuval Mintz 	u64	txmca;  /* 0x4e (Offset 0x150) TX MC frame counter */
3235fe56b9e6SYuval Mintz 	u64	txbca;  /* 0x4f (Offset 0x158) TX BC frame counter */
3236fe56b9e6SYuval Mintz 	u64	txcf;   /* 0x54 (Offset 0x160) TX control frame counter */
3237fe56b9e6SYuval Mintz };
3238fe56b9e6SYuval Mintz 
3239fe56b9e6SYuval Mintz struct brb_stats {
3240fe56b9e6SYuval Mintz 	u64	brb_truncate[8];
3241fe56b9e6SYuval Mintz 	u64	brb_discard[8];
3242fe56b9e6SYuval Mintz };
3243fe56b9e6SYuval Mintz 
3244fe56b9e6SYuval Mintz struct port_stats {
3245fe56b9e6SYuval Mintz 	struct brb_stats	brb;
3246fe56b9e6SYuval Mintz 	struct pmm_stats	pmm;
3247fe56b9e6SYuval Mintz };
3248fe56b9e6SYuval Mintz 
3249fe56b9e6SYuval Mintz #define CMT_TEAM0 0
3250fe56b9e6SYuval Mintz #define CMT_TEAM1 1
3251fe56b9e6SYuval Mintz #define CMT_TEAM_MAX 2
3252fe56b9e6SYuval Mintz 
3253fe56b9e6SYuval Mintz struct couple_mode_teaming {
3254fe56b9e6SYuval Mintz 	u8 port_cmt[MCP_GLOB_PORT_MAX];
3255fe56b9e6SYuval Mintz #define PORT_CMT_IN_TEAM		BIT(0)
3256fe56b9e6SYuval Mintz 
3257fe56b9e6SYuval Mintz #define PORT_CMT_PORT_ROLE		BIT(1)
3258fe56b9e6SYuval Mintz #define PORT_CMT_PORT_INACTIVE      (0 << 1)
3259fe56b9e6SYuval Mintz #define PORT_CMT_PORT_ACTIVE		BIT(1)
3260fe56b9e6SYuval Mintz 
3261fe56b9e6SYuval Mintz #define PORT_CMT_TEAM_MASK		BIT(2)
3262fe56b9e6SYuval Mintz #define PORT_CMT_TEAM0              (0 << 2)
3263fe56b9e6SYuval Mintz #define PORT_CMT_TEAM1			BIT(2)
3264fe56b9e6SYuval Mintz };
3265fe56b9e6SYuval Mintz 
3266fe56b9e6SYuval Mintz /**************************************
3267fe56b9e6SYuval Mintz *     LLDP and DCBX HSI structures
3268fe56b9e6SYuval Mintz **************************************/
3269fe56b9e6SYuval Mintz #define LLDP_CHASSIS_ID_STAT_LEN 4
3270fe56b9e6SYuval Mintz #define LLDP_PORT_ID_STAT_LEN 4
3271fe56b9e6SYuval Mintz #define DCBX_MAX_APP_PROTOCOL           32
3272fe56b9e6SYuval Mintz #define MAX_SYSTEM_LLDP_TLV_DATA    32
3273fe56b9e6SYuval Mintz 
3274fe56b9e6SYuval Mintz enum lldp_agent_e {
3275fe56b9e6SYuval Mintz 	LLDP_NEAREST_BRIDGE = 0,
3276fe56b9e6SYuval Mintz 	LLDP_NEAREST_NON_TPMR_BRIDGE,
3277fe56b9e6SYuval Mintz 	LLDP_NEAREST_CUSTOMER_BRIDGE,
3278fe56b9e6SYuval Mintz 	LLDP_MAX_LLDP_AGENTS
3279fe56b9e6SYuval Mintz };
3280fe56b9e6SYuval Mintz 
3281fe56b9e6SYuval Mintz struct lldp_config_params_s {
3282fe56b9e6SYuval Mintz 	u32 config;
3283fe56b9e6SYuval Mintz #define LLDP_CONFIG_TX_INTERVAL_MASK        0x000000ff
3284fe56b9e6SYuval Mintz #define LLDP_CONFIG_TX_INTERVAL_SHIFT       0
3285fe56b9e6SYuval Mintz #define LLDP_CONFIG_HOLD_MASK               0x00000f00
3286fe56b9e6SYuval Mintz #define LLDP_CONFIG_HOLD_SHIFT              8
3287fe56b9e6SYuval Mintz #define LLDP_CONFIG_MAX_CREDIT_MASK         0x0000f000
3288fe56b9e6SYuval Mintz #define LLDP_CONFIG_MAX_CREDIT_SHIFT        12
3289fe56b9e6SYuval Mintz #define LLDP_CONFIG_ENABLE_RX_MASK          0x40000000
3290fe56b9e6SYuval Mintz #define LLDP_CONFIG_ENABLE_RX_SHIFT         30
3291fe56b9e6SYuval Mintz #define LLDP_CONFIG_ENABLE_TX_MASK          0x80000000
3292fe56b9e6SYuval Mintz #define LLDP_CONFIG_ENABLE_TX_SHIFT         31
3293fe56b9e6SYuval Mintz 	u32	local_chassis_id[LLDP_CHASSIS_ID_STAT_LEN];
3294fe56b9e6SYuval Mintz 	u32	local_port_id[LLDP_PORT_ID_STAT_LEN];
3295fe56b9e6SYuval Mintz };
3296fe56b9e6SYuval Mintz 
3297fe56b9e6SYuval Mintz struct lldp_status_params_s {
3298fe56b9e6SYuval Mintz 	u32	prefix_seq_num;
3299fe56b9e6SYuval Mintz 	u32	status; /* TBD */
3300fe56b9e6SYuval Mintz 
3301fe56b9e6SYuval Mintz 	/* Holds remote Chassis ID TLV header, subtype and 9B of payload. */
3302fe56b9e6SYuval Mintz 	u32	peer_chassis_id[LLDP_CHASSIS_ID_STAT_LEN];
3303fe56b9e6SYuval Mintz 
3304fe56b9e6SYuval Mintz 	/* Holds remote Port ID TLV header, subtype and 9B of payload. */
3305fe56b9e6SYuval Mintz 	u32	peer_port_id[LLDP_PORT_ID_STAT_LEN];
3306fe56b9e6SYuval Mintz 	u32	suffix_seq_num;
3307fe56b9e6SYuval Mintz };
3308fe56b9e6SYuval Mintz 
3309fe56b9e6SYuval Mintz struct dcbx_ets_feature {
3310fe56b9e6SYuval Mintz 	u32 flags;
3311fe56b9e6SYuval Mintz #define DCBX_ETS_ENABLED_MASK                   0x00000001
3312fe56b9e6SYuval Mintz #define DCBX_ETS_ENABLED_SHIFT                  0
3313fe56b9e6SYuval Mintz #define DCBX_ETS_WILLING_MASK                   0x00000002
3314fe56b9e6SYuval Mintz #define DCBX_ETS_WILLING_SHIFT                  1
3315fe56b9e6SYuval Mintz #define DCBX_ETS_ERROR_MASK                     0x00000004
3316fe56b9e6SYuval Mintz #define DCBX_ETS_ERROR_SHIFT                    2
3317fe56b9e6SYuval Mintz #define DCBX_ETS_CBS_MASK                       0x00000008
3318fe56b9e6SYuval Mintz #define DCBX_ETS_CBS_SHIFT                      3
3319fe56b9e6SYuval Mintz #define DCBX_ETS_MAX_TCS_MASK                   0x000000f0
3320fe56b9e6SYuval Mintz #define DCBX_ETS_MAX_TCS_SHIFT                  4
3321fe56b9e6SYuval Mintz 	u32	pri_tc_tbl[1];
3322fe56b9e6SYuval Mintz #define DCBX_ISCSI_OOO_TC                       4
3323fe56b9e6SYuval Mintz #define NIG_ETS_ISCSI_OOO_CLIENT_OFFSET         (DCBX_ISCSI_OOO_TC + 1)
3324fe56b9e6SYuval Mintz 	u32	tc_bw_tbl[2];
3325fe56b9e6SYuval Mintz 	u32	tc_tsa_tbl[2];
3326fe56b9e6SYuval Mintz #define DCBX_ETS_TSA_STRICT                     0
3327fe56b9e6SYuval Mintz #define DCBX_ETS_TSA_CBS                        1
3328fe56b9e6SYuval Mintz #define DCBX_ETS_TSA_ETS                        2
3329fe56b9e6SYuval Mintz };
3330fe56b9e6SYuval Mintz 
3331fe56b9e6SYuval Mintz struct dcbx_app_priority_entry {
3332fe56b9e6SYuval Mintz 	u32 entry;
3333fe56b9e6SYuval Mintz #define DCBX_APP_PRI_MAP_MASK       0x000000ff
3334fe56b9e6SYuval Mintz #define DCBX_APP_PRI_MAP_SHIFT      0
3335fe56b9e6SYuval Mintz #define DCBX_APP_PRI_0              0x01
3336fe56b9e6SYuval Mintz #define DCBX_APP_PRI_1              0x02
3337fe56b9e6SYuval Mintz #define DCBX_APP_PRI_2              0x04
3338fe56b9e6SYuval Mintz #define DCBX_APP_PRI_3              0x08
3339fe56b9e6SYuval Mintz #define DCBX_APP_PRI_4              0x10
3340fe56b9e6SYuval Mintz #define DCBX_APP_PRI_5              0x20
3341fe56b9e6SYuval Mintz #define DCBX_APP_PRI_6              0x40
3342fe56b9e6SYuval Mintz #define DCBX_APP_PRI_7              0x80
3343fe56b9e6SYuval Mintz #define DCBX_APP_SF_MASK            0x00000300
3344fe56b9e6SYuval Mintz #define DCBX_APP_SF_SHIFT           8
3345fe56b9e6SYuval Mintz #define DCBX_APP_SF_ETHTYPE         0
3346fe56b9e6SYuval Mintz #define DCBX_APP_SF_PORT            1
3347fe56b9e6SYuval Mintz #define DCBX_APP_PROTOCOL_ID_MASK   0xffff0000
3348fe56b9e6SYuval Mintz #define DCBX_APP_PROTOCOL_ID_SHIFT  16
3349fe56b9e6SYuval Mintz };
3350fe56b9e6SYuval Mintz 
3351fe56b9e6SYuval Mintz /* FW structure in BE */
3352fe56b9e6SYuval Mintz struct dcbx_app_priority_feature {
3353fe56b9e6SYuval Mintz 	u32 flags;
3354fe56b9e6SYuval Mintz #define DCBX_APP_ENABLED_MASK           0x00000001
3355fe56b9e6SYuval Mintz #define DCBX_APP_ENABLED_SHIFT          0
3356fe56b9e6SYuval Mintz #define DCBX_APP_WILLING_MASK           0x00000002
3357fe56b9e6SYuval Mintz #define DCBX_APP_WILLING_SHIFT          1
3358fe56b9e6SYuval Mintz #define DCBX_APP_ERROR_MASK             0x00000004
3359fe56b9e6SYuval Mintz #define DCBX_APP_ERROR_SHIFT            2
3360fe56b9e6SYuval Mintz /* Not in use
3361fe56b9e6SYuval Mintz  * #define DCBX_APP_DEFAULT_PRI_MASK       0x00000f00
3362fe56b9e6SYuval Mintz  * #define DCBX_APP_DEFAULT_PRI_SHIFT      8
3363fe56b9e6SYuval Mintz  */
3364fe56b9e6SYuval Mintz #define DCBX_APP_MAX_TCS_MASK           0x0000f000
3365fe56b9e6SYuval Mintz #define DCBX_APP_MAX_TCS_SHIFT          12
3366fe56b9e6SYuval Mintz #define DCBX_APP_NUM_ENTRIES_MASK       0x00ff0000
3367fe56b9e6SYuval Mintz #define DCBX_APP_NUM_ENTRIES_SHIFT      16
3368fe56b9e6SYuval Mintz 	struct dcbx_app_priority_entry app_pri_tbl[DCBX_MAX_APP_PROTOCOL];
3369fe56b9e6SYuval Mintz };
3370fe56b9e6SYuval Mintz 
3371fe56b9e6SYuval Mintz /* FW structure in BE */
3372fe56b9e6SYuval Mintz struct dcbx_features {
3373fe56b9e6SYuval Mintz 	/* PG feature */
3374fe56b9e6SYuval Mintz 	struct dcbx_ets_feature ets;
3375fe56b9e6SYuval Mintz 
3376fe56b9e6SYuval Mintz 	/* PFC feature */
3377fe56b9e6SYuval Mintz 	u32			pfc;
3378fe56b9e6SYuval Mintz #define DCBX_PFC_PRI_EN_BITMAP_MASK             0x000000ff
3379fe56b9e6SYuval Mintz #define DCBX_PFC_PRI_EN_BITMAP_SHIFT            0
3380fe56b9e6SYuval Mintz #define DCBX_PFC_PRI_EN_BITMAP_PRI_0            0x01
3381fe56b9e6SYuval Mintz #define DCBX_PFC_PRI_EN_BITMAP_PRI_1            0x02
3382fe56b9e6SYuval Mintz #define DCBX_PFC_PRI_EN_BITMAP_PRI_2            0x04
3383fe56b9e6SYuval Mintz #define DCBX_PFC_PRI_EN_BITMAP_PRI_3            0x08
3384fe56b9e6SYuval Mintz #define DCBX_PFC_PRI_EN_BITMAP_PRI_4            0x10
3385fe56b9e6SYuval Mintz #define DCBX_PFC_PRI_EN_BITMAP_PRI_5            0x20
3386fe56b9e6SYuval Mintz #define DCBX_PFC_PRI_EN_BITMAP_PRI_6            0x40
3387fe56b9e6SYuval Mintz #define DCBX_PFC_PRI_EN_BITMAP_PRI_7            0x80
3388fe56b9e6SYuval Mintz 
3389fe56b9e6SYuval Mintz #define DCBX_PFC_FLAGS_MASK                     0x0000ff00
3390fe56b9e6SYuval Mintz #define DCBX_PFC_FLAGS_SHIFT                    8
3391fe56b9e6SYuval Mintz #define DCBX_PFC_CAPS_MASK                      0x00000f00
3392fe56b9e6SYuval Mintz #define DCBX_PFC_CAPS_SHIFT                     8
3393fe56b9e6SYuval Mintz #define DCBX_PFC_MBC_MASK                       0x00004000
3394fe56b9e6SYuval Mintz #define DCBX_PFC_MBC_SHIFT                      14
3395fe56b9e6SYuval Mintz #define DCBX_PFC_WILLING_MASK                   0x00008000
3396fe56b9e6SYuval Mintz #define DCBX_PFC_WILLING_SHIFT                  15
3397fe56b9e6SYuval Mintz #define DCBX_PFC_ENABLED_MASK                   0x00010000
3398fe56b9e6SYuval Mintz #define DCBX_PFC_ENABLED_SHIFT                  16
3399fe56b9e6SYuval Mintz #define DCBX_PFC_ERROR_MASK                     0x00020000
3400fe56b9e6SYuval Mintz #define DCBX_PFC_ERROR_SHIFT                    17
3401fe56b9e6SYuval Mintz 
3402fe56b9e6SYuval Mintz 	/* APP feature */
3403fe56b9e6SYuval Mintz 	struct dcbx_app_priority_feature app;
3404fe56b9e6SYuval Mintz };
3405fe56b9e6SYuval Mintz 
3406fe56b9e6SYuval Mintz struct dcbx_local_params {
3407fe56b9e6SYuval Mintz 	u32 config;
3408fe56b9e6SYuval Mintz #define DCBX_CONFIG_VERSION_MASK            0x00000003
3409fe56b9e6SYuval Mintz #define DCBX_CONFIG_VERSION_SHIFT           0
3410fe56b9e6SYuval Mintz #define DCBX_CONFIG_VERSION_DISABLED        0
3411fe56b9e6SYuval Mintz #define DCBX_CONFIG_VERSION_IEEE            1
3412fe56b9e6SYuval Mintz #define DCBX_CONFIG_VERSION_CEE             2
3413fe56b9e6SYuval Mintz 
3414fe56b9e6SYuval Mintz 	u32			flags;
3415fe56b9e6SYuval Mintz 	struct dcbx_features	features;
3416fe56b9e6SYuval Mintz };
3417fe56b9e6SYuval Mintz 
3418fe56b9e6SYuval Mintz struct dcbx_mib {
3419fe56b9e6SYuval Mintz 	u32	prefix_seq_num;
3420fe56b9e6SYuval Mintz 	u32	flags;
3421fe56b9e6SYuval Mintz 	struct dcbx_features	features;
3422fe56b9e6SYuval Mintz 	u32			suffix_seq_num;
3423fe56b9e6SYuval Mintz };
3424fe56b9e6SYuval Mintz 
3425fe56b9e6SYuval Mintz struct lldp_system_tlvs_buffer_s {
3426fe56b9e6SYuval Mintz 	u16	valid;
3427fe56b9e6SYuval Mintz 	u16	length;
3428fe56b9e6SYuval Mintz 	u32	data[MAX_SYSTEM_LLDP_TLV_DATA];
3429fe56b9e6SYuval Mintz };
3430fe56b9e6SYuval Mintz 
3431fe56b9e6SYuval Mintz /**************************************/
3432fe56b9e6SYuval Mintz /*                                    */
3433fe56b9e6SYuval Mintz /*     P U B L I C      G L O B A L   */
3434fe56b9e6SYuval Mintz /*                                    */
3435fe56b9e6SYuval Mintz /**************************************/
3436fe56b9e6SYuval Mintz struct public_global {
3437fe56b9e6SYuval Mintz 	u32				max_path;
3438fe56b9e6SYuval Mintz #define MAX_PATH_BIG_BEAR       2
3439fe56b9e6SYuval Mintz #define MAX_PATH_K2             1
3440fe56b9e6SYuval Mintz 	u32				max_ports;
3441fe56b9e6SYuval Mintz #define MODE_1P 1
3442fe56b9e6SYuval Mintz #define MODE_2P 2
3443fe56b9e6SYuval Mintz #define MODE_3P 3
3444fe56b9e6SYuval Mintz #define MODE_4P 4
3445fe56b9e6SYuval Mintz 	u32				debug_mb_offset;
3446fe56b9e6SYuval Mintz 	u32				phymod_dbg_mb_offset;
3447fe56b9e6SYuval Mintz 	struct couple_mode_teaming	cmt;
3448fe56b9e6SYuval Mintz 	s32				internal_temperature;
3449fe56b9e6SYuval Mintz 	u32				mfw_ver;
3450fe56b9e6SYuval Mintz 	u32				running_bundle_id;
3451fe56b9e6SYuval Mintz };
3452fe56b9e6SYuval Mintz 
3453fe56b9e6SYuval Mintz /**************************************/
3454fe56b9e6SYuval Mintz /*                                    */
3455fe56b9e6SYuval Mintz /*     P U B L I C      P A T H       */
3456fe56b9e6SYuval Mintz /*                                    */
3457fe56b9e6SYuval Mintz /**************************************/
3458fe56b9e6SYuval Mintz 
3459fe56b9e6SYuval Mintz /****************************************************************************
3460fe56b9e6SYuval Mintz * Shared Memory 2 Region                                                   *
3461fe56b9e6SYuval Mintz ****************************************************************************/
3462fe56b9e6SYuval Mintz /* The fw_flr_ack is actually built in the following way:                   */
3463fe56b9e6SYuval Mintz /* 8 bit:  PF ack                                                           */
3464fe56b9e6SYuval Mintz /* 128 bit: VF ack                                                           */
3465fe56b9e6SYuval Mintz /* 8 bit:  ios_dis_ack                                                      */
3466fe56b9e6SYuval Mintz /* In order to maintain endianity in the mailbox hsi, we want to keep using */
3467fe56b9e6SYuval Mintz /* u32. The fw must have the VF right after the PF since this is how it     */
3468fe56b9e6SYuval Mintz /* access arrays(it expects always the VF to reside after the PF, and that  */
3469fe56b9e6SYuval Mintz /* makes the calculation much easier for it. )                              */
3470fe56b9e6SYuval Mintz /* In order to answer both limitations, and keep the struct small, the code */
3471fe56b9e6SYuval Mintz /* will abuse the structure defined here to achieve the actual partition    */
3472fe56b9e6SYuval Mintz /* above                                                                    */
3473fe56b9e6SYuval Mintz /****************************************************************************/
3474fe56b9e6SYuval Mintz struct fw_flr_mb {
3475fe56b9e6SYuval Mintz 	u32	aggint;
3476fe56b9e6SYuval Mintz 	u32	opgen_addr;
3477fe56b9e6SYuval Mintz 	u32	accum_ack;  /* 0..15:PF, 16..207:VF, 256..271:IOV_DIS */
3478fe56b9e6SYuval Mintz #define ACCUM_ACK_PF_BASE       0
3479fe56b9e6SYuval Mintz #define ACCUM_ACK_PF_SHIFT      0
3480fe56b9e6SYuval Mintz 
3481fe56b9e6SYuval Mintz #define ACCUM_ACK_VF_BASE       8
3482fe56b9e6SYuval Mintz #define ACCUM_ACK_VF_SHIFT      3
3483fe56b9e6SYuval Mintz 
3484fe56b9e6SYuval Mintz #define ACCUM_ACK_IOV_DIS_BASE  256
3485fe56b9e6SYuval Mintz #define ACCUM_ACK_IOV_DIS_SHIFT 8
3486fe56b9e6SYuval Mintz };
3487fe56b9e6SYuval Mintz 
3488fe56b9e6SYuval Mintz struct public_path {
3489fe56b9e6SYuval Mintz 	struct fw_flr_mb	flr_mb;
3490fe56b9e6SYuval Mintz 	u32			mcp_vf_disabled[VF_MAX_STATIC / 32];
3491fe56b9e6SYuval Mintz 
3492fe56b9e6SYuval Mintz 	u32			process_kill;
3493fe56b9e6SYuval Mintz #define PROCESS_KILL_COUNTER_MASK               0x0000ffff
3494fe56b9e6SYuval Mintz #define PROCESS_KILL_COUNTER_SHIFT              0
3495fe56b9e6SYuval Mintz #define PROCESS_KILL_GLOB_AEU_BIT_MASK          0xffff0000
3496fe56b9e6SYuval Mintz #define PROCESS_KILL_GLOB_AEU_BIT_SHIFT         16
3497fe56b9e6SYuval Mintz #define GLOBAL_AEU_BIT(aeu_reg_id, aeu_bit) (aeu_reg_id * 32 + aeu_bit)
3498fe56b9e6SYuval Mintz };
3499fe56b9e6SYuval Mintz 
3500fe56b9e6SYuval Mintz /**************************************/
3501fe56b9e6SYuval Mintz /*                                    */
3502fe56b9e6SYuval Mintz /*     P U B L I C      P O R T       */
3503fe56b9e6SYuval Mintz /*                                    */
3504fe56b9e6SYuval Mintz /**************************************/
3505fe56b9e6SYuval Mintz 
3506fe56b9e6SYuval Mintz /****************************************************************************
3507fe56b9e6SYuval Mintz * Driver <-> FW Mailbox                                                    *
3508fe56b9e6SYuval Mintz ****************************************************************************/
3509fe56b9e6SYuval Mintz 
3510fe56b9e6SYuval Mintz struct public_port {
3511fe56b9e6SYuval Mintz 	u32 validity_map;   /* 0x0 (4*2 = 0x8) */
3512fe56b9e6SYuval Mintz 
3513fe56b9e6SYuval Mintz 	/* validity bits */
3514fe56b9e6SYuval Mintz #define MCP_VALIDITY_PCI_CFG                    0x00100000
3515fe56b9e6SYuval Mintz #define MCP_VALIDITY_MB                         0x00200000
3516fe56b9e6SYuval Mintz #define MCP_VALIDITY_DEV_INFO                   0x00400000
3517fe56b9e6SYuval Mintz #define MCP_VALIDITY_RESERVED                   0x00000007
3518fe56b9e6SYuval Mintz 
3519fe56b9e6SYuval Mintz 	/* One licensing bit should be set */
3520fe56b9e6SYuval Mintz #define MCP_VALIDITY_LIC_KEY_IN_EFFECT_MASK     0x00000038
3521fe56b9e6SYuval Mintz #define MCP_VALIDITY_LIC_MANUF_KEY_IN_EFFECT    0x00000008
3522fe56b9e6SYuval Mintz #define MCP_VALIDITY_LIC_UPGRADE_KEY_IN_EFFECT  0x00000010
3523fe56b9e6SYuval Mintz #define MCP_VALIDITY_LIC_NO_KEY_IN_EFFECT       0x00000020
3524fe56b9e6SYuval Mintz 
3525fe56b9e6SYuval Mintz 	/* Active MFW */
3526fe56b9e6SYuval Mintz #define MCP_VALIDITY_ACTIVE_MFW_UNKNOWN         0x00000000
3527fe56b9e6SYuval Mintz #define MCP_VALIDITY_ACTIVE_MFW_MASK            0x000001c0
3528fe56b9e6SYuval Mintz #define MCP_VALIDITY_ACTIVE_MFW_NCSI            0x00000040
3529fe56b9e6SYuval Mintz #define MCP_VALIDITY_ACTIVE_MFW_NONE            0x000001c0
3530fe56b9e6SYuval Mintz 
3531fe56b9e6SYuval Mintz 	u32 link_status;
3532fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_UP \
3533fe56b9e6SYuval Mintz 	0x00000001
3534fe56b9e6SYuval Mintz #define LINK_STATUS_SPEED_AND_DUPLEX_MASK                       0x0000001e
3535fe56b9e6SYuval Mintz #define LINK_STATUS_SPEED_AND_DUPLEX_1000THD		BIT(1)
3536fe56b9e6SYuval Mintz #define LINK_STATUS_SPEED_AND_DUPLEX_1000TFD            (2 << 1)
3537fe56b9e6SYuval Mintz #define LINK_STATUS_SPEED_AND_DUPLEX_10G                        (3 << 1)
3538fe56b9e6SYuval Mintz #define LINK_STATUS_SPEED_AND_DUPLEX_20G                        (4 << 1)
3539fe56b9e6SYuval Mintz #define LINK_STATUS_SPEED_AND_DUPLEX_40G                        (5 << 1)
3540fe56b9e6SYuval Mintz #define LINK_STATUS_SPEED_AND_DUPLEX_50G                        (6 << 1)
3541fe56b9e6SYuval Mintz #define LINK_STATUS_SPEED_AND_DUPLEX_100G                       (7 << 1)
3542fe56b9e6SYuval Mintz #define LINK_STATUS_SPEED_AND_DUPLEX_25G                        (8 << 1)
3543fe56b9e6SYuval Mintz 
3544fe56b9e6SYuval Mintz #define LINK_STATUS_AUTO_NEGOTIATE_ENABLED                      0x00000020
3545fe56b9e6SYuval Mintz 
3546fe56b9e6SYuval Mintz #define LINK_STATUS_AUTO_NEGOTIATE_COMPLETE                     0x00000040
3547fe56b9e6SYuval Mintz #define LINK_STATUS_PARALLEL_DETECTION_USED                     0x00000080
3548fe56b9e6SYuval Mintz 
3549fe56b9e6SYuval Mintz #define LINK_STATUS_PFC_ENABLED	\
3550fe56b9e6SYuval Mintz 	0x00000100
3551fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE        0x00000200
3552fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE        0x00000400
3553fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_10G_CAPABLE            0x00000800
3554fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_20G_CAPABLE            0x00001000
3555fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_40G_CAPABLE            0x00002000
3556fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_50G_CAPABLE            0x00004000
3557fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_100G_CAPABLE           0x00008000
3558fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_25G_CAPABLE            0x00010000
3559fe56b9e6SYuval Mintz 
3560fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_FLOW_CONTROL_MASK      0x000C0000
3561fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_NOT_PAUSE_CAPABLE      (0 << 18)
3562fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE	BIT(18)
3563fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE       (2 << 18)
3564fe56b9e6SYuval Mintz #define LINK_STATUS_LINK_PARTNER_BOTH_PAUSE                     (3 << 18)
3565fe56b9e6SYuval Mintz 
3566fe56b9e6SYuval Mintz #define LINK_STATUS_SFP_TX_FAULT \
3567fe56b9e6SYuval Mintz 	0x00100000
3568fe56b9e6SYuval Mintz #define LINK_STATUS_TX_FLOW_CONTROL_ENABLED                     0x00200000
3569fe56b9e6SYuval Mintz #define LINK_STATUS_RX_FLOW_CONTROL_ENABLED                     0x00400000
3570fe56b9e6SYuval Mintz 
3571fe56b9e6SYuval Mintz 	u32			link_status1;
3572fe56b9e6SYuval Mintz 	u32			ext_phy_fw_version;
3573fe56b9e6SYuval Mintz 	u32			drv_phy_cfg_addr;
3574fe56b9e6SYuval Mintz 
3575fe56b9e6SYuval Mintz 	u32			port_stx;
3576fe56b9e6SYuval Mintz 
3577fe56b9e6SYuval Mintz 	u32			stat_nig_timer;
3578fe56b9e6SYuval Mintz 
3579fe56b9e6SYuval Mintz 	struct port_mf_cfg	port_mf_config;
3580fe56b9e6SYuval Mintz 	struct port_stats	stats;
3581fe56b9e6SYuval Mintz 
3582fe56b9e6SYuval Mintz 	u32			media_type;
3583fe56b9e6SYuval Mintz #define MEDIA_UNSPECIFIED       0x0
3584fe56b9e6SYuval Mintz #define MEDIA_SFPP_10G_FIBER    0x1
3585fe56b9e6SYuval Mintz #define MEDIA_XFP_FIBER         0x2
3586fe56b9e6SYuval Mintz #define MEDIA_DA_TWINAX         0x3
3587fe56b9e6SYuval Mintz #define MEDIA_BASE_T            0x4
3588fe56b9e6SYuval Mintz #define MEDIA_SFP_1G_FIBER      0x5
3589fe56b9e6SYuval Mintz #define MEDIA_KR                0xf0
3590fe56b9e6SYuval Mintz #define MEDIA_NOT_PRESENT       0xff
3591fe56b9e6SYuval Mintz 
3592fe56b9e6SYuval Mintz 	u32 lfa_status;
3593fe56b9e6SYuval Mintz #define LFA_LINK_FLAP_REASON_OFFSET             0
3594fe56b9e6SYuval Mintz #define LFA_LINK_FLAP_REASON_MASK               0x000000ff
3595fe56b9e6SYuval Mintz #define LFA_NO_REASON                                   (0 << 0)
3596fe56b9e6SYuval Mintz #define LFA_LINK_DOWN					BIT(0)
3597fe56b9e6SYuval Mintz #define LFA_FORCE_INIT                                  BIT(1)
3598fe56b9e6SYuval Mintz #define LFA_LOOPBACK_MISMATCH                           BIT(2)
3599fe56b9e6SYuval Mintz #define LFA_SPEED_MISMATCH                              BIT(3)
3600fe56b9e6SYuval Mintz #define LFA_FLOW_CTRL_MISMATCH                          BIT(4)
3601fe56b9e6SYuval Mintz #define LFA_ADV_SPEED_MISMATCH                          BIT(5)
3602fe56b9e6SYuval Mintz #define LINK_FLAP_AVOIDANCE_COUNT_OFFSET        8
3603fe56b9e6SYuval Mintz #define LINK_FLAP_AVOIDANCE_COUNT_MASK          0x0000ff00
3604fe56b9e6SYuval Mintz #define LINK_FLAP_COUNT_OFFSET                  16
3605fe56b9e6SYuval Mintz #define LINK_FLAP_COUNT_MASK                    0x00ff0000
3606fe56b9e6SYuval Mintz 
3607fe56b9e6SYuval Mintz 	u32					link_change_count;
3608fe56b9e6SYuval Mintz 
3609fe56b9e6SYuval Mintz 	/* LLDP params */
3610fe56b9e6SYuval Mintz 	struct lldp_config_params_s		lldp_config_params[
3611fe56b9e6SYuval Mintz 		LLDP_MAX_LLDP_AGENTS];
3612fe56b9e6SYuval Mintz 	struct lldp_status_params_s		lldp_status_params[
3613fe56b9e6SYuval Mintz 		LLDP_MAX_LLDP_AGENTS];
3614fe56b9e6SYuval Mintz 	struct lldp_system_tlvs_buffer_s	system_lldp_tlvs_buf;
3615fe56b9e6SYuval Mintz 
3616fe56b9e6SYuval Mintz 	/* DCBX related MIB */
3617fe56b9e6SYuval Mintz 	struct dcbx_local_params		local_admin_dcbx_mib;
3618fe56b9e6SYuval Mintz 	struct dcbx_mib				remote_dcbx_mib;
3619fe56b9e6SYuval Mintz 	struct dcbx_mib				operational_dcbx_mib;
3620fc48b7a6SYuval Mintz 
3621fc48b7a6SYuval Mintz 	u32					fc_npiv_nvram_tbl_addr;
3622fc48b7a6SYuval Mintz 	u32					fc_npiv_nvram_tbl_size;
3623fc48b7a6SYuval Mintz 	u32					transceiver_data;
3624334c03b5SZvi Nachmani #define PMM_TRANSCEIVER_STATE_MASK		0x000000FF
3625334c03b5SZvi Nachmani #define PMM_TRANSCEIVER_STATE_SHIFT		0x00000000
3626334c03b5SZvi Nachmani #define PMM_TRANSCEIVER_STATE_PRESENT		0x00000001
3627fe56b9e6SYuval Mintz };
3628fe56b9e6SYuval Mintz 
3629fe56b9e6SYuval Mintz /**************************************/
3630fe56b9e6SYuval Mintz /*                                    */
3631fe56b9e6SYuval Mintz /*     P U B L I C      F U N C       */
3632fe56b9e6SYuval Mintz /*                                    */
3633fe56b9e6SYuval Mintz /**************************************/
3634fe56b9e6SYuval Mintz 
3635fe56b9e6SYuval Mintz struct public_func {
3636fe56b9e6SYuval Mintz 	u32	iscsi_boot_signature;
3637fe56b9e6SYuval Mintz 	u32	iscsi_boot_block_offset;
3638fe56b9e6SYuval Mintz 
3639fc48b7a6SYuval Mintz 	u32	mtu_size;
3640fc48b7a6SYuval Mintz 	u32	c2s_pcp_map_lower;
3641fc48b7a6SYuval Mintz 	u32	c2s_pcp_map_upper;
3642fc48b7a6SYuval Mintz 	u32	c2s_pcp_map_default;
3643fc48b7a6SYuval Mintz 	u32	reserved[4];
3644fe56b9e6SYuval Mintz 
3645fe56b9e6SYuval Mintz 	u32	config;
3646fe56b9e6SYuval Mintz 
3647fe56b9e6SYuval Mintz 	/* E/R/I/D */
3648fe56b9e6SYuval Mintz 	/* function 0 of each port cannot be hidden */
3649fe56b9e6SYuval Mintz #define FUNC_MF_CFG_FUNC_HIDE                   0x00000001
3650fe56b9e6SYuval Mintz #define FUNC_MF_CFG_PAUSE_ON_HOST_RING          0x00000002
3651fe56b9e6SYuval Mintz #define FUNC_MF_CFG_PAUSE_ON_HOST_RING_SHIFT    0x00000001
3652fe56b9e6SYuval Mintz 
3653fe56b9e6SYuval Mintz #define FUNC_MF_CFG_PROTOCOL_MASK               0x000000f0
3654fe56b9e6SYuval Mintz #define FUNC_MF_CFG_PROTOCOL_SHIFT              4
3655fe56b9e6SYuval Mintz #define FUNC_MF_CFG_PROTOCOL_ETHERNET           0x00000000
3656fe56b9e6SYuval Mintz #define FUNC_MF_CFG_PROTOCOL_ISCSI              0x00000010
3657fe56b9e6SYuval Mintz #define FUNC_MF_CFG_PROTOCOL_FCOE               0x00000020
3658fe56b9e6SYuval Mintz #define FUNC_MF_CFG_PROTOCOL_ROCE               0x00000030
3659fe56b9e6SYuval Mintz #define FUNC_MF_CFG_PROTOCOL_MAX                0x00000030
3660fe56b9e6SYuval Mintz 
3661fe56b9e6SYuval Mintz 	/* MINBW, MAXBW */
3662fe56b9e6SYuval Mintz 	/* value range - 0..100, increments in 1 %  */
3663fe56b9e6SYuval Mintz #define FUNC_MF_CFG_MIN_BW_MASK                 0x0000ff00
3664fe56b9e6SYuval Mintz #define FUNC_MF_CFG_MIN_BW_SHIFT                8
3665fe56b9e6SYuval Mintz #define FUNC_MF_CFG_MIN_BW_DEFAULT              0x00000000
3666fe56b9e6SYuval Mintz #define FUNC_MF_CFG_MAX_BW_MASK                 0x00ff0000
3667fe56b9e6SYuval Mintz #define FUNC_MF_CFG_MAX_BW_SHIFT                16
3668fe56b9e6SYuval Mintz #define FUNC_MF_CFG_MAX_BW_DEFAULT              0x00640000
3669fe56b9e6SYuval Mintz 
3670fe56b9e6SYuval Mintz 	u32	status;
3671fe56b9e6SYuval Mintz #define FUNC_STATUS_VLINK_DOWN                  0x00000001
3672fe56b9e6SYuval Mintz 
3673fe56b9e6SYuval Mintz 	u32	mac_upper;  /* MAC */
3674fe56b9e6SYuval Mintz #define FUNC_MF_CFG_UPPERMAC_MASK               0x0000ffff
3675fe56b9e6SYuval Mintz #define FUNC_MF_CFG_UPPERMAC_SHIFT              0
3676fe56b9e6SYuval Mintz #define FUNC_MF_CFG_UPPERMAC_DEFAULT            FUNC_MF_CFG_UPPERMAC_MASK
3677fe56b9e6SYuval Mintz 	u32	mac_lower;
3678fe56b9e6SYuval Mintz #define FUNC_MF_CFG_LOWERMAC_DEFAULT            0xffffffff
3679fe56b9e6SYuval Mintz 
3680fe56b9e6SYuval Mintz 	u32	fcoe_wwn_port_name_upper;
3681fe56b9e6SYuval Mintz 	u32	fcoe_wwn_port_name_lower;
3682fe56b9e6SYuval Mintz 
3683fe56b9e6SYuval Mintz 	u32	fcoe_wwn_node_name_upper;
3684fe56b9e6SYuval Mintz 	u32	fcoe_wwn_node_name_lower;
3685fe56b9e6SYuval Mintz 
3686fe56b9e6SYuval Mintz 	u32	ovlan_stag; /* tags */
3687fe56b9e6SYuval Mintz #define FUNC_MF_CFG_OV_STAG_MASK              0x0000ffff
3688fe56b9e6SYuval Mintz #define FUNC_MF_CFG_OV_STAG_SHIFT             0
3689fe56b9e6SYuval Mintz #define FUNC_MF_CFG_OV_STAG_DEFAULT           FUNC_MF_CFG_OV_STAG_MASK
3690fe56b9e6SYuval Mintz 
3691fe56b9e6SYuval Mintz 	u32	pf_allocation;  /* vf per pf */
3692fe56b9e6SYuval Mintz 
3693fe56b9e6SYuval Mintz 	u32	preserve_data;  /* Will be used bt CCM */
3694fe56b9e6SYuval Mintz 
3695fe56b9e6SYuval Mintz 	u32	driver_last_activity_ts;
3696fe56b9e6SYuval Mintz 
3697fe56b9e6SYuval Mintz 	u32	drv_ack_vf_disabled[VF_MAX_STATIC / 32]; /* 0x0044 */
3698fe56b9e6SYuval Mintz 
3699fe56b9e6SYuval Mintz 	u32	drv_id;
3700fe56b9e6SYuval Mintz #define DRV_ID_PDA_COMP_VER_MASK        0x0000ffff
3701fe56b9e6SYuval Mintz #define DRV_ID_PDA_COMP_VER_SHIFT       0
3702fe56b9e6SYuval Mintz 
3703fe56b9e6SYuval Mintz #define DRV_ID_MCP_HSI_VER_MASK         0x00ff0000
3704fe56b9e6SYuval Mintz #define DRV_ID_MCP_HSI_VER_SHIFT        16
3705fe56b9e6SYuval Mintz #define DRV_ID_MCP_HSI_VER_CURRENT	BIT(DRV_ID_MCP_HSI_VER_SHIFT)
3706fe56b9e6SYuval Mintz 
3707fc48b7a6SYuval Mintz #define DRV_ID_DRV_TYPE_MASK            0x7f000000
3708fe56b9e6SYuval Mintz #define DRV_ID_DRV_TYPE_SHIFT           24
3709fe56b9e6SYuval Mintz #define DRV_ID_DRV_TYPE_UNKNOWN         (0 << DRV_ID_DRV_TYPE_SHIFT)
3710fc48b7a6SYuval Mintz #define DRV_ID_DRV_TYPE_LINUX           (1 << DRV_ID_DRV_TYPE_SHIFT)
3711fe56b9e6SYuval Mintz #define DRV_ID_DRV_TYPE_WINDOWS         (2 << DRV_ID_DRV_TYPE_SHIFT)
3712fe56b9e6SYuval Mintz #define DRV_ID_DRV_TYPE_DIAG            (3 << DRV_ID_DRV_TYPE_SHIFT)
3713fe56b9e6SYuval Mintz #define DRV_ID_DRV_TYPE_PREBOOT         (4 << DRV_ID_DRV_TYPE_SHIFT)
3714fe56b9e6SYuval Mintz #define DRV_ID_DRV_TYPE_SOLARIS         (5 << DRV_ID_DRV_TYPE_SHIFT)
3715fe56b9e6SYuval Mintz #define DRV_ID_DRV_TYPE_VMWARE          (6 << DRV_ID_DRV_TYPE_SHIFT)
3716fe56b9e6SYuval Mintz #define DRV_ID_DRV_TYPE_FREEBSD         (7 << DRV_ID_DRV_TYPE_SHIFT)
3717fe56b9e6SYuval Mintz #define DRV_ID_DRV_TYPE_AIX             (8 << DRV_ID_DRV_TYPE_SHIFT)
3718fc48b7a6SYuval Mintz 
3719fc48b7a6SYuval Mintz #define DRV_ID_DRV_INIT_HW_MASK         0x80000000
3720fc48b7a6SYuval Mintz #define DRV_ID_DRV_INIT_HW_SHIFT        31
3721fc48b7a6SYuval Mintz #define DRV_ID_DRV_INIT_HW_FLAG         BIT(DRV_ID_DRV_INIT_HW_SHIFT)
3722fe56b9e6SYuval Mintz };
3723fe56b9e6SYuval Mintz 
3724fe56b9e6SYuval Mintz /**************************************/
3725fe56b9e6SYuval Mintz /*                                    */
3726fe56b9e6SYuval Mintz /*     P U B L I C       M B          */
3727fe56b9e6SYuval Mintz /*                                    */
3728fe56b9e6SYuval Mintz /**************************************/
3729fe56b9e6SYuval Mintz /* This is the only section that the driver can write to, and each */
3730fe56b9e6SYuval Mintz /* Basically each driver request to set feature parameters,
3731fe56b9e6SYuval Mintz  * will be done using a different command, which will be linked
3732fe56b9e6SYuval Mintz  * to a specific data structure from the union below.
3733fe56b9e6SYuval Mintz  * For huge strucuture, the common blank structure should be used.
3734fe56b9e6SYuval Mintz  */
3735fe56b9e6SYuval Mintz 
3736fe56b9e6SYuval Mintz struct mcp_mac {
3737fe56b9e6SYuval Mintz 	u32	mac_upper;  /* Upper 16 bits are always zeroes */
3738fe56b9e6SYuval Mintz 	u32	mac_lower;
3739fe56b9e6SYuval Mintz };
3740fe56b9e6SYuval Mintz 
3741fe56b9e6SYuval Mintz struct mcp_val64 {
3742fe56b9e6SYuval Mintz 	u32	lo;
3743fe56b9e6SYuval Mintz 	u32	hi;
3744fe56b9e6SYuval Mintz };
3745fe56b9e6SYuval Mintz 
3746fe56b9e6SYuval Mintz struct mcp_file_att {
3747fe56b9e6SYuval Mintz 	u32	nvm_start_addr;
3748fe56b9e6SYuval Mintz 	u32	len;
3749fe56b9e6SYuval Mintz };
3750fe56b9e6SYuval Mintz 
3751fe56b9e6SYuval Mintz #define MCP_DRV_VER_STR_SIZE 16
3752fe56b9e6SYuval Mintz #define MCP_DRV_VER_STR_SIZE_DWORD (MCP_DRV_VER_STR_SIZE / sizeof(u32))
3753fe56b9e6SYuval Mintz #define MCP_DRV_NVM_BUF_LEN 32
3754fe56b9e6SYuval Mintz struct drv_version_stc {
3755fe56b9e6SYuval Mintz 	u32	version;
3756fe56b9e6SYuval Mintz 	u8	name[MCP_DRV_VER_STR_SIZE - 4];
3757fe56b9e6SYuval Mintz };
3758fe56b9e6SYuval Mintz 
3759fe56b9e6SYuval Mintz union drv_union_data {
3760fe56b9e6SYuval Mintz 	u32			ver_str[MCP_DRV_VER_STR_SIZE_DWORD];
3761fe56b9e6SYuval Mintz 	struct mcp_mac		wol_mac;
3762fe56b9e6SYuval Mintz 
3763fe56b9e6SYuval Mintz 	struct pmm_phy_cfg	drv_phy_cfg;
3764fe56b9e6SYuval Mintz 
3765fe56b9e6SYuval Mintz 	struct mcp_val64	val64; /* For PHY / AVS commands */
3766fe56b9e6SYuval Mintz 
3767fe56b9e6SYuval Mintz 	u8			raw_data[MCP_DRV_NVM_BUF_LEN];
3768fe56b9e6SYuval Mintz 
3769fe56b9e6SYuval Mintz 	struct mcp_file_att	file_att;
3770fe56b9e6SYuval Mintz 
3771fe56b9e6SYuval Mintz 	u32			ack_vf_disabled[VF_MAX_STATIC / 32];
3772fe56b9e6SYuval Mintz 
3773fe56b9e6SYuval Mintz 	struct drv_version_stc	drv_version;
3774fe56b9e6SYuval Mintz };
3775fe56b9e6SYuval Mintz 
3776fe56b9e6SYuval Mintz struct public_drv_mb {
3777fe56b9e6SYuval Mintz 	u32 drv_mb_header;
3778fe56b9e6SYuval Mintz #define DRV_MSG_CODE_MASK                       0xffff0000
3779fe56b9e6SYuval Mintz #define DRV_MSG_CODE_LOAD_REQ                   0x10000000
3780fe56b9e6SYuval Mintz #define DRV_MSG_CODE_LOAD_DONE                  0x11000000
3781fc48b7a6SYuval Mintz #define DRV_MSG_CODE_INIT_HW                    0x12000000
3782fe56b9e6SYuval Mintz #define DRV_MSG_CODE_UNLOAD_REQ                 0x20000000
3783fe56b9e6SYuval Mintz #define DRV_MSG_CODE_UNLOAD_DONE                0x21000000
3784fe56b9e6SYuval Mintz #define DRV_MSG_CODE_INIT_PHY                   0x22000000
3785fe56b9e6SYuval Mintz 	/* Params - FORCE - Reinitialize the link regardless of LFA */
3786fe56b9e6SYuval Mintz 	/*        - DONT_CARE - Don't flap the link if up */
3787fe56b9e6SYuval Mintz #define DRV_MSG_CODE_LINK_RESET                 0x23000000
3788fe56b9e6SYuval Mintz 
3789fe56b9e6SYuval Mintz #define DRV_MSG_CODE_SET_LLDP                   0x24000000
3790fe56b9e6SYuval Mintz #define DRV_MSG_CODE_SET_DCBX                   0x25000000
3791fe56b9e6SYuval Mintz 
3792fe56b9e6SYuval Mintz #define DRV_MSG_CODE_NIG_DRAIN                  0x30000000
3793fe56b9e6SYuval Mintz 
3794fe56b9e6SYuval Mintz #define DRV_MSG_CODE_INITIATE_FLR               0x02000000
3795fe56b9e6SYuval Mintz #define DRV_MSG_CODE_VF_DISABLED_DONE           0xc0000000
3796fe56b9e6SYuval Mintz #define DRV_MSG_CODE_CFG_VF_MSIX                0xc0010000
3797fe56b9e6SYuval Mintz #define DRV_MSG_CODE_NVM_PUT_FILE_BEGIN         0x00010000
3798fe56b9e6SYuval Mintz #define DRV_MSG_CODE_NVM_PUT_FILE_DATA          0x00020000
3799fe56b9e6SYuval Mintz #define DRV_MSG_CODE_NVM_GET_FILE_ATT           0x00030000
3800fe56b9e6SYuval Mintz #define DRV_MSG_CODE_NVM_READ_NVRAM             0x00050000
3801fe56b9e6SYuval Mintz #define DRV_MSG_CODE_NVM_WRITE_NVRAM            0x00060000
3802fe56b9e6SYuval Mintz #define DRV_MSG_CODE_NVM_DEL_FILE               0x00080000
3803fe56b9e6SYuval Mintz #define DRV_MSG_CODE_MCP_RESET                  0x00090000
3804fe56b9e6SYuval Mintz #define DRV_MSG_CODE_SET_SECURE_MODE            0x000a0000
3805fe56b9e6SYuval Mintz #define DRV_MSG_CODE_PHY_RAW_READ               0x000b0000
3806fe56b9e6SYuval Mintz #define DRV_MSG_CODE_PHY_RAW_WRITE              0x000c0000
3807fe56b9e6SYuval Mintz #define DRV_MSG_CODE_PHY_CORE_READ              0x000d0000
3808fe56b9e6SYuval Mintz #define DRV_MSG_CODE_PHY_CORE_WRITE             0x000e0000
3809fe56b9e6SYuval Mintz #define DRV_MSG_CODE_SET_VERSION                0x000f0000
3810fe56b9e6SYuval Mintz 
381191420b83SSudarsana Kalluru #define DRV_MSG_CODE_SET_LED_MODE               0x00200000
381291420b83SSudarsana Kalluru 
3813fe56b9e6SYuval Mintz #define DRV_MSG_SEQ_NUMBER_MASK                 0x0000ffff
3814fe56b9e6SYuval Mintz 
3815fe56b9e6SYuval Mintz 	u32 drv_mb_param;
3816fe56b9e6SYuval Mintz 
3817fe56b9e6SYuval Mintz 	/* UNLOAD_REQ params */
3818fe56b9e6SYuval Mintz #define DRV_MB_PARAM_UNLOAD_WOL_UNKNOWN         0x00000000
3819fe56b9e6SYuval Mintz #define DRV_MB_PARAM_UNLOAD_WOL_MCP             0x00000001
3820fe56b9e6SYuval Mintz #define DRV_MB_PARAM_UNLOAD_WOL_DISABLED        0x00000002
3821fe56b9e6SYuval Mintz #define DRV_MB_PARAM_UNLOAD_WOL_ENABLED         0x00000003
3822fe56b9e6SYuval Mintz 
3823fe56b9e6SYuval Mintz 	/* UNLOAD_DONE_params */
3824fe56b9e6SYuval Mintz #define DRV_MB_PARAM_UNLOAD_NON_D3_POWER        0x00000001
3825fe56b9e6SYuval Mintz 
3826fe56b9e6SYuval Mintz 	/* INIT_PHY params */
3827fe56b9e6SYuval Mintz #define DRV_MB_PARAM_INIT_PHY_FORCE             0x00000001
3828fe56b9e6SYuval Mintz #define DRV_MB_PARAM_INIT_PHY_DONT_CARE         0x00000002
3829fe56b9e6SYuval Mintz 
3830fe56b9e6SYuval Mintz 	/* LLDP / DCBX params*/
3831fe56b9e6SYuval Mintz #define DRV_MB_PARAM_LLDP_SEND_MASK             0x00000001
3832fe56b9e6SYuval Mintz #define DRV_MB_PARAM_LLDP_SEND_SHIFT            0
3833fe56b9e6SYuval Mintz #define DRV_MB_PARAM_LLDP_AGENT_MASK            0x00000006
3834fe56b9e6SYuval Mintz #define DRV_MB_PARAM_LLDP_AGENT_SHIFT           1
3835fe56b9e6SYuval Mintz #define DRV_MB_PARAM_DCBX_NOTIFY_MASK           0x00000008
3836fe56b9e6SYuval Mintz #define DRV_MB_PARAM_DCBX_NOTIFY_SHIFT          3
3837fe56b9e6SYuval Mintz 
3838fe56b9e6SYuval Mintz #define DRV_MB_PARAM_NIG_DRAIN_PERIOD_MS_MASK   0x000000FF
3839fe56b9e6SYuval Mintz #define DRV_MB_PARAM_NIG_DRAIN_PERIOD_MS_SHIFT  0
3840fe56b9e6SYuval Mintz 
3841fe56b9e6SYuval Mintz #define DRV_MB_PARAM_NVM_PUT_FILE_BEGIN_MFW     0x1
3842fe56b9e6SYuval Mintz #define DRV_MB_PARAM_NVM_PUT_FILE_BEGIN_IMAGE   0x2
3843fe56b9e6SYuval Mintz 
3844fe56b9e6SYuval Mintz #define DRV_MB_PARAM_NVM_OFFSET_SHIFT           0
3845fe56b9e6SYuval Mintz #define DRV_MB_PARAM_NVM_OFFSET_MASK            0x00FFFFFF
3846fe56b9e6SYuval Mintz #define DRV_MB_PARAM_NVM_LEN_SHIFT              24
3847fe56b9e6SYuval Mintz #define DRV_MB_PARAM_NVM_LEN_MASK               0xFF000000
3848fe56b9e6SYuval Mintz 
3849fe56b9e6SYuval Mintz #define DRV_MB_PARAM_PHY_ADDR_SHIFT             0
3850fe56b9e6SYuval Mintz #define DRV_MB_PARAM_PHY_ADDR_MASK              0x1FF0FFFF
3851fe56b9e6SYuval Mintz #define DRV_MB_PARAM_PHY_LANE_SHIFT             16
3852fe56b9e6SYuval Mintz #define DRV_MB_PARAM_PHY_LANE_MASK              0x000F0000
3853fe56b9e6SYuval Mintz #define DRV_MB_PARAM_PHY_SELECT_PORT_SHIFT      29
3854fe56b9e6SYuval Mintz #define DRV_MB_PARAM_PHY_SELECT_PORT_MASK       0x20000000
3855fe56b9e6SYuval Mintz #define DRV_MB_PARAM_PHY_PORT_SHIFT             30
3856fe56b9e6SYuval Mintz #define DRV_MB_PARAM_PHY_PORT_MASK              0xc0000000
3857fe56b9e6SYuval Mintz 
3858fe56b9e6SYuval Mintz /* configure vf MSIX params*/
3859fe56b9e6SYuval Mintz #define DRV_MB_PARAM_CFG_VF_MSIX_VF_ID_SHIFT    0
3860fe56b9e6SYuval Mintz #define DRV_MB_PARAM_CFG_VF_MSIX_VF_ID_MASK     0x000000FF
3861fe56b9e6SYuval Mintz #define DRV_MB_PARAM_CFG_VF_MSIX_SB_NUM_SHIFT   8
3862fe56b9e6SYuval Mintz #define DRV_MB_PARAM_CFG_VF_MSIX_SB_NUM_MASK    0x0000FF00
3863fe56b9e6SYuval Mintz 
386491420b83SSudarsana Kalluru #define DRV_MB_PARAM_SET_LED_MODE_OPER          0x0
386591420b83SSudarsana Kalluru #define DRV_MB_PARAM_SET_LED_MODE_ON            0x1
386691420b83SSudarsana Kalluru #define DRV_MB_PARAM_SET_LED_MODE_OFF           0x2
386791420b83SSudarsana Kalluru 
3868fe56b9e6SYuval Mintz 	u32 fw_mb_header;
3869fe56b9e6SYuval Mintz #define FW_MSG_CODE_MASK                        0xffff0000
3870fe56b9e6SYuval Mintz #define FW_MSG_CODE_DRV_LOAD_ENGINE             0x10100000
3871fe56b9e6SYuval Mintz #define FW_MSG_CODE_DRV_LOAD_PORT               0x10110000
3872fe56b9e6SYuval Mintz #define FW_MSG_CODE_DRV_LOAD_FUNCTION           0x10120000
3873fe56b9e6SYuval Mintz #define FW_MSG_CODE_DRV_LOAD_REFUSED_PDA        0x10200000
3874fe56b9e6SYuval Mintz #define FW_MSG_CODE_DRV_LOAD_REFUSED_HSI        0x10210000
3875fe56b9e6SYuval Mintz #define FW_MSG_CODE_DRV_LOAD_REFUSED_DIAG       0x10220000
3876fe56b9e6SYuval Mintz #define FW_MSG_CODE_DRV_LOAD_DONE               0x11100000
3877fe56b9e6SYuval Mintz #define FW_MSG_CODE_DRV_UNLOAD_ENGINE           0x20110000
3878fe56b9e6SYuval Mintz #define FW_MSG_CODE_DRV_UNLOAD_PORT             0x20120000
3879fe56b9e6SYuval Mintz #define FW_MSG_CODE_DRV_UNLOAD_FUNCTION         0x20130000
3880fe56b9e6SYuval Mintz #define FW_MSG_CODE_DRV_UNLOAD_DONE             0x21100000
3881fe56b9e6SYuval Mintz #define FW_MSG_CODE_INIT_PHY_DONE               0x21200000
3882fe56b9e6SYuval Mintz #define FW_MSG_CODE_INIT_PHY_ERR_INVALID_ARGS   0x21300000
3883fe56b9e6SYuval Mintz #define FW_MSG_CODE_LINK_RESET_DONE             0x23000000
3884fe56b9e6SYuval Mintz #define FW_MSG_CODE_SET_LLDP_DONE               0x24000000
3885fe56b9e6SYuval Mintz #define FW_MSG_CODE_SET_LLDP_UNSUPPORTED_AGENT  0x24010000
3886fe56b9e6SYuval Mintz #define FW_MSG_CODE_SET_DCBX_DONE               0x25000000
3887fe56b9e6SYuval Mintz #define FW_MSG_CODE_NIG_DRAIN_DONE              0x30000000
3888fe56b9e6SYuval Mintz #define FW_MSG_CODE_VF_DISABLED_DONE            0xb0000000
3889fe56b9e6SYuval Mintz #define FW_MSG_CODE_DRV_CFG_VF_MSIX_DONE        0xb0010000
3890fe56b9e6SYuval Mintz #define FW_MSG_CODE_FLR_ACK                     0x02000000
3891fe56b9e6SYuval Mintz #define FW_MSG_CODE_FLR_NACK                    0x02100000
3892fe56b9e6SYuval Mintz 
3893fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_OK                      0x00010000
3894fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_INVALID_MODE            0x00020000
3895fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_PREV_CMD_WAS_NOT_FINISHED       0x00030000
3896fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_FAILED_TO_ALLOCATE_PAGE 0x00040000
3897fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_INVALID_DIR_FOUND       0x00050000
3898fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_PAGE_NOT_FOUND          0x00060000
3899fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_FAILED_PARSING_BNDLE_HEADER 0x00070000
3900fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_FAILED_PARSING_IMAGE_HEADER 0x00080000
3901fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_PARSING_OUT_OF_SYNC     0x00090000
3902fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_FAILED_UPDATING_DIR     0x000a0000
3903fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_FAILED_TO_FREE_PAGE     0x000b0000
3904fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_FILE_NOT_FOUND          0x000c0000
3905fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_OPERATION_FAILED        0x000d0000
3906fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_FAILED_UNALIGNED        0x000e0000
3907fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_BAD_OFFSET              0x000f0000
3908fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_BAD_SIGNATURE           0x00100000
3909fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_FILE_READ_ONLY          0x00200000
3910fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_UNKNOWN_FILE            0x00300000
3911fe56b9e6SYuval Mintz #define FW_MSG_CODE_NVM_PUT_FILE_FINISH_OK      0x00400000
3912fe56b9e6SYuval Mintz #define FW_MSG_CODE_MCP_RESET_REJECT            0x00600000
3913fe56b9e6SYuval Mintz #define FW_MSG_CODE_PHY_OK                      0x00110000
3914fe56b9e6SYuval Mintz #define FW_MSG_CODE_PHY_ERROR                   0x00120000
3915fe56b9e6SYuval Mintz #define FW_MSG_CODE_SET_SECURE_MODE_ERROR       0x00130000
3916fe56b9e6SYuval Mintz #define FW_MSG_CODE_SET_SECURE_MODE_OK          0x00140000
3917fe56b9e6SYuval Mintz #define FW_MSG_MODE_PHY_PRIVILEGE_ERROR         0x00150000
3918fc48b7a6SYuval Mintz #define FW_MSG_CODE_OK                          0x00160000
3919fe56b9e6SYuval Mintz 
3920fe56b9e6SYuval Mintz #define FW_MSG_SEQ_NUMBER_MASK                  0x0000ffff
3921fe56b9e6SYuval Mintz 
3922fe56b9e6SYuval Mintz 	u32	fw_mb_param;
3923fe56b9e6SYuval Mintz 
3924fe56b9e6SYuval Mintz 	u32	drv_pulse_mb;
3925fe56b9e6SYuval Mintz #define DRV_PULSE_SEQ_MASK                      0x00007fff
3926fe56b9e6SYuval Mintz #define DRV_PULSE_SYSTEM_TIME_MASK              0xffff0000
3927fe56b9e6SYuval Mintz #define DRV_PULSE_ALWAYS_ALIVE                  0x00008000
3928fe56b9e6SYuval Mintz 	u32 mcp_pulse_mb;
3929fe56b9e6SYuval Mintz #define MCP_PULSE_SEQ_MASK                      0x00007fff
3930fe56b9e6SYuval Mintz #define MCP_PULSE_ALWAYS_ALIVE                  0x00008000
3931fe56b9e6SYuval Mintz #define MCP_EVENT_MASK                          0xffff0000
3932fe56b9e6SYuval Mintz #define MCP_EVENT_OTHER_DRIVER_RESET_REQ        0x00010000
3933fe56b9e6SYuval Mintz 
3934fe56b9e6SYuval Mintz 	union drv_union_data union_data;
3935fe56b9e6SYuval Mintz };
3936fe56b9e6SYuval Mintz 
3937fe56b9e6SYuval Mintz /* MFW - DRV MB */
3938fe56b9e6SYuval Mintz /**********************************************************************
3939fe56b9e6SYuval Mintz * Description
3940fe56b9e6SYuval Mintz *   Incremental Aggregative
3941fe56b9e6SYuval Mintz *   8-bit MFW counter per message
3942fe56b9e6SYuval Mintz *   8-bit ack-counter per message
3943fe56b9e6SYuval Mintz * Capabilities
3944fe56b9e6SYuval Mintz *   Provides up to 256 aggregative message per type
3945fe56b9e6SYuval Mintz *   Provides 4 message types in dword
3946fe56b9e6SYuval Mintz *   Message type pointers to byte offset
3947fe56b9e6SYuval Mintz *   Backward Compatibility by using sizeof for the counters.
3948fe56b9e6SYuval Mintz *   No lock requires for 32bit messages
3949fe56b9e6SYuval Mintz * Limitations:
3950fe56b9e6SYuval Mintz * In case of messages greater than 32bit, a dedicated mechanism(e.g lock)
3951fe56b9e6SYuval Mintz * is required to prevent data corruption.
3952fe56b9e6SYuval Mintz **********************************************************************/
3953fe56b9e6SYuval Mintz enum MFW_DRV_MSG_TYPE {
3954fe56b9e6SYuval Mintz 	MFW_DRV_MSG_LINK_CHANGE,
3955fe56b9e6SYuval Mintz 	MFW_DRV_MSG_FLR_FW_ACK_FAILED,
3956fe56b9e6SYuval Mintz 	MFW_DRV_MSG_VF_DISABLED,
3957fe56b9e6SYuval Mintz 	MFW_DRV_MSG_LLDP_DATA_UPDATED,
3958fe56b9e6SYuval Mintz 	MFW_DRV_MSG_DCBX_REMOTE_MIB_UPDATED,
3959fe56b9e6SYuval Mintz 	MFW_DRV_MSG_DCBX_OPERATIONAL_MIB_UPDATED,
3960fe56b9e6SYuval Mintz 	MFW_DRV_MSG_ERROR_RECOVERY,
3961334c03b5SZvi Nachmani 	MFW_DRV_MSG_BW_UPDATE,
3962334c03b5SZvi Nachmani 	MFW_DRV_MSG_S_TAG_UPDATE,
3963334c03b5SZvi Nachmani 	MFW_DRV_MSG_GET_LAN_STATS,
3964334c03b5SZvi Nachmani 	MFW_DRV_MSG_GET_FCOE_STATS,
3965334c03b5SZvi Nachmani 	MFW_DRV_MSG_GET_ISCSI_STATS,
3966334c03b5SZvi Nachmani 	MFW_DRV_MSG_GET_RDMA_STATS,
3967334c03b5SZvi Nachmani 	MFW_DRV_MSG_FAILURE_DETECTED,
3968334c03b5SZvi Nachmani 	MFW_DRV_MSG_TRANSCEIVER_STATE_CHANGE,
3969fe56b9e6SYuval Mintz 	MFW_DRV_MSG_MAX
3970fe56b9e6SYuval Mintz };
3971fe56b9e6SYuval Mintz 
3972fe56b9e6SYuval Mintz #define MFW_DRV_MSG_MAX_DWORDS(msgs)    (((msgs - 1) >> 2) + 1)
3973fe56b9e6SYuval Mintz #define MFW_DRV_MSG_DWORD(msg_id)       (msg_id >> 2)
3974fe56b9e6SYuval Mintz #define MFW_DRV_MSG_OFFSET(msg_id)      ((msg_id & 0x3) << 3)
3975fe56b9e6SYuval Mintz #define MFW_DRV_MSG_MASK(msg_id)        (0xff << MFW_DRV_MSG_OFFSET(msg_id))
3976fe56b9e6SYuval Mintz 
3977fe56b9e6SYuval Mintz struct public_mfw_mb {
3978fe56b9e6SYuval Mintz 	u32	sup_msgs;
3979fe56b9e6SYuval Mintz 	u32	msg[MFW_DRV_MSG_MAX_DWORDS(MFW_DRV_MSG_MAX)];
3980fe56b9e6SYuval Mintz 	u32	ack[MFW_DRV_MSG_MAX_DWORDS(MFW_DRV_MSG_MAX)];
3981fe56b9e6SYuval Mintz };
3982fe56b9e6SYuval Mintz 
3983fe56b9e6SYuval Mintz /**************************************/
3984fe56b9e6SYuval Mintz /*                                    */
3985fe56b9e6SYuval Mintz /*     P U B L I C       D A T A      */
3986fe56b9e6SYuval Mintz /*                                    */
3987fe56b9e6SYuval Mintz /**************************************/
3988fe56b9e6SYuval Mintz enum public_sections {
3989fe56b9e6SYuval Mintz 	PUBLIC_DRV_MB,          /* Points to the first drv_mb of path0 */
3990fe56b9e6SYuval Mintz 	PUBLIC_MFW_MB,          /* Points to the first mfw_mb of path0 */
3991fe56b9e6SYuval Mintz 	PUBLIC_GLOBAL,
3992fe56b9e6SYuval Mintz 	PUBLIC_PATH,
3993fe56b9e6SYuval Mintz 	PUBLIC_PORT,
3994fe56b9e6SYuval Mintz 	PUBLIC_FUNC,
3995fe56b9e6SYuval Mintz 	PUBLIC_MAX_SECTIONS
3996fe56b9e6SYuval Mintz };
3997fe56b9e6SYuval Mintz 
3998fe56b9e6SYuval Mintz struct drv_ver_info_stc {
3999fe56b9e6SYuval Mintz 	u32	ver;
4000fe56b9e6SYuval Mintz 	u8	name[32];
4001fe56b9e6SYuval Mintz };
4002fe56b9e6SYuval Mintz 
4003fe56b9e6SYuval Mintz struct mcp_public_data {
4004fe56b9e6SYuval Mintz 	/* The sections fields is an array */
4005fe56b9e6SYuval Mintz 	u32			num_sections;
4006fe56b9e6SYuval Mintz 	offsize_t		sections[PUBLIC_MAX_SECTIONS];
4007fe56b9e6SYuval Mintz 	struct public_drv_mb	drv_mb[MCP_GLOB_FUNC_MAX];
4008fe56b9e6SYuval Mintz 	struct public_mfw_mb	mfw_mb[MCP_GLOB_FUNC_MAX];
4009fe56b9e6SYuval Mintz 	struct public_global	global;
4010fe56b9e6SYuval Mintz 	struct public_path	path[MCP_GLOB_PATH_MAX];
4011fe56b9e6SYuval Mintz 	struct public_port	port[MCP_GLOB_PORT_MAX];
4012fe56b9e6SYuval Mintz 	struct public_func	func[MCP_GLOB_FUNC_MAX];
4013fe56b9e6SYuval Mintz 	struct drv_ver_info_stc drv_info;
4014fe56b9e6SYuval Mintz };
4015fe56b9e6SYuval Mintz 
4016fe56b9e6SYuval Mintz struct nvm_cfg_mac_address {
4017fe56b9e6SYuval Mintz 	u32	mac_addr_hi;
4018fe56b9e6SYuval Mintz #define NVM_CFG_MAC_ADDRESS_HI_MASK                             0x0000FFFF
4019fe56b9e6SYuval Mintz #define NVM_CFG_MAC_ADDRESS_HI_OFFSET                           0
4020fe56b9e6SYuval Mintz 
4021fe56b9e6SYuval Mintz 	u32	mac_addr_lo;
4022fe56b9e6SYuval Mintz };
4023fe56b9e6SYuval Mintz 
4024fe56b9e6SYuval Mintz /******************************************
4025fe56b9e6SYuval Mintz * nvm_cfg1 structs
4026fe56b9e6SYuval Mintz ******************************************/
4027fe56b9e6SYuval Mintz 
4028fe56b9e6SYuval Mintz struct nvm_cfg1_glob {
4029fe56b9e6SYuval Mintz 	u32 generic_cont0;					/* 0x0 */
4030fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BOARD_SWAP_MASK                           0x0000000F
4031fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BOARD_SWAP_OFFSET                         0
4032fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BOARD_SWAP_NONE                           0x0
4033fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BOARD_SWAP_PATH                           0x1
4034fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BOARD_SWAP_PORT                           0x2
4035fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BOARD_SWAP_BOTH                           0x3
4036fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MF_MODE_MASK                              0x00000FF0
4037fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MF_MODE_OFFSET                            4
4038fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MF_MODE_MF_ALLOWED                        0x0
4039fc48b7a6SYuval Mintz #define NVM_CFG1_GLOB_MF_MODE_DEFAULT                           0x1
4040fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MF_MODE_SPIO4                             0x2
4041fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MF_MODE_NPAR1_0                           0x3
4042fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MF_MODE_NPAR1_5                           0x4
4043fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MF_MODE_NPAR2_0                           0x5
4044fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MF_MODE_BD                                0x6
4045fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MF_MODE_UFP                               0x7
4046fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_FAN_FAILURE_ENFORCEMENT_MASK              0x00001000
4047fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_FAN_FAILURE_ENFORCEMENT_OFFSET            12
4048fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_FAN_FAILURE_ENFORCEMENT_DISABLED          0x0
4049fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_FAN_FAILURE_ENFORCEMENT_ENABLED           0x1
4050fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_AVS_MARGIN_LOW_MASK                       0x001FE000
4051fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_AVS_MARGIN_LOW_OFFSET                     13
4052fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_AVS_MARGIN_HIGH_MASK                      0x1FE00000
4053fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_AVS_MARGIN_HIGH_OFFSET                    21
4054fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ENABLE_SRIOV_MASK                         0x20000000
4055fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ENABLE_SRIOV_OFFSET                       29
4056fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ENABLE_SRIOV_DISABLED                     0x0
4057fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ENABLE_SRIOV_ENABLED                      0x1
4058fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ENABLE_ATC_MASK                           0x40000000
4059fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ENABLE_ATC_OFFSET                         30
4060fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ENABLE_ATC_DISABLED                       0x0
4061fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ENABLE_ATC_ENABLED                        0x1
4062fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_CLOCK_SLOWDOWN_MASK                       0x80000000
4063fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_CLOCK_SLOWDOWN_OFFSET                     31
4064fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_CLOCK_SLOWDOWN_DISABLED                   0x0
4065fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_CLOCK_SLOWDOWN_ENABLED                    0x1
4066fe56b9e6SYuval Mintz 
4067fe56b9e6SYuval Mintz 	u32	engineering_change[3];				/* 0x4 */
4068fe56b9e6SYuval Mintz 
4069fe56b9e6SYuval Mintz 	u32	manufacturing_id;				/* 0x10 */
4070fe56b9e6SYuval Mintz 
4071fe56b9e6SYuval Mintz 	u32	serial_number[4];				/* 0x14 */
4072fe56b9e6SYuval Mintz 
4073fe56b9e6SYuval Mintz 	u32	pcie_cfg;					/* 0x24 */
4074fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCI_GEN_MASK                              0x00000003
4075fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCI_GEN_OFFSET                            0
4076fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCI_GEN_PCI_GEN1                          0x0
4077fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCI_GEN_PCI_GEN2                          0x1
4078fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCI_GEN_PCI_GEN3                          0x2
4079fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BEACON_WOL_ENABLED_MASK                   0x00000004
4080fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BEACON_WOL_ENABLED_OFFSET                 2
4081fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BEACON_WOL_ENABLED_DISABLED               0x0
4082fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BEACON_WOL_ENABLED_ENABLED                0x1
4083fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ASPM_SUPPORT_MASK                         0x00000018
4084fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ASPM_SUPPORT_OFFSET                       3
4085fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ASPM_SUPPORT_L0S_L1_ENABLED               0x0
4086fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ASPM_SUPPORT_L0S_DISABLED                 0x1
4087fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ASPM_SUPPORT_L1_DISABLED                  0x2
4088fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_ASPM_SUPPORT_L0S_L1_DISABLED              0x3
4089fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PREVENT_PCIE_L1_MENTRY_MASK               0x00000020
4090fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PREVENT_PCIE_L1_MENTRY_OFFSET             5
4091fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PREVENT_PCIE_L1_MENTRY_DISABLED           0x0
4092fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PREVENT_PCIE_L1_MENTRY_ENABLED            0x1
4093fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCIE_G2_TX_AMPLITUDE_MASK                 0x000003C0
4094fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCIE_G2_TX_AMPLITUDE_OFFSET               6
4095fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCIE_PREEMPHASIS_MASK                     0x00001C00
4096fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCIE_PREEMPHASIS_OFFSET                   10
4097fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCIE_PREEMPHASIS_HW                       0x0
4098fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCIE_PREEMPHASIS_0DB                      0x1
4099fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCIE_PREEMPHASIS_3_5DB                    0x2
4100fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_PCIE_PREEMPHASIS_6_0DB                    0x3
4101fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_WWN_NODE_PREFIX0_MASK                     0x001FE000
4102fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_WWN_NODE_PREFIX0_OFFSET                   13
4103fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_WWN_NODE_PREFIX1_MASK                     0x1FE00000
4104fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_WWN_NODE_PREFIX1_OFFSET                   21
4105fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NCSI_PACKAGE_ID_MASK                      0x60000000
4106fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NCSI_PACKAGE_ID_OFFSET                    29
4107fe56b9e6SYuval Mintz 
4108fe56b9e6SYuval Mintz 	u32 mgmt_traffic;                                       /* 0x28 */
4109fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RESERVED60_MASK                           0x00000001
4110fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RESERVED60_OFFSET                         0
4111fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RESERVED60_100KHZ                         0x0
4112fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RESERVED60_400KHZ                         0x1
4113fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_WWN_PORT_PREFIX0_MASK                     0x000001FE
4114fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_WWN_PORT_PREFIX0_OFFSET                   1
4115fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_WWN_PORT_PREFIX1_MASK                     0x0001FE00
4116fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_WWN_PORT_PREFIX1_OFFSET                   9
4117fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SMBUS_ADDRESS_MASK                        0x01FE0000
4118fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SMBUS_ADDRESS_OFFSET                      17
4119fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SIDEBAND_MODE_MASK                        0x06000000
4120fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SIDEBAND_MODE_OFFSET                      25
4121fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SIDEBAND_MODE_DISABLED                    0x0
4122fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SIDEBAND_MODE_RMII                        0x1
4123fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SIDEBAND_MODE_SGMII                       0x2
4124fe56b9e6SYuval Mintz 
4125fe56b9e6SYuval Mintz 	u32 core_cfg;                                           /* 0x2C */
4126fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_MASK                    0x000000FF
4127fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_OFFSET                  0
4128fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_DE_2X40G                0x0
4129fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_DE_2X50G                0x1
4130fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_DE_1X100G               0x2
4131fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_DE_4X10G_F              0x3
4132fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_DE_4X10G_E              0x4
4133fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_DE_4X20G                0x5
4134fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_DE_1X40G                0xB
4135fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_DE_2X25G                0xC
4136fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NETWORK_PORT_MODE_DE_1X25G                0xD
4137fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EAGLE_ENFORCE_TX_FIR_CFG_MASK             0x00000100
4138fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EAGLE_ENFORCE_TX_FIR_CFG_OFFSET           8
4139fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EAGLE_ENFORCE_TX_FIR_CFG_DISABLED         0x0
4140fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EAGLE_ENFORCE_TX_FIR_CFG_ENABLED          0x1
4141fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_FALCON_ENFORCE_TX_FIR_CFG_MASK            0x00000200
4142fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_FALCON_ENFORCE_TX_FIR_CFG_OFFSET          9
4143fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_FALCON_ENFORCE_TX_FIR_CFG_DISABLED        0x0
4144fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_FALCON_ENFORCE_TX_FIR_CFG_ENABLED         0x1
4145fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EAGLE_CORE_ADDR_MASK                      0x0003FC00
4146fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EAGLE_CORE_ADDR_OFFSET                    10
4147fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_FALCON_CORE_ADDR_MASK                     0x03FC0000
4148fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_FALCON_CORE_ADDR_OFFSET                   18
4149fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_AVS_MODE_MASK                             0x1C000000
4150fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_AVS_MODE_OFFSET                           26
4151fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_AVS_MODE_CLOSE_LOOP                       0x0
4152fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_AVS_MODE_OPEN_LOOP                        0x1
4153fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_AVS_MODE_DISABLED                         0x3
4154fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_OVERRIDE_SECURE_MODE_MASK                 0x60000000
4155fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_OVERRIDE_SECURE_MODE_OFFSET               29
4156fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_OVERRIDE_SECURE_MODE_DISABLED             0x0
4157fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_OVERRIDE_SECURE_MODE_ENABLED              0x1
4158fe56b9e6SYuval Mintz 
4159fe56b9e6SYuval Mintz 	u32 e_lane_cfg1;					/* 0x30 */
4160fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE0_SWAP_MASK                        0x0000000F
4161fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE0_SWAP_OFFSET                      0
4162fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE1_SWAP_MASK                        0x000000F0
4163fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE1_SWAP_OFFSET                      4
4164fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE2_SWAP_MASK                        0x00000F00
4165fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE2_SWAP_OFFSET                      8
4166fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE3_SWAP_MASK                        0x0000F000
4167fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE3_SWAP_OFFSET                      12
4168fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE0_SWAP_MASK                        0x000F0000
4169fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE0_SWAP_OFFSET                      16
4170fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE1_SWAP_MASK                        0x00F00000
4171fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE1_SWAP_OFFSET                      20
4172fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE2_SWAP_MASK                        0x0F000000
4173fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE2_SWAP_OFFSET                      24
4174fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE3_SWAP_MASK                        0xF0000000
4175fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE3_SWAP_OFFSET                      28
4176fe56b9e6SYuval Mintz 
4177fe56b9e6SYuval Mintz 	u32 e_lane_cfg2;					/* 0x34 */
4178fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE0_POL_FLIP_MASK                    0x00000001
4179fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE0_POL_FLIP_OFFSET                  0
4180fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE1_POL_FLIP_MASK                    0x00000002
4181fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE1_POL_FLIP_OFFSET                  1
4182fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE2_POL_FLIP_MASK                    0x00000004
4183fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE2_POL_FLIP_OFFSET                  2
4184fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE3_POL_FLIP_MASK                    0x00000008
4185fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE3_POL_FLIP_OFFSET                  3
4186fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE0_POL_FLIP_MASK                    0x00000010
4187fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE0_POL_FLIP_OFFSET                  4
4188fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE1_POL_FLIP_MASK                    0x00000020
4189fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE1_POL_FLIP_OFFSET                  5
4190fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE2_POL_FLIP_MASK                    0x00000040
4191fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE2_POL_FLIP_OFFSET                  6
4192fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE3_POL_FLIP_MASK                    0x00000080
4193fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE3_POL_FLIP_OFFSET                  7
4194fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SMBUS_MODE_MASK                           0x00000F00
4195fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SMBUS_MODE_OFFSET                         8
4196fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SMBUS_MODE_DISABLED                       0x0
4197fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SMBUS_MODE_100KHZ                         0x1
4198fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SMBUS_MODE_400KHZ                         0x2
4199fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NCSI_MASK                                 0x0000F000
4200fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NCSI_OFFSET                               12
4201fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NCSI_DISABLED                             0x0
4202fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_NCSI_ENABLED                              0x1
4203fe56b9e6SYuval Mintz 
4204fe56b9e6SYuval Mintz 	u32 f_lane_cfg1;					/* 0x38 */
4205fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE0_SWAP_MASK                        0x0000000F
4206fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE0_SWAP_OFFSET                      0
4207fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE1_SWAP_MASK                        0x000000F0
4208fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE1_SWAP_OFFSET                      4
4209fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE2_SWAP_MASK                        0x00000F00
4210fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE2_SWAP_OFFSET                      8
4211fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE3_SWAP_MASK                        0x0000F000
4212fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE3_SWAP_OFFSET                      12
4213fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE0_SWAP_MASK                        0x000F0000
4214fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE0_SWAP_OFFSET                      16
4215fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE1_SWAP_MASK                        0x00F00000
4216fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE1_SWAP_OFFSET                      20
4217fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE2_SWAP_MASK                        0x0F000000
4218fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE2_SWAP_OFFSET                      24
4219fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE3_SWAP_MASK                        0xF0000000
4220fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE3_SWAP_OFFSET                      28
4221fe56b9e6SYuval Mintz 
4222fe56b9e6SYuval Mintz 	u32 f_lane_cfg2;					/* 0x3C */
4223fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE0_POL_FLIP_MASK                    0x00000001
4224fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE0_POL_FLIP_OFFSET                  0
4225fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE1_POL_FLIP_MASK                    0x00000002
4226fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE1_POL_FLIP_OFFSET                  1
4227fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE2_POL_FLIP_MASK                    0x00000004
4228fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE2_POL_FLIP_OFFSET                  2
4229fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE3_POL_FLIP_MASK                    0x00000008
4230fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_RX_LANE3_POL_FLIP_OFFSET                  3
4231fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE0_POL_FLIP_MASK                    0x00000010
4232fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE0_POL_FLIP_OFFSET                  4
4233fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE1_POL_FLIP_MASK                    0x00000020
4234fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE1_POL_FLIP_OFFSET                  5
4235fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE2_POL_FLIP_MASK                    0x00000040
4236fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE2_POL_FLIP_OFFSET                  6
4237fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE3_POL_FLIP_MASK                    0x00000080
4238fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_TX_LANE3_POL_FLIP_OFFSET                  7
4239fe56b9e6SYuval Mintz 
4240fe56b9e6SYuval Mintz 	u32 eagle_preemphasis;					/* 0x40 */
4241fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_PREEMP_MASK                         0x000000FF
4242fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_PREEMP_OFFSET                       0
4243fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_PREEMP_MASK                         0x0000FF00
4244fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_PREEMP_OFFSET                       8
4245fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_PREEMP_MASK                         0x00FF0000
4246fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_PREEMP_OFFSET                       16
4247fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_PREEMP_MASK                         0xFF000000
4248fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_PREEMP_OFFSET                       24
4249fe56b9e6SYuval Mintz 
4250fe56b9e6SYuval Mintz 	u32 eagle_driver_current;				/* 0x44 */
4251fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_AMP_MASK                            0x000000FF
4252fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_AMP_OFFSET                          0
4253fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_AMP_MASK                            0x0000FF00
4254fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_AMP_OFFSET                          8
4255fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_AMP_MASK                            0x00FF0000
4256fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_AMP_OFFSET                          16
4257fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_AMP_MASK                            0xFF000000
4258fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_AMP_OFFSET                          24
4259fe56b9e6SYuval Mintz 
4260fe56b9e6SYuval Mintz 	u32 falcon_preemphasis;					/* 0x48 */
4261fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_PREEMP_MASK                         0x000000FF
4262fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_PREEMP_OFFSET                       0
4263fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_PREEMP_MASK                         0x0000FF00
4264fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_PREEMP_OFFSET                       8
4265fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_PREEMP_MASK                         0x00FF0000
4266fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_PREEMP_OFFSET                       16
4267fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_PREEMP_MASK                         0xFF000000
4268fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_PREEMP_OFFSET                       24
4269fe56b9e6SYuval Mintz 
4270fe56b9e6SYuval Mintz 	u32 falcon_driver_current;				/* 0x4C */
4271fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_AMP_MASK                            0x000000FF
4272fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_AMP_OFFSET                          0
4273fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_AMP_MASK                            0x0000FF00
4274fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_AMP_OFFSET                          8
4275fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_AMP_MASK                            0x00FF0000
4276fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_AMP_OFFSET                          16
4277fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_AMP_MASK                            0xFF000000
4278fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_AMP_OFFSET                          24
4279fe56b9e6SYuval Mintz 
4280fe56b9e6SYuval Mintz 	u32	pci_id;						/* 0x50 */
4281fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VENDOR_ID_MASK                            0x0000FFFF
4282fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VENDOR_ID_OFFSET                          0
4283fe56b9e6SYuval Mintz 
4284fe56b9e6SYuval Mintz 	u32	pci_subsys_id;					/* 0x54 */
4285fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SUBSYSTEM_VENDOR_ID_MASK                  0x0000FFFF
4286fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SUBSYSTEM_VENDOR_ID_OFFSET                0
4287fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SUBSYSTEM_DEVICE_ID_MASK                  0xFFFF0000
4288fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_SUBSYSTEM_DEVICE_ID_OFFSET                16
4289fe56b9e6SYuval Mintz 
4290fe56b9e6SYuval Mintz 	u32	bar;						/* 0x58 */
4291fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_MASK                   0x0000000F
4292fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_OFFSET                 0
4293fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_DISABLED               0x0
4294fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_2K                     0x1
4295fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_4K                     0x2
4296fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_8K                     0x3
4297fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_16K                    0x4
4298fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_32K                    0x5
4299fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_64K                    0x6
4300fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_128K                   0x7
4301fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_256K                   0x8
4302fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_512K                   0x9
4303fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_1M                     0xA
4304fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_2M                     0xB
4305fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_4M                     0xC
4306fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_8M                     0xD
4307fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_16M                    0xE
4308fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_EXPANSION_ROM_SIZE_32M                    0xF
4309fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_MASK                     0x000000F0
4310fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_OFFSET                   4
4311fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_DISABLED                 0x0
4312fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_4K                       0x1
4313fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_8K                       0x2
4314fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_16K                      0x3
4315fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_32K                      0x4
4316fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_64K                      0x5
4317fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_128K                     0x6
4318fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_256K                     0x7
4319fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_512K                     0x8
4320fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_1M                       0x9
4321fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_2M                       0xA
4322fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_4M                       0xB
4323fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_8M                       0xC
4324fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_16M                      0xD
4325fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_32M                      0xE
4326fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_VF_PCI_BAR2_SIZE_64M                      0xF
4327fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_MASK                            0x00000F00
4328fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_OFFSET                          8
4329fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_DISABLED                        0x0
4330fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_64K                             0x1
4331fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_128K                            0x2
4332fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_256K                            0x3
4333fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_512K                            0x4
4334fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_1M                              0x5
4335fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_2M                              0x6
4336fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_4M                              0x7
4337fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_8M                              0x8
4338fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_16M                             0x9
4339fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_32M                             0xA
4340fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_64M                             0xB
4341fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_128M                            0xC
4342fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_256M                            0xD
4343fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_512M                            0xE
4344fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_BAR2_SIZE_1G                              0xF
4345fe56b9e6SYuval Mintz 
4346fe56b9e6SYuval Mintz 	u32 eagle_txfir_main;					/* 0x5C */
4347fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_TXFIR_MAIN_MASK                     0x000000FF
4348fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_TXFIR_MAIN_OFFSET                   0
4349fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_TXFIR_MAIN_MASK                     0x0000FF00
4350fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_TXFIR_MAIN_OFFSET                   8
4351fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_TXFIR_MAIN_MASK                     0x00FF0000
4352fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_TXFIR_MAIN_OFFSET                   16
4353fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_TXFIR_MAIN_MASK                     0xFF000000
4354fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_TXFIR_MAIN_OFFSET                   24
4355fe56b9e6SYuval Mintz 
4356fe56b9e6SYuval Mintz 	u32 eagle_txfir_post;					/* 0x60 */
4357fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_TXFIR_POST_MASK                     0x000000FF
4358fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_TXFIR_POST_OFFSET                   0
4359fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_TXFIR_POST_MASK                     0x0000FF00
4360fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_TXFIR_POST_OFFSET                   8
4361fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_TXFIR_POST_MASK                     0x00FF0000
4362fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_TXFIR_POST_OFFSET                   16
4363fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_TXFIR_POST_MASK                     0xFF000000
4364fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_TXFIR_POST_OFFSET                   24
4365fe56b9e6SYuval Mintz 
4366fe56b9e6SYuval Mintz 	u32 falcon_txfir_main;					/* 0x64 */
4367fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_TXFIR_MAIN_MASK                     0x000000FF
4368fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_TXFIR_MAIN_OFFSET                   0
4369fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_TXFIR_MAIN_MASK                     0x0000FF00
4370fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_TXFIR_MAIN_OFFSET                   8
4371fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_TXFIR_MAIN_MASK                     0x00FF0000
4372fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_TXFIR_MAIN_OFFSET                   16
4373fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_TXFIR_MAIN_MASK                     0xFF000000
4374fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_TXFIR_MAIN_OFFSET                   24
4375fe56b9e6SYuval Mintz 
4376fe56b9e6SYuval Mintz 	u32 falcon_txfir_post;					/* 0x68 */
4377fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_TXFIR_POST_MASK                     0x000000FF
4378fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE0_TXFIR_POST_OFFSET                   0
4379fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_TXFIR_POST_MASK                     0x0000FF00
4380fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE1_TXFIR_POST_OFFSET                   8
4381fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_TXFIR_POST_MASK                     0x00FF0000
4382fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE2_TXFIR_POST_OFFSET                   16
4383fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_TXFIR_POST_MASK                     0xFF000000
4384fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LANE3_TXFIR_POST_OFFSET                   24
4385fe56b9e6SYuval Mintz 
4386fe56b9e6SYuval Mintz 	u32 manufacture_ver;					/* 0x6C */
4387fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF0_VER_MASK                           0x0000003F
4388fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF0_VER_OFFSET                         0
4389fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF1_VER_MASK                           0x00000FC0
4390fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF1_VER_OFFSET                         6
4391fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF2_VER_MASK                           0x0003F000
4392fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF2_VER_OFFSET                         12
4393fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF3_VER_MASK                           0x00FC0000
4394fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF3_VER_OFFSET                         18
4395fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF4_VER_MASK                           0x3F000000
4396fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF4_VER_OFFSET                         24
4397fe56b9e6SYuval Mintz 
4398fe56b9e6SYuval Mintz 	u32 manufacture_time;					/* 0x70 */
4399fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF0_TIME_MASK                          0x0000003F
4400fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF0_TIME_OFFSET                        0
4401fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF1_TIME_MASK                          0x00000FC0
4402fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF1_TIME_OFFSET                        6
4403fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF2_TIME_MASK                          0x0003F000
4404fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MANUF2_TIME_OFFSET                        12
4405fe56b9e6SYuval Mintz 
4406fe56b9e6SYuval Mintz 	u32 led_global_settings;				/* 0x74 */
4407fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LED_SWAP_0_MASK                           0x0000000F
4408fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LED_SWAP_0_OFFSET                         0
4409fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LED_SWAP_1_MASK                           0x000000F0
4410fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LED_SWAP_1_OFFSET                         4
4411fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LED_SWAP_2_MASK                           0x00000F00
4412fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LED_SWAP_2_OFFSET                         8
4413fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LED_SWAP_3_MASK                           0x0000F000
4414fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_LED_SWAP_3_OFFSET                         12
4415fe56b9e6SYuval Mintz 
4416fe56b9e6SYuval Mintz 	u32	generic_cont1;					/* 0x78 */
4417fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_AVS_DAC_CODE_MASK                         0x000003FF
4418fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_AVS_DAC_CODE_OFFSET                       0
4419fe56b9e6SYuval Mintz 
4420fe56b9e6SYuval Mintz 	u32	mbi_version;					/* 0x7C */
4421fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MBI_VERSION_0_MASK                        0x000000FF
4422fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MBI_VERSION_0_OFFSET                      0
4423fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MBI_VERSION_1_MASK                        0x0000FF00
4424fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MBI_VERSION_1_OFFSET                      8
4425fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MBI_VERSION_2_MASK                        0x00FF0000
4426fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_MBI_VERSION_2_OFFSET                      16
4427fe56b9e6SYuval Mintz 
4428fe56b9e6SYuval Mintz 	u32	mbi_date;					/* 0x80 */
4429fe56b9e6SYuval Mintz 
4430fe56b9e6SYuval Mintz 	u32	misc_sig;					/* 0x84 */
4431fe56b9e6SYuval Mintz 
4432fe56b9e6SYuval Mintz 	/*  Define the GPIO mapping to switch i2c mux */
4433fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO_0_MASK                   0x000000FF
4434fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO_0_OFFSET                 0
4435fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO_1_MASK                   0x0000FF00
4436fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO_1_OFFSET                 8
4437fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__NA                      0x0
4438fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO0                   0x1
4439fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO1                   0x2
4440fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO2                   0x3
4441fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO3                   0x4
4442fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO4                   0x5
4443fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO5                   0x6
4444fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO6                   0x7
4445fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO7                   0x8
4446fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO8                   0x9
4447fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO9                   0xA
4448fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO10                  0xB
4449fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO11                  0xC
4450fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO12                  0xD
4451fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO13                  0xE
4452fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO14                  0xF
4453fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO15                  0x10
4454fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO16                  0x11
4455fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO17                  0x12
4456fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO18                  0x13
4457fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO19                  0x14
4458fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO20                  0x15
4459fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO21                  0x16
4460fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO22                  0x17
4461fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO23                  0x18
4462fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO24                  0x19
4463fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO25                  0x1A
4464fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO26                  0x1B
4465fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO27                  0x1C
4466fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO28                  0x1D
4467fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO29                  0x1E
4468fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO30                  0x1F
4469fe56b9e6SYuval Mintz #define NVM_CFG1_GLOB_I2C_MUX_SEL_GPIO__GPIO31                  0x20
4470fc48b7a6SYuval Mintz 	u32	device_capabilities;                            /* 0x88 */
4471fc48b7a6SYuval Mintz #define NVM_CFG1_GLOB_DEVICE_CAPABILITIES_ETHERNET              0x1
4472fc48b7a6SYuval Mintz 	u32	power_dissipated;                               /* 0x8C */
4473fc48b7a6SYuval Mintz 	u32 power_consumed;                                     /* 0x90 */
4474fc48b7a6SYuval Mintz 	u32	efi_version;                                    /* 0x94 */
4475fc48b7a6SYuval Mintz 	u32	reserved[42];                                   /* 0x98 */
4476fe56b9e6SYuval Mintz };
4477fe56b9e6SYuval Mintz 
4478fe56b9e6SYuval Mintz struct nvm_cfg1_path {
4479fe56b9e6SYuval Mintz 	u32 reserved[30];					/* 0x0 */
4480fe56b9e6SYuval Mintz };
4481fe56b9e6SYuval Mintz 
4482fe56b9e6SYuval Mintz struct nvm_cfg1_port {
4483fc48b7a6SYuval Mintz 	u32	reserved__m_relocated_to_option_123;           /* 0x0 */
4484fc48b7a6SYuval Mintz 	u32	reserved__m_relocated_to_option_124;           /* 0x4 */
4485fe56b9e6SYuval Mintz 	u32 generic_cont0;					/* 0x8 */
4486fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_MASK                             0x000000FF
4487fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_OFFSET                           0
4488fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_MAC1                             0x0
4489fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_PHY1                             0x1
4490fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_PHY2                             0x2
4491fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_PHY3                             0x3
4492fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_MAC2                             0x4
4493fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_PHY4                             0x5
4494fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_PHY5                             0x6
4495fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_PHY6                             0x7
4496fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_MAC3                             0x8
4497fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_PHY7                             0x9
4498fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_PHY8                             0xA
4499fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_PHY9                             0xB
4500fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_MAC4                             0xC
4501fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_PHY10                            0xD
4502fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_PHY11                            0xE
4503fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LED_MODE_PHY12                            0xF
4504fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_ROCE_PRIORITY_MASK                        0x0000FF00
4505fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_ROCE_PRIORITY_OFFSET                      8
4506fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DCBX_MODE_MASK                            0x000F0000
4507fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DCBX_MODE_OFFSET                          16
4508fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DCBX_MODE_DISABLED                        0x0
4509fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DCBX_MODE_IEEE                            0x1
4510fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DCBX_MODE_CEE                             0x2
4511fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DCBX_MODE_DYNAMIC                         0x3
4512fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_DEFAULT_ENABLED_PROTOCOLS_MASK            0x00F00000
4513fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_DEFAULT_ENABLED_PROTOCOLS_OFFSET          20
4514fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_DEFAULT_ENABLED_PROTOCOLS_ETHERNET        0x1
4515fe56b9e6SYuval Mintz 	u32	pcie_cfg;					/* 0xC */
4516fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_RESERVED15_MASK                           0x00000007
4517fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_RESERVED15_OFFSET                         0
4518fe56b9e6SYuval Mintz 
4519fe56b9e6SYuval Mintz 	u32	features;					/* 0x10 */
4520fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_ENABLE_WOL_ON_ACPI_PATTERN_MASK           0x00000001
4521fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_ENABLE_WOL_ON_ACPI_PATTERN_OFFSET         0
4522fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_ENABLE_WOL_ON_ACPI_PATTERN_DISABLED       0x0
4523fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_ENABLE_WOL_ON_ACPI_PATTERN_ENABLED        0x1
4524fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MAGIC_PACKET_WOL_MASK                     0x00000002
4525fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MAGIC_PACKET_WOL_OFFSET                   1
4526fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MAGIC_PACKET_WOL_DISABLED                 0x0
4527fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MAGIC_PACKET_WOL_ENABLED                  0x1
4528fe56b9e6SYuval Mintz 
4529fe56b9e6SYuval Mintz 	u32 speed_cap_mask;					/* 0x14 */
4530fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_MASK            0x0000FFFF
4531fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_OFFSET          0
4532fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_1G              0x1
4533fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_10G             0x2
4534fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_25G             0x8
4535fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_40G             0x10
4536fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_50G             0x20
4537fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_SPEED_CAPABILITY_MASK_100G            0x40
4538fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_SPEED_CAPABILITY_MASK_MASK            0xFFFF0000
4539fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_SPEED_CAPABILITY_MASK_OFFSET          16
4540fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_SPEED_CAPABILITY_MASK_1G              0x1
4541fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_SPEED_CAPABILITY_MASK_10G             0x2
4542fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_SPEED_CAPABILITY_MASK_25G             0x8
4543fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_SPEED_CAPABILITY_MASK_40G             0x10
4544fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_SPEED_CAPABILITY_MASK_50G             0x20
4545fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_SPEED_CAPABILITY_MASK_100G            0x40
4546fe56b9e6SYuval Mintz 
4547fe56b9e6SYuval Mintz 	u32 link_settings;					/* 0x18 */
4548fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_LINK_SPEED_MASK                       0x0000000F
4549fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_LINK_SPEED_OFFSET                     0
4550fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_LINK_SPEED_AUTONEG                    0x0
4551fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_LINK_SPEED_1G                         0x1
4552fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_LINK_SPEED_10G                        0x2
4553fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_LINK_SPEED_25G                        0x4
4554fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_LINK_SPEED_40G                        0x5
4555fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_LINK_SPEED_50G                        0x6
4556fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_LINK_SPEED_100G                       0x7
4557fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_FLOW_CONTROL_MASK                     0x00000070
4558fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_FLOW_CONTROL_OFFSET                   4
4559fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_FLOW_CONTROL_AUTONEG                  0x1
4560fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_FLOW_CONTROL_RX                       0x2
4561fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_DRV_FLOW_CONTROL_TX                       0x4
4562fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_LINK_SPEED_MASK                       0x00000780
4563fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_LINK_SPEED_OFFSET                     7
4564fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_LINK_SPEED_AUTONEG                    0x0
4565fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_LINK_SPEED_1G                         0x1
4566fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_LINK_SPEED_10G                        0x2
4567fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_LINK_SPEED_25G                        0x4
4568fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_LINK_SPEED_40G                        0x5
4569fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_LINK_SPEED_50G                        0x6
4570fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_LINK_SPEED_100G                       0x7
4571fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_FLOW_CONTROL_MASK                     0x00003800
4572fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_FLOW_CONTROL_OFFSET                   11
4573fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_FLOW_CONTROL_AUTONEG                  0x1
4574fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_FLOW_CONTROL_RX                       0x2
4575fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MFW_FLOW_CONTROL_TX                       0x4
4576fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_OPTIC_MODULE_VENDOR_ENFORCEMENT_MASK      0x00004000
4577fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_OPTIC_MODULE_VENDOR_ENFORCEMENT_OFFSET    14
4578fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_OPTIC_MODULE_VENDOR_ENFORCEMENT_DISABLED  0x0
4579fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_OPTIC_MODULE_VENDOR_ENFORCEMENT_ENABLED   0x1
4580fe56b9e6SYuval Mintz 
4581fe56b9e6SYuval Mintz 	u32 phy_cfg;						/* 0x1C */
4582fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_OPTIONAL_LINK_MODES_MASK                  0x0000FFFF
4583fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_OPTIONAL_LINK_MODES_OFFSET                0
4584fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_OPTIONAL_LINK_MODES_HIGIG                 0x1
4585fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_OPTIONAL_LINK_MODES_SCRAMBLER             0x2
4586fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_OPTIONAL_LINK_MODES_FIBER                 0x4
4587fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_OPTIONAL_LINK_MODES_DISABLE_CL72_AN       0x8
4588fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_OPTIONAL_LINK_MODES_DISABLE_FEC_AN        0x10
4589fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_MASK                 0x00FF0000
4590fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_OFFSET               16
4591fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_BYPASS               0x0
4592fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_KR                   0x2
4593fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_KR2                  0x3
4594fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_KR4                  0x4
4595fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_XFI                  0x8
4596fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_SFI                  0x9
4597fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_1000X                0xB
4598fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_SGMII                0xC
4599fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_XLAUI                0x11
4600fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_XLPPI                0x12
4601fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_CAUI                 0x21
4602fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_CPPI                 0x22
4603fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_SERDES_NET_INTERFACE_25GAUI               0x31
4604fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_AN_MODE_MASK                              0xFF000000
4605fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_AN_MODE_OFFSET                            24
4606fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_AN_MODE_NONE                              0x0
4607fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_AN_MODE_CL73                              0x1
4608fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_AN_MODE_CL37                              0x2
4609fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_AN_MODE_CL73_BAM                          0x3
4610fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_AN_MODE_CL37_BAM                          0x4
4611fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_AN_MODE_HPAM                              0x5
4612fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_AN_MODE_SGMII                             0x6
4613fe56b9e6SYuval Mintz 
4614fe56b9e6SYuval Mintz 	u32 mgmt_traffic;					/* 0x20 */
4615fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_RESERVED61_MASK                           0x0000000F
4616fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_RESERVED61_OFFSET                         0
4617fe56b9e6SYuval Mintz 
4618fe56b9e6SYuval Mintz 	u32 ext_phy;						/* 0x24 */
4619fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_EXTERNAL_PHY_TYPE_MASK                    0x000000FF
4620fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_EXTERNAL_PHY_TYPE_OFFSET                  0
4621fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_EXTERNAL_PHY_TYPE_NONE                    0x0
4622fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_EXTERNAL_PHY_TYPE_BCM84844                0x1
4623fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_EXTERNAL_PHY_ADDRESS_MASK                 0x0000FF00
4624fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_EXTERNAL_PHY_ADDRESS_OFFSET               8
4625fe56b9e6SYuval Mintz 
4626fe56b9e6SYuval Mintz 	u32 mba_cfg1;						/* 0x28 */
4627fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_OPROM_MASK                        0x00000001
4628fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_OPROM_OFFSET                      0
4629fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_OPROM_DISABLED                    0x0
4630fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_OPROM_ENABLED                     0x1
4631fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_RESERVED__M_MBA_BOOT_TYPE_MASK            0x00000006
4632fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_RESERVED__M_MBA_BOOT_TYPE_OFFSET          1
4633fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MBA_DELAY_TIME_MASK                       0x00000078
4634fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MBA_DELAY_TIME_OFFSET                     3
4635fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MBA_SETUP_HOT_KEY_MASK                    0x00000080
4636fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MBA_SETUP_HOT_KEY_OFFSET                  7
4637fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MBA_SETUP_HOT_KEY_CTRL_S                  0x0
4638fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MBA_SETUP_HOT_KEY_CTRL_B                  0x1
4639fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MBA_HIDE_SETUP_PROMPT_MASK                0x00000100
4640fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MBA_HIDE_SETUP_PROMPT_OFFSET              8
4641fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MBA_HIDE_SETUP_PROMPT_DISABLED            0x0
4642fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_MBA_HIDE_SETUP_PROMPT_ENABLED             0x1
4643fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_RESERVED5_MASK                            0x0001FE00
4644fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_RESERVED5_OFFSET                          9
4645fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_LINK_SPEED_MASK                   0x001E0000
4646fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_LINK_SPEED_OFFSET                 17
4647fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_LINK_SPEED_AUTONEG                0x0
4648fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_LINK_SPEED_1G                     0x1
4649fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_LINK_SPEED_10G                    0x2
4650fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_LINK_SPEED_25G                    0x4
4651fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_LINK_SPEED_40G                    0x5
4652fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_LINK_SPEED_50G                    0x6
4653fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_LINK_SPEED_100G                   0x7
4654fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_PREBOOT_LINK_SPEED_SMARTLINQ              0x8
4655fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_RESERVED__M_MBA_BOOT_RETRY_COUNT_MASK     0x00E00000
4656fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_RESERVED__M_MBA_BOOT_RETRY_COUNT_OFFSET   21
4657fe56b9e6SYuval Mintz 
4658fe56b9e6SYuval Mintz 	u32	mba_cfg2;					/* 0x2C */
4659fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_RESERVED65_MASK                           0x0000FFFF
4660fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_RESERVED65_OFFSET                         0
4661fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_RESERVED66_MASK                           0x00010000
4662fc48b7a6SYuval Mintz #define NVM_CFG1_PORT_RESERVED66_OFFSET                         16
4663fe56b9e6SYuval Mintz 
4664fe56b9e6SYuval Mintz 	u32	vf_cfg;						/* 0x30 */
4665fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_RESERVED8_MASK                            0x0000FFFF
4666fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_RESERVED8_OFFSET                          0
4667fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_RESERVED6_MASK                            0x000F0000
4668fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_RESERVED6_OFFSET                          16
4669fe56b9e6SYuval Mintz 
4670fe56b9e6SYuval Mintz 	struct nvm_cfg_mac_address	lldp_mac_address;	/* 0x34 */
4671fe56b9e6SYuval Mintz 
4672fe56b9e6SYuval Mintz 	u32				led_port_settings;	/* 0x3C */
4673fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LANE_LED_SPD_0_SEL_MASK                   0x000000FF
4674fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LANE_LED_SPD_0_SEL_OFFSET                 0
4675fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LANE_LED_SPD_1_SEL_MASK                   0x0000FF00
4676fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LANE_LED_SPD_1_SEL_OFFSET                 8
4677fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LANE_LED_SPD_2_SEL_MASK                   0x00FF0000
4678fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LANE_LED_SPD_2_SEL_OFFSET                 16
4679fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LANE_LED_SPD__SEL_1G                      0x1
4680fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LANE_LED_SPD__SEL_10G                     0x2
4681fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LANE_LED_SPD__SEL_25G                     0x8
4682fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LANE_LED_SPD__SEL_40G                     0x10
4683fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LANE_LED_SPD__SEL_50G                     0x20
4684fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_LANE_LED_SPD__SEL_100G                    0x40
4685fe56b9e6SYuval Mintz 
4686fe56b9e6SYuval Mintz 	u32 transceiver_00;					/* 0x40 */
4687fe56b9e6SYuval Mintz 
4688fe56b9e6SYuval Mintz 	/*  Define for mapping of transceiver signal module absent */
4689fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_MASK                     0x000000FF
4690fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_OFFSET                   0
4691fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_NA                       0x0
4692fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO0                    0x1
4693fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO1                    0x2
4694fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO2                    0x3
4695fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO3                    0x4
4696fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO4                    0x5
4697fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO5                    0x6
4698fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO6                    0x7
4699fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO7                    0x8
4700fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO8                    0x9
4701fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO9                    0xA
4702fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO10                   0xB
4703fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO11                   0xC
4704fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO12                   0xD
4705fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO13                   0xE
4706fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO14                   0xF
4707fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO15                   0x10
4708fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO16                   0x11
4709fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO17                   0x12
4710fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO18                   0x13
4711fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO19                   0x14
4712fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO20                   0x15
4713fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO21                   0x16
4714fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO22                   0x17
4715fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO23                   0x18
4716fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO24                   0x19
4717fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO25                   0x1A
4718fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO26                   0x1B
4719fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO27                   0x1C
4720fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO28                   0x1D
4721fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO29                   0x1E
4722fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO30                   0x1F
4723fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_TRANS_MODULE_ABS_GPIO31                   0x20
4724fe56b9e6SYuval Mintz 	/*  Define the GPIO mux settings  to switch i2c mux to this port */
4725fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_I2C_MUX_SEL_VALUE_0_MASK                  0x00000F00
4726fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_I2C_MUX_SEL_VALUE_0_OFFSET                8
4727fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_I2C_MUX_SEL_VALUE_1_MASK                  0x0000F000
4728fe56b9e6SYuval Mintz #define NVM_CFG1_PORT_I2C_MUX_SEL_VALUE_1_OFFSET                12
4729fe56b9e6SYuval Mintz 
4730fe56b9e6SYuval Mintz 	u32 reserved[133];					/* 0x44 */
4731fe56b9e6SYuval Mintz };
4732fe56b9e6SYuval Mintz 
4733fe56b9e6SYuval Mintz struct nvm_cfg1_func {
4734fe56b9e6SYuval Mintz 	struct nvm_cfg_mac_address	mac_address;		/* 0x0 */
4735fe56b9e6SYuval Mintz 
4736fe56b9e6SYuval Mintz 	u32				rsrv1;			/* 0x8 */
4737fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_RESERVED1_MASK                            0x0000FFFF
4738fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_RESERVED1_OFFSET                          0
4739fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_RESERVED2_MASK                            0xFFFF0000
4740fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_RESERVED2_OFFSET                          16
4741fe56b9e6SYuval Mintz 
4742fe56b9e6SYuval Mintz 	u32				rsrv2;			/* 0xC */
4743fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_RESERVED3_MASK                            0x0000FFFF
4744fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_RESERVED3_OFFSET                          0
4745fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_RESERVED4_MASK                            0xFFFF0000
4746fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_RESERVED4_OFFSET                          16
4747fe56b9e6SYuval Mintz 
4748fe56b9e6SYuval Mintz 	u32				device_id;		/* 0x10 */
4749fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_MF_VENDOR_DEVICE_ID_MASK                  0x0000FFFF
4750fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_MF_VENDOR_DEVICE_ID_OFFSET                0
4751fc48b7a6SYuval Mintz #define NVM_CFG1_FUNC_RESERVED77_MASK                           0xFFFF0000
4752fc48b7a6SYuval Mintz #define NVM_CFG1_FUNC_RESERVED77_OFFSET                         16
4753fe56b9e6SYuval Mintz 
4754fe56b9e6SYuval Mintz 	u32				cmn_cfg;		/* 0x14 */
4755fc48b7a6SYuval Mintz #define NVM_CFG1_FUNC_PREBOOT_BOOT_PROTOCOL_MASK                0x00000007
4756fc48b7a6SYuval Mintz #define NVM_CFG1_FUNC_PREBOOT_BOOT_PROTOCOL_OFFSET              0
4757fc48b7a6SYuval Mintz #define NVM_CFG1_FUNC_PREBOOT_BOOT_PROTOCOL_PXE                 0x0
4758fc48b7a6SYuval Mintz #define NVM_CFG1_FUNC_PREBOOT_BOOT_PROTOCOL_ISCSI_BOOT          0x3
4759fc48b7a6SYuval Mintz #define NVM_CFG1_FUNC_PREBOOT_BOOT_PROTOCOL_FCOE_BOOT           0x4
4760fc48b7a6SYuval Mintz #define NVM_CFG1_FUNC_PREBOOT_BOOT_PROTOCOL_NONE                0x7
4761fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_VF_PCI_DEVICE_ID_MASK                     0x0007FFF8
4762fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_VF_PCI_DEVICE_ID_OFFSET                   3
4763fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_PERSONALITY_MASK                          0x00780000
4764fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_PERSONALITY_OFFSET                        19
4765fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_PERSONALITY_ETHERNET                      0x0
4766fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_PERSONALITY_ISCSI                         0x1
4767fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_PERSONALITY_FCOE                          0x2
4768fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_PERSONALITY_ROCE                          0x3
4769fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BANDWIDTH_WEIGHT_MASK                     0x7F800000
4770fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BANDWIDTH_WEIGHT_OFFSET                   23
4771fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_PAUSE_ON_HOST_RING_MASK                   0x80000000
4772fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_PAUSE_ON_HOST_RING_OFFSET                 31
4773fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_PAUSE_ON_HOST_RING_DISABLED               0x0
4774fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_PAUSE_ON_HOST_RING_ENABLED                0x1
4775fe56b9e6SYuval Mintz 
4776fe56b9e6SYuval Mintz 	u32 pci_cfg;						/* 0x18 */
4777fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_NUMBER_OF_VFS_PER_PF_MASK                 0x0000007F
4778fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_NUMBER_OF_VFS_PER_PF_OFFSET               0
4779fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_RESERVESD12_MASK                          0x00003F80
4780fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_RESERVESD12_OFFSET                        7
4781fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_MASK                            0x0003C000
4782fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_OFFSET                          14
4783fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_DISABLED                        0x0
4784fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_64K                             0x1
4785fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_128K                            0x2
4786fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_256K                            0x3
4787fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_512K                            0x4
4788fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_1M                              0x5
4789fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_2M                              0x6
4790fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_4M                              0x7
4791fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_8M                              0x8
4792fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_16M                             0x9
4793fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_32M                             0xA
4794fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_64M                             0xB
4795fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_128M                            0xC
4796fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_256M                            0xD
4797fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_512M                            0xE
4798fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_BAR1_SIZE_1G                              0xF
4799fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_MAX_BANDWIDTH_MASK                        0x03FC0000
4800fe56b9e6SYuval Mintz #define NVM_CFG1_FUNC_MAX_BANDWIDTH_OFFSET                      18
4801fe56b9e6SYuval Mintz 
4802fe56b9e6SYuval Mintz 	struct nvm_cfg_mac_address	fcoe_node_wwn_mac_addr;	/* 0x1C */
4803fe56b9e6SYuval Mintz 
4804fe56b9e6SYuval Mintz 	struct nvm_cfg_mac_address	fcoe_port_wwn_mac_addr;	/* 0x24 */
4805fc48b7a6SYuval Mintz 	u32				preboot_generic_cfg;    /* 0x2C */
4806fc48b7a6SYuval Mintz 	u32				reserved[8];            /* 0x30 */
4807fe56b9e6SYuval Mintz };
4808fe56b9e6SYuval Mintz 
4809fe56b9e6SYuval Mintz struct nvm_cfg1 {
4810fe56b9e6SYuval Mintz 	struct nvm_cfg1_glob	glob;				/* 0x0 */
4811fe56b9e6SYuval Mintz 
4812fe56b9e6SYuval Mintz 	struct nvm_cfg1_path	path[MCP_GLOB_PATH_MAX];	/* 0x140 */
4813fe56b9e6SYuval Mintz 
4814fe56b9e6SYuval Mintz 	struct nvm_cfg1_port	port[MCP_GLOB_PORT_MAX];	/* 0x230 */
4815fe56b9e6SYuval Mintz 
4816fe56b9e6SYuval Mintz 	struct nvm_cfg1_func	func[MCP_GLOB_FUNC_MAX];	/* 0xB90 */
4817fe56b9e6SYuval Mintz };
4818fe56b9e6SYuval Mintz 
4819fe56b9e6SYuval Mintz /******************************************
4820fe56b9e6SYuval Mintz * nvm_cfg structs
4821fe56b9e6SYuval Mintz ******************************************/
4822fe56b9e6SYuval Mintz 
4823fe56b9e6SYuval Mintz enum nvm_cfg_sections {
4824fe56b9e6SYuval Mintz 	NVM_CFG_SECTION_NVM_CFG1,
4825fe56b9e6SYuval Mintz 	NVM_CFG_SECTION_MAX
4826fe56b9e6SYuval Mintz };
4827fe56b9e6SYuval Mintz 
4828fe56b9e6SYuval Mintz struct nvm_cfg {
4829fe56b9e6SYuval Mintz 	u32		num_sections;
4830fe56b9e6SYuval Mintz 	u32		sections_offset[NVM_CFG_SECTION_MAX];
4831fe56b9e6SYuval Mintz 	struct nvm_cfg1 cfg1;
4832fe56b9e6SYuval Mintz };
4833fe56b9e6SYuval Mintz 
4834fe56b9e6SYuval Mintz #define PORT_0          0
4835fe56b9e6SYuval Mintz #define PORT_1          1
4836fe56b9e6SYuval Mintz #define PORT_2          2
4837fe56b9e6SYuval Mintz #define PORT_3          3
4838fe56b9e6SYuval Mintz 
4839fe56b9e6SYuval Mintz extern struct spad_layout g_spad;
4840fe56b9e6SYuval Mintz 
4841fe56b9e6SYuval Mintz #define MCP_SPAD_SIZE                       0x00028000  /* 160 KB */
4842fe56b9e6SYuval Mintz 
4843fe56b9e6SYuval Mintz #define SPAD_OFFSET(addr) (((u32)addr - (u32)CPU_SPAD_BASE))
4844fe56b9e6SYuval Mintz 
4845fe56b9e6SYuval Mintz #define TO_OFFSIZE(_offset, _size)				\
4846fe56b9e6SYuval Mintz 	(u32)((((u32)(_offset) >> 2) << OFFSIZE_OFFSET_SHIFT) |	\
4847fe56b9e6SYuval Mintz 	      (((u32)(_size) >> 2) << OFFSIZE_SIZE_SHIFT))
4848fe56b9e6SYuval Mintz 
4849fe56b9e6SYuval Mintz enum spad_sections {
4850fe56b9e6SYuval Mintz 	SPAD_SECTION_TRACE,
4851fe56b9e6SYuval Mintz 	SPAD_SECTION_NVM_CFG,
4852fe56b9e6SYuval Mintz 	SPAD_SECTION_PUBLIC,
4853fe56b9e6SYuval Mintz 	SPAD_SECTION_PRIVATE,
4854fe56b9e6SYuval Mintz 	SPAD_SECTION_MAX
4855fe56b9e6SYuval Mintz };
4856fe56b9e6SYuval Mintz 
4857fe56b9e6SYuval Mintz struct spad_layout {
4858fe56b9e6SYuval Mintz 	struct nvm_cfg		nvm_cfg;
4859fe56b9e6SYuval Mintz 	struct mcp_public_data	public_data;
4860fe56b9e6SYuval Mintz };
4861fe56b9e6SYuval Mintz 
4862fe56b9e6SYuval Mintz #define CRC_MAGIC_VALUE                     0xDEBB20E3
4863fe56b9e6SYuval Mintz #define CRC32_POLYNOMIAL                    0xEDB88320
4864fe56b9e6SYuval Mintz #define NVM_CRC_SIZE                            (sizeof(u32))
4865fe56b9e6SYuval Mintz 
4866fe56b9e6SYuval Mintz enum nvm_sw_arbitrator {
4867fe56b9e6SYuval Mintz 	NVM_SW_ARB_HOST,
4868fe56b9e6SYuval Mintz 	NVM_SW_ARB_MCP,
4869fe56b9e6SYuval Mintz 	NVM_SW_ARB_UART,
4870fe56b9e6SYuval Mintz 	NVM_SW_ARB_RESERVED
4871fe56b9e6SYuval Mintz };
4872fe56b9e6SYuval Mintz 
4873fe56b9e6SYuval Mintz /****************************************************************************
4874fe56b9e6SYuval Mintz * Boot Strap Region                                                        *
4875fe56b9e6SYuval Mintz ****************************************************************************/
4876fe56b9e6SYuval Mintz struct legacy_bootstrap_region {
4877fe56b9e6SYuval Mintz 	u32	magic_value;
4878fe56b9e6SYuval Mintz #define NVM_MAGIC_VALUE          0x669955aa
4879fe56b9e6SYuval Mintz 	u32	sram_start_addr;
4880fe56b9e6SYuval Mintz 	u32	code_len;               /* boot code length (in dwords) */
4881fe56b9e6SYuval Mintz 	u32	code_start_addr;
4882fe56b9e6SYuval Mintz 	u32	crc;                    /* 32-bit CRC */
4883fe56b9e6SYuval Mintz };
4884fe56b9e6SYuval Mintz 
4885fe56b9e6SYuval Mintz /****************************************************************************
4886fe56b9e6SYuval Mintz * Directories Region                                                       *
4887fe56b9e6SYuval Mintz ****************************************************************************/
4888fe56b9e6SYuval Mintz struct nvm_code_entry {
4889fe56b9e6SYuval Mintz 	u32	image_type;             /* Image type */
4890fe56b9e6SYuval Mintz 	u32	nvm_start_addr;         /* NVM address of the image */
4891fe56b9e6SYuval Mintz 	u32	len;                    /* Include CRC */
4892fe56b9e6SYuval Mintz 	u32	sram_start_addr;
4893fe56b9e6SYuval Mintz 	u32	sram_run_addr;          /* Relevant in case of MIM only */
4894fe56b9e6SYuval Mintz };
4895fe56b9e6SYuval Mintz 
4896fe56b9e6SYuval Mintz enum nvm_image_type {
4897fe56b9e6SYuval Mintz 	NVM_TYPE_TIM1		= 0x01,
4898fe56b9e6SYuval Mintz 	NVM_TYPE_TIM2		= 0x02,
4899fe56b9e6SYuval Mintz 	NVM_TYPE_MIM1		= 0x03,
4900fe56b9e6SYuval Mintz 	NVM_TYPE_MIM2		= 0x04,
4901fe56b9e6SYuval Mintz 	NVM_TYPE_MBA		= 0x05,
4902fe56b9e6SYuval Mintz 	NVM_TYPE_MODULES_PN	= 0x06,
4903fe56b9e6SYuval Mintz 	NVM_TYPE_VPD		= 0x07,
4904fe56b9e6SYuval Mintz 	NVM_TYPE_MFW_TRACE1	= 0x08,
4905fe56b9e6SYuval Mintz 	NVM_TYPE_MFW_TRACE2	= 0x09,
4906fe56b9e6SYuval Mintz 	NVM_TYPE_NVM_CFG1	= 0x0a,
4907fe56b9e6SYuval Mintz 	NVM_TYPE_L2B		= 0x0b,
4908fe56b9e6SYuval Mintz 	NVM_TYPE_DIR1		= 0x0c,
4909fe56b9e6SYuval Mintz 	NVM_TYPE_EAGLE_FW1	= 0x0d,
4910fe56b9e6SYuval Mintz 	NVM_TYPE_FALCON_FW1	= 0x0e,
4911fe56b9e6SYuval Mintz 	NVM_TYPE_PCIE_FW1	= 0x0f,
4912fe56b9e6SYuval Mintz 	NVM_TYPE_HW_SET		= 0x10,
4913fe56b9e6SYuval Mintz 	NVM_TYPE_LIM		= 0x11,
4914fe56b9e6SYuval Mintz 	NVM_TYPE_AVS_FW1	= 0x12,
4915fe56b9e6SYuval Mintz 	NVM_TYPE_DIR2		= 0x13,
4916fe56b9e6SYuval Mintz 	NVM_TYPE_CCM		= 0x14,
4917fe56b9e6SYuval Mintz 	NVM_TYPE_EAGLE_FW2	= 0x15,
4918fe56b9e6SYuval Mintz 	NVM_TYPE_FALCON_FW2	= 0x16,
4919fe56b9e6SYuval Mintz 	NVM_TYPE_PCIE_FW2	= 0x17,
4920fe56b9e6SYuval Mintz 	NVM_TYPE_AVS_FW2	= 0x18,
4921fe56b9e6SYuval Mintz 
4922fe56b9e6SYuval Mintz 	NVM_TYPE_MAX,
4923fe56b9e6SYuval Mintz };
4924fe56b9e6SYuval Mintz 
4925fe56b9e6SYuval Mintz #define MAX_NVM_DIR_ENTRIES 200
4926fe56b9e6SYuval Mintz 
4927fe56b9e6SYuval Mintz struct nvm_dir {
4928fe56b9e6SYuval Mintz 	s32 seq;
4929fe56b9e6SYuval Mintz #define NVM_DIR_NEXT_MFW_MASK   0x00000001
4930fe56b9e6SYuval Mintz #define NVM_DIR_SEQ_MASK        0xfffffffe
4931fe56b9e6SYuval Mintz #define NVM_DIR_NEXT_MFW(seq) ((seq) & NVM_DIR_NEXT_MFW_MASK)
4932fe56b9e6SYuval Mintz 
4933fe56b9e6SYuval Mintz #define IS_DIR_SEQ_VALID(seq) ((seq & NVM_DIR_SEQ_MASK) != NVM_DIR_SEQ_MASK)
4934fe56b9e6SYuval Mintz 
4935fe56b9e6SYuval Mintz 	u32			num_images;
4936fe56b9e6SYuval Mintz 	u32			rsrv;
4937fe56b9e6SYuval Mintz 	struct nvm_code_entry	code[1]; /* Up to MAX_NVM_DIR_ENTRIES */
4938fe56b9e6SYuval Mintz };
4939fe56b9e6SYuval Mintz 
4940fe56b9e6SYuval Mintz #define NVM_DIR_SIZE(_num_images) (sizeof(struct nvm_dir) +		 \
4941fe56b9e6SYuval Mintz 				   (_num_images -			 \
4942fe56b9e6SYuval Mintz 				    1) * sizeof(struct nvm_code_entry) + \
4943fe56b9e6SYuval Mintz 				   NVM_CRC_SIZE)
4944fe56b9e6SYuval Mintz 
4945fe56b9e6SYuval Mintz struct nvm_vpd_image {
4946fe56b9e6SYuval Mintz 	u32	format_revision;
4947fe56b9e6SYuval Mintz #define VPD_IMAGE_VERSION        1
4948fe56b9e6SYuval Mintz 
4949fe56b9e6SYuval Mintz 	/* This array length depends on the number of VPD fields */
4950fe56b9e6SYuval Mintz 	u8	vpd_data[1];
4951fe56b9e6SYuval Mintz };
4952fe56b9e6SYuval Mintz 
4953fe56b9e6SYuval Mintz /****************************************************************************
4954fe56b9e6SYuval Mintz * NVRAM FULL MAP                                                           *
4955fe56b9e6SYuval Mintz ****************************************************************************/
4956fe56b9e6SYuval Mintz #define DIR_ID_1    (0)
4957fe56b9e6SYuval Mintz #define DIR_ID_2    (1)
4958fe56b9e6SYuval Mintz #define MAX_DIR_IDS (2)
4959fe56b9e6SYuval Mintz 
4960fe56b9e6SYuval Mintz #define MFW_BUNDLE_1    (0)
4961fe56b9e6SYuval Mintz #define MFW_BUNDLE_2    (1)
4962fe56b9e6SYuval Mintz #define MAX_MFW_BUNDLES (2)
4963fe56b9e6SYuval Mintz 
4964fe56b9e6SYuval Mintz #define FLASH_PAGE_SIZE 0x1000
4965fe56b9e6SYuval Mintz #define NVM_DIR_MAX_SIZE    (FLASH_PAGE_SIZE)           /* 4Kb */
4966fe56b9e6SYuval Mintz #define ASIC_MIM_MAX_SIZE   (300 * FLASH_PAGE_SIZE)     /* 1.2Mb */
4967fe56b9e6SYuval Mintz #define FPGA_MIM_MAX_SIZE   (25 * FLASH_PAGE_SIZE)      /* 60Kb */
4968fe56b9e6SYuval Mintz 
4969fe56b9e6SYuval Mintz #define LIM_MAX_SIZE        ((2 *				      \
4970fe56b9e6SYuval Mintz 			      FLASH_PAGE_SIZE) -		      \
4971fe56b9e6SYuval Mintz 			     sizeof(struct legacy_bootstrap_region) - \
4972fe56b9e6SYuval Mintz 			     NVM_RSV_SIZE)
4973fe56b9e6SYuval Mintz #define LIM_OFFSET          (NVM_OFFSET(lim_image))
4974fe56b9e6SYuval Mintz #define NVM_RSV_SIZE            (44)
4975fe56b9e6SYuval Mintz #define MIM_MAX_SIZE(is_asic) ((is_asic) ? ASIC_MIM_MAX_SIZE : \
4976fe56b9e6SYuval Mintz 			       FPGA_MIM_MAX_SIZE)
4977fe56b9e6SYuval Mintz #define MIM_OFFSET(idx, is_asic) (NVM_OFFSET(dir[MAX_MFW_BUNDLES]) + \
4978fe56b9e6SYuval Mintz 				  ((idx ==			     \
4979fe56b9e6SYuval Mintz 				    NVM_TYPE_MIM2) ? MIM_MAX_SIZE(is_asic) : 0))
4980fe56b9e6SYuval Mintz #define NVM_FIXED_AREA_SIZE(is_asic) (sizeof(struct nvm_image) + \
4981fe56b9e6SYuval Mintz 				      MIM_MAX_SIZE(is_asic) * 2)
4982fe56b9e6SYuval Mintz 
4983fe56b9e6SYuval Mintz union nvm_dir_union {
4984fe56b9e6SYuval Mintz 	struct nvm_dir	dir;
4985fe56b9e6SYuval Mintz 	u8		page[FLASH_PAGE_SIZE];
4986fe56b9e6SYuval Mintz };
4987fe56b9e6SYuval Mintz 
4988fe56b9e6SYuval Mintz /*                        Address
4989fe56b9e6SYuval Mintz  *  +-------------------+ 0x000000
4990fe56b9e6SYuval Mintz  *  |    Bootstrap:     |
4991fe56b9e6SYuval Mintz  *  | magic_number      |
4992fe56b9e6SYuval Mintz  *  | sram_start_addr   |
4993fe56b9e6SYuval Mintz  *  | code_len          |
4994fe56b9e6SYuval Mintz  *  | code_start_addr   |
4995fe56b9e6SYuval Mintz  *  | crc               |
4996fe56b9e6SYuval Mintz  *  +-------------------+ 0x000014
4997fe56b9e6SYuval Mintz  *  | rsrv              |
4998fe56b9e6SYuval Mintz  *  +-------------------+ 0x000040
4999fe56b9e6SYuval Mintz  *  | LIM               |
5000fe56b9e6SYuval Mintz  *  +-------------------+ 0x002000
5001fe56b9e6SYuval Mintz  *  | Dir1              |
5002fe56b9e6SYuval Mintz  *  +-------------------+ 0x003000
5003fe56b9e6SYuval Mintz  *  | Dir2              |
5004fe56b9e6SYuval Mintz  *  +-------------------+ 0x004000
5005fe56b9e6SYuval Mintz  *  | MIM1              |
5006fe56b9e6SYuval Mintz  *  +-------------------+ 0x130000
5007fe56b9e6SYuval Mintz  *  | MIM2              |
5008fe56b9e6SYuval Mintz  *  +-------------------+ 0x25C000
5009fe56b9e6SYuval Mintz  *  | Rest Images:      |
5010fe56b9e6SYuval Mintz  *  | TIM1/2            |
5011fe56b9e6SYuval Mintz  *  | MFW_TRACE1/2      |
5012fe56b9e6SYuval Mintz  *  | Eagle/Falcon FW   |
5013fe56b9e6SYuval Mintz  *  | PCIE/AVS FW       |
5014fe56b9e6SYuval Mintz  *  | MBA/CCM/L2B       |
5015fe56b9e6SYuval Mintz  *  | VPD               |
5016fe56b9e6SYuval Mintz  *  | optic_modules     |
5017fe56b9e6SYuval Mintz  *  |  ...              |
5018fe56b9e6SYuval Mintz  *  +-------------------+ 0x400000
5019fe56b9e6SYuval Mintz  */
5020fe56b9e6SYuval Mintz struct nvm_image {
5021fe56b9e6SYuval Mintz /*********** !!!  FIXED SECTIONS  !!! DO NOT MODIFY !!! **********************/
5022fe56b9e6SYuval Mintz 	/* NVM Offset  (size) */
5023fe56b9e6SYuval Mintz 	struct legacy_bootstrap_region	bootstrap;
5024fe56b9e6SYuval Mintz 	u8				rsrv[NVM_RSV_SIZE];
5025fe56b9e6SYuval Mintz 	u8				lim_image[LIM_MAX_SIZE];
5026fe56b9e6SYuval Mintz 	union nvm_dir_union		dir[MAX_MFW_BUNDLES];
5027fe56b9e6SYuval Mintz 
5028fe56b9e6SYuval Mintz 	/* MIM1_IMAGE                              0x004000 (0x12c000) */
5029fe56b9e6SYuval Mintz 	/* MIM2_IMAGE                              0x130000 (0x12c000) */
5030fe56b9e6SYuval Mintz /*********** !!!  FIXED SECTIONS  !!! DO NOT MODIFY !!! **********************/
5031fe56b9e6SYuval Mintz };                              /* 0x134 */
5032fe56b9e6SYuval Mintz 
5033fe56b9e6SYuval Mintz #define NVM_OFFSET(f)	((u32_t)((int_ptr_t)(&(((struct nvm_image *)0)->f))))
5034fe56b9e6SYuval Mintz 
5035fe56b9e6SYuval Mintz struct hw_set_info {
5036fe56b9e6SYuval Mintz 	u32	reg_type;
5037fe56b9e6SYuval Mintz #define GRC_REG_TYPE 1
5038fe56b9e6SYuval Mintz #define PHY_REG_TYPE 2
5039fe56b9e6SYuval Mintz #define PCI_REG_TYPE 4
5040fe56b9e6SYuval Mintz 
5041fe56b9e6SYuval Mintz 	u32	bank_num;
5042fe56b9e6SYuval Mintz 	u32	pf_num;
5043fe56b9e6SYuval Mintz 	u32	operation;
5044fe56b9e6SYuval Mintz #define READ_OP     1
5045fe56b9e6SYuval Mintz #define WRITE_OP    2
5046fe56b9e6SYuval Mintz #define RMW_SET_OP  3
5047fe56b9e6SYuval Mintz #define RMW_CLR_OP  4
5048fe56b9e6SYuval Mintz 
5049fe56b9e6SYuval Mintz 	u32	reg_addr;
5050fe56b9e6SYuval Mintz 	u32	reg_data;
5051fe56b9e6SYuval Mintz 
5052fe56b9e6SYuval Mintz 	u32	reset_type;
5053fe56b9e6SYuval Mintz #define POR_RESET_TYPE	BIT(0)
5054fe56b9e6SYuval Mintz #define HARD_RESET_TYPE	BIT(1)
5055fe56b9e6SYuval Mintz #define CORE_RESET_TYPE	BIT(2)
5056fe56b9e6SYuval Mintz #define MCP_RESET_TYPE	BIT(3)
5057fe56b9e6SYuval Mintz #define PERSET_ASSERT	BIT(4)
5058fe56b9e6SYuval Mintz #define PERSET_DEASSERT	BIT(5)
5059fe56b9e6SYuval Mintz };
5060fe56b9e6SYuval Mintz 
5061fe56b9e6SYuval Mintz struct hw_set_image {
5062fe56b9e6SYuval Mintz 	u32			format_version;
5063fe56b9e6SYuval Mintz #define HW_SET_IMAGE_VERSION        1
5064fe56b9e6SYuval Mintz 	u32			no_hw_sets;
5065fe56b9e6SYuval Mintz 
5066fe56b9e6SYuval Mintz 	/* This array length depends on the no_hw_sets */
5067fe56b9e6SYuval Mintz 	struct hw_set_info	hw_sets[1];
5068fe56b9e6SYuval Mintz };
5069fe56b9e6SYuval Mintz 
5070fe56b9e6SYuval Mintz #endif
5071