blob: e6f816df88b868047c8801436935c2e938cefae1 [file] [log] [blame]
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001/* bnx2x_hsi.h: Broadcom Everest network driver.
2 *
Dmitry Kravkov5de92402011-05-04 23:51:13 +00003 * Copyright (c) 2007-2011 Broadcom Corporation
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation.
8 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00009#ifndef BNX2X_HSI_H
10#define BNX2X_HSI_H
11
12#include "bnx2x_fw_defs.h"
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +020013
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +030014#define FW_ENCODE_32BIT_PATTERN 0x1e1e1e1e
Vladislav Zolotarov2ba45142011-01-31 14:39:17 +000015
Michael Chane2513062009-10-10 13:46:58 +000016struct license_key {
17 u32 reserved[6];
18
Vladislav Zolotarov2ba45142011-01-31 14:39:17 +000019 u32 max_iscsi_conn;
20#define BNX2X_MAX_ISCSI_TRGT_CONN_MASK 0xFFFF
21#define BNX2X_MAX_ISCSI_TRGT_CONN_SHIFT 0
22#define BNX2X_MAX_ISCSI_INIT_CONN_MASK 0xFFFF0000
23#define BNX2X_MAX_ISCSI_INIT_CONN_SHIFT 16
Michael Chane2513062009-10-10 13:46:58 +000024
Vladislav Zolotarov2ba45142011-01-31 14:39:17 +000025 u32 reserved_a;
26
27 u32 max_fcoe_conn;
28#define BNX2X_MAX_FCOE_TRGT_CONN_MASK 0xFFFF
29#define BNX2X_MAX_FCOE_TRGT_CONN_SHIFT 0
30#define BNX2X_MAX_FCOE_INIT_CONN_MASK 0xFFFF0000
31#define BNX2X_MAX_FCOE_INIT_CONN_SHIFT 16
32
33 u32 reserved_b[4];
Michael Chane2513062009-10-10 13:46:58 +000034};
35
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +030036
37#define PORT_0 0
38#define PORT_1 1
39#define PORT_MAX 2
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +020040
41/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +030042 * Shared HW configuration *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +020043 ****************************************************************************/
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +030044#define PIN_CFG_NA 0x00000000
45#define PIN_CFG_GPIO0_P0 0x00000001
46#define PIN_CFG_GPIO1_P0 0x00000002
47#define PIN_CFG_GPIO2_P0 0x00000003
48#define PIN_CFG_GPIO3_P0 0x00000004
49#define PIN_CFG_GPIO0_P1 0x00000005
50#define PIN_CFG_GPIO1_P1 0x00000006
51#define PIN_CFG_GPIO2_P1 0x00000007
52#define PIN_CFG_GPIO3_P1 0x00000008
53#define PIN_CFG_EPIO0 0x00000009
54#define PIN_CFG_EPIO1 0x0000000a
55#define PIN_CFG_EPIO2 0x0000000b
56#define PIN_CFG_EPIO3 0x0000000c
57#define PIN_CFG_EPIO4 0x0000000d
58#define PIN_CFG_EPIO5 0x0000000e
59#define PIN_CFG_EPIO6 0x0000000f
60#define PIN_CFG_EPIO7 0x00000010
61#define PIN_CFG_EPIO8 0x00000011
62#define PIN_CFG_EPIO9 0x00000012
63#define PIN_CFG_EPIO10 0x00000013
64#define PIN_CFG_EPIO11 0x00000014
65#define PIN_CFG_EPIO12 0x00000015
66#define PIN_CFG_EPIO13 0x00000016
67#define PIN_CFG_EPIO14 0x00000017
68#define PIN_CFG_EPIO15 0x00000018
69#define PIN_CFG_EPIO16 0x00000019
70#define PIN_CFG_EPIO17 0x0000001a
71#define PIN_CFG_EPIO18 0x0000001b
72#define PIN_CFG_EPIO19 0x0000001c
73#define PIN_CFG_EPIO20 0x0000001d
74#define PIN_CFG_EPIO21 0x0000001e
75#define PIN_CFG_EPIO22 0x0000001f
76#define PIN_CFG_EPIO23 0x00000020
77#define PIN_CFG_EPIO24 0x00000021
78#define PIN_CFG_EPIO25 0x00000022
79#define PIN_CFG_EPIO26 0x00000023
80#define PIN_CFG_EPIO27 0x00000024
81#define PIN_CFG_EPIO28 0x00000025
82#define PIN_CFG_EPIO29 0x00000026
83#define PIN_CFG_EPIO30 0x00000027
84#define PIN_CFG_EPIO31 0x00000028
85
86/* EPIO definition */
87#define EPIO_CFG_NA 0x00000000
88#define EPIO_CFG_EPIO0 0x00000001
89#define EPIO_CFG_EPIO1 0x00000002
90#define EPIO_CFG_EPIO2 0x00000003
91#define EPIO_CFG_EPIO3 0x00000004
92#define EPIO_CFG_EPIO4 0x00000005
93#define EPIO_CFG_EPIO5 0x00000006
94#define EPIO_CFG_EPIO6 0x00000007
95#define EPIO_CFG_EPIO7 0x00000008
96#define EPIO_CFG_EPIO8 0x00000009
97#define EPIO_CFG_EPIO9 0x0000000a
98#define EPIO_CFG_EPIO10 0x0000000b
99#define EPIO_CFG_EPIO11 0x0000000c
100#define EPIO_CFG_EPIO12 0x0000000d
101#define EPIO_CFG_EPIO13 0x0000000e
102#define EPIO_CFG_EPIO14 0x0000000f
103#define EPIO_CFG_EPIO15 0x00000010
104#define EPIO_CFG_EPIO16 0x00000011
105#define EPIO_CFG_EPIO17 0x00000012
106#define EPIO_CFG_EPIO18 0x00000013
107#define EPIO_CFG_EPIO19 0x00000014
108#define EPIO_CFG_EPIO20 0x00000015
109#define EPIO_CFG_EPIO21 0x00000016
110#define EPIO_CFG_EPIO22 0x00000017
111#define EPIO_CFG_EPIO23 0x00000018
112#define EPIO_CFG_EPIO24 0x00000019
113#define EPIO_CFG_EPIO25 0x0000001a
114#define EPIO_CFG_EPIO26 0x0000001b
115#define EPIO_CFG_EPIO27 0x0000001c
116#define EPIO_CFG_EPIO28 0x0000001d
117#define EPIO_CFG_EPIO29 0x0000001e
118#define EPIO_CFG_EPIO30 0x0000001f
119#define EPIO_CFG_EPIO31 0x00000020
120
121
122struct shared_hw_cfg { /* NVRAM Offset */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200123 /* Up to 16 bytes of NULL-terminated string */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300124 u8 part_num[16]; /* 0x104 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200125
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300126 u32 config; /* 0x114 */
127 #define SHARED_HW_CFG_MDIO_VOLTAGE_MASK 0x00000001
128 #define SHARED_HW_CFG_MDIO_VOLTAGE_SHIFT 0
129 #define SHARED_HW_CFG_MDIO_VOLTAGE_1_2V 0x00000000
130 #define SHARED_HW_CFG_MDIO_VOLTAGE_2_5V 0x00000001
131 #define SHARED_HW_CFG_MCP_RST_ON_CORE_RST_EN 0x00000002
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200132
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300133 #define SHARED_HW_CFG_PORT_SWAP 0x00000004
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200134
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300135 #define SHARED_HW_CFG_BEACON_WOL_EN 0x00000008
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200136
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300137 #define SHARED_HW_CFG_PCIE_GEN3_DISABLED 0x00000000
138 #define SHARED_HW_CFG_PCIE_GEN3_ENABLED 0x00000010
139
140 #define SHARED_HW_CFG_MFW_SELECT_MASK 0x00000700
141 #define SHARED_HW_CFG_MFW_SELECT_SHIFT 8
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200142 /* Whatever MFW found in NVM
143 (if multiple found, priority order is: NC-SI, UMP, IPMI) */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300144 #define SHARED_HW_CFG_MFW_SELECT_DEFAULT 0x00000000
145 #define SHARED_HW_CFG_MFW_SELECT_NC_SI 0x00000100
146 #define SHARED_HW_CFG_MFW_SELECT_UMP 0x00000200
147 #define SHARED_HW_CFG_MFW_SELECT_IPMI 0x00000300
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200148 /* Use SPIO4 as an arbiter between: 0-NC_SI, 1-IPMI
149 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300150 #define SHARED_HW_CFG_MFW_SELECT_SPIO4_NC_SI_IPMI 0x00000400
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200151 /* Use SPIO4 as an arbiter between: 0-UMP, 1-IPMI
152 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300153 #define SHARED_HW_CFG_MFW_SELECT_SPIO4_UMP_IPMI 0x00000500
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200154 /* Use SPIO4 as an arbiter between: 0-NC-SI, 1-UMP
155 (can only be used when an add-in board, not BMC, pulls-down SPIO4) */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300156 #define SHARED_HW_CFG_MFW_SELECT_SPIO4_NC_SI_UMP 0x00000600
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200157
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300158 #define SHARED_HW_CFG_LED_MODE_MASK 0x000f0000
159 #define SHARED_HW_CFG_LED_MODE_SHIFT 16
160 #define SHARED_HW_CFG_LED_MAC1 0x00000000
161 #define SHARED_HW_CFG_LED_PHY1 0x00010000
162 #define SHARED_HW_CFG_LED_PHY2 0x00020000
163 #define SHARED_HW_CFG_LED_PHY3 0x00030000
164 #define SHARED_HW_CFG_LED_MAC2 0x00040000
165 #define SHARED_HW_CFG_LED_PHY4 0x00050000
166 #define SHARED_HW_CFG_LED_PHY5 0x00060000
167 #define SHARED_HW_CFG_LED_PHY6 0x00070000
168 #define SHARED_HW_CFG_LED_MAC3 0x00080000
169 #define SHARED_HW_CFG_LED_PHY7 0x00090000
170 #define SHARED_HW_CFG_LED_PHY9 0x000a0000
171 #define SHARED_HW_CFG_LED_PHY11 0x000b0000
172 #define SHARED_HW_CFG_LED_MAC4 0x000c0000
173 #define SHARED_HW_CFG_LED_PHY8 0x000d0000
174 #define SHARED_HW_CFG_LED_EXTPHY1 0x000e0000
Yaniv Rosner7f02c4a2010-09-07 11:41:23 +0000175
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200176
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300177 #define SHARED_HW_CFG_AN_ENABLE_MASK 0x3f000000
178 #define SHARED_HW_CFG_AN_ENABLE_SHIFT 24
179 #define SHARED_HW_CFG_AN_ENABLE_CL37 0x01000000
180 #define SHARED_HW_CFG_AN_ENABLE_CL73 0x02000000
181 #define SHARED_HW_CFG_AN_ENABLE_BAM 0x04000000
182 #define SHARED_HW_CFG_AN_ENABLE_PARALLEL_DETECTION 0x08000000
183 #define SHARED_HW_CFG_AN_EN_SGMII_FIBER_AUTO_DETECT 0x10000000
184 #define SHARED_HW_CFG_AN_ENABLE_REMOTE_PHY 0x20000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200185
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300186 #define SHARED_HW_CFG_SRIOV_MASK 0x40000000
187 #define SHARED_HW_CFG_SRIOV_DISABLED 0x00000000
188 #define SHARED_HW_CFG_SRIOV_ENABLED 0x40000000
189
190 #define SHARED_HW_CFG_ATC_MASK 0x80000000
191 #define SHARED_HW_CFG_ATC_DISABLED 0x00000000
192 #define SHARED_HW_CFG_ATC_ENABLED 0x80000000
193
194 u32 config2; /* 0x118 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200195 /* one time auto detect grace period (in sec) */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300196 #define SHARED_HW_CFG_GRACE_PERIOD_MASK 0x000000ff
197 #define SHARED_HW_CFG_GRACE_PERIOD_SHIFT 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200198
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300199 #define SHARED_HW_CFG_PCIE_GEN2_ENABLED 0x00000100
200 #define SHARED_HW_CFG_PCIE_GEN2_DISABLED 0x00000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200201
202 /* The default value for the core clock is 250MHz and it is
203 achieved by setting the clock change to 4 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300204 #define SHARED_HW_CFG_CLOCK_CHANGE_MASK 0x00000e00
205 #define SHARED_HW_CFG_CLOCK_CHANGE_SHIFT 9
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200206
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300207 #define SHARED_HW_CFG_SMBUS_TIMING_MASK 0x00001000
208 #define SHARED_HW_CFG_SMBUS_TIMING_100KHZ 0x00000000
209 #define SHARED_HW_CFG_SMBUS_TIMING_400KHZ 0x00001000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200210
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300211 #define SHARED_HW_CFG_HIDE_PORT1 0x00002000
212
213 #define SHARED_HW_CFG_WOL_CAPABLE_MASK 0x00004000
214 #define SHARED_HW_CFG_WOL_CAPABLE_DISABLED 0x00000000
215 #define SHARED_HW_CFG_WOL_CAPABLE_ENABLED 0x00004000
216
217 /* Output low when PERST is asserted */
218 #define SHARED_HW_CFG_SPIO4_FOLLOW_PERST_MASK 0x00008000
219 #define SHARED_HW_CFG_SPIO4_FOLLOW_PERST_DISABLED 0x00000000
220 #define SHARED_HW_CFG_SPIO4_FOLLOW_PERST_ENABLED 0x00008000
221
222 #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_MASK 0x00070000
223 #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_SHIFT 16
224 #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_HW 0x00000000
225 #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_0DB 0x00010000
226 #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_3_5DB 0x00020000
227 #define SHARED_HW_CFG_PCIE_GEN2_PREEMPHASIS_6_0DB 0x00030000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200228
Eilon Greensteinfd4ef402009-07-21 05:47:27 +0000229 /* The fan failure mechanism is usually related to the PHY type
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300230 since the power consumption of the board is determined by the PHY.
231 Currently, fan is required for most designs with SFX7101, BCM8727
232 and BCM8481. If a fan is not required for a board which uses one
233 of those PHYs, this field should be set to "Disabled". If a fan is
234 required for a different PHY type, this option should be set to
235 "Enabled". The fan failure indication is expected on SPIO5 */
236 #define SHARED_HW_CFG_FAN_FAILURE_MASK 0x00180000
237 #define SHARED_HW_CFG_FAN_FAILURE_SHIFT 19
238 #define SHARED_HW_CFG_FAN_FAILURE_PHY_TYPE 0x00000000
239 #define SHARED_HW_CFG_FAN_FAILURE_DISABLED 0x00080000
240 #define SHARED_HW_CFG_FAN_FAILURE_ENABLED 0x00100000
Eilon Greensteinfd4ef402009-07-21 05:47:27 +0000241
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300242 /* ASPM Power Management support */
243 #define SHARED_HW_CFG_ASPM_SUPPORT_MASK 0x00600000
244 #define SHARED_HW_CFG_ASPM_SUPPORT_SHIFT 21
245 #define SHARED_HW_CFG_ASPM_SUPPORT_L0S_L1_ENABLED 0x00000000
246 #define SHARED_HW_CFG_ASPM_SUPPORT_L0S_DISABLED 0x00200000
247 #define SHARED_HW_CFG_ASPM_SUPPORT_L1_DISABLED 0x00400000
248 #define SHARED_HW_CFG_ASPM_SUPPORT_L0S_L1_DISABLED 0x00600000
Yaniv Rosnere10bc842010-09-07 11:40:50 +0000249
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300250 /* The value of PM_TL_IGNORE_REQS (bit0) in PCI register
251 tl_control_0 (register 0x2800) */
252 #define SHARED_HW_CFG_PREVENT_L1_ENTRY_MASK 0x00800000
253 #define SHARED_HW_CFG_PREVENT_L1_ENTRY_DISABLED 0x00000000
254 #define SHARED_HW_CFG_PREVENT_L1_ENTRY_ENABLED 0x00800000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200255
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300256 #define SHARED_HW_CFG_PORT_MODE_MASK 0x01000000
257 #define SHARED_HW_CFG_PORT_MODE_2 0x00000000
258 #define SHARED_HW_CFG_PORT_MODE_4 0x01000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200259
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300260 #define SHARED_HW_CFG_PATH_SWAP_MASK 0x02000000
261 #define SHARED_HW_CFG_PATH_SWAP_DISABLED 0x00000000
262 #define SHARED_HW_CFG_PATH_SWAP_ENABLED 0x02000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200263
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300264 /* Set the MDC/MDIO access for the first external phy */
265 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_MASK 0x1C000000
266 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_SHIFT 26
267 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_PHY_TYPE 0x00000000
268 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_EMAC0 0x04000000
269 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_EMAC1 0x08000000
270 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_BOTH 0x0c000000
271 #define SHARED_HW_CFG_MDC_MDIO_ACCESS1_SWAPPED 0x10000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200272
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300273 /* Set the MDC/MDIO access for the second external phy */
274 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_MASK 0xE0000000
275 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_SHIFT 29
276 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_PHY_TYPE 0x00000000
277 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_EMAC0 0x20000000
278 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_EMAC1 0x40000000
279 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_BOTH 0x60000000
280 #define SHARED_HW_CFG_MDC_MDIO_ACCESS2_SWAPPED 0x80000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200281
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200282
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300283 u32 power_dissipated; /* 0x11c */
284 #define SHARED_HW_CFG_POWER_MGNT_SCALE_MASK 0x00ff0000
285 #define SHARED_HW_CFG_POWER_MGNT_SCALE_SHIFT 16
286 #define SHARED_HW_CFG_POWER_MGNT_UNKNOWN_SCALE 0x00000000
287 #define SHARED_HW_CFG_POWER_MGNT_DOT_1_WATT 0x00010000
288 #define SHARED_HW_CFG_POWER_MGNT_DOT_01_WATT 0x00020000
289 #define SHARED_HW_CFG_POWER_MGNT_DOT_001_WATT 0x00030000
Eilon Greenstein35b19ba2009-02-12 08:36:47 +0000290
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300291 #define SHARED_HW_CFG_POWER_DIS_CMN_MASK 0xff000000
292 #define SHARED_HW_CFG_POWER_DIS_CMN_SHIFT 24
Eilon Greenstein35b19ba2009-02-12 08:36:47 +0000293
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300294 u32 ump_nc_si_config; /* 0x120 */
295 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MASK 0x00000003
296 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_SHIFT 0
297 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MAC 0x00000000
298 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_PHY 0x00000001
299 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_MII 0x00000000
300 #define SHARED_HW_CFG_UMP_NC_SI_MII_MODE_RMII 0x00000002
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200301
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300302 #define SHARED_HW_CFG_UMP_NC_SI_NUM_DEVS_MASK 0x00000f00
303 #define SHARED_HW_CFG_UMP_NC_SI_NUM_DEVS_SHIFT 8
304
305 #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_MASK 0x00ff0000
306 #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_SHIFT 16
307 #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_NONE 0x00000000
308 #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_BCM5221 0x00010000
309
310 u32 board; /* 0x124 */
311 #define SHARED_HW_CFG_E3_I2C_MUX0_MASK 0x0000003F
312 #define SHARED_HW_CFG_E3_I2C_MUX0_SHIFT 0
313 #define SHARED_HW_CFG_E3_I2C_MUX1_MASK 0x00000FC0
314 #define SHARED_HW_CFG_E3_I2C_MUX1_SHIFT 6
315 /* Use the PIN_CFG_XXX defines on top */
316 #define SHARED_HW_CFG_BOARD_REV_MASK 0x00ff0000
317 #define SHARED_HW_CFG_BOARD_REV_SHIFT 16
318
319 #define SHARED_HW_CFG_BOARD_MAJOR_VER_MASK 0x0f000000
320 #define SHARED_HW_CFG_BOARD_MAJOR_VER_SHIFT 24
321
322 #define SHARED_HW_CFG_BOARD_MINOR_VER_MASK 0xf0000000
323 #define SHARED_HW_CFG_BOARD_MINOR_VER_SHIFT 28
324
325 u32 wc_lane_config; /* 0x128 */
326 #define SHARED_HW_CFG_LANE_SWAP_CFG_MASK 0x0000FFFF
327 #define SHARED_HW_CFG_LANE_SWAP_CFG_SHIFT 0
328 #define SHARED_HW_CFG_LANE_SWAP_CFG_32103210 0x00001b1b
329 #define SHARED_HW_CFG_LANE_SWAP_CFG_32100123 0x00001be4
330 #define SHARED_HW_CFG_LANE_SWAP_CFG_01233210 0x0000e41b
331 #define SHARED_HW_CFG_LANE_SWAP_CFG_01230123 0x0000e4e4
332 #define SHARED_HW_CFG_LANE_SWAP_CFG_TX_MASK 0x000000FF
333 #define SHARED_HW_CFG_LANE_SWAP_CFG_TX_SHIFT 0
334 #define SHARED_HW_CFG_LANE_SWAP_CFG_RX_MASK 0x0000FF00
335 #define SHARED_HW_CFG_LANE_SWAP_CFG_RX_SHIFT 8
336
337 /* TX lane Polarity swap */
338 #define SHARED_HW_CFG_TX_LANE0_POL_FLIP_ENABLED 0x00010000
339 #define SHARED_HW_CFG_TX_LANE1_POL_FLIP_ENABLED 0x00020000
340 #define SHARED_HW_CFG_TX_LANE2_POL_FLIP_ENABLED 0x00040000
341 #define SHARED_HW_CFG_TX_LANE3_POL_FLIP_ENABLED 0x00080000
342 /* TX lane Polarity swap */
343 #define SHARED_HW_CFG_RX_LANE0_POL_FLIP_ENABLED 0x00100000
344 #define SHARED_HW_CFG_RX_LANE1_POL_FLIP_ENABLED 0x00200000
345 #define SHARED_HW_CFG_RX_LANE2_POL_FLIP_ENABLED 0x00400000
346 #define SHARED_HW_CFG_RX_LANE3_POL_FLIP_ENABLED 0x00800000
347
348 /* Selects the port layout of the board */
349 #define SHARED_HW_CFG_E3_PORT_LAYOUT_MASK 0x0F000000
350 #define SHARED_HW_CFG_E3_PORT_LAYOUT_SHIFT 24
351 #define SHARED_HW_CFG_E3_PORT_LAYOUT_2P_01 0x00000000
352 #define SHARED_HW_CFG_E3_PORT_LAYOUT_2P_10 0x01000000
353 #define SHARED_HW_CFG_E3_PORT_LAYOUT_4P_0123 0x02000000
354 #define SHARED_HW_CFG_E3_PORT_LAYOUT_4P_1032 0x03000000
355 #define SHARED_HW_CFG_E3_PORT_LAYOUT_4P_2301 0x04000000
356 #define SHARED_HW_CFG_E3_PORT_LAYOUT_4P_3210 0x05000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200357};
358
Eliezer Tamirf1410642008-02-28 11:51:50 -0800359
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200360/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300361 * Port HW configuration *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200362 ****************************************************************************/
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300363struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200364
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200365 u32 pci_id;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300366 #define PORT_HW_CFG_PCI_VENDOR_ID_MASK 0xffff0000
367 #define PORT_HW_CFG_PCI_DEVICE_ID_MASK 0x0000ffff
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200368
369 u32 pci_sub_id;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300370 #define PORT_HW_CFG_PCI_SUBSYS_DEVICE_ID_MASK 0xffff0000
371 #define PORT_HW_CFG_PCI_SUBSYS_VENDOR_ID_MASK 0x0000ffff
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200372
373 u32 power_dissipated;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300374 #define PORT_HW_CFG_POWER_DIS_D0_MASK 0x000000ff
375 #define PORT_HW_CFG_POWER_DIS_D0_SHIFT 0
376 #define PORT_HW_CFG_POWER_DIS_D1_MASK 0x0000ff00
377 #define PORT_HW_CFG_POWER_DIS_D1_SHIFT 8
378 #define PORT_HW_CFG_POWER_DIS_D2_MASK 0x00ff0000
379 #define PORT_HW_CFG_POWER_DIS_D2_SHIFT 16
380 #define PORT_HW_CFG_POWER_DIS_D3_MASK 0xff000000
381 #define PORT_HW_CFG_POWER_DIS_D3_SHIFT 24
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200382
383 u32 power_consumed;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300384 #define PORT_HW_CFG_POWER_CONS_D0_MASK 0x000000ff
385 #define PORT_HW_CFG_POWER_CONS_D0_SHIFT 0
386 #define PORT_HW_CFG_POWER_CONS_D1_MASK 0x0000ff00
387 #define PORT_HW_CFG_POWER_CONS_D1_SHIFT 8
388 #define PORT_HW_CFG_POWER_CONS_D2_MASK 0x00ff0000
389 #define PORT_HW_CFG_POWER_CONS_D2_SHIFT 16
390 #define PORT_HW_CFG_POWER_CONS_D3_MASK 0xff000000
391 #define PORT_HW_CFG_POWER_CONS_D3_SHIFT 24
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200392
393 u32 mac_upper;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300394 #define PORT_HW_CFG_UPPERMAC_MASK 0x0000ffff
395 #define PORT_HW_CFG_UPPERMAC_SHIFT 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200396 u32 mac_lower;
397
398 u32 iscsi_mac_upper; /* Upper 16 bits are always zeroes */
399 u32 iscsi_mac_lower;
400
401 u32 rdma_mac_upper; /* Upper 16 bits are always zeroes */
402 u32 rdma_mac_lower;
403
404 u32 serdes_config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300405 #define PORT_HW_CFG_SERDES_TX_DRV_PRE_EMPHASIS_MASK 0x0000ffff
406 #define PORT_HW_CFG_SERDES_TX_DRV_PRE_EMPHASIS_SHIFT 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200407
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300408 #define PORT_HW_CFG_SERDES_RX_DRV_EQUALIZER_MASK 0xffff0000
409 #define PORT_HW_CFG_SERDES_RX_DRV_EQUALIZER_SHIFT 16
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200410
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200411
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300412 /* Default values: 2P-64, 4P-32 */
413 u32 pf_config; /* 0x158 */
414 #define PORT_HW_CFG_PF_NUM_VF_MASK 0x0000007F
415 #define PORT_HW_CFG_PF_NUM_VF_SHIFT 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200416
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300417 /* Default values: 17 */
418 #define PORT_HW_CFG_PF_NUM_MSIX_VECTORS_MASK 0x00007F00
419 #define PORT_HW_CFG_PF_NUM_MSIX_VECTORS_SHIFT 8
Yaniv Rosner020c7e32011-05-31 21:28:43 +0000420
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300421 #define PORT_HW_CFG_ENABLE_FLR_MASK 0x00010000
422 #define PORT_HW_CFG_FLR_ENABLED 0x00010000
Yaniv Rosner020c7e32011-05-31 21:28:43 +0000423
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300424 u32 vf_config; /* 0x15C */
425 #define PORT_HW_CFG_VF_NUM_MSIX_VECTORS_MASK 0x0000007F
426 #define PORT_HW_CFG_VF_NUM_MSIX_VECTORS_SHIFT 0
Yaniv Rosner1ac9e422011-05-31 21:26:11 +0000427
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300428 #define PORT_HW_CFG_VF_PCI_DEVICE_ID_MASK 0xFFFF0000
429 #define PORT_HW_CFG_VF_PCI_DEVICE_ID_SHIFT 16
Yaniv Rosner1ac9e422011-05-31 21:26:11 +0000430
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300431 u32 mf_pci_id; /* 0x160 */
432 #define PORT_HW_CFG_MF_PCI_DEVICE_ID_MASK 0x0000FFFF
433 #define PORT_HW_CFG_MF_PCI_DEVICE_ID_SHIFT 0
Yaniv Rosner1ac9e422011-05-31 21:26:11 +0000434
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300435 /* Controls the TX laser of the SFP+ module */
436 u32 sfp_ctrl; /* 0x164 */
437 #define PORT_HW_CFG_TX_LASER_MASK 0x000000FF
438 #define PORT_HW_CFG_TX_LASER_SHIFT 0
439 #define PORT_HW_CFG_TX_LASER_MDIO 0x00000000
440 #define PORT_HW_CFG_TX_LASER_GPIO0 0x00000001
441 #define PORT_HW_CFG_TX_LASER_GPIO1 0x00000002
442 #define PORT_HW_CFG_TX_LASER_GPIO2 0x00000003
443 #define PORT_HW_CFG_TX_LASER_GPIO3 0x00000004
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200444
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300445 /* Controls the fault module LED of the SFP+ */
446 #define PORT_HW_CFG_FAULT_MODULE_LED_MASK 0x0000FF00
447 #define PORT_HW_CFG_FAULT_MODULE_LED_SHIFT 8
448 #define PORT_HW_CFG_FAULT_MODULE_LED_GPIO0 0x00000000
449 #define PORT_HW_CFG_FAULT_MODULE_LED_GPIO1 0x00000100
450 #define PORT_HW_CFG_FAULT_MODULE_LED_GPIO2 0x00000200
451 #define PORT_HW_CFG_FAULT_MODULE_LED_GPIO3 0x00000300
452 #define PORT_HW_CFG_FAULT_MODULE_LED_DISABLED 0x00000400
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200453
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300454 /* The output pin TX_DIS that controls the TX laser of the SFP+
455 module. Use the PIN_CFG_XXX defines on top */
456 u32 e3_sfp_ctrl; /* 0x168 */
457 #define PORT_HW_CFG_E3_TX_LASER_MASK 0x000000FF
458 #define PORT_HW_CFG_E3_TX_LASER_SHIFT 0
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000459
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300460 /* The output pin for SFPP_TYPE which turns on the Fault module LED */
461 #define PORT_HW_CFG_E3_FAULT_MDL_LED_MASK 0x0000FF00
462 #define PORT_HW_CFG_E3_FAULT_MDL_LED_SHIFT 8
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000463
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300464 /* The input pin MOD_ABS that indicates whether SFP+ module is
465 present or not. Use the PIN_CFG_XXX defines on top */
466 #define PORT_HW_CFG_E3_MOD_ABS_MASK 0x00FF0000
467 #define PORT_HW_CFG_E3_MOD_ABS_SHIFT 16
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000468
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300469 /* The output pin PWRDIS_SFP_X which disable the power of the SFP+
470 module. Use the PIN_CFG_XXX defines on top */
471 #define PORT_HW_CFG_E3_PWR_DIS_MASK 0xFF000000
472 #define PORT_HW_CFG_E3_PWR_DIS_SHIFT 24
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000473
474 /*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300475 * The input pin which signals module transmit fault. Use the
476 * PIN_CFG_XXX defines on top
Yaniv Rosnera8db5b42011-01-31 04:22:28 +0000477 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300478 u32 e3_cmn_pin_cfg; /* 0x16C */
479 #define PORT_HW_CFG_E3_TX_FAULT_MASK 0x000000FF
480 #define PORT_HW_CFG_E3_TX_FAULT_SHIFT 0
481
482 /* The output pin which reset the PHY. Use the PIN_CFG_XXX defines on
483 top */
484 #define PORT_HW_CFG_E3_PHY_RESET_MASK 0x0000FF00
485 #define PORT_HW_CFG_E3_PHY_RESET_SHIFT 8
486
487 /*
488 * The output pin which powers down the PHY. Use the PIN_CFG_XXX
489 * defines on top
490 */
491 #define PORT_HW_CFG_E3_PWR_DOWN_MASK 0x00FF0000
492 #define PORT_HW_CFG_E3_PWR_DOWN_SHIFT 16
493
494 /* The output pin values BSC_SEL which selects the I2C for this port
495 in the I2C Mux */
496 #define PORT_HW_CFG_E3_I2C_MUX0_MASK 0x01000000
497 #define PORT_HW_CFG_E3_I2C_MUX1_MASK 0x02000000
498
499
500 /*
501 * The input pin I_FAULT which indicate over-current has occurred.
502 * Use the PIN_CFG_XXX defines on top
503 */
504 u32 e3_cmn_pin_cfg1; /* 0x170 */
505 #define PORT_HW_CFG_E3_OVER_CURRENT_MASK 0x000000FF
506 #define PORT_HW_CFG_E3_OVER_CURRENT_SHIFT 0
507 u32 reserved0[7]; /* 0x174 */
508
509 u32 aeu_int_mask; /* 0x190 */
510
511 u32 media_type; /* 0x194 */
512 #define PORT_HW_CFG_MEDIA_TYPE_PHY0_MASK 0x000000FF
513 #define PORT_HW_CFG_MEDIA_TYPE_PHY0_SHIFT 0
514
515 #define PORT_HW_CFG_MEDIA_TYPE_PHY1_MASK 0x0000FF00
516 #define PORT_HW_CFG_MEDIA_TYPE_PHY1_SHIFT 8
517
518 #define PORT_HW_CFG_MEDIA_TYPE_PHY2_MASK 0x00FF0000
519 #define PORT_HW_CFG_MEDIA_TYPE_PHY2_SHIFT 16
520
521 /* 4 times 16 bits for all 4 lanes. In case external PHY is present
522 (not direct mode), those values will not take effect on the 4 XGXS
523 lanes. For some external PHYs (such as 8706 and 8726) the values
524 will be used to configure the external PHY in those cases, not
525 all 4 values are needed. */
526 u16 xgxs_config_rx[4]; /* 0x198 */
527 u16 xgxs_config_tx[4]; /* 0x1A0 */
528
529 /* For storing FCOE mac on shared memory */
530 u32 fcoe_fip_mac_upper;
531 #define PORT_HW_CFG_FCOE_UPPERMAC_MASK 0x0000ffff
532 #define PORT_HW_CFG_FCOE_UPPERMAC_SHIFT 0
533 u32 fcoe_fip_mac_lower;
534
535 u32 fcoe_wwn_port_name_upper;
536 u32 fcoe_wwn_port_name_lower;
537
538 u32 fcoe_wwn_node_name_upper;
539 u32 fcoe_wwn_node_name_lower;
540
541 u32 Reserved1[50]; /* 0x1C0 */
542
543 u32 default_cfg; /* 0x288 */
544 #define PORT_HW_CFG_GPIO0_CONFIG_MASK 0x00000003
545 #define PORT_HW_CFG_GPIO0_CONFIG_SHIFT 0
546 #define PORT_HW_CFG_GPIO0_CONFIG_NA 0x00000000
547 #define PORT_HW_CFG_GPIO0_CONFIG_LOW 0x00000001
548 #define PORT_HW_CFG_GPIO0_CONFIG_HIGH 0x00000002
549 #define PORT_HW_CFG_GPIO0_CONFIG_INPUT 0x00000003
550
551 #define PORT_HW_CFG_GPIO1_CONFIG_MASK 0x0000000C
552 #define PORT_HW_CFG_GPIO1_CONFIG_SHIFT 2
553 #define PORT_HW_CFG_GPIO1_CONFIG_NA 0x00000000
554 #define PORT_HW_CFG_GPIO1_CONFIG_LOW 0x00000004
555 #define PORT_HW_CFG_GPIO1_CONFIG_HIGH 0x00000008
556 #define PORT_HW_CFG_GPIO1_CONFIG_INPUT 0x0000000c
557
558 #define PORT_HW_CFG_GPIO2_CONFIG_MASK 0x00000030
559 #define PORT_HW_CFG_GPIO2_CONFIG_SHIFT 4
560 #define PORT_HW_CFG_GPIO2_CONFIG_NA 0x00000000
561 #define PORT_HW_CFG_GPIO2_CONFIG_LOW 0x00000010
562 #define PORT_HW_CFG_GPIO2_CONFIG_HIGH 0x00000020
563 #define PORT_HW_CFG_GPIO2_CONFIG_INPUT 0x00000030
564
565 #define PORT_HW_CFG_GPIO3_CONFIG_MASK 0x000000C0
566 #define PORT_HW_CFG_GPIO3_CONFIG_SHIFT 6
567 #define PORT_HW_CFG_GPIO3_CONFIG_NA 0x00000000
568 #define PORT_HW_CFG_GPIO3_CONFIG_LOW 0x00000040
569 #define PORT_HW_CFG_GPIO3_CONFIG_HIGH 0x00000080
570 #define PORT_HW_CFG_GPIO3_CONFIG_INPUT 0x000000c0
571
572 /* When KR link is required to be set to force which is not
573 KR-compliant, this parameter determine what is the trigger for it.
574 When GPIO is selected, low input will force the speed. Currently
575 default speed is 1G. In the future, it may be widen to select the
576 forced speed in with another parameter. Note when force-1G is
577 enabled, it override option 56: Link Speed option. */
578 #define PORT_HW_CFG_FORCE_KR_ENABLER_MASK 0x00000F00
579 #define PORT_HW_CFG_FORCE_KR_ENABLER_SHIFT 8
580 #define PORT_HW_CFG_FORCE_KR_ENABLER_NOT_FORCED 0x00000000
581 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO0_P0 0x00000100
582 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO1_P0 0x00000200
583 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO2_P0 0x00000300
584 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO3_P0 0x00000400
585 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO0_P1 0x00000500
586 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO1_P1 0x00000600
587 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO2_P1 0x00000700
588 #define PORT_HW_CFG_FORCE_KR_ENABLER_GPIO3_P1 0x00000800
589 #define PORT_HW_CFG_FORCE_KR_ENABLER_FORCED 0x00000900
590 /* Enable to determine with which GPIO to reset the external phy */
591 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_MASK 0x000F0000
592 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_SHIFT 16
593 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_PHY_TYPE 0x00000000
594 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO0_P0 0x00010000
595 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO1_P0 0x00020000
596 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO2_P0 0x00030000
597 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO3_P0 0x00040000
598 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO0_P1 0x00050000
599 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO1_P1 0x00060000
600 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO2_P1 0x00070000
601 #define PORT_HW_CFG_EXT_PHY_GPIO_RST_GPIO3_P1 0x00080000
602
Yaniv Rosner121839b2010-11-01 05:32:38 +0000603 /* Enable BAM on KR */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300604 #define PORT_HW_CFG_ENABLE_BAM_ON_KR_MASK 0x00100000
605 #define PORT_HW_CFG_ENABLE_BAM_ON_KR_SHIFT 20
606 #define PORT_HW_CFG_ENABLE_BAM_ON_KR_DISABLED 0x00000000
607 #define PORT_HW_CFG_ENABLE_BAM_ON_KR_ENABLED 0x00100000
Yaniv Rosner121839b2010-11-01 05:32:38 +0000608
Yaniv Rosner1bef68e2011-01-31 04:22:46 +0000609 /* Enable Common Mode Sense */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300610 #define PORT_HW_CFG_ENABLE_CMS_MASK 0x00200000
611 #define PORT_HW_CFG_ENABLE_CMS_SHIFT 21
612 #define PORT_HW_CFG_ENABLE_CMS_DISABLED 0x00000000
613 #define PORT_HW_CFG_ENABLE_CMS_ENABLED 0x00200000
614
615 /* Enable RJ45 magjack pair swapping on 10GBase-T PHY, 84833 only */
616 #define PORT_HW_CFG_RJ45_PR_SWP_MASK 0x00400000
617 #define PORT_HW_CFG_RJ45_PR_SWP_SHIFT 22
618 #define PORT_HW_CFG_RJ45_PR_SWP_DISABLED 0x00000000
619 #define PORT_HW_CFG_RJ45_PR_SWP_ENABLED 0x00400000
620
621 /* Determine the Serdes electrical interface */
622 #define PORT_HW_CFG_NET_SERDES_IF_MASK 0x0F000000
623 #define PORT_HW_CFG_NET_SERDES_IF_SHIFT 24
624 #define PORT_HW_CFG_NET_SERDES_IF_SGMII 0x00000000
625 #define PORT_HW_CFG_NET_SERDES_IF_XFI 0x01000000
626 #define PORT_HW_CFG_NET_SERDES_IF_SFI 0x02000000
627 #define PORT_HW_CFG_NET_SERDES_IF_KR 0x03000000
628 #define PORT_HW_CFG_NET_SERDES_IF_DXGXS 0x04000000
629 #define PORT_HW_CFG_NET_SERDES_IF_KR2 0x05000000
630
Yaniv Rosner1bef68e2011-01-31 04:22:46 +0000631
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000632 u32 speed_capability_mask2; /* 0x28C */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300633 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_MASK 0x0000FFFF
634 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_SHIFT 0
635 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_10M_FULL 0x00000001
636 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3__ 0x00000002
637 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3___ 0x00000004
638 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_100M_FULL 0x00000008
639 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_1G 0x00000010
640 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_2_DOT_5G 0x00000020
641 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_10G 0x00000040
642 #define PORT_HW_CFG_SPEED_CAPABILITY2_D3_20G 0x00000080
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000643
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300644 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_MASK 0xFFFF0000
645 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_SHIFT 16
646 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_10M_FULL 0x00010000
647 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0__ 0x00020000
648 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0___ 0x00040000
649 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_100M_FULL 0x00080000
650 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_1G 0x00100000
651 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_2_DOT_5G 0x00200000
652 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_10G 0x00400000
653 #define PORT_HW_CFG_SPEED_CAPABILITY2_D0_20G 0x00800000
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000654
655
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300656 /* In the case where two media types (e.g. copper and fiber) are
657 present and electrically active at the same time, PHY Selection
658 will determine which of the two PHYs will be designated as the
659 Active PHY and used for a connection to the network. */
660 u32 multi_phy_config; /* 0x290 */
661 #define PORT_HW_CFG_PHY_SELECTION_MASK 0x00000007
662 #define PORT_HW_CFG_PHY_SELECTION_SHIFT 0
663 #define PORT_HW_CFG_PHY_SELECTION_HARDWARE_DEFAULT 0x00000000
664 #define PORT_HW_CFG_PHY_SELECTION_FIRST_PHY 0x00000001
665 #define PORT_HW_CFG_PHY_SELECTION_SECOND_PHY 0x00000002
666 #define PORT_HW_CFG_PHY_SELECTION_FIRST_PHY_PRIORITY 0x00000003
667 #define PORT_HW_CFG_PHY_SELECTION_SECOND_PHY_PRIORITY 0x00000004
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000668
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300669 /* When enabled, all second phy nvram parameters will be swapped
670 with the first phy parameters */
671 #define PORT_HW_CFG_PHY_SWAPPED_MASK 0x00000008
672 #define PORT_HW_CFG_PHY_SWAPPED_SHIFT 3
673 #define PORT_HW_CFG_PHY_SWAPPED_DISABLED 0x00000000
674 #define PORT_HW_CFG_PHY_SWAPPED_ENABLED 0x00000008
Yaniv Rosnera22f0782010-09-07 11:41:20 +0000675
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300676
677 /* Address of the second external phy */
678 u32 external_phy_config2; /* 0x294 */
679 #define PORT_HW_CFG_XGXS_EXT_PHY2_ADDR_MASK 0x000000FF
680 #define PORT_HW_CFG_XGXS_EXT_PHY2_ADDR_SHIFT 0
681
682 /* The second XGXS external PHY type */
683 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_MASK 0x0000FF00
684 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_SHIFT 8
685 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_DIRECT 0x00000000
686 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8071 0x00000100
687 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8072 0x00000200
688 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8073 0x00000300
689 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8705 0x00000400
690 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8706 0x00000500
691 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8726 0x00000600
692 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8481 0x00000700
693 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_SFX7101 0x00000800
694 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8727 0x00000900
695 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8727_NOC 0x00000a00
696 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84823 0x00000b00
697 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54640 0x00000c00
698 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84833 0x00000d00
Yaniv Rosner52c4d6c2011-07-05 01:06:34 +0000699 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54618SE 0x00000e00
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300700 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8722 0x00000f00
701 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_FAILURE 0x0000fd00
702 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_NOT_CONN 0x0000ff00
703
704
705 /* 4 times 16 bits for all 4 lanes. For some external PHYs (such as
706 8706, 8726 and 8727) not all 4 values are needed. */
707 u16 xgxs_config2_rx[4]; /* 0x296 */
708 u16 xgxs_config2_tx[4]; /* 0x2A0 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200709
710 u32 lane_config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300711 #define PORT_HW_CFG_LANE_SWAP_CFG_MASK 0x0000ffff
712 #define PORT_HW_CFG_LANE_SWAP_CFG_SHIFT 0
713 /* AN and forced */
714 #define PORT_HW_CFG_LANE_SWAP_CFG_01230123 0x00001b1b
715 /* forced only */
716 #define PORT_HW_CFG_LANE_SWAP_CFG_01233210 0x00001be4
717 /* forced only */
718 #define PORT_HW_CFG_LANE_SWAP_CFG_31203120 0x0000d8d8
719 /* forced only */
720 #define PORT_HW_CFG_LANE_SWAP_CFG_32103210 0x0000e4e4
721 #define PORT_HW_CFG_LANE_SWAP_CFG_TX_MASK 0x000000ff
722 #define PORT_HW_CFG_LANE_SWAP_CFG_TX_SHIFT 0
723 #define PORT_HW_CFG_LANE_SWAP_CFG_RX_MASK 0x0000ff00
724 #define PORT_HW_CFG_LANE_SWAP_CFG_RX_SHIFT 8
725 #define PORT_HW_CFG_LANE_SWAP_CFG_MASTER_MASK 0x0000c000
726 #define PORT_HW_CFG_LANE_SWAP_CFG_MASTER_SHIFT 14
Dmitry Kravkov523224a2010-10-06 03:23:26 +0000727
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300728 /* Indicate whether to swap the external phy polarity */
729 #define PORT_HW_CFG_SWAP_PHY_POLARITY_MASK 0x00010000
730 #define PORT_HW_CFG_SWAP_PHY_POLARITY_DISABLED 0x00000000
731 #define PORT_HW_CFG_SWAP_PHY_POLARITY_ENABLED 0x00010000
732
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200733
734 u32 external_phy_config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300735 #define PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK 0x000000ff
736 #define PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200737
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300738 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK 0x0000ff00
739 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SHIFT 8
740 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT 0x00000000
741 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8071 0x00000100
742 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8072 0x00000200
743 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073 0x00000300
744 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705 0x00000400
745 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706 0x00000500
746 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726 0x00000600
747 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481 0x00000700
748 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101 0x00000800
749 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727 0x00000900
750 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727_NOC 0x00000a00
751 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823 0x00000b00
752 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54640 0x00000c00
753 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833 0x00000d00
Yaniv Rosner52c4d6c2011-07-05 01:06:34 +0000754 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE 0x00000e00
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300755 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8722 0x00000f00
756 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT_WC 0x0000fc00
757 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE 0x0000fd00
758 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN 0x0000ff00
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200759
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300760 #define PORT_HW_CFG_SERDES_EXT_PHY_ADDR_MASK 0x00ff0000
761 #define PORT_HW_CFG_SERDES_EXT_PHY_ADDR_SHIFT 16
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200762
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300763 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK 0xff000000
764 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_SHIFT 24
765 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_DIRECT 0x00000000
766 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_BCM5482 0x01000000
767 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_DIRECT_SD 0x02000000
768 #define PORT_HW_CFG_SERDES_EXT_PHY_TYPE_NOT_CONN 0xff000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200769
770 u32 speed_capability_mask;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300771 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_MASK 0x0000ffff
772 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_SHIFT 0
773 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_10M_FULL 0x00000001
774 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_10M_HALF 0x00000002
775 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_100M_HALF 0x00000004
776 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_100M_FULL 0x00000008
777 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_1G 0x00000010
778 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_2_5G 0x00000020
779 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_10G 0x00000040
780 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_20G 0x00000080
781 #define PORT_HW_CFG_SPEED_CAPABILITY_D3_RESERVED 0x0000f000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200782
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300783 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_MASK 0xffff0000
784 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_SHIFT 16
785 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL 0x00010000
786 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF 0x00020000
787 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF 0x00040000
788 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL 0x00080000
789 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_1G 0x00100000
790 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G 0x00200000
791 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_10G 0x00400000
792 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_20G 0x00800000
793 #define PORT_HW_CFG_SPEED_CAPABILITY_D0_RESERVED 0xf0000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200794
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300795 /* A place to hold the original MAC address as a backup */
796 u32 backup_mac_upper; /* 0x2B4 */
797 u32 backup_mac_lower; /* 0x2B8 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200798
799};
800
Eliezer Tamirf1410642008-02-28 11:51:50 -0800801
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200802/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300803 * Shared Feature configuration *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200804 ****************************************************************************/
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300805struct shared_feat_cfg { /* NVRAM Offset */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800806
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300807 u32 config; /* 0x450 */
808 #define SHARED_FEATURE_BMC_ECHO_MODE_EN 0x00000001
Eilon Greenstein589abe32009-02-12 08:36:55 +0000809
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300810 /* Use NVRAM values instead of HW default values */
811 #define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_MASK \
812 0x00000002
813 #define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_DISABLED \
814 0x00000000
815 #define SHARED_FEAT_CFG_OVERRIDE_PREEMPHASIS_CFG_ENABLED \
816 0x00000002
Eilon Greenstein589abe32009-02-12 08:36:55 +0000817
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300818 #define SHARED_FEAT_CFG_NCSI_ID_METHOD_MASK 0x00000008
819 #define SHARED_FEAT_CFG_NCSI_ID_METHOD_SPIO 0x00000000
820 #define SHARED_FEAT_CFG_NCSI_ID_METHOD_NVRAM 0x00000008
821
822 #define SHARED_FEAT_CFG_NCSI_ID_MASK 0x00000030
823 #define SHARED_FEAT_CFG_NCSI_ID_SHIFT 4
824
825 /* Override the OTP back to single function mode. When using GPIO,
826 high means only SF, 0 is according to CLP configuration */
827 #define SHARED_FEAT_CFG_FORCE_SF_MODE_MASK 0x00000700
828 #define SHARED_FEAT_CFG_FORCE_SF_MODE_SHIFT 8
829 #define SHARED_FEAT_CFG_FORCE_SF_MODE_MF_ALLOWED 0x00000000
830 #define SHARED_FEAT_CFG_FORCE_SF_MODE_FORCED_SF 0x00000100
831 #define SHARED_FEAT_CFG_FORCE_SF_MODE_SPIO4 0x00000200
832 #define SHARED_FEAT_CFG_FORCE_SF_MODE_SWITCH_INDEPT 0x00000300
833
834 /* The interval in seconds between sending LLDP packets. Set to zero
835 to disable the feature */
836 #define SHARED_FEAT_CFG_LLDP_XMIT_INTERVAL_MASK 0x00ff0000
837 #define SHARED_FEAT_CFG_LLDP_XMIT_INTERVAL_SHIFT 16
838
839 /* The assigned device type ID for LLDP usage */
840 #define SHARED_FEAT_CFG_LLDP_DEVICE_TYPE_ID_MASK 0xff000000
841 #define SHARED_FEAT_CFG_LLDP_DEVICE_TYPE_ID_SHIFT 24
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200842
843};
844
845
846/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300847 * Port Feature configuration *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200848 ****************************************************************************/
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300849struct port_feat_cfg { /* port 0: 0x454 port 1: 0x4c8 */
Eliezer Tamirf1410642008-02-28 11:51:50 -0800850
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200851 u32 config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300852 #define PORT_FEATURE_BAR1_SIZE_MASK 0x0000000f
853 #define PORT_FEATURE_BAR1_SIZE_SHIFT 0
854 #define PORT_FEATURE_BAR1_SIZE_DISABLED 0x00000000
855 #define PORT_FEATURE_BAR1_SIZE_64K 0x00000001
856 #define PORT_FEATURE_BAR1_SIZE_128K 0x00000002
857 #define PORT_FEATURE_BAR1_SIZE_256K 0x00000003
858 #define PORT_FEATURE_BAR1_SIZE_512K 0x00000004
859 #define PORT_FEATURE_BAR1_SIZE_1M 0x00000005
860 #define PORT_FEATURE_BAR1_SIZE_2M 0x00000006
861 #define PORT_FEATURE_BAR1_SIZE_4M 0x00000007
862 #define PORT_FEATURE_BAR1_SIZE_8M 0x00000008
863 #define PORT_FEATURE_BAR1_SIZE_16M 0x00000009
864 #define PORT_FEATURE_BAR1_SIZE_32M 0x0000000a
865 #define PORT_FEATURE_BAR1_SIZE_64M 0x0000000b
866 #define PORT_FEATURE_BAR1_SIZE_128M 0x0000000c
867 #define PORT_FEATURE_BAR1_SIZE_256M 0x0000000d
868 #define PORT_FEATURE_BAR1_SIZE_512M 0x0000000e
869 #define PORT_FEATURE_BAR1_SIZE_1G 0x0000000f
870 #define PORT_FEATURE_BAR2_SIZE_MASK 0x000000f0
871 #define PORT_FEATURE_BAR2_SIZE_SHIFT 4
872 #define PORT_FEATURE_BAR2_SIZE_DISABLED 0x00000000
873 #define PORT_FEATURE_BAR2_SIZE_64K 0x00000010
874 #define PORT_FEATURE_BAR2_SIZE_128K 0x00000020
875 #define PORT_FEATURE_BAR2_SIZE_256K 0x00000030
876 #define PORT_FEATURE_BAR2_SIZE_512K 0x00000040
877 #define PORT_FEATURE_BAR2_SIZE_1M 0x00000050
878 #define PORT_FEATURE_BAR2_SIZE_2M 0x00000060
879 #define PORT_FEATURE_BAR2_SIZE_4M 0x00000070
880 #define PORT_FEATURE_BAR2_SIZE_8M 0x00000080
881 #define PORT_FEATURE_BAR2_SIZE_16M 0x00000090
882 #define PORT_FEATURE_BAR2_SIZE_32M 0x000000a0
883 #define PORT_FEATURE_BAR2_SIZE_64M 0x000000b0
884 #define PORT_FEATURE_BAR2_SIZE_128M 0x000000c0
885 #define PORT_FEATURE_BAR2_SIZE_256M 0x000000d0
886 #define PORT_FEATURE_BAR2_SIZE_512M 0x000000e0
887 #define PORT_FEATURE_BAR2_SIZE_1G 0x000000f0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200888
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300889 #define PORT_FEAT_CFG_DCBX_MASK 0x00000100
890 #define PORT_FEAT_CFG_DCBX_DISABLED 0x00000000
891 #define PORT_FEAT_CFG_DCBX_ENABLED 0x00000100
Eilon Greenstein4d295db2009-07-21 05:47:47 +0000892
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300893 #define PORT_FEAT_CFG_AUTOGREEN_MASK 0x00000200
894 #define PORT_FEAT_CFG_AUTOGREEN_SHIFT 9
895 #define PORT_FEAT_CFG_AUTOGREEN_DISABLED 0x00000000
896 #define PORT_FEAT_CFG_AUTOGREEN_ENABLED 0x00000200
897
898 #define PORT_FEATURE_EN_SIZE_MASK 0x0f000000
899 #define PORT_FEATURE_EN_SIZE_SHIFT 24
900 #define PORT_FEATURE_WOL_ENABLED 0x01000000
901 #define PORT_FEATURE_MBA_ENABLED 0x02000000
902 #define PORT_FEATURE_MFW_ENABLED 0x04000000
903
904 /* Advertise expansion ROM even if MBA is disabled */
905 #define PORT_FEAT_CFG_FORCE_EXP_ROM_ADV_MASK 0x08000000
906 #define PORT_FEAT_CFG_FORCE_EXP_ROM_ADV_DISABLED 0x00000000
907 #define PORT_FEAT_CFG_FORCE_EXP_ROM_ADV_ENABLED 0x08000000
908
909 /* Check the optic vendor via i2c against a list of approved modules
910 in a separate nvram image */
911 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK 0xe0000000
912 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_SHIFT 29
913 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_NO_ENFORCEMENT \
914 0x00000000
915 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER \
916 0x20000000
917 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_WARNING_MSG 0x40000000
918 #define PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_POWER_DOWN 0x60000000
Eilon Greenstein589abe32009-02-12 08:36:55 +0000919
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200920 u32 wol_config;
921 /* Default is used when driver sets to "auto" mode */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300922 #define PORT_FEATURE_WOL_DEFAULT_MASK 0x00000003
923 #define PORT_FEATURE_WOL_DEFAULT_SHIFT 0
924 #define PORT_FEATURE_WOL_DEFAULT_DISABLE 0x00000000
925 #define PORT_FEATURE_WOL_DEFAULT_MAGIC 0x00000001
926 #define PORT_FEATURE_WOL_DEFAULT_ACPI 0x00000002
927 #define PORT_FEATURE_WOL_DEFAULT_MAGIC_AND_ACPI 0x00000003
928 #define PORT_FEATURE_WOL_RES_PAUSE_CAP 0x00000004
929 #define PORT_FEATURE_WOL_RES_ASYM_PAUSE_CAP 0x00000008
930 #define PORT_FEATURE_WOL_ACPI_UPON_MGMT 0x00000010
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200931
932 u32 mba_config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300933 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_MASK 0x00000007
934 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_SHIFT 0
935 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_PXE 0x00000000
936 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_RPL 0x00000001
937 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_BOOTP 0x00000002
938 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_ISCSIB 0x00000003
939 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_FCOE_BOOT 0x00000004
940 #define PORT_FEATURE_MBA_BOOT_AGENT_TYPE_NONE 0x00000007
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200941
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300942 #define PORT_FEATURE_MBA_BOOT_RETRY_MASK 0x00000038
943 #define PORT_FEATURE_MBA_BOOT_RETRY_SHIFT 3
944
945 #define PORT_FEATURE_MBA_RES_PAUSE_CAP 0x00000100
946 #define PORT_FEATURE_MBA_RES_ASYM_PAUSE_CAP 0x00000200
947 #define PORT_FEATURE_MBA_SETUP_PROMPT_ENABLE 0x00000400
948 #define PORT_FEATURE_MBA_HOTKEY_MASK 0x00000800
949 #define PORT_FEATURE_MBA_HOTKEY_CTRL_S 0x00000000
950 #define PORT_FEATURE_MBA_HOTKEY_CTRL_B 0x00000800
951 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_MASK 0x000ff000
952 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_SHIFT 12
953 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_DISABLED 0x00000000
954 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_2K 0x00001000
955 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_4K 0x00002000
956 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_8K 0x00003000
957 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_16K 0x00004000
958 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_32K 0x00005000
959 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_64K 0x00006000
960 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_128K 0x00007000
961 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_256K 0x00008000
962 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_512K 0x00009000
963 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_1M 0x0000a000
964 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_2M 0x0000b000
965 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_4M 0x0000c000
966 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_8M 0x0000d000
967 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_16M 0x0000e000
968 #define PORT_FEATURE_MBA_EXP_ROM_SIZE_32M 0x0000f000
969 #define PORT_FEATURE_MBA_MSG_TIMEOUT_MASK 0x00f00000
970 #define PORT_FEATURE_MBA_MSG_TIMEOUT_SHIFT 20
971 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_MASK 0x03000000
972 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_SHIFT 24
973 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_AUTO 0x00000000
974 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_BBS 0x01000000
975 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT18H 0x02000000
976 #define PORT_FEATURE_MBA_BIOS_BOOTSTRAP_INT19H 0x03000000
977 #define PORT_FEATURE_MBA_LINK_SPEED_MASK 0x3c000000
978 #define PORT_FEATURE_MBA_LINK_SPEED_SHIFT 26
979 #define PORT_FEATURE_MBA_LINK_SPEED_AUTO 0x00000000
980 #define PORT_FEATURE_MBA_LINK_SPEED_10HD 0x04000000
981 #define PORT_FEATURE_MBA_LINK_SPEED_10FD 0x08000000
982 #define PORT_FEATURE_MBA_LINK_SPEED_100HD 0x0c000000
983 #define PORT_FEATURE_MBA_LINK_SPEED_100FD 0x10000000
984 #define PORT_FEATURE_MBA_LINK_SPEED_1GBPS 0x14000000
985 #define PORT_FEATURE_MBA_LINK_SPEED_2_5GBPS 0x18000000
986 #define PORT_FEATURE_MBA_LINK_SPEED_10GBPS_CX4 0x1c000000
987 #define PORT_FEATURE_MBA_LINK_SPEED_20GBPS 0x20000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200988 u32 bmc_config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300989 #define PORT_FEATURE_BMC_LINK_OVERRIDE_MASK 0x00000001
990 #define PORT_FEATURE_BMC_LINK_OVERRIDE_DEFAULT 0x00000000
991 #define PORT_FEATURE_BMC_LINK_OVERRIDE_EN 0x00000001
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200992
993 u32 mba_vlan_cfg;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300994 #define PORT_FEATURE_MBA_VLAN_TAG_MASK 0x0000ffff
995 #define PORT_FEATURE_MBA_VLAN_TAG_SHIFT 0
996 #define PORT_FEATURE_MBA_VLAN_EN 0x00010000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +0200997
998 u32 resource_cfg;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +0300999 #define PORT_FEATURE_RESOURCE_CFG_VALID 0x00000001
1000 #define PORT_FEATURE_RESOURCE_CFG_DIAG 0x00000002
1001 #define PORT_FEATURE_RESOURCE_CFG_L2 0x00000004
1002 #define PORT_FEATURE_RESOURCE_CFG_ISCSI 0x00000008
1003 #define PORT_FEATURE_RESOURCE_CFG_RDMA 0x00000010
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001004
1005 u32 smbus_config;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001006 #define PORT_FEATURE_SMBUS_ADDR_MASK 0x000000fe
1007 #define PORT_FEATURE_SMBUS_ADDR_SHIFT 1
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001008
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001009 u32 vf_config;
1010 #define PORT_FEAT_CFG_VF_BAR2_SIZE_MASK 0x0000000f
1011 #define PORT_FEAT_CFG_VF_BAR2_SIZE_SHIFT 0
1012 #define PORT_FEAT_CFG_VF_BAR2_SIZE_DISABLED 0x00000000
1013 #define PORT_FEAT_CFG_VF_BAR2_SIZE_4K 0x00000001
1014 #define PORT_FEAT_CFG_VF_BAR2_SIZE_8K 0x00000002
1015 #define PORT_FEAT_CFG_VF_BAR2_SIZE_16K 0x00000003
1016 #define PORT_FEAT_CFG_VF_BAR2_SIZE_32K 0x00000004
1017 #define PORT_FEAT_CFG_VF_BAR2_SIZE_64K 0x00000005
1018 #define PORT_FEAT_CFG_VF_BAR2_SIZE_128K 0x00000006
1019 #define PORT_FEAT_CFG_VF_BAR2_SIZE_256K 0x00000007
1020 #define PORT_FEAT_CFG_VF_BAR2_SIZE_512K 0x00000008
1021 #define PORT_FEAT_CFG_VF_BAR2_SIZE_1M 0x00000009
1022 #define PORT_FEAT_CFG_VF_BAR2_SIZE_2M 0x0000000a
1023 #define PORT_FEAT_CFG_VF_BAR2_SIZE_4M 0x0000000b
1024 #define PORT_FEAT_CFG_VF_BAR2_SIZE_8M 0x0000000c
1025 #define PORT_FEAT_CFG_VF_BAR2_SIZE_16M 0x0000000d
1026 #define PORT_FEAT_CFG_VF_BAR2_SIZE_32M 0x0000000e
1027 #define PORT_FEAT_CFG_VF_BAR2_SIZE_64M 0x0000000f
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001028
1029 u32 link_config; /* Used as HW defaults for the driver */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001030 #define PORT_FEATURE_CONNECTED_SWITCH_MASK 0x03000000
1031 #define PORT_FEATURE_CONNECTED_SWITCH_SHIFT 24
1032 /* (forced) low speed switch (< 10G) */
1033 #define PORT_FEATURE_CON_SWITCH_1G_SWITCH 0x00000000
1034 /* (forced) high speed switch (>= 10G) */
1035 #define PORT_FEATURE_CON_SWITCH_10G_SWITCH 0x01000000
1036 #define PORT_FEATURE_CON_SWITCH_AUTO_DETECT 0x02000000
1037 #define PORT_FEATURE_CON_SWITCH_ONE_TIME_DETECT 0x03000000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001038
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001039 #define PORT_FEATURE_LINK_SPEED_MASK 0x000f0000
1040 #define PORT_FEATURE_LINK_SPEED_SHIFT 16
1041 #define PORT_FEATURE_LINK_SPEED_AUTO 0x00000000
1042 #define PORT_FEATURE_LINK_SPEED_10M_FULL 0x00010000
1043 #define PORT_FEATURE_LINK_SPEED_10M_HALF 0x00020000
1044 #define PORT_FEATURE_LINK_SPEED_100M_HALF 0x00030000
1045 #define PORT_FEATURE_LINK_SPEED_100M_FULL 0x00040000
1046 #define PORT_FEATURE_LINK_SPEED_1G 0x00050000
1047 #define PORT_FEATURE_LINK_SPEED_2_5G 0x00060000
1048 #define PORT_FEATURE_LINK_SPEED_10G_CX4 0x00070000
1049 #define PORT_FEATURE_LINK_SPEED_20G 0x00080000
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001050
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001051 #define PORT_FEATURE_FLOW_CONTROL_MASK 0x00000700
1052 #define PORT_FEATURE_FLOW_CONTROL_SHIFT 8
1053 #define PORT_FEATURE_FLOW_CONTROL_AUTO 0x00000000
1054 #define PORT_FEATURE_FLOW_CONTROL_TX 0x00000100
1055 #define PORT_FEATURE_FLOW_CONTROL_RX 0x00000200
1056 #define PORT_FEATURE_FLOW_CONTROL_BOTH 0x00000300
1057 #define PORT_FEATURE_FLOW_CONTROL_NONE 0x00000400
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001058
1059 /* The default for MCP link configuration,
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001060 uses the same defines as link_config */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001061 u32 mfw_wol_link_cfg;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001062
Yaniv Rosnera22f0782010-09-07 11:41:20 +00001063 /* The default for the driver of the second external phy,
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001064 uses the same defines as link_config */
1065 u32 link_config2; /* 0x47C */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001066
Yaniv Rosnera22f0782010-09-07 11:41:20 +00001067 /* The default for MCP of the second external phy,
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001068 uses the same defines as link_config */
1069 u32 mfw_wol_link_cfg2; /* 0x480 */
Yaniv Rosnera22f0782010-09-07 11:41:20 +00001070
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001071 u32 Reserved2[17]; /* 0x484 */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001072
1073};
1074
1075
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001076/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001077 * Device Information *
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001078 ****************************************************************************/
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001079struct shm_dev_info { /* size */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001080
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001081 u32 bc_rev; /* 8 bits each: major, minor, build */ /* 4 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001082
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001083 struct shared_hw_cfg shared_hw_config; /* 40 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001084
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001085 struct port_hw_cfg port_hw_config[PORT_MAX]; /* 400*2=800 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001086
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001087 struct shared_feat_cfg shared_feature_config; /* 4 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001088
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001089 struct port_feat_cfg port_feature_config[PORT_MAX];/* 116*2=232 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001090
1091};
1092
1093
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001094#if !defined(__LITTLE_ENDIAN) && !defined(__BIG_ENDIAN)
1095 #error "Missing either LITTLE_ENDIAN or BIG_ENDIAN definition."
1096#endif
Eilon Greensteinad8d3942008-06-23 20:29:02 -07001097
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001098#define FUNC_0 0
1099#define FUNC_1 1
1100#define FUNC_2 2
1101#define FUNC_3 3
1102#define FUNC_4 4
1103#define FUNC_5 5
1104#define FUNC_6 6
1105#define FUNC_7 7
1106#define E1_FUNC_MAX 2
1107#define E1H_FUNC_MAX 8
1108#define E2_FUNC_MAX 4 /* per path */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001109
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001110#define VN_0 0
1111#define VN_1 1
1112#define VN_2 2
1113#define VN_3 3
1114#define E1VN_MAX 1
1115#define E1HVN_MAX 4
1116
1117#define E2_VF_MAX 64 /* HC_REG_VF_CONFIGURATION_SIZE */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001118/* This value (in milliseconds) determines the frequency of the driver
1119 * issuing the PULSE message code. The firmware monitors this periodic
1120 * pulse to determine when to switch to an OS-absent mode. */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001121#define DRV_PULSE_PERIOD_MS 250
Eliezer Tamirf1410642008-02-28 11:51:50 -08001122
1123/* This value (in milliseconds) determines how long the driver should
1124 * wait for an acknowledgement from the firmware before timing out. Once
1125 * the firmware has timed out, the driver will assume there is no firmware
1126 * running and there won't be any firmware-driver synchronization during a
1127 * driver reset. */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001128#define FW_ACK_TIME_OUT_MS 5000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001129
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001130#define FW_ACK_POLL_TIME_MS 1
Eliezer Tamirf1410642008-02-28 11:51:50 -08001131
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001132#define FW_ACK_NUM_OF_POLL (FW_ACK_TIME_OUT_MS/FW_ACK_POLL_TIME_MS)
Eliezer Tamirf1410642008-02-28 11:51:50 -08001133
1134/* LED Blink rate that will achieve ~15.9Hz */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001135#define LED_BLINK_RATE_VAL 480
Eliezer Tamirf1410642008-02-28 11:51:50 -08001136
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001137/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001138 * Driver <-> FW Mailbox *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001139 ****************************************************************************/
Eliezer Tamirf1410642008-02-28 11:51:50 -08001140struct drv_port_mb {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001141
Eliezer Tamirf1410642008-02-28 11:51:50 -08001142 u32 link_status;
1143 /* Driver should update this field on any link change event */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001144
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001145 #define LINK_STATUS_LINK_FLAG_MASK 0x00000001
1146 #define LINK_STATUS_LINK_UP 0x00000001
1147 #define LINK_STATUS_SPEED_AND_DUPLEX_MASK 0x0000001E
1148 #define LINK_STATUS_SPEED_AND_DUPLEX_AN_NOT_COMPLETE (0<<1)
1149 #define LINK_STATUS_SPEED_AND_DUPLEX_10THD (1<<1)
1150 #define LINK_STATUS_SPEED_AND_DUPLEX_10TFD (2<<1)
1151 #define LINK_STATUS_SPEED_AND_DUPLEX_100TXHD (3<<1)
1152 #define LINK_STATUS_SPEED_AND_DUPLEX_100T4 (4<<1)
1153 #define LINK_STATUS_SPEED_AND_DUPLEX_100TXFD (5<<1)
1154 #define LINK_STATUS_SPEED_AND_DUPLEX_1000THD (6<<1)
1155 #define LINK_STATUS_SPEED_AND_DUPLEX_1000TFD (7<<1)
1156 #define LINK_STATUS_SPEED_AND_DUPLEX_1000XFD (7<<1)
1157 #define LINK_STATUS_SPEED_AND_DUPLEX_2500THD (8<<1)
1158 #define LINK_STATUS_SPEED_AND_DUPLEX_2500TFD (9<<1)
1159 #define LINK_STATUS_SPEED_AND_DUPLEX_2500XFD (9<<1)
1160 #define LINK_STATUS_SPEED_AND_DUPLEX_10GTFD (10<<1)
1161 #define LINK_STATUS_SPEED_AND_DUPLEX_10GXFD (10<<1)
1162 #define LINK_STATUS_SPEED_AND_DUPLEX_20GTFD (11<<1)
1163 #define LINK_STATUS_SPEED_AND_DUPLEX_20GXFD (11<<1)
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001164
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001165 #define LINK_STATUS_AUTO_NEGOTIATE_FLAG_MASK 0x00000020
1166 #define LINK_STATUS_AUTO_NEGOTIATE_ENABLED 0x00000020
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001167
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001168 #define LINK_STATUS_AUTO_NEGOTIATE_COMPLETE 0x00000040
1169 #define LINK_STATUS_PARALLEL_DETECTION_FLAG_MASK 0x00000080
1170 #define LINK_STATUS_PARALLEL_DETECTION_USED 0x00000080
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001171
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001172 #define LINK_STATUS_LINK_PARTNER_1000TFD_CAPABLE 0x00000200
1173 #define LINK_STATUS_LINK_PARTNER_1000THD_CAPABLE 0x00000400
1174 #define LINK_STATUS_LINK_PARTNER_100T4_CAPABLE 0x00000800
1175 #define LINK_STATUS_LINK_PARTNER_100TXFD_CAPABLE 0x00001000
1176 #define LINK_STATUS_LINK_PARTNER_100TXHD_CAPABLE 0x00002000
1177 #define LINK_STATUS_LINK_PARTNER_10TFD_CAPABLE 0x00004000
1178 #define LINK_STATUS_LINK_PARTNER_10THD_CAPABLE 0x00008000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001179
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001180 #define LINK_STATUS_TX_FLOW_CONTROL_FLAG_MASK 0x00010000
1181 #define LINK_STATUS_TX_FLOW_CONTROL_ENABLED 0x00010000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001182
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001183 #define LINK_STATUS_RX_FLOW_CONTROL_FLAG_MASK 0x00020000
1184 #define LINK_STATUS_RX_FLOW_CONTROL_ENABLED 0x00020000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001185
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001186 #define LINK_STATUS_LINK_PARTNER_FLOW_CONTROL_MASK 0x000C0000
1187 #define LINK_STATUS_LINK_PARTNER_NOT_PAUSE_CAPABLE (0<<18)
1188 #define LINK_STATUS_LINK_PARTNER_SYMMETRIC_PAUSE (1<<18)
1189 #define LINK_STATUS_LINK_PARTNER_ASYMMETRIC_PAUSE (2<<18)
1190 #define LINK_STATUS_LINK_PARTNER_BOTH_PAUSE (3<<18)
Eliezer Tamirf1410642008-02-28 11:51:50 -08001191
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001192 #define LINK_STATUS_SERDES_LINK 0x00100000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001193
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001194 #define LINK_STATUS_LINK_PARTNER_2500XFD_CAPABLE 0x00200000
1195 #define LINK_STATUS_LINK_PARTNER_2500XHD_CAPABLE 0x00400000
1196 #define LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE 0x00800000
1197 #define LINK_STATUS_LINK_PARTNER_20GXFD_CAPABLE 0x10000000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001198
Yaniv Rosnerb8d6d082011-07-05 01:06:27 +00001199 #define LINK_STATUS_PFC_ENABLED 0x20000000
1200
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001201 u32 port_stx;
1202
Eilon Greensteinde832a52009-02-12 08:36:33 +00001203 u32 stat_nig_timer;
1204
Eilon Greensteina35da8d2009-02-12 08:37:02 +00001205 /* MCP firmware does not use this field */
1206 u32 ext_phy_fw_version;
Eliezer Tamirf1410642008-02-28 11:51:50 -08001207
1208};
1209
1210
1211struct drv_func_mb {
1212
1213 u32 drv_mb_header;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001214 #define DRV_MSG_CODE_MASK 0xffff0000
1215 #define DRV_MSG_CODE_LOAD_REQ 0x10000000
1216 #define DRV_MSG_CODE_LOAD_DONE 0x11000000
1217 #define DRV_MSG_CODE_UNLOAD_REQ_WOL_EN 0x20000000
1218 #define DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS 0x20010000
1219 #define DRV_MSG_CODE_UNLOAD_REQ_WOL_MCP 0x20020000
1220 #define DRV_MSG_CODE_UNLOAD_DONE 0x21000000
1221 #define DRV_MSG_CODE_DCC_OK 0x30000000
1222 #define DRV_MSG_CODE_DCC_FAILURE 0x31000000
1223 #define DRV_MSG_CODE_DIAG_ENTER_REQ 0x50000000
1224 #define DRV_MSG_CODE_DIAG_EXIT_REQ 0x60000000
1225 #define DRV_MSG_CODE_VALIDATE_KEY 0x70000000
1226 #define DRV_MSG_CODE_GET_CURR_KEY 0x80000000
1227 #define DRV_MSG_CODE_GET_UPGRADE_KEY 0x81000000
1228 #define DRV_MSG_CODE_GET_MANUF_KEY 0x82000000
1229 #define DRV_MSG_CODE_LOAD_L2B_PRAM 0x90000000
Eilon Greenstein4d295db2009-07-21 05:47:47 +00001230 /*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001231 * The optic module verification command requires bootcode
1232 * v5.0.6 or later, te specific optic module verification command
1233 * requires bootcode v5.2.12 or later
Eilon Greenstein4d295db2009-07-21 05:47:47 +00001234 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001235 #define DRV_MSG_CODE_VRFY_FIRST_PHY_OPT_MDL 0xa0000000
1236 #define REQ_BC_VER_4_VRFY_FIRST_PHY_OPT_MDL 0x00050006
1237 #define DRV_MSG_CODE_VRFY_SPECIFIC_PHY_OPT_MDL 0xa1000000
1238 #define REQ_BC_VER_4_VRFY_SPECIFIC_PHY_OPT_MDL 0x00050234
Eliezer Tamirf1410642008-02-28 11:51:50 -08001239
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001240 #define DRV_MSG_CODE_DCBX_ADMIN_PMF_MSG 0xb0000000
1241 #define DRV_MSG_CODE_DCBX_PMF_DRV_OK 0xb2000000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001242
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001243 #define DRV_MSG_CODE_VF_DISABLED_DONE 0xc0000000
1244
1245 #define DRV_MSG_CODE_SET_MF_BW 0xe0000000
1246 #define REQ_BC_VER_4_SET_MF_BW 0x00060202
1247 #define DRV_MSG_CODE_SET_MF_BW_ACK 0xe1000000
1248
1249 #define DRV_MSG_CODE_LINK_STATUS_CHANGED 0x01000000
1250
1251 #define BIOS_MSG_CODE_LIC_CHALLENGE 0xff010000
1252 #define BIOS_MSG_CODE_LIC_RESPONSE 0xff020000
1253 #define BIOS_MSG_CODE_VIRT_MAC_PRIM 0xff030000
1254 #define BIOS_MSG_CODE_VIRT_MAC_ISCSI 0xff040000
1255
1256 #define DRV_MSG_SEQ_NUMBER_MASK 0x0000ffff
Eliezer Tamirf1410642008-02-28 11:51:50 -08001257
1258 u32 drv_mb_param;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001259 #define DRV_MSG_CODE_SET_MF_BW_MIN_MASK 0x00ff0000
1260 #define DRV_MSG_CODE_SET_MF_BW_MAX_MASK 0xff000000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001261
1262 u32 fw_mb_header;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001263 #define FW_MSG_CODE_MASK 0xffff0000
1264 #define FW_MSG_CODE_DRV_LOAD_COMMON 0x10100000
1265 #define FW_MSG_CODE_DRV_LOAD_PORT 0x10110000
1266 #define FW_MSG_CODE_DRV_LOAD_FUNCTION 0x10120000
1267 /* Load common chip is supported from bc 6.0.0 */
1268 #define REQ_BC_VER_4_DRV_LOAD_COMMON_CHIP 0x00060000
1269 #define FW_MSG_CODE_DRV_LOAD_COMMON_CHIP 0x10130000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001270
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001271 #define FW_MSG_CODE_DRV_LOAD_REFUSED 0x10200000
1272 #define FW_MSG_CODE_DRV_LOAD_DONE 0x11100000
1273 #define FW_MSG_CODE_DRV_UNLOAD_COMMON 0x20100000
1274 #define FW_MSG_CODE_DRV_UNLOAD_PORT 0x20110000
1275 #define FW_MSG_CODE_DRV_UNLOAD_FUNCTION 0x20120000
1276 #define FW_MSG_CODE_DRV_UNLOAD_DONE 0x21100000
1277 #define FW_MSG_CODE_DCC_DONE 0x30100000
1278 #define FW_MSG_CODE_LLDP_DONE 0x40100000
1279 #define FW_MSG_CODE_DIAG_ENTER_DONE 0x50100000
1280 #define FW_MSG_CODE_DIAG_REFUSE 0x50200000
1281 #define FW_MSG_CODE_DIAG_EXIT_DONE 0x60100000
1282 #define FW_MSG_CODE_VALIDATE_KEY_SUCCESS 0x70100000
1283 #define FW_MSG_CODE_VALIDATE_KEY_FAILURE 0x70200000
1284 #define FW_MSG_CODE_GET_KEY_DONE 0x80100000
1285 #define FW_MSG_CODE_NO_KEY 0x80f00000
1286 #define FW_MSG_CODE_LIC_INFO_NOT_READY 0x80f80000
1287 #define FW_MSG_CODE_L2B_PRAM_LOADED 0x90100000
1288 #define FW_MSG_CODE_L2B_PRAM_T_LOAD_FAILURE 0x90210000
1289 #define FW_MSG_CODE_L2B_PRAM_C_LOAD_FAILURE 0x90220000
1290 #define FW_MSG_CODE_L2B_PRAM_X_LOAD_FAILURE 0x90230000
1291 #define FW_MSG_CODE_L2B_PRAM_U_LOAD_FAILURE 0x90240000
1292 #define FW_MSG_CODE_VRFY_OPT_MDL_SUCCESS 0xa0100000
1293 #define FW_MSG_CODE_VRFY_OPT_MDL_INVLD_IMG 0xa0200000
1294 #define FW_MSG_CODE_VRFY_OPT_MDL_UNAPPROVED 0xa0300000
1295 #define FW_MSG_CODE_VF_DISABLED_DONE 0xb0000000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001296
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001297 #define FW_MSG_CODE_SET_MF_BW_SENT 0xe0000000
1298 #define FW_MSG_CODE_SET_MF_BW_DONE 0xe1000000
1299
1300 #define FW_MSG_CODE_LINK_CHANGED_ACK 0x01100000
1301
1302 #define FW_MSG_CODE_LIC_CHALLENGE 0xff010000
1303 #define FW_MSG_CODE_LIC_RESPONSE 0xff020000
1304 #define FW_MSG_CODE_VIRT_MAC_PRIM 0xff030000
1305 #define FW_MSG_CODE_VIRT_MAC_ISCSI 0xff040000
1306
1307 #define FW_MSG_SEQ_NUMBER_MASK 0x0000ffff
Eliezer Tamirf1410642008-02-28 11:51:50 -08001308
1309 u32 fw_mb_param;
1310
1311 u32 drv_pulse_mb;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001312 #define DRV_PULSE_SEQ_MASK 0x00007fff
1313 #define DRV_PULSE_SYSTEM_TIME_MASK 0xffff0000
1314 /*
1315 * The system time is in the format of
1316 * (year-2001)*12*32 + month*32 + day.
1317 */
1318 #define DRV_PULSE_ALWAYS_ALIVE 0x00008000
1319 /*
1320 * Indicate to the firmware not to go into the
Eliezer Tamirf1410642008-02-28 11:51:50 -08001321 * OS-absent when it is not getting driver pulse.
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001322 * This is used for debugging as well for PXE(MBA).
1323 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001324
1325 u32 mcp_pulse_mb;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001326 #define MCP_PULSE_SEQ_MASK 0x00007fff
1327 #define MCP_PULSE_ALWAYS_ALIVE 0x00008000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001328 /* Indicates to the driver not to assert due to lack
1329 * of MCP response */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001330 #define MCP_EVENT_MASK 0xffff0000
1331 #define MCP_EVENT_OTHER_DRIVER_RESET_REQ 0x00010000
Eliezer Tamirf1410642008-02-28 11:51:50 -08001332
1333 u32 iscsi_boot_signature;
1334 u32 iscsi_boot_block_offset;
1335
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001336 u32 drv_status;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001337 #define DRV_STATUS_PMF 0x00000001
1338 #define DRV_STATUS_VF_DISABLED 0x00000002
1339 #define DRV_STATUS_SET_MF_BW 0x00000004
1340 #define DRV_STATUS_LINK_EVENT 0x00000008
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001341
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001342 #define DRV_STATUS_DCC_EVENT_MASK 0x0000ff00
1343 #define DRV_STATUS_DCC_DISABLE_ENABLE_PF 0x00000100
1344 #define DRV_STATUS_DCC_BANDWIDTH_ALLOCATION 0x00000200
1345 #define DRV_STATUS_DCC_CHANGE_MAC_ADDRESS 0x00000400
1346 #define DRV_STATUS_DCC_RESERVED1 0x00000800
1347 #define DRV_STATUS_DCC_SET_PROTOCOL 0x00001000
1348 #define DRV_STATUS_DCC_SET_PRIORITY 0x00002000
1349
1350 #define DRV_STATUS_DCBX_EVENT_MASK 0x000f0000
1351 #define DRV_STATUS_DCBX_NEGOTIATION_RESULTS 0x00010000
Eilon Greenstein2691d512009-08-12 08:22:08 +00001352
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001353 u32 virt_mac_upper;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001354 #define VIRT_MAC_SIGN_MASK 0xffff0000
1355 #define VIRT_MAC_SIGNATURE 0x564d0000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001356 u32 virt_mac_lower;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001357
1358};
1359
1360
1361/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001362 * Management firmware state *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001363 ****************************************************************************/
Eliezer Tamirf1410642008-02-28 11:51:50 -08001364/* Allocate 440 bytes for management firmware */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001365#define MGMTFW_STATE_WORD_SIZE 110
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001366
1367struct mgmtfw_state {
1368 u32 opaque[MGMTFW_STATE_WORD_SIZE];
1369};
1370
1371
1372/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001373 * Multi-Function configuration *
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001374 ****************************************************************************/
1375struct shared_mf_cfg {
1376
1377 u32 clp_mb;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001378 #define SHARED_MF_CLP_SET_DEFAULT 0x00000000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001379 /* set by CLP */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001380 #define SHARED_MF_CLP_EXIT 0x00000001
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001381 /* set by MCP */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001382 #define SHARED_MF_CLP_EXIT_DONE 0x00010000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001383
1384};
1385
1386struct port_mf_cfg {
1387
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001388 u32 dynamic_cfg; /* device control channel */
1389 #define PORT_MF_CFG_E1HOV_TAG_MASK 0x0000ffff
1390 #define PORT_MF_CFG_E1HOV_TAG_SHIFT 0
1391 #define PORT_MF_CFG_E1HOV_TAG_DEFAULT PORT_MF_CFG_E1HOV_TAG_MASK
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001392
1393 u32 reserved[3];
1394
1395};
1396
1397struct func_mf_cfg {
1398
1399 u32 config;
1400 /* E/R/I/D */
1401 /* function 0 of each port cannot be hidden */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001402 #define FUNC_MF_CFG_FUNC_HIDE 0x00000001
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001403
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001404 #define FUNC_MF_CFG_PROTOCOL_MASK 0x00000006
1405 #define FUNC_MF_CFG_PROTOCOL_FCOE 0x00000000
1406 #define FUNC_MF_CFG_PROTOCOL_ETHERNET 0x00000002
1407 #define FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA 0x00000004
1408 #define FUNC_MF_CFG_PROTOCOL_ISCSI 0x00000006
1409 #define FUNC_MF_CFG_PROTOCOL_DEFAULT \
1410 FUNC_MF_CFG_PROTOCOL_ETHERNET_WITH_RDMA
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001411
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001412 #define FUNC_MF_CFG_FUNC_DISABLED 0x00000008
1413 #define FUNC_MF_CFG_FUNC_DELETED 0x00000010
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001414
1415 /* PRI */
1416 /* 0 - low priority, 3 - high priority */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001417 #define FUNC_MF_CFG_TRANSMIT_PRIORITY_MASK 0x00000300
1418 #define FUNC_MF_CFG_TRANSMIT_PRIORITY_SHIFT 8
1419 #define FUNC_MF_CFG_TRANSMIT_PRIORITY_DEFAULT 0x00000000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001420
1421 /* MINBW, MAXBW */
1422 /* value range - 0..100, increments in 100Mbps */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001423 #define FUNC_MF_CFG_MIN_BW_MASK 0x00ff0000
1424 #define FUNC_MF_CFG_MIN_BW_SHIFT 16
1425 #define FUNC_MF_CFG_MIN_BW_DEFAULT 0x00000000
1426 #define FUNC_MF_CFG_MAX_BW_MASK 0xff000000
1427 #define FUNC_MF_CFG_MAX_BW_SHIFT 24
1428 #define FUNC_MF_CFG_MAX_BW_DEFAULT 0x64000000
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001429
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001430 u32 mac_upper; /* MAC */
1431 #define FUNC_MF_CFG_UPPERMAC_MASK 0x0000ffff
1432 #define FUNC_MF_CFG_UPPERMAC_SHIFT 0
1433 #define FUNC_MF_CFG_UPPERMAC_DEFAULT FUNC_MF_CFG_UPPERMAC_MASK
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001434 u32 mac_lower;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001435 #define FUNC_MF_CFG_LOWERMAC_DEFAULT 0xffffffff
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001436
1437 u32 e1hov_tag; /* VNI */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001438 #define FUNC_MF_CFG_E1HOV_TAG_MASK 0x0000ffff
1439 #define FUNC_MF_CFG_E1HOV_TAG_SHIFT 0
1440 #define FUNC_MF_CFG_E1HOV_TAG_DEFAULT FUNC_MF_CFG_E1HOV_TAG_MASK
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001441
1442 u32 reserved[2];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001443};
1444
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -08001445/* This structure is not applicable and should not be accessed on 57711 */
1446struct func_ext_cfg {
1447 u32 func_cfg;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001448 #define MACP_FUNC_CFG_FLAGS_MASK 0x000000FF
1449 #define MACP_FUNC_CFG_FLAGS_SHIFT 0
1450 #define MACP_FUNC_CFG_FLAGS_ENABLED 0x00000001
1451 #define MACP_FUNC_CFG_FLAGS_ETHERNET 0x00000002
1452 #define MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD 0x00000004
1453 #define MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD 0x00000008
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -08001454
1455 u32 iscsi_mac_addr_upper;
1456 u32 iscsi_mac_addr_lower;
1457
1458 u32 fcoe_mac_addr_upper;
1459 u32 fcoe_mac_addr_lower;
1460
1461 u32 fcoe_wwn_port_name_upper;
1462 u32 fcoe_wwn_port_name_lower;
1463
1464 u32 fcoe_wwn_node_name_upper;
1465 u32 fcoe_wwn_node_name_lower;
1466
1467 u32 preserve_data;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001468 #define MF_FUNC_CFG_PRESERVE_L2_MAC (1<<0)
1469 #define MF_FUNC_CFG_PRESERVE_ISCSI_MAC (1<<1)
1470 #define MF_FUNC_CFG_PRESERVE_FCOE_MAC (1<<2)
1471 #define MF_FUNC_CFG_PRESERVE_FCOE_WWN_P (1<<3)
1472 #define MF_FUNC_CFG_PRESERVE_FCOE_WWN_N (1<<4)
1473 #define MF_FUNC_CFG_PRESERVE_TX_BW (1<<5)
Dmitry Kravkov0793f83f2010-12-01 12:39:28 -08001474};
1475
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001476struct mf_cfg {
1477
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001478 struct shared_mf_cfg shared_mf_config; /* 0x4 */
1479 struct port_mf_cfg port_mf_config[PORT_MAX]; /* 0x10 * 2 = 0x20 */
1480 /* for all chips, there are 8 mf functions */
1481 struct func_mf_cfg func_mf_config[E1H_FUNC_MAX]; /* 0x18 * 8 = 0xc0 */
1482 /*
1483 * Extended configuration per function - this array does not exist and
1484 * should not be accessed on 57711
1485 */
1486 struct func_ext_cfg func_ext_config[E1H_FUNC_MAX]; /* 0x28 * 8 = 0x140*/
1487}; /* 0x224 */
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001488
1489/****************************************************************************
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001490 * Shared Memory Region *
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001491 ****************************************************************************/
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001492struct shmem_region { /* SharedMem Offset (size) */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001493
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001494 u32 validity_map[PORT_MAX]; /* 0x0 (4*2 = 0x8) */
1495 #define SHR_MEM_FORMAT_REV_MASK 0xff000000
1496 #define SHR_MEM_FORMAT_REV_ID ('A'<<24)
Eliezer Tamirf1410642008-02-28 11:51:50 -08001497 /* validity bits */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001498 #define SHR_MEM_VALIDITY_PCI_CFG 0x00100000
1499 #define SHR_MEM_VALIDITY_MB 0x00200000
1500 #define SHR_MEM_VALIDITY_DEV_INFO 0x00400000
1501 #define SHR_MEM_VALIDITY_RESERVED 0x00000007
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001502 /* One licensing bit should be set */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001503 #define SHR_MEM_VALIDITY_LIC_KEY_IN_EFFECT_MASK 0x00000038
1504 #define SHR_MEM_VALIDITY_LIC_MANUF_KEY_IN_EFFECT 0x00000008
1505 #define SHR_MEM_VALIDITY_LIC_UPGRADE_KEY_IN_EFFECT 0x00000010
1506 #define SHR_MEM_VALIDITY_LIC_NO_KEY_IN_EFFECT 0x00000020
Eliezer Tamirf1410642008-02-28 11:51:50 -08001507 /* Active MFW */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001508 #define SHR_MEM_VALIDITY_ACTIVE_MFW_UNKNOWN 0x00000000
1509 #define SHR_MEM_VALIDITY_ACTIVE_MFW_MASK 0x000001c0
1510 #define SHR_MEM_VALIDITY_ACTIVE_MFW_IPMI 0x00000040
1511 #define SHR_MEM_VALIDITY_ACTIVE_MFW_UMP 0x00000080
1512 #define SHR_MEM_VALIDITY_ACTIVE_MFW_NCSI 0x000000c0
1513 #define SHR_MEM_VALIDITY_ACTIVE_MFW_NONE 0x000001c0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001514
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001515 struct shm_dev_info dev_info; /* 0x8 (0x438) */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001516
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001517 struct license_key drv_lic_key[PORT_MAX]; /* 0x440 (52*2=0x68) */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001518
1519 /* FW information (for internal FW use) */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001520 u32 fw_info_fio_offset; /* 0x4a8 (0x4) */
1521 struct mgmtfw_state mgmtfw_state; /* 0x4ac (0x1b8) */
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001522
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001523 struct drv_port_mb port_mb[PORT_MAX]; /* 0x664 (16*2=0x20) */
1524
1525#ifdef BMAPI
1526 /* This is a variable length array */
1527 /* the number of function depends on the chip type */
1528 struct drv_func_mb func_mb[1]; /* 0x684 (44*2/4/8=0x58/0xb0/0x160) */
1529#else
1530 /* the number of function depends on the chip type */
1531 struct drv_func_mb func_mb[]; /* 0x684 (44*2/4/8=0x58/0xb0/0x160) */
1532#endif /* BMAPI */
Eilon Greenstein34f80b02008-06-23 20:33:01 -07001533
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001534}; /* 57710 = 0x6dc | 57711 = 0x7E4 | 57712 = 0x734 */
Eliezer Tamirf1410642008-02-28 11:51:50 -08001535
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001536/****************************************************************************
1537 * Shared Memory 2 Region *
1538 ****************************************************************************/
1539/* The fw_flr_ack is actually built in the following way: */
1540/* 8 bit: PF ack */
1541/* 64 bit: VF ack */
1542/* 8 bit: ios_dis_ack */
1543/* In order to maintain endianity in the mailbox hsi, we want to keep using */
1544/* u32. The fw must have the VF right after the PF since this is how it */
1545/* access arrays(it expects always the VF to reside after the PF, and that */
1546/* makes the calculation much easier for it. ) */
1547/* In order to answer both limitations, and keep the struct small, the code */
1548/* will abuse the structure defined here to achieve the actual partition */
1549/* above */
1550/****************************************************************************/
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001551struct fw_flr_ack {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001552 u32 pf_ack;
1553 u32 vf_ack[1];
1554 u32 iov_dis_ack;
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001555};
Dmitry Kravkov523224a2010-10-06 03:23:26 +00001556
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001557struct fw_flr_mb {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001558 u32 aggint;
1559 u32 opgen_addr;
1560 struct fw_flr_ack ack;
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001561};
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001562
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001563/**** SUPPORT FOR SHMEM ARRRAYS ***
1564 * The SHMEM HSI is aligned on 32 bit boundaries which makes it difficult to
1565 * define arrays with storage types smaller then unsigned dwords.
1566 * The macros below add generic support for SHMEM arrays with numeric elements
1567 * that can span 2,4,8 or 16 bits. The array underlying type is a 32 bit dword
1568 * array with individual bit-filed elements accessed using shifts and masks.
1569 *
1570 */
1571
1572/* eb is the bitwidth of a single element */
1573#define SHMEM_ARRAY_MASK(eb) ((1<<(eb))-1)
1574#define SHMEM_ARRAY_ENTRY(i, eb) ((i)/(32/(eb)))
1575
1576/* the bit-position macro allows the used to flip the order of the arrays
1577 * elements on a per byte or word boundary.
1578 *
1579 * example: an array with 8 entries each 4 bit wide. This array will fit into
1580 * a single dword. The diagrmas below show the array order of the nibbles.
1581 *
1582 * SHMEM_ARRAY_BITPOS(i, 4, 4) defines the stadard ordering:
1583 *
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001584 * | | | |
1585 * 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
1586 * | | | |
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001587 *
1588 * SHMEM_ARRAY_BITPOS(i, 4, 8) defines a flip ordering per byte:
1589 *
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001590 * | | | |
1591 * 1 | 0 | 3 | 2 | 5 | 4 | 7 | 6 |
1592 * | | | |
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001593 *
1594 * SHMEM_ARRAY_BITPOS(i, 4, 16) defines a flip ordering per word:
1595 *
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001596 * | | | |
1597 * 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 |
1598 * | | | |
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001599 */
1600#define SHMEM_ARRAY_BITPOS(i, eb, fb) \
1601 ((((32/(fb)) - 1 - ((i)/((fb)/(eb))) % (32/(fb))) * (fb)) + \
1602 (((i)%((fb)/(eb))) * (eb)))
1603
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001604#define SHMEM_ARRAY_GET(a, i, eb, fb) \
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001605 ((a[SHMEM_ARRAY_ENTRY(i, eb)] >> SHMEM_ARRAY_BITPOS(i, eb, fb)) & \
1606 SHMEM_ARRAY_MASK(eb))
1607
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001608#define SHMEM_ARRAY_SET(a, i, eb, fb, val) \
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001609do { \
1610 a[SHMEM_ARRAY_ENTRY(i, eb)] &= ~(SHMEM_ARRAY_MASK(eb) << \
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001611 SHMEM_ARRAY_BITPOS(i, eb, fb)); \
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001612 a[SHMEM_ARRAY_ENTRY(i, eb)] |= (((val) & SHMEM_ARRAY_MASK(eb)) << \
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001613 SHMEM_ARRAY_BITPOS(i, eb, fb)); \
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001614} while (0)
1615
1616
1617/****START OF DCBX STRUCTURES DECLARATIONS****/
1618#define DCBX_MAX_NUM_PRI_PG_ENTRIES 8
1619#define DCBX_PRI_PG_BITWIDTH 4
1620#define DCBX_PRI_PG_FBITS 8
1621#define DCBX_PRI_PG_GET(a, i) \
1622 SHMEM_ARRAY_GET(a, i, DCBX_PRI_PG_BITWIDTH, DCBX_PRI_PG_FBITS)
1623#define DCBX_PRI_PG_SET(a, i, val) \
1624 SHMEM_ARRAY_SET(a, i, DCBX_PRI_PG_BITWIDTH, DCBX_PRI_PG_FBITS, val)
1625#define DCBX_MAX_NUM_PG_BW_ENTRIES 8
1626#define DCBX_BW_PG_BITWIDTH 8
1627#define DCBX_PG_BW_GET(a, i) \
1628 SHMEM_ARRAY_GET(a, i, DCBX_BW_PG_BITWIDTH, DCBX_BW_PG_BITWIDTH)
1629#define DCBX_PG_BW_SET(a, i, val) \
1630 SHMEM_ARRAY_SET(a, i, DCBX_BW_PG_BITWIDTH, DCBX_BW_PG_BITWIDTH, val)
1631#define DCBX_STRICT_PRI_PG 15
1632#define DCBX_MAX_APP_PROTOCOL 16
1633#define FCOE_APP_IDX 0
1634#define ISCSI_APP_IDX 1
1635#define PREDEFINED_APP_IDX_MAX 2
1636
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001637
1638/* Big/Little endian have the same representation. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001639struct dcbx_ets_feature {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001640 /*
1641 * For Admin MIB - is this feature supported by the
1642 * driver | For Local MIB - should this feature be enabled.
1643 */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001644 u32 enabled;
1645 u32 pg_bw_tbl[2];
1646 u32 pri_pg_tbl[1];
1647};
1648
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001649/* Driver structure in LE */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001650struct dcbx_pfc_feature {
1651#ifdef __BIG_ENDIAN
1652 u8 pri_en_bitmap;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001653 #define DCBX_PFC_PRI_0 0x01
1654 #define DCBX_PFC_PRI_1 0x02
1655 #define DCBX_PFC_PRI_2 0x04
1656 #define DCBX_PFC_PRI_3 0x08
1657 #define DCBX_PFC_PRI_4 0x10
1658 #define DCBX_PFC_PRI_5 0x20
1659 #define DCBX_PFC_PRI_6 0x40
1660 #define DCBX_PFC_PRI_7 0x80
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001661 u8 pfc_caps;
1662 u8 reserved;
1663 u8 enabled;
1664#elif defined(__LITTLE_ENDIAN)
1665 u8 enabled;
1666 u8 reserved;
1667 u8 pfc_caps;
1668 u8 pri_en_bitmap;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001669 #define DCBX_PFC_PRI_0 0x01
1670 #define DCBX_PFC_PRI_1 0x02
1671 #define DCBX_PFC_PRI_2 0x04
1672 #define DCBX_PFC_PRI_3 0x08
1673 #define DCBX_PFC_PRI_4 0x10
1674 #define DCBX_PFC_PRI_5 0x20
1675 #define DCBX_PFC_PRI_6 0x40
1676 #define DCBX_PFC_PRI_7 0x80
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001677#endif
1678};
1679
1680struct dcbx_app_priority_entry {
1681#ifdef __BIG_ENDIAN
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001682 u16 app_id;
1683 u8 pri_bitmap;
1684 u8 appBitfield;
1685 #define DCBX_APP_ENTRY_VALID 0x01
1686 #define DCBX_APP_ENTRY_SF_MASK 0x30
1687 #define DCBX_APP_ENTRY_SF_SHIFT 4
1688 #define DCBX_APP_SF_ETH_TYPE 0x10
1689 #define DCBX_APP_SF_PORT 0x20
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001690#elif defined(__LITTLE_ENDIAN)
1691 u8 appBitfield;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001692 #define DCBX_APP_ENTRY_VALID 0x01
1693 #define DCBX_APP_ENTRY_SF_MASK 0x30
1694 #define DCBX_APP_ENTRY_SF_SHIFT 4
1695 #define DCBX_APP_SF_ETH_TYPE 0x10
1696 #define DCBX_APP_SF_PORT 0x20
1697 u8 pri_bitmap;
1698 u16 app_id;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001699#endif
1700};
1701
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001702
1703/* FW structure in BE */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001704struct dcbx_app_priority_feature {
1705#ifdef __BIG_ENDIAN
1706 u8 reserved;
1707 u8 default_pri;
1708 u8 tc_supported;
1709 u8 enabled;
1710#elif defined(__LITTLE_ENDIAN)
1711 u8 enabled;
1712 u8 tc_supported;
1713 u8 default_pri;
1714 u8 reserved;
1715#endif
1716 struct dcbx_app_priority_entry app_pri_tbl[DCBX_MAX_APP_PROTOCOL];
1717};
1718
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001719/* FW structure in BE */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001720struct dcbx_features {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001721 /* PG feature */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001722 struct dcbx_ets_feature ets;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001723 /* PFC feature */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001724 struct dcbx_pfc_feature pfc;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001725 /* APP feature */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001726 struct dcbx_app_priority_feature app;
1727};
1728
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001729/* LLDP protocol parameters */
1730/* FW structure in BE */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001731struct lldp_params {
1732#ifdef __BIG_ENDIAN
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001733 u8 msg_fast_tx_interval;
1734 u8 msg_tx_hold;
1735 u8 msg_tx_interval;
1736 u8 admin_status;
1737 #define LLDP_TX_ONLY 0x01
1738 #define LLDP_RX_ONLY 0x02
1739 #define LLDP_TX_RX 0x03
1740 #define LLDP_DISABLED 0x04
1741 u8 reserved1;
1742 u8 tx_fast;
1743 u8 tx_crd_max;
1744 u8 tx_crd;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001745#elif defined(__LITTLE_ENDIAN)
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001746 u8 admin_status;
1747 #define LLDP_TX_ONLY 0x01
1748 #define LLDP_RX_ONLY 0x02
1749 #define LLDP_TX_RX 0x03
1750 #define LLDP_DISABLED 0x04
1751 u8 msg_tx_interval;
1752 u8 msg_tx_hold;
1753 u8 msg_fast_tx_interval;
1754 u8 tx_crd;
1755 u8 tx_crd_max;
1756 u8 tx_fast;
1757 u8 reserved1;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001758#endif
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001759 #define REM_CHASSIS_ID_STAT_LEN 4
1760 #define REM_PORT_ID_STAT_LEN 4
1761 /* Holds remote Chassis ID TLV header, subtype and 9B of payload. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001762 u32 peer_chassis_id[REM_CHASSIS_ID_STAT_LEN];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001763 /* Holds remote Port ID TLV header, subtype and 9B of payload. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001764 u32 peer_port_id[REM_PORT_ID_STAT_LEN];
1765};
1766
1767struct lldp_dcbx_stat {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001768 #define LOCAL_CHASSIS_ID_STAT_LEN 2
1769 #define LOCAL_PORT_ID_STAT_LEN 2
1770 /* Holds local Chassis ID 8B payload of constant subtype 4. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001771 u32 local_chassis_id[LOCAL_CHASSIS_ID_STAT_LEN];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001772 /* Holds local Port ID 8B payload of constant subtype 3. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001773 u32 local_port_id[LOCAL_PORT_ID_STAT_LEN];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001774 /* Number of DCBX frames transmitted. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001775 u32 num_tx_dcbx_pkts;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001776 /* Number of DCBX frames received. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001777 u32 num_rx_dcbx_pkts;
1778};
1779
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001780/* ADMIN MIB - DCBX local machine default configuration. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001781struct lldp_admin_mib {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001782 u32 ver_cfg_flags;
1783 #define DCBX_ETS_CONFIG_TX_ENABLED 0x00000001
1784 #define DCBX_PFC_CONFIG_TX_ENABLED 0x00000002
1785 #define DCBX_APP_CONFIG_TX_ENABLED 0x00000004
1786 #define DCBX_ETS_RECO_TX_ENABLED 0x00000008
1787 #define DCBX_ETS_RECO_VALID 0x00000010
1788 #define DCBX_ETS_WILLING 0x00000020
1789 #define DCBX_PFC_WILLING 0x00000040
1790 #define DCBX_APP_WILLING 0x00000080
1791 #define DCBX_VERSION_CEE 0x00000100
1792 #define DCBX_VERSION_IEEE 0x00000200
1793 #define DCBX_DCBX_ENABLED 0x00000400
1794 #define DCBX_CEE_VERSION_MASK 0x0000f000
1795 #define DCBX_CEE_VERSION_SHIFT 12
1796 #define DCBX_CEE_MAX_VERSION_MASK 0x000f0000
1797 #define DCBX_CEE_MAX_VERSION_SHIFT 16
1798 struct dcbx_features features;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001799};
1800
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001801/* REMOTE MIB - remote machine DCBX configuration. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001802struct lldp_remote_mib {
1803 u32 prefix_seq_num;
1804 u32 flags;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001805 #define DCBX_ETS_TLV_RX 0x00000001
1806 #define DCBX_PFC_TLV_RX 0x00000002
1807 #define DCBX_APP_TLV_RX 0x00000004
1808 #define DCBX_ETS_RX_ERROR 0x00000010
1809 #define DCBX_PFC_RX_ERROR 0x00000020
1810 #define DCBX_APP_RX_ERROR 0x00000040
1811 #define DCBX_ETS_REM_WILLING 0x00000100
1812 #define DCBX_PFC_REM_WILLING 0x00000200
1813 #define DCBX_APP_REM_WILLING 0x00000400
1814 #define DCBX_REMOTE_ETS_RECO_VALID 0x00001000
1815 #define DCBX_REMOTE_MIB_VALID 0x00002000
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001816 struct dcbx_features features;
1817 u32 suffix_seq_num;
1818};
1819
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001820/* LOCAL MIB - operational DCBX configuration - transmitted on Tx LLDPDU. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001821struct lldp_local_mib {
1822 u32 prefix_seq_num;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001823 /* Indicates if there is mismatch with negotiation results. */
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001824 u32 error;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001825 #define DCBX_LOCAL_ETS_ERROR 0x00000001
1826 #define DCBX_LOCAL_PFC_ERROR 0x00000002
1827 #define DCBX_LOCAL_APP_ERROR 0x00000004
1828 #define DCBX_LOCAL_PFC_MISMATCH 0x00000010
1829 #define DCBX_LOCAL_APP_MISMATCH 0x00000020
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00001830 struct dcbx_features features;
1831 u32 suffix_seq_num;
1832};
1833/***END OF DCBX STRUCTURES DECLARATIONS***/
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02001834
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001835struct ncsi_oem_fcoe_features {
1836 u32 fcoe_features1;
1837 #define FCOE_FEATURES1_IOS_PER_CONNECTION_MASK 0x0000FFFF
1838 #define FCOE_FEATURES1_IOS_PER_CONNECTION_OFFSET 0
1839
1840 #define FCOE_FEATURES1_LOGINS_PER_PORT_MASK 0xFFFF0000
1841 #define FCOE_FEATURES1_LOGINS_PER_PORT_OFFSET 16
1842
1843 u32 fcoe_features2;
1844 #define FCOE_FEATURES2_EXCHANGES_MASK 0x0000FFFF
1845 #define FCOE_FEATURES2_EXCHANGES_OFFSET 0
1846
1847 #define FCOE_FEATURES2_NPIV_WWN_PER_PORT_MASK 0xFFFF0000
1848 #define FCOE_FEATURES2_NPIV_WWN_PER_PORT_OFFSET 16
1849
1850 u32 fcoe_features3;
1851 #define FCOE_FEATURES3_TARGETS_SUPPORTED_MASK 0x0000FFFF
1852 #define FCOE_FEATURES3_TARGETS_SUPPORTED_OFFSET 0
1853
1854 #define FCOE_FEATURES3_OUTSTANDING_COMMANDS_MASK 0xFFFF0000
1855 #define FCOE_FEATURES3_OUTSTANDING_COMMANDS_OFFSET 16
1856
1857 u32 fcoe_features4;
1858 #define FCOE_FEATURES4_FEATURE_SETTINGS_MASK 0x0000000F
1859 #define FCOE_FEATURES4_FEATURE_SETTINGS_OFFSET 0
1860};
1861
1862struct ncsi_oem_data {
1863 u32 driver_version[4];
1864 struct ncsi_oem_fcoe_features ncsi_oem_fcoe_features;
1865};
1866
Eilon Greenstein2691d512009-08-12 08:22:08 +00001867struct shmem2_region {
1868
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001869 u32 size; /* 0x0000 */
Eilon Greenstein2691d512009-08-12 08:22:08 +00001870
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001871 u32 dcc_support; /* 0x0004 */
1872 #define SHMEM_DCC_SUPPORT_NONE 0x00000000
1873 #define SHMEM_DCC_SUPPORT_DISABLE_ENABLE_PF_TLV 0x00000001
1874 #define SHMEM_DCC_SUPPORT_BANDWIDTH_ALLOCATION_TLV 0x00000004
1875 #define SHMEM_DCC_SUPPORT_CHANGE_MAC_ADDRESS_TLV 0x00000008
1876 #define SHMEM_DCC_SUPPORT_SET_PROTOCOL_TLV 0x00000040
1877 #define SHMEM_DCC_SUPPORT_SET_PRIORITY_TLV 0x00000080
1878
1879 u32 ext_phy_fw_version2[PORT_MAX]; /* 0x0008 */
Yaniv Rosnera22f0782010-09-07 11:41:20 +00001880 /*
1881 * For backwards compatibility, if the mf_cfg_addr does not exist
1882 * (the size filed is smaller than 0xc) the mf_cfg resides at the
1883 * end of struct shmem_region
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001884 */
1885 u32 mf_cfg_addr; /* 0x0010 */
1886 #define SHMEM_MF_CFG_ADDR_NONE 0x00000000
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001887
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001888 struct fw_flr_mb flr_mb; /* 0x0014 */
1889 u32 dcbx_lldp_params_offset; /* 0x0028 */
1890 #define SHMEM_LLDP_DCBX_PARAMS_NONE 0x00000000
1891 u32 dcbx_neg_res_offset; /* 0x002c */
1892 #define SHMEM_DCBX_NEG_RES_NONE 0x00000000
1893 u32 dcbx_remote_mib_offset; /* 0x0030 */
1894 #define SHMEM_DCBX_REMOTE_MIB_NONE 0x00000000
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00001895 /*
1896 * The other shmemX_base_addr holds the other path's shmem address
1897 * required for example in case of common phy init, or for path1 to know
1898 * the address of mcp debug trace which is located in offset from shmem
1899 * of path0
Yaniv Rosnera22f0782010-09-07 11:41:20 +00001900 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001901 u32 other_shmem_base_addr; /* 0x0034 */
1902 u32 other_shmem2_base_addr; /* 0x0038 */
1903 /*
1904 * mcp_vf_disabled is set by the MCP to indicate the driver about VFs
1905 * which were disabled/flred
1906 */
1907 u32 mcp_vf_disabled[E2_VF_MAX / 32]; /* 0x003c */
1908
1909 /*
1910 * drv_ack_vf_disabled is set by the PF driver to ack handled disabled
1911 * VFs
1912 */
1913 u32 drv_ack_vf_disabled[E2_FUNC_MAX][E2_VF_MAX / 32]; /* 0x0044 */
1914
1915 u32 dcbx_lldp_dcbx_stat_offset; /* 0x0064 */
1916 #define SHMEM_LLDP_DCBX_STAT_NONE 0x00000000
1917
1918 /*
1919 * edebug_driver_if field is used to transfer messages between edebug
1920 * app to the driver through shmem2.
1921 *
1922 * message format:
1923 * bits 0-2 - function number / instance of driver to perform request
1924 * bits 3-5 - op code / is_ack?
1925 * bits 6-63 - data
1926 */
1927 u32 edebug_driver_if[2]; /* 0x0068 */
1928 #define EDEBUG_DRIVER_IF_OP_CODE_GET_PHYS_ADDR 1
1929 #define EDEBUG_DRIVER_IF_OP_CODE_GET_BUS_ADDR 2
1930 #define EDEBUG_DRIVER_IF_OP_CODE_DISABLE_STAT 3
1931
1932 u32 nvm_retain_bitmap_addr; /* 0x0070 */
1933
1934 u32 reserved1; /* 0x0074 */
1935
1936 u32 reserved2[E2_FUNC_MAX];
1937
1938 u32 reserved3[E2_FUNC_MAX];/* 0x0088 */
1939 u32 reserved4[E2_FUNC_MAX];/* 0x0098 */
1940
1941 u32 swim_base_addr; /* 0x0108 */
1942 u32 swim_funcs;
1943 u32 swim_main_cb;
1944
1945 u32 reserved5[2];
1946
1947 /* generic flags controlled by the driver */
1948 u32 drv_flags;
1949 #define DRV_FLAGS_DCB_CONFIGURED 0x1
1950
1951 /* pointer to extended dev_info shared data copied from nvm image */
1952 u32 extended_dev_info_shared_addr;
1953 u32 ncsi_oem_data_addr;
1954
1955 u32 ocsd_host_addr;
1956 u32 ocbb_host_addr;
1957 u32 ocsd_req_update_interval;
Eilon Greenstein2691d512009-08-12 08:22:08 +00001958};
1959
1960
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07001961struct emac_stats {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001962 u32 rx_stat_ifhcinoctets;
1963 u32 rx_stat_ifhcinbadoctets;
1964 u32 rx_stat_etherstatsfragments;
1965 u32 rx_stat_ifhcinucastpkts;
1966 u32 rx_stat_ifhcinmulticastpkts;
1967 u32 rx_stat_ifhcinbroadcastpkts;
1968 u32 rx_stat_dot3statsfcserrors;
1969 u32 rx_stat_dot3statsalignmenterrors;
1970 u32 rx_stat_dot3statscarriersenseerrors;
1971 u32 rx_stat_xonpauseframesreceived;
1972 u32 rx_stat_xoffpauseframesreceived;
1973 u32 rx_stat_maccontrolframesreceived;
1974 u32 rx_stat_xoffstateentered;
1975 u32 rx_stat_dot3statsframestoolong;
1976 u32 rx_stat_etherstatsjabbers;
1977 u32 rx_stat_etherstatsundersizepkts;
1978 u32 rx_stat_etherstatspkts64octets;
1979 u32 rx_stat_etherstatspkts65octetsto127octets;
1980 u32 rx_stat_etherstatspkts128octetsto255octets;
1981 u32 rx_stat_etherstatspkts256octetsto511octets;
1982 u32 rx_stat_etherstatspkts512octetsto1023octets;
1983 u32 rx_stat_etherstatspkts1024octetsto1522octets;
1984 u32 rx_stat_etherstatspktsover1522octets;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07001985
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001986 u32 rx_stat_falsecarriererrors;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07001987
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03001988 u32 tx_stat_ifhcoutoctets;
1989 u32 tx_stat_ifhcoutbadoctets;
1990 u32 tx_stat_etherstatscollisions;
1991 u32 tx_stat_outxonsent;
1992 u32 tx_stat_outxoffsent;
1993 u32 tx_stat_flowcontroldone;
1994 u32 tx_stat_dot3statssinglecollisionframes;
1995 u32 tx_stat_dot3statsmultiplecollisionframes;
1996 u32 tx_stat_dot3statsdeferredtransmissions;
1997 u32 tx_stat_dot3statsexcessivecollisions;
1998 u32 tx_stat_dot3statslatecollisions;
1999 u32 tx_stat_ifhcoutucastpkts;
2000 u32 tx_stat_ifhcoutmulticastpkts;
2001 u32 tx_stat_ifhcoutbroadcastpkts;
2002 u32 tx_stat_etherstatspkts64octets;
2003 u32 tx_stat_etherstatspkts65octetsto127octets;
2004 u32 tx_stat_etherstatspkts128octetsto255octets;
2005 u32 tx_stat_etherstatspkts256octetsto511octets;
2006 u32 tx_stat_etherstatspkts512octetsto1023octets;
2007 u32 tx_stat_etherstatspkts1024octetsto1522octets;
2008 u32 tx_stat_etherstatspktsover1522octets;
2009 u32 tx_stat_dot3statsinternalmactransmiterrors;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002010};
2011
2012
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002013struct bmac1_stats {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002014 u32 tx_stat_gtpkt_lo;
2015 u32 tx_stat_gtpkt_hi;
2016 u32 tx_stat_gtxpf_lo;
2017 u32 tx_stat_gtxpf_hi;
2018 u32 tx_stat_gtfcs_lo;
2019 u32 tx_stat_gtfcs_hi;
2020 u32 tx_stat_gtmca_lo;
2021 u32 tx_stat_gtmca_hi;
2022 u32 tx_stat_gtbca_lo;
2023 u32 tx_stat_gtbca_hi;
2024 u32 tx_stat_gtfrg_lo;
2025 u32 tx_stat_gtfrg_hi;
2026 u32 tx_stat_gtovr_lo;
2027 u32 tx_stat_gtovr_hi;
2028 u32 tx_stat_gt64_lo;
2029 u32 tx_stat_gt64_hi;
2030 u32 tx_stat_gt127_lo;
2031 u32 tx_stat_gt127_hi;
2032 u32 tx_stat_gt255_lo;
2033 u32 tx_stat_gt255_hi;
2034 u32 tx_stat_gt511_lo;
2035 u32 tx_stat_gt511_hi;
2036 u32 tx_stat_gt1023_lo;
2037 u32 tx_stat_gt1023_hi;
2038 u32 tx_stat_gt1518_lo;
2039 u32 tx_stat_gt1518_hi;
2040 u32 tx_stat_gt2047_lo;
2041 u32 tx_stat_gt2047_hi;
2042 u32 tx_stat_gt4095_lo;
2043 u32 tx_stat_gt4095_hi;
2044 u32 tx_stat_gt9216_lo;
2045 u32 tx_stat_gt9216_hi;
2046 u32 tx_stat_gt16383_lo;
2047 u32 tx_stat_gt16383_hi;
2048 u32 tx_stat_gtmax_lo;
2049 u32 tx_stat_gtmax_hi;
2050 u32 tx_stat_gtufl_lo;
2051 u32 tx_stat_gtufl_hi;
2052 u32 tx_stat_gterr_lo;
2053 u32 tx_stat_gterr_hi;
2054 u32 tx_stat_gtbyt_lo;
2055 u32 tx_stat_gtbyt_hi;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002056
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002057 u32 rx_stat_gr64_lo;
2058 u32 rx_stat_gr64_hi;
2059 u32 rx_stat_gr127_lo;
2060 u32 rx_stat_gr127_hi;
2061 u32 rx_stat_gr255_lo;
2062 u32 rx_stat_gr255_hi;
2063 u32 rx_stat_gr511_lo;
2064 u32 rx_stat_gr511_hi;
2065 u32 rx_stat_gr1023_lo;
2066 u32 rx_stat_gr1023_hi;
2067 u32 rx_stat_gr1518_lo;
2068 u32 rx_stat_gr1518_hi;
2069 u32 rx_stat_gr2047_lo;
2070 u32 rx_stat_gr2047_hi;
2071 u32 rx_stat_gr4095_lo;
2072 u32 rx_stat_gr4095_hi;
2073 u32 rx_stat_gr9216_lo;
2074 u32 rx_stat_gr9216_hi;
2075 u32 rx_stat_gr16383_lo;
2076 u32 rx_stat_gr16383_hi;
2077 u32 rx_stat_grmax_lo;
2078 u32 rx_stat_grmax_hi;
2079 u32 rx_stat_grpkt_lo;
2080 u32 rx_stat_grpkt_hi;
2081 u32 rx_stat_grfcs_lo;
2082 u32 rx_stat_grfcs_hi;
2083 u32 rx_stat_grmca_lo;
2084 u32 rx_stat_grmca_hi;
2085 u32 rx_stat_grbca_lo;
2086 u32 rx_stat_grbca_hi;
2087 u32 rx_stat_grxcf_lo;
2088 u32 rx_stat_grxcf_hi;
2089 u32 rx_stat_grxpf_lo;
2090 u32 rx_stat_grxpf_hi;
2091 u32 rx_stat_grxuo_lo;
2092 u32 rx_stat_grxuo_hi;
2093 u32 rx_stat_grjbr_lo;
2094 u32 rx_stat_grjbr_hi;
2095 u32 rx_stat_grovr_lo;
2096 u32 rx_stat_grovr_hi;
2097 u32 rx_stat_grflr_lo;
2098 u32 rx_stat_grflr_hi;
2099 u32 rx_stat_grmeg_lo;
2100 u32 rx_stat_grmeg_hi;
2101 u32 rx_stat_grmeb_lo;
2102 u32 rx_stat_grmeb_hi;
2103 u32 rx_stat_grbyt_lo;
2104 u32 rx_stat_grbyt_hi;
2105 u32 rx_stat_grund_lo;
2106 u32 rx_stat_grund_hi;
2107 u32 rx_stat_grfrg_lo;
2108 u32 rx_stat_grfrg_hi;
2109 u32 rx_stat_grerb_lo;
2110 u32 rx_stat_grerb_hi;
2111 u32 rx_stat_grfre_lo;
2112 u32 rx_stat_grfre_hi;
2113 u32 rx_stat_gripj_lo;
2114 u32 rx_stat_gripj_hi;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002115};
2116
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00002117struct bmac2_stats {
2118 u32 tx_stat_gtpk_lo; /* gtpok */
2119 u32 tx_stat_gtpk_hi; /* gtpok */
2120 u32 tx_stat_gtxpf_lo; /* gtpf */
2121 u32 tx_stat_gtxpf_hi; /* gtpf */
2122 u32 tx_stat_gtpp_lo; /* NEW BMAC2 */
2123 u32 tx_stat_gtpp_hi; /* NEW BMAC2 */
2124 u32 tx_stat_gtfcs_lo;
2125 u32 tx_stat_gtfcs_hi;
2126 u32 tx_stat_gtuca_lo; /* NEW BMAC2 */
2127 u32 tx_stat_gtuca_hi; /* NEW BMAC2 */
2128 u32 tx_stat_gtmca_lo;
2129 u32 tx_stat_gtmca_hi;
2130 u32 tx_stat_gtbca_lo;
2131 u32 tx_stat_gtbca_hi;
2132 u32 tx_stat_gtovr_lo;
2133 u32 tx_stat_gtovr_hi;
2134 u32 tx_stat_gtfrg_lo;
2135 u32 tx_stat_gtfrg_hi;
2136 u32 tx_stat_gtpkt1_lo; /* gtpkt */
2137 u32 tx_stat_gtpkt1_hi; /* gtpkt */
2138 u32 tx_stat_gt64_lo;
2139 u32 tx_stat_gt64_hi;
2140 u32 tx_stat_gt127_lo;
2141 u32 tx_stat_gt127_hi;
2142 u32 tx_stat_gt255_lo;
2143 u32 tx_stat_gt255_hi;
2144 u32 tx_stat_gt511_lo;
2145 u32 tx_stat_gt511_hi;
2146 u32 tx_stat_gt1023_lo;
2147 u32 tx_stat_gt1023_hi;
2148 u32 tx_stat_gt1518_lo;
2149 u32 tx_stat_gt1518_hi;
2150 u32 tx_stat_gt2047_lo;
2151 u32 tx_stat_gt2047_hi;
2152 u32 tx_stat_gt4095_lo;
2153 u32 tx_stat_gt4095_hi;
2154 u32 tx_stat_gt9216_lo;
2155 u32 tx_stat_gt9216_hi;
2156 u32 tx_stat_gt16383_lo;
2157 u32 tx_stat_gt16383_hi;
2158 u32 tx_stat_gtmax_lo;
2159 u32 tx_stat_gtmax_hi;
2160 u32 tx_stat_gtufl_lo;
2161 u32 tx_stat_gtufl_hi;
2162 u32 tx_stat_gterr_lo;
2163 u32 tx_stat_gterr_hi;
2164 u32 tx_stat_gtbyt_lo;
2165 u32 tx_stat_gtbyt_hi;
2166
2167 u32 rx_stat_gr64_lo;
2168 u32 rx_stat_gr64_hi;
2169 u32 rx_stat_gr127_lo;
2170 u32 rx_stat_gr127_hi;
2171 u32 rx_stat_gr255_lo;
2172 u32 rx_stat_gr255_hi;
2173 u32 rx_stat_gr511_lo;
2174 u32 rx_stat_gr511_hi;
2175 u32 rx_stat_gr1023_lo;
2176 u32 rx_stat_gr1023_hi;
2177 u32 rx_stat_gr1518_lo;
2178 u32 rx_stat_gr1518_hi;
2179 u32 rx_stat_gr2047_lo;
2180 u32 rx_stat_gr2047_hi;
2181 u32 rx_stat_gr4095_lo;
2182 u32 rx_stat_gr4095_hi;
2183 u32 rx_stat_gr9216_lo;
2184 u32 rx_stat_gr9216_hi;
2185 u32 rx_stat_gr16383_lo;
2186 u32 rx_stat_gr16383_hi;
2187 u32 rx_stat_grmax_lo;
2188 u32 rx_stat_grmax_hi;
2189 u32 rx_stat_grpkt_lo;
2190 u32 rx_stat_grpkt_hi;
2191 u32 rx_stat_grfcs_lo;
2192 u32 rx_stat_grfcs_hi;
2193 u32 rx_stat_gruca_lo;
2194 u32 rx_stat_gruca_hi;
2195 u32 rx_stat_grmca_lo;
2196 u32 rx_stat_grmca_hi;
2197 u32 rx_stat_grbca_lo;
2198 u32 rx_stat_grbca_hi;
2199 u32 rx_stat_grxpf_lo; /* grpf */
2200 u32 rx_stat_grxpf_hi; /* grpf */
2201 u32 rx_stat_grpp_lo;
2202 u32 rx_stat_grpp_hi;
2203 u32 rx_stat_grxuo_lo; /* gruo */
2204 u32 rx_stat_grxuo_hi; /* gruo */
2205 u32 rx_stat_grjbr_lo;
2206 u32 rx_stat_grjbr_hi;
2207 u32 rx_stat_grovr_lo;
2208 u32 rx_stat_grovr_hi;
2209 u32 rx_stat_grxcf_lo; /* grcf */
2210 u32 rx_stat_grxcf_hi; /* grcf */
2211 u32 rx_stat_grflr_lo;
2212 u32 rx_stat_grflr_hi;
2213 u32 rx_stat_grpok_lo;
2214 u32 rx_stat_grpok_hi;
2215 u32 rx_stat_grmeg_lo;
2216 u32 rx_stat_grmeg_hi;
2217 u32 rx_stat_grmeb_lo;
2218 u32 rx_stat_grmeb_hi;
2219 u32 rx_stat_grbyt_lo;
2220 u32 rx_stat_grbyt_hi;
2221 u32 rx_stat_grund_lo;
2222 u32 rx_stat_grund_hi;
2223 u32 rx_stat_grfrg_lo;
2224 u32 rx_stat_grfrg_hi;
2225 u32 rx_stat_grerb_lo; /* grerrbyt */
2226 u32 rx_stat_grerb_hi; /* grerrbyt */
2227 u32 rx_stat_grfre_lo; /* grfrerr */
2228 u32 rx_stat_grfre_hi; /* grfrerr */
2229 u32 rx_stat_gripj_lo;
2230 u32 rx_stat_gripj_hi;
2231};
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002232
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002233struct mstat_stats {
2234 struct {
2235 /* OTE MSTAT on E3 has a bug where this register's contents are
2236 * actually tx_gtxpok + tx_gtxpf + (possibly)tx_gtxpp
2237 */
2238 u32 tx_gtxpok_lo;
2239 u32 tx_gtxpok_hi;
2240 u32 tx_gtxpf_lo;
2241 u32 tx_gtxpf_hi;
2242 u32 tx_gtxpp_lo;
2243 u32 tx_gtxpp_hi;
2244 u32 tx_gtfcs_lo;
2245 u32 tx_gtfcs_hi;
2246 u32 tx_gtuca_lo;
2247 u32 tx_gtuca_hi;
2248 u32 tx_gtmca_lo;
2249 u32 tx_gtmca_hi;
2250 u32 tx_gtgca_lo;
2251 u32 tx_gtgca_hi;
2252 u32 tx_gtpkt_lo;
2253 u32 tx_gtpkt_hi;
2254 u32 tx_gt64_lo;
2255 u32 tx_gt64_hi;
2256 u32 tx_gt127_lo;
2257 u32 tx_gt127_hi;
2258 u32 tx_gt255_lo;
2259 u32 tx_gt255_hi;
2260 u32 tx_gt511_lo;
2261 u32 tx_gt511_hi;
2262 u32 tx_gt1023_lo;
2263 u32 tx_gt1023_hi;
2264 u32 tx_gt1518_lo;
2265 u32 tx_gt1518_hi;
2266 u32 tx_gt2047_lo;
2267 u32 tx_gt2047_hi;
2268 u32 tx_gt4095_lo;
2269 u32 tx_gt4095_hi;
2270 u32 tx_gt9216_lo;
2271 u32 tx_gt9216_hi;
2272 u32 tx_gt16383_lo;
2273 u32 tx_gt16383_hi;
2274 u32 tx_gtufl_lo;
2275 u32 tx_gtufl_hi;
2276 u32 tx_gterr_lo;
2277 u32 tx_gterr_hi;
2278 u32 tx_gtbyt_lo;
2279 u32 tx_gtbyt_hi;
2280 u32 tx_collisions_lo;
2281 u32 tx_collisions_hi;
2282 u32 tx_singlecollision_lo;
2283 u32 tx_singlecollision_hi;
2284 u32 tx_multiplecollisions_lo;
2285 u32 tx_multiplecollisions_hi;
2286 u32 tx_deferred_lo;
2287 u32 tx_deferred_hi;
2288 u32 tx_excessivecollisions_lo;
2289 u32 tx_excessivecollisions_hi;
2290 u32 tx_latecollisions_lo;
2291 u32 tx_latecollisions_hi;
2292 } stats_tx;
2293
2294 struct {
2295 u32 rx_gr64_lo;
2296 u32 rx_gr64_hi;
2297 u32 rx_gr127_lo;
2298 u32 rx_gr127_hi;
2299 u32 rx_gr255_lo;
2300 u32 rx_gr255_hi;
2301 u32 rx_gr511_lo;
2302 u32 rx_gr511_hi;
2303 u32 rx_gr1023_lo;
2304 u32 rx_gr1023_hi;
2305 u32 rx_gr1518_lo;
2306 u32 rx_gr1518_hi;
2307 u32 rx_gr2047_lo;
2308 u32 rx_gr2047_hi;
2309 u32 rx_gr4095_lo;
2310 u32 rx_gr4095_hi;
2311 u32 rx_gr9216_lo;
2312 u32 rx_gr9216_hi;
2313 u32 rx_gr16383_lo;
2314 u32 rx_gr16383_hi;
2315 u32 rx_grpkt_lo;
2316 u32 rx_grpkt_hi;
2317 u32 rx_grfcs_lo;
2318 u32 rx_grfcs_hi;
2319 u32 rx_gruca_lo;
2320 u32 rx_gruca_hi;
2321 u32 rx_grmca_lo;
2322 u32 rx_grmca_hi;
2323 u32 rx_grbca_lo;
2324 u32 rx_grbca_hi;
2325 u32 rx_grxpf_lo;
2326 u32 rx_grxpf_hi;
2327 u32 rx_grxpp_lo;
2328 u32 rx_grxpp_hi;
2329 u32 rx_grxuo_lo;
2330 u32 rx_grxuo_hi;
2331 u32 rx_grovr_lo;
2332 u32 rx_grovr_hi;
2333 u32 rx_grxcf_lo;
2334 u32 rx_grxcf_hi;
2335 u32 rx_grflr_lo;
2336 u32 rx_grflr_hi;
2337 u32 rx_grpok_lo;
2338 u32 rx_grpok_hi;
2339 u32 rx_grbyt_lo;
2340 u32 rx_grbyt_hi;
2341 u32 rx_grund_lo;
2342 u32 rx_grund_hi;
2343 u32 rx_grfrg_lo;
2344 u32 rx_grfrg_hi;
2345 u32 rx_grerb_lo;
2346 u32 rx_grerb_hi;
2347 u32 rx_grfre_lo;
2348 u32 rx_grfre_hi;
2349
2350 u32 rx_alignmenterrors_lo;
2351 u32 rx_alignmenterrors_hi;
2352 u32 rx_falsecarrier_lo;
2353 u32 rx_falsecarrier_hi;
2354 u32 rx_llfcmsgcnt_lo;
2355 u32 rx_llfcmsgcnt_hi;
2356 } stats_rx;
2357};
2358
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002359union mac_stats {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002360 struct emac_stats emac_stats;
2361 struct bmac1_stats bmac1_stats;
2362 struct bmac2_stats bmac2_stats;
2363 struct mstat_stats mstat_stats;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002364};
2365
2366
2367struct mac_stx {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002368 /* in_bad_octets */
2369 u32 rx_stat_ifhcinbadoctets_hi;
2370 u32 rx_stat_ifhcinbadoctets_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002371
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002372 /* out_bad_octets */
2373 u32 tx_stat_ifhcoutbadoctets_hi;
2374 u32 tx_stat_ifhcoutbadoctets_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002375
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002376 /* crc_receive_errors */
2377 u32 rx_stat_dot3statsfcserrors_hi;
2378 u32 rx_stat_dot3statsfcserrors_lo;
2379 /* alignment_errors */
2380 u32 rx_stat_dot3statsalignmenterrors_hi;
2381 u32 rx_stat_dot3statsalignmenterrors_lo;
2382 /* carrier_sense_errors */
2383 u32 rx_stat_dot3statscarriersenseerrors_hi;
2384 u32 rx_stat_dot3statscarriersenseerrors_lo;
2385 /* false_carrier_detections */
2386 u32 rx_stat_falsecarriererrors_hi;
2387 u32 rx_stat_falsecarriererrors_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002388
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002389 /* runt_packets_received */
2390 u32 rx_stat_etherstatsundersizepkts_hi;
2391 u32 rx_stat_etherstatsundersizepkts_lo;
2392 /* jabber_packets_received */
2393 u32 rx_stat_dot3statsframestoolong_hi;
2394 u32 rx_stat_dot3statsframestoolong_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002395
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002396 /* error_runt_packets_received */
2397 u32 rx_stat_etherstatsfragments_hi;
2398 u32 rx_stat_etherstatsfragments_lo;
2399 /* error_jabber_packets_received */
2400 u32 rx_stat_etherstatsjabbers_hi;
2401 u32 rx_stat_etherstatsjabbers_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002402
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002403 /* control_frames_received */
2404 u32 rx_stat_maccontrolframesreceived_hi;
2405 u32 rx_stat_maccontrolframesreceived_lo;
2406 u32 rx_stat_mac_xpf_hi;
2407 u32 rx_stat_mac_xpf_lo;
2408 u32 rx_stat_mac_xcf_hi;
2409 u32 rx_stat_mac_xcf_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002410
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002411 /* xoff_state_entered */
2412 u32 rx_stat_xoffstateentered_hi;
2413 u32 rx_stat_xoffstateentered_lo;
2414 /* pause_xon_frames_received */
2415 u32 rx_stat_xonpauseframesreceived_hi;
2416 u32 rx_stat_xonpauseframesreceived_lo;
2417 /* pause_xoff_frames_received */
2418 u32 rx_stat_xoffpauseframesreceived_hi;
2419 u32 rx_stat_xoffpauseframesreceived_lo;
2420 /* pause_xon_frames_transmitted */
2421 u32 tx_stat_outxonsent_hi;
2422 u32 tx_stat_outxonsent_lo;
2423 /* pause_xoff_frames_transmitted */
2424 u32 tx_stat_outxoffsent_hi;
2425 u32 tx_stat_outxoffsent_lo;
2426 /* flow_control_done */
2427 u32 tx_stat_flowcontroldone_hi;
2428 u32 tx_stat_flowcontroldone_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002429
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002430 /* ether_stats_collisions */
2431 u32 tx_stat_etherstatscollisions_hi;
2432 u32 tx_stat_etherstatscollisions_lo;
2433 /* single_collision_transmit_frames */
2434 u32 tx_stat_dot3statssinglecollisionframes_hi;
2435 u32 tx_stat_dot3statssinglecollisionframes_lo;
2436 /* multiple_collision_transmit_frames */
2437 u32 tx_stat_dot3statsmultiplecollisionframes_hi;
2438 u32 tx_stat_dot3statsmultiplecollisionframes_lo;
2439 /* deferred_transmissions */
2440 u32 tx_stat_dot3statsdeferredtransmissions_hi;
2441 u32 tx_stat_dot3statsdeferredtransmissions_lo;
2442 /* excessive_collision_frames */
2443 u32 tx_stat_dot3statsexcessivecollisions_hi;
2444 u32 tx_stat_dot3statsexcessivecollisions_lo;
2445 /* late_collision_frames */
2446 u32 tx_stat_dot3statslatecollisions_hi;
2447 u32 tx_stat_dot3statslatecollisions_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002448
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002449 /* frames_transmitted_64_bytes */
2450 u32 tx_stat_etherstatspkts64octets_hi;
2451 u32 tx_stat_etherstatspkts64octets_lo;
2452 /* frames_transmitted_65_127_bytes */
2453 u32 tx_stat_etherstatspkts65octetsto127octets_hi;
2454 u32 tx_stat_etherstatspkts65octetsto127octets_lo;
2455 /* frames_transmitted_128_255_bytes */
2456 u32 tx_stat_etherstatspkts128octetsto255octets_hi;
2457 u32 tx_stat_etherstatspkts128octetsto255octets_lo;
2458 /* frames_transmitted_256_511_bytes */
2459 u32 tx_stat_etherstatspkts256octetsto511octets_hi;
2460 u32 tx_stat_etherstatspkts256octetsto511octets_lo;
2461 /* frames_transmitted_512_1023_bytes */
2462 u32 tx_stat_etherstatspkts512octetsto1023octets_hi;
2463 u32 tx_stat_etherstatspkts512octetsto1023octets_lo;
2464 /* frames_transmitted_1024_1522_bytes */
2465 u32 tx_stat_etherstatspkts1024octetsto1522octets_hi;
2466 u32 tx_stat_etherstatspkts1024octetsto1522octets_lo;
2467 /* frames_transmitted_1523_9022_bytes */
2468 u32 tx_stat_etherstatspktsover1522octets_hi;
2469 u32 tx_stat_etherstatspktsover1522octets_lo;
2470 u32 tx_stat_mac_2047_hi;
2471 u32 tx_stat_mac_2047_lo;
2472 u32 tx_stat_mac_4095_hi;
2473 u32 tx_stat_mac_4095_lo;
2474 u32 tx_stat_mac_9216_hi;
2475 u32 tx_stat_mac_9216_lo;
2476 u32 tx_stat_mac_16383_hi;
2477 u32 tx_stat_mac_16383_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002478
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002479 /* internal_mac_transmit_errors */
2480 u32 tx_stat_dot3statsinternalmactransmiterrors_hi;
2481 u32 tx_stat_dot3statsinternalmactransmiterrors_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002482
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002483 /* if_out_discards */
2484 u32 tx_stat_mac_ufl_hi;
2485 u32 tx_stat_mac_ufl_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002486};
2487
2488
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002489#define MAC_STX_IDX_MAX 2
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002490
2491struct host_port_stats {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002492 u32 host_port_stats_start;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002493
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002494 struct mac_stx mac_stx[MAC_STX_IDX_MAX];
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002495
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002496 u32 brb_drop_hi;
2497 u32 brb_drop_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002498
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002499 u32 host_port_stats_end;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002500};
2501
2502
2503struct host_func_stats {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002504 u32 host_func_stats_start;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002505
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002506 u32 total_bytes_received_hi;
2507 u32 total_bytes_received_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002508
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002509 u32 total_bytes_transmitted_hi;
2510 u32 total_bytes_transmitted_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002511
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002512 u32 total_unicast_packets_received_hi;
2513 u32 total_unicast_packets_received_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002514
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002515 u32 total_multicast_packets_received_hi;
2516 u32 total_multicast_packets_received_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002517
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002518 u32 total_broadcast_packets_received_hi;
2519 u32 total_broadcast_packets_received_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002520
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002521 u32 total_unicast_packets_transmitted_hi;
2522 u32 total_unicast_packets_transmitted_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002523
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002524 u32 total_multicast_packets_transmitted_hi;
2525 u32 total_multicast_packets_transmitted_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002526
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002527 u32 total_broadcast_packets_transmitted_hi;
2528 u32 total_broadcast_packets_transmitted_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002529
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002530 u32 valid_bytes_received_hi;
2531 u32 valid_bytes_received_lo;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002532
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002533 u32 host_func_stats_end;
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07002534};
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002535
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002536/* VIC definitions */
2537#define VICSTATST_UIF_INDEX 2
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002538
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002539#define BCM_5710_FW_MAJOR_VERSION 7
2540#define BCM_5710_FW_MINOR_VERSION 0
2541#define BCM_5710_FW_REVISION_VERSION 20
2542#define BCM_5710_FW_ENGINEERING_VERSION 0
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002543#define BCM_5710_FW_COMPILE_FLAGS 1
2544
2545
2546/*
2547 * attention bits
2548 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002549struct atten_sp_status_block {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002550 __le32 attn_bits;
2551 __le32 attn_bits_ack;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002552 u8 status_block_id;
2553 u8 reserved0;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002554 __le16 attn_bits_index;
2555 __le32 reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002556};
2557
2558
2559/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002560 * The eth aggregative context of Cstorm
2561 */
2562struct cstorm_eth_ag_context {
2563 u32 __reserved0[10];
2564};
2565
2566
2567/*
2568 * dmae command structure
2569 */
2570struct dmae_command {
2571 u32 opcode;
2572#define DMAE_COMMAND_SRC (0x1<<0)
2573#define DMAE_COMMAND_SRC_SHIFT 0
2574#define DMAE_COMMAND_DST (0x3<<1)
2575#define DMAE_COMMAND_DST_SHIFT 1
2576#define DMAE_COMMAND_C_DST (0x1<<3)
2577#define DMAE_COMMAND_C_DST_SHIFT 3
2578#define DMAE_COMMAND_C_TYPE_ENABLE (0x1<<4)
2579#define DMAE_COMMAND_C_TYPE_ENABLE_SHIFT 4
2580#define DMAE_COMMAND_C_TYPE_CRC_ENABLE (0x1<<5)
2581#define DMAE_COMMAND_C_TYPE_CRC_ENABLE_SHIFT 5
2582#define DMAE_COMMAND_C_TYPE_CRC_OFFSET (0x7<<6)
2583#define DMAE_COMMAND_C_TYPE_CRC_OFFSET_SHIFT 6
2584#define DMAE_COMMAND_ENDIANITY (0x3<<9)
2585#define DMAE_COMMAND_ENDIANITY_SHIFT 9
2586#define DMAE_COMMAND_PORT (0x1<<11)
2587#define DMAE_COMMAND_PORT_SHIFT 11
2588#define DMAE_COMMAND_CRC_RESET (0x1<<12)
2589#define DMAE_COMMAND_CRC_RESET_SHIFT 12
2590#define DMAE_COMMAND_SRC_RESET (0x1<<13)
2591#define DMAE_COMMAND_SRC_RESET_SHIFT 13
2592#define DMAE_COMMAND_DST_RESET (0x1<<14)
2593#define DMAE_COMMAND_DST_RESET_SHIFT 14
2594#define DMAE_COMMAND_E1HVN (0x3<<15)
2595#define DMAE_COMMAND_E1HVN_SHIFT 15
2596#define DMAE_COMMAND_DST_VN (0x3<<17)
2597#define DMAE_COMMAND_DST_VN_SHIFT 17
2598#define DMAE_COMMAND_C_FUNC (0x1<<19)
2599#define DMAE_COMMAND_C_FUNC_SHIFT 19
2600#define DMAE_COMMAND_ERR_POLICY (0x3<<20)
2601#define DMAE_COMMAND_ERR_POLICY_SHIFT 20
2602#define DMAE_COMMAND_RESERVED0 (0x3FF<<22)
2603#define DMAE_COMMAND_RESERVED0_SHIFT 22
2604 u32 src_addr_lo;
2605 u32 src_addr_hi;
2606 u32 dst_addr_lo;
2607 u32 dst_addr_hi;
2608#if defined(__BIG_ENDIAN)
2609 u16 opcode_iov;
2610#define DMAE_COMMAND_SRC_VFID (0x3F<<0)
2611#define DMAE_COMMAND_SRC_VFID_SHIFT 0
2612#define DMAE_COMMAND_SRC_VFPF (0x1<<6)
2613#define DMAE_COMMAND_SRC_VFPF_SHIFT 6
2614#define DMAE_COMMAND_RESERVED1 (0x1<<7)
2615#define DMAE_COMMAND_RESERVED1_SHIFT 7
2616#define DMAE_COMMAND_DST_VFID (0x3F<<8)
2617#define DMAE_COMMAND_DST_VFID_SHIFT 8
2618#define DMAE_COMMAND_DST_VFPF (0x1<<14)
2619#define DMAE_COMMAND_DST_VFPF_SHIFT 14
2620#define DMAE_COMMAND_RESERVED2 (0x1<<15)
2621#define DMAE_COMMAND_RESERVED2_SHIFT 15
2622 u16 len;
2623#elif defined(__LITTLE_ENDIAN)
2624 u16 len;
2625 u16 opcode_iov;
2626#define DMAE_COMMAND_SRC_VFID (0x3F<<0)
2627#define DMAE_COMMAND_SRC_VFID_SHIFT 0
2628#define DMAE_COMMAND_SRC_VFPF (0x1<<6)
2629#define DMAE_COMMAND_SRC_VFPF_SHIFT 6
2630#define DMAE_COMMAND_RESERVED1 (0x1<<7)
2631#define DMAE_COMMAND_RESERVED1_SHIFT 7
2632#define DMAE_COMMAND_DST_VFID (0x3F<<8)
2633#define DMAE_COMMAND_DST_VFID_SHIFT 8
2634#define DMAE_COMMAND_DST_VFPF (0x1<<14)
2635#define DMAE_COMMAND_DST_VFPF_SHIFT 14
2636#define DMAE_COMMAND_RESERVED2 (0x1<<15)
2637#define DMAE_COMMAND_RESERVED2_SHIFT 15
2638#endif
2639 u32 comp_addr_lo;
2640 u32 comp_addr_hi;
2641 u32 comp_val;
2642 u32 crc32;
2643 u32 crc32_c;
2644#if defined(__BIG_ENDIAN)
2645 u16 crc16_c;
2646 u16 crc16;
2647#elif defined(__LITTLE_ENDIAN)
2648 u16 crc16;
2649 u16 crc16_c;
2650#endif
2651#if defined(__BIG_ENDIAN)
2652 u16 reserved3;
2653 u16 crc_t10;
2654#elif defined(__LITTLE_ENDIAN)
2655 u16 crc_t10;
2656 u16 reserved3;
2657#endif
2658#if defined(__BIG_ENDIAN)
2659 u16 xsum8;
2660 u16 xsum16;
2661#elif defined(__LITTLE_ENDIAN)
2662 u16 xsum16;
2663 u16 xsum8;
2664#endif
2665};
2666
2667
2668/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002669 * common data for all protocols
2670 */
2671struct doorbell_hdr {
2672 u8 header;
2673#define DOORBELL_HDR_RX (0x1<<0)
2674#define DOORBELL_HDR_RX_SHIFT 0
2675#define DOORBELL_HDR_DB_TYPE (0x1<<1)
2676#define DOORBELL_HDR_DB_TYPE_SHIFT 1
2677#define DOORBELL_HDR_DPM_SIZE (0x3<<2)
2678#define DOORBELL_HDR_DPM_SIZE_SHIFT 2
2679#define DOORBELL_HDR_CONN_TYPE (0xF<<4)
2680#define DOORBELL_HDR_CONN_TYPE_SHIFT 4
2681};
2682
2683/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002684 * Ethernet doorbell
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002685 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002686struct eth_tx_doorbell {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002687#if defined(__BIG_ENDIAN)
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002688 u16 npackets;
2689 u8 params;
2690#define ETH_TX_DOORBELL_NUM_BDS (0x3F<<0)
2691#define ETH_TX_DOORBELL_NUM_BDS_SHIFT 0
2692#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG (0x1<<6)
2693#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG_SHIFT 6
2694#define ETH_TX_DOORBELL_SPARE (0x1<<7)
2695#define ETH_TX_DOORBELL_SPARE_SHIFT 7
2696 struct doorbell_hdr hdr;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002697#elif defined(__LITTLE_ENDIAN)
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002698 struct doorbell_hdr hdr;
2699 u8 params;
2700#define ETH_TX_DOORBELL_NUM_BDS (0x3F<<0)
2701#define ETH_TX_DOORBELL_NUM_BDS_SHIFT 0
2702#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG (0x1<<6)
2703#define ETH_TX_DOORBELL_RESERVED_TX_FIN_FLAG_SHIFT 6
2704#define ETH_TX_DOORBELL_SPARE (0x1<<7)
2705#define ETH_TX_DOORBELL_SPARE_SHIFT 7
2706 u16 npackets;
Eilon Greensteinca003922009-08-12 22:53:28 -07002707#endif
2708};
2709
2710
2711/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002712 * 3 lines. status block
2713 */
2714struct hc_status_block_e1x {
2715 __le16 index_values[HC_SB_MAX_INDICES_E1X];
2716 __le16 running_index[HC_SB_MAX_SM];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002717 __le32 rsrv[11];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002718};
2719
2720/*
2721 * host status block
2722 */
2723struct host_hc_status_block_e1x {
2724 struct hc_status_block_e1x sb;
2725};
2726
2727
2728/*
2729 * 3 lines. status block
2730 */
2731struct hc_status_block_e2 {
2732 __le16 index_values[HC_SB_MAX_INDICES_E2];
2733 __le16 running_index[HC_SB_MAX_SM];
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002734 __le32 reserved[11];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002735};
2736
2737/*
2738 * host status block
2739 */
2740struct host_hc_status_block_e2 {
2741 struct hc_status_block_e2 sb;
2742};
2743
2744
2745/*
2746 * 5 lines. slow-path status block
2747 */
2748struct hc_sp_status_block {
2749 __le16 index_values[HC_SP_SB_MAX_INDICES];
2750 __le16 running_index;
2751 __le16 rsrv;
2752 u32 rsrv1;
2753};
2754
2755/*
2756 * host status block
2757 */
2758struct host_sp_status_block {
2759 struct atten_sp_status_block atten_status_block;
2760 struct hc_sp_status_block sp_sb;
2761};
2762
2763
2764/*
2765 * IGU driver acknowledgment register
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002766 */
2767struct igu_ack_register {
2768#if defined(__BIG_ENDIAN)
2769 u16 sb_id_and_flags;
2770#define IGU_ACK_REGISTER_STATUS_BLOCK_ID (0x1F<<0)
2771#define IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT 0
2772#define IGU_ACK_REGISTER_STORM_ID (0x7<<5)
2773#define IGU_ACK_REGISTER_STORM_ID_SHIFT 5
2774#define IGU_ACK_REGISTER_UPDATE_INDEX (0x1<<8)
2775#define IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT 8
2776#define IGU_ACK_REGISTER_INTERRUPT_MODE (0x3<<9)
2777#define IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT 9
2778#define IGU_ACK_REGISTER_RESERVED (0x1F<<11)
2779#define IGU_ACK_REGISTER_RESERVED_SHIFT 11
2780 u16 status_block_index;
2781#elif defined(__LITTLE_ENDIAN)
2782 u16 status_block_index;
2783 u16 sb_id_and_flags;
2784#define IGU_ACK_REGISTER_STATUS_BLOCK_ID (0x1F<<0)
2785#define IGU_ACK_REGISTER_STATUS_BLOCK_ID_SHIFT 0
2786#define IGU_ACK_REGISTER_STORM_ID (0x7<<5)
2787#define IGU_ACK_REGISTER_STORM_ID_SHIFT 5
2788#define IGU_ACK_REGISTER_UPDATE_INDEX (0x1<<8)
2789#define IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT 8
2790#define IGU_ACK_REGISTER_INTERRUPT_MODE (0x3<<9)
2791#define IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT 9
2792#define IGU_ACK_REGISTER_RESERVED (0x1F<<11)
2793#define IGU_ACK_REGISTER_RESERVED_SHIFT 11
2794#endif
2795};
2796
2797
2798/*
Eilon Greensteinca003922009-08-12 22:53:28 -07002799 * IGU driver acknowledgement register
2800 */
2801struct igu_backward_compatible {
2802 u32 sb_id_and_flags;
2803#define IGU_BACKWARD_COMPATIBLE_SB_INDEX (0xFFFF<<0)
2804#define IGU_BACKWARD_COMPATIBLE_SB_INDEX_SHIFT 0
2805#define IGU_BACKWARD_COMPATIBLE_SB_SELECT (0x1F<<16)
2806#define IGU_BACKWARD_COMPATIBLE_SB_SELECT_SHIFT 16
2807#define IGU_BACKWARD_COMPATIBLE_SEGMENT_ACCESS (0x7<<21)
2808#define IGU_BACKWARD_COMPATIBLE_SEGMENT_ACCESS_SHIFT 21
2809#define IGU_BACKWARD_COMPATIBLE_BUPDATE (0x1<<24)
2810#define IGU_BACKWARD_COMPATIBLE_BUPDATE_SHIFT 24
2811#define IGU_BACKWARD_COMPATIBLE_ENABLE_INT (0x3<<25)
2812#define IGU_BACKWARD_COMPATIBLE_ENABLE_INT_SHIFT 25
2813#define IGU_BACKWARD_COMPATIBLE_RESERVED_0 (0x1F<<27)
2814#define IGU_BACKWARD_COMPATIBLE_RESERVED_0_SHIFT 27
2815 u32 reserved_2;
2816};
2817
2818
2819/*
2820 * IGU driver acknowledgement register
2821 */
2822struct igu_regular {
2823 u32 sb_id_and_flags;
2824#define IGU_REGULAR_SB_INDEX (0xFFFFF<<0)
2825#define IGU_REGULAR_SB_INDEX_SHIFT 0
2826#define IGU_REGULAR_RESERVED0 (0x1<<20)
2827#define IGU_REGULAR_RESERVED0_SHIFT 20
2828#define IGU_REGULAR_SEGMENT_ACCESS (0x7<<21)
2829#define IGU_REGULAR_SEGMENT_ACCESS_SHIFT 21
2830#define IGU_REGULAR_BUPDATE (0x1<<24)
2831#define IGU_REGULAR_BUPDATE_SHIFT 24
2832#define IGU_REGULAR_ENABLE_INT (0x3<<25)
2833#define IGU_REGULAR_ENABLE_INT_SHIFT 25
2834#define IGU_REGULAR_RESERVED_1 (0x1<<27)
2835#define IGU_REGULAR_RESERVED_1_SHIFT 27
2836#define IGU_REGULAR_CLEANUP_TYPE (0x3<<28)
2837#define IGU_REGULAR_CLEANUP_TYPE_SHIFT 28
2838#define IGU_REGULAR_CLEANUP_SET (0x1<<30)
2839#define IGU_REGULAR_CLEANUP_SET_SHIFT 30
2840#define IGU_REGULAR_BCLEANUP (0x1<<31)
2841#define IGU_REGULAR_BCLEANUP_SHIFT 31
2842 u32 reserved_2;
2843};
2844
2845/*
2846 * IGU driver acknowledgement register
2847 */
2848union igu_consprod_reg {
2849 struct igu_regular regular;
2850 struct igu_backward_compatible backward_compatible;
2851};
2852
2853
2854/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002855 * Igu control commands
2856 */
2857enum igu_ctrl_cmd {
2858 IGU_CTRL_CMD_TYPE_RD,
2859 IGU_CTRL_CMD_TYPE_WR,
2860 MAX_IGU_CTRL_CMD
2861};
2862
2863
2864/*
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00002865 * Control register for the IGU command register
2866 */
2867struct igu_ctrl_reg {
2868 u32 ctrl_data;
2869#define IGU_CTRL_REG_ADDRESS (0xFFF<<0)
2870#define IGU_CTRL_REG_ADDRESS_SHIFT 0
2871#define IGU_CTRL_REG_FID (0x7F<<12)
2872#define IGU_CTRL_REG_FID_SHIFT 12
2873#define IGU_CTRL_REG_RESERVED (0x1<<19)
2874#define IGU_CTRL_REG_RESERVED_SHIFT 19
2875#define IGU_CTRL_REG_TYPE (0x1<<20)
2876#define IGU_CTRL_REG_TYPE_SHIFT 20
2877#define IGU_CTRL_REG_UNUSED (0x7FF<<21)
2878#define IGU_CTRL_REG_UNUSED_SHIFT 21
2879};
2880
2881
2882/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002883 * Igu interrupt command
2884 */
2885enum igu_int_cmd {
2886 IGU_INT_ENABLE,
2887 IGU_INT_DISABLE,
2888 IGU_INT_NOP,
2889 IGU_INT_NOP2,
2890 MAX_IGU_INT_CMD
2891};
2892
2893
2894/*
2895 * Igu segments
2896 */
2897enum igu_seg_access {
2898 IGU_SEG_ACCESS_NORM,
2899 IGU_SEG_ACCESS_DEF,
2900 IGU_SEG_ACCESS_ATTN,
2901 MAX_IGU_SEG_ACCESS
2902};
2903
2904
2905/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002906 * Parser parsing flags field
2907 */
2908struct parsing_flags {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00002909 __le16 flags;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002910#define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE (0x1<<0)
2911#define PARSING_FLAGS_ETHERNET_ADDRESS_TYPE_SHIFT 0
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002912#define PARSING_FLAGS_VLAN (0x1<<1)
2913#define PARSING_FLAGS_VLAN_SHIFT 1
2914#define PARSING_FLAGS_EXTRA_VLAN (0x1<<2)
2915#define PARSING_FLAGS_EXTRA_VLAN_SHIFT 2
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002916#define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL (0x3<<3)
2917#define PARSING_FLAGS_OVER_ETHERNET_PROTOCOL_SHIFT 3
2918#define PARSING_FLAGS_IP_OPTIONS (0x1<<5)
2919#define PARSING_FLAGS_IP_OPTIONS_SHIFT 5
2920#define PARSING_FLAGS_FRAGMENTATION_STATUS (0x1<<6)
2921#define PARSING_FLAGS_FRAGMENTATION_STATUS_SHIFT 6
2922#define PARSING_FLAGS_OVER_IP_PROTOCOL (0x3<<7)
2923#define PARSING_FLAGS_OVER_IP_PROTOCOL_SHIFT 7
2924#define PARSING_FLAGS_PURE_ACK_INDICATION (0x1<<9)
2925#define PARSING_FLAGS_PURE_ACK_INDICATION_SHIFT 9
2926#define PARSING_FLAGS_TCP_OPTIONS_EXIST (0x1<<10)
2927#define PARSING_FLAGS_TCP_OPTIONS_EXIST_SHIFT 10
2928#define PARSING_FLAGS_TIME_STAMP_EXIST_FLAG (0x1<<11)
2929#define PARSING_FLAGS_TIME_STAMP_EXIST_FLAG_SHIFT 11
2930#define PARSING_FLAGS_CONNECTION_MATCH (0x1<<12)
2931#define PARSING_FLAGS_CONNECTION_MATCH_SHIFT 12
2932#define PARSING_FLAGS_LLC_SNAP (0x1<<13)
2933#define PARSING_FLAGS_LLC_SNAP_SHIFT 13
2934#define PARSING_FLAGS_RESERVED0 (0x3<<14)
2935#define PARSING_FLAGS_RESERVED0_SHIFT 14
2936};
2937
2938
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002939/*
2940 * Parsing flags for TCP ACK type
2941 */
2942enum prs_flags_ack_type {
2943 PRS_FLAG_PUREACK_PIGGY,
2944 PRS_FLAG_PUREACK_PURE,
2945 MAX_PRS_FLAGS_ACK_TYPE
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002946};
2947
2948
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002949/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002950 * Parsing flags for Ethernet address type
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002951 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002952enum prs_flags_eth_addr_type {
2953 PRS_FLAG_ETHTYPE_NON_UNICAST,
2954 PRS_FLAG_ETHTYPE_UNICAST,
2955 MAX_PRS_FLAGS_ETH_ADDR_TYPE
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002956};
2957
2958
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03002959/*
2960 * Parsing flags for over-ethernet protocol
2961 */
2962enum prs_flags_over_eth {
2963 PRS_FLAG_OVERETH_UNKNOWN,
2964 PRS_FLAG_OVERETH_IPV4,
2965 PRS_FLAG_OVERETH_IPV6,
2966 PRS_FLAG_OVERETH_LLCSNAP_UNKNOWN,
2967 MAX_PRS_FLAGS_OVER_ETH
2968};
2969
2970
2971/*
2972 * Parsing flags for over-IP protocol
2973 */
2974enum prs_flags_over_ip {
2975 PRS_FLAG_OVERIP_UNKNOWN,
2976 PRS_FLAG_OVERIP_TCP,
2977 PRS_FLAG_OVERIP_UDP,
2978 MAX_PRS_FLAGS_OVER_IP
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002979};
2980
2981
2982/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002983 * SDM operation gen command (generate aggregative interrupt)
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002984 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00002985struct sdm_op_gen {
2986 __le32 command;
2987#define SDM_OP_GEN_COMP_PARAM (0x1F<<0)
2988#define SDM_OP_GEN_COMP_PARAM_SHIFT 0
2989#define SDM_OP_GEN_COMP_TYPE (0x7<<5)
2990#define SDM_OP_GEN_COMP_TYPE_SHIFT 5
2991#define SDM_OP_GEN_AGG_VECT_IDX (0xFF<<8)
2992#define SDM_OP_GEN_AGG_VECT_IDX_SHIFT 8
2993#define SDM_OP_GEN_AGG_VECT_IDX_VALID (0x1<<16)
2994#define SDM_OP_GEN_AGG_VECT_IDX_VALID_SHIFT 16
2995#define SDM_OP_GEN_RESERVED (0x7FFF<<17)
2996#define SDM_OP_GEN_RESERVED_SHIFT 17
Eilon Greenstein34f80b02008-06-23 20:33:01 -07002997};
2998
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02002999
3000/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003001 * Timers connection context
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003002 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003003struct timers_block_context {
3004 u32 __reserved_0;
3005 u32 __reserved_1;
3006 u32 __reserved_2;
3007 u32 flags;
3008#define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS (0x3<<0)
3009#define __TIMERS_BLOCK_CONTEXT_NUM_OF_ACTIVE_TIMERS_SHIFT 0
3010#define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG (0x1<<2)
3011#define TIMERS_BLOCK_CONTEXT_CONN_VALID_FLG_SHIFT 2
3012#define __TIMERS_BLOCK_CONTEXT_RESERVED0 (0x1FFFFFFF<<3)
3013#define __TIMERS_BLOCK_CONTEXT_RESERVED0_SHIFT 3
Eilon Greenstein34f80b02008-06-23 20:33:01 -07003014};
3015
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003016
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003017/*
3018 * The eth aggregative context of Tstorm
3019 */
3020struct tstorm_eth_ag_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003021 u32 __reserved0[14];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003022};
3023
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003024
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003025/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003026 * The eth aggregative context of Ustorm
3027 */
3028struct ustorm_eth_ag_context {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003029 u32 __reserved0;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003030#if defined(__BIG_ENDIAN)
3031 u8 cdu_usage;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003032 u8 __reserved2;
3033 u16 __reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003034#elif defined(__LITTLE_ENDIAN)
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003035 u16 __reserved1;
3036 u8 __reserved2;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003037 u8 cdu_usage;
3038#endif
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003039 u32 __reserved3[6];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003040};
3041
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003042
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003043/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003044 * The eth aggregative context of Xstorm
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003045 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003046struct xstorm_eth_ag_context {
3047 u32 reserved0;
3048#if defined(__BIG_ENDIAN)
3049 u8 cdu_reserved;
3050 u8 reserved2;
3051 u16 reserved1;
3052#elif defined(__LITTLE_ENDIAN)
3053 u16 reserved1;
3054 u8 reserved2;
3055 u8 cdu_reserved;
3056#endif
3057 u32 reserved3[30];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003058};
3059
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003060
3061/*
3062 * doorbell message sent to the chip
3063 */
3064struct doorbell {
3065#if defined(__BIG_ENDIAN)
3066 u16 zero_fill2;
3067 u8 zero_fill1;
3068 struct doorbell_hdr header;
3069#elif defined(__LITTLE_ENDIAN)
3070 struct doorbell_hdr header;
3071 u8 zero_fill1;
3072 u16 zero_fill2;
3073#endif
3074};
3075
3076
3077/*
3078 * doorbell message sent to the chip
3079 */
3080struct doorbell_set_prod {
3081#if defined(__BIG_ENDIAN)
3082 u16 prod;
3083 u8 zero_fill1;
3084 struct doorbell_hdr header;
3085#elif defined(__LITTLE_ENDIAN)
3086 struct doorbell_hdr header;
3087 u8 zero_fill1;
3088 u16 prod;
3089#endif
3090};
3091
3092
3093struct regpair {
3094 __le32 lo;
3095 __le32 hi;
3096};
3097
3098
3099/*
3100 * Classify rule opcodes in E2/E3
3101 */
3102enum classify_rule {
3103 CLASSIFY_RULE_OPCODE_MAC,
3104 CLASSIFY_RULE_OPCODE_VLAN,
3105 CLASSIFY_RULE_OPCODE_PAIR,
3106 MAX_CLASSIFY_RULE
3107};
3108
3109
3110/*
3111 * Classify rule types in E2/E3
3112 */
3113enum classify_rule_action_type {
3114 CLASSIFY_RULE_REMOVE,
3115 CLASSIFY_RULE_ADD,
3116 MAX_CLASSIFY_RULE_ACTION_TYPE
3117};
3118
3119
3120/*
3121 * client init ramrod data
3122 */
3123struct client_init_general_data {
3124 u8 client_id;
3125 u8 statistics_counter_id;
3126 u8 statistics_en_flg;
3127 u8 is_fcoe_flg;
3128 u8 activate_flg;
3129 u8 sp_client_id;
3130 __le16 mtu;
3131 u8 statistics_zero_flg;
3132 u8 func_id;
3133 u8 cos;
3134 u8 traffic_type;
3135 u32 reserved0;
3136};
3137
3138
3139/*
3140 * client init rx data
3141 */
3142struct client_init_rx_data {
3143 u8 tpa_en;
3144#define CLIENT_INIT_RX_DATA_TPA_EN_IPV4 (0x1<<0)
3145#define CLIENT_INIT_RX_DATA_TPA_EN_IPV4_SHIFT 0
3146#define CLIENT_INIT_RX_DATA_TPA_EN_IPV6 (0x1<<1)
3147#define CLIENT_INIT_RX_DATA_TPA_EN_IPV6_SHIFT 1
3148#define CLIENT_INIT_RX_DATA_RESERVED5 (0x3F<<2)
3149#define CLIENT_INIT_RX_DATA_RESERVED5_SHIFT 2
3150 u8 vmqueue_mode_en_flg;
3151 u8 extra_data_over_sgl_en_flg;
3152 u8 cache_line_alignment_log_size;
3153 u8 enable_dynamic_hc;
3154 u8 max_sges_for_packet;
3155 u8 client_qzone_id;
3156 u8 drop_ip_cs_err_flg;
3157 u8 drop_tcp_cs_err_flg;
3158 u8 drop_ttl0_flg;
3159 u8 drop_udp_cs_err_flg;
3160 u8 inner_vlan_removal_enable_flg;
3161 u8 outer_vlan_removal_enable_flg;
3162 u8 status_block_id;
3163 u8 rx_sb_index_number;
3164 u8 reserved0;
3165 u8 max_tpa_queues;
3166 u8 silent_vlan_removal_flg;
3167 __le16 max_bytes_on_bd;
3168 __le16 sge_buff_size;
3169 u8 approx_mcast_engine_id;
3170 u8 rss_engine_id;
3171 struct regpair bd_page_base;
3172 struct regpair sge_page_base;
3173 struct regpair cqe_page_base;
3174 u8 is_leading_rss;
3175 u8 is_approx_mcast;
3176 __le16 max_agg_size;
3177 __le16 state;
3178#define CLIENT_INIT_RX_DATA_UCAST_DROP_ALL (0x1<<0)
3179#define CLIENT_INIT_RX_DATA_UCAST_DROP_ALL_SHIFT 0
3180#define CLIENT_INIT_RX_DATA_UCAST_ACCEPT_ALL (0x1<<1)
3181#define CLIENT_INIT_RX_DATA_UCAST_ACCEPT_ALL_SHIFT 1
3182#define CLIENT_INIT_RX_DATA_UCAST_ACCEPT_UNMATCHED (0x1<<2)
3183#define CLIENT_INIT_RX_DATA_UCAST_ACCEPT_UNMATCHED_SHIFT 2
3184#define CLIENT_INIT_RX_DATA_MCAST_DROP_ALL (0x1<<3)
3185#define CLIENT_INIT_RX_DATA_MCAST_DROP_ALL_SHIFT 3
3186#define CLIENT_INIT_RX_DATA_MCAST_ACCEPT_ALL (0x1<<4)
3187#define CLIENT_INIT_RX_DATA_MCAST_ACCEPT_ALL_SHIFT 4
3188#define CLIENT_INIT_RX_DATA_BCAST_ACCEPT_ALL (0x1<<5)
3189#define CLIENT_INIT_RX_DATA_BCAST_ACCEPT_ALL_SHIFT 5
3190#define CLIENT_INIT_RX_DATA_ACCEPT_ANY_VLAN (0x1<<6)
3191#define CLIENT_INIT_RX_DATA_ACCEPT_ANY_VLAN_SHIFT 6
3192#define CLIENT_INIT_RX_DATA_RESERVED2 (0x1FF<<7)
3193#define CLIENT_INIT_RX_DATA_RESERVED2_SHIFT 7
3194 __le16 cqe_pause_thr_low;
3195 __le16 cqe_pause_thr_high;
3196 __le16 bd_pause_thr_low;
3197 __le16 bd_pause_thr_high;
3198 __le16 sge_pause_thr_low;
3199 __le16 sge_pause_thr_high;
3200 __le16 rx_cos_mask;
3201 __le16 silent_vlan_value;
3202 __le16 silent_vlan_mask;
3203 __le32 reserved6[2];
3204};
3205
3206/*
3207 * client init tx data
3208 */
3209struct client_init_tx_data {
3210 u8 enforce_security_flg;
3211 u8 tx_status_block_id;
3212 u8 tx_sb_index_number;
3213 u8 tss_leading_client_id;
3214 u8 tx_switching_flg;
3215 u8 anti_spoofing_flg;
3216 __le16 default_vlan;
3217 struct regpair tx_bd_page_base;
3218 __le16 state;
3219#define CLIENT_INIT_TX_DATA_UCAST_ACCEPT_ALL (0x1<<0)
3220#define CLIENT_INIT_TX_DATA_UCAST_ACCEPT_ALL_SHIFT 0
3221#define CLIENT_INIT_TX_DATA_MCAST_ACCEPT_ALL (0x1<<1)
3222#define CLIENT_INIT_TX_DATA_MCAST_ACCEPT_ALL_SHIFT 1
3223#define CLIENT_INIT_TX_DATA_BCAST_ACCEPT_ALL (0x1<<2)
3224#define CLIENT_INIT_TX_DATA_BCAST_ACCEPT_ALL_SHIFT 2
3225#define CLIENT_INIT_TX_DATA_ACCEPT_ANY_VLAN (0x1<<3)
3226#define CLIENT_INIT_TX_DATA_ACCEPT_ANY_VLAN_SHIFT 3
3227#define CLIENT_INIT_TX_DATA_RESERVED1 (0xFFF<<4)
3228#define CLIENT_INIT_TX_DATA_RESERVED1_SHIFT 4
3229 u8 default_vlan_flg;
3230 u8 reserved2;
3231 __le32 reserved3;
3232};
3233
3234/*
3235 * client init ramrod data
3236 */
3237struct client_init_ramrod_data {
3238 struct client_init_general_data general;
3239 struct client_init_rx_data rx;
3240 struct client_init_tx_data tx;
3241};
3242
3243
3244/*
3245 * client update ramrod data
3246 */
3247struct client_update_ramrod_data {
3248 u8 client_id;
3249 u8 func_id;
3250 u8 inner_vlan_removal_enable_flg;
3251 u8 inner_vlan_removal_change_flg;
3252 u8 outer_vlan_removal_enable_flg;
3253 u8 outer_vlan_removal_change_flg;
3254 u8 anti_spoofing_enable_flg;
3255 u8 anti_spoofing_change_flg;
3256 u8 activate_flg;
3257 u8 activate_change_flg;
3258 __le16 default_vlan;
3259 u8 default_vlan_enable_flg;
3260 u8 default_vlan_change_flg;
3261 __le16 silent_vlan_value;
3262 __le16 silent_vlan_mask;
3263 u8 silent_vlan_removal_flg;
3264 u8 silent_vlan_change_flg;
3265 __le32 echo;
3266};
3267
3268
3269/*
3270 * The eth storm context of Cstorm
3271 */
3272struct cstorm_eth_st_context {
3273 u32 __reserved0[4];
3274};
3275
3276
3277struct double_regpair {
3278 u32 regpair0_lo;
3279 u32 regpair0_hi;
3280 u32 regpair1_lo;
3281 u32 regpair1_hi;
3282};
3283
3284
3285/*
3286 * Ethernet address typesm used in ethernet tx BDs
3287 */
3288enum eth_addr_type {
3289 UNKNOWN_ADDRESS,
3290 UNICAST_ADDRESS,
3291 MULTICAST_ADDRESS,
3292 BROADCAST_ADDRESS,
3293 MAX_ETH_ADDR_TYPE
3294};
3295
3296
3297/*
3298 *
3299 */
3300struct eth_classify_cmd_header {
3301 u8 cmd_general_data;
3302#define ETH_CLASSIFY_CMD_HEADER_RX_CMD (0x1<<0)
3303#define ETH_CLASSIFY_CMD_HEADER_RX_CMD_SHIFT 0
3304#define ETH_CLASSIFY_CMD_HEADER_TX_CMD (0x1<<1)
3305#define ETH_CLASSIFY_CMD_HEADER_TX_CMD_SHIFT 1
3306#define ETH_CLASSIFY_CMD_HEADER_OPCODE (0x3<<2)
3307#define ETH_CLASSIFY_CMD_HEADER_OPCODE_SHIFT 2
3308#define ETH_CLASSIFY_CMD_HEADER_IS_ADD (0x1<<4)
3309#define ETH_CLASSIFY_CMD_HEADER_IS_ADD_SHIFT 4
3310#define ETH_CLASSIFY_CMD_HEADER_RESERVED0 (0x7<<5)
3311#define ETH_CLASSIFY_CMD_HEADER_RESERVED0_SHIFT 5
3312 u8 func_id;
3313 u8 client_id;
3314 u8 reserved1;
3315};
3316
3317
3318/*
3319 * header for eth classification config ramrod
3320 */
3321struct eth_classify_header {
3322 u8 rule_cnt;
3323 u8 reserved0;
3324 __le16 reserved1;
3325 __le32 echo;
3326};
3327
3328
3329/*
3330 * Command for adding/removing a MAC classification rule
3331 */
3332struct eth_classify_mac_cmd {
3333 struct eth_classify_cmd_header header;
3334 __le32 reserved0;
3335 __le16 mac_lsb;
3336 __le16 mac_mid;
3337 __le16 mac_msb;
3338 __le16 reserved1;
3339};
3340
3341
3342/*
3343 * Command for adding/removing a MAC-VLAN pair classification rule
3344 */
3345struct eth_classify_pair_cmd {
3346 struct eth_classify_cmd_header header;
3347 __le32 reserved0;
3348 __le16 mac_lsb;
3349 __le16 mac_mid;
3350 __le16 mac_msb;
3351 __le16 vlan;
3352};
3353
3354
3355/*
3356 * Command for adding/removing a VLAN classification rule
3357 */
3358struct eth_classify_vlan_cmd {
3359 struct eth_classify_cmd_header header;
3360 __le32 reserved0;
3361 __le32 reserved1;
3362 __le16 reserved2;
3363 __le16 vlan;
3364};
3365
3366/*
3367 * union for eth classification rule
3368 */
3369union eth_classify_rule_cmd {
3370 struct eth_classify_mac_cmd mac;
3371 struct eth_classify_vlan_cmd vlan;
3372 struct eth_classify_pair_cmd pair;
3373};
3374
3375/*
3376 * parameters for eth classification configuration ramrod
3377 */
3378struct eth_classify_rules_ramrod_data {
3379 struct eth_classify_header header;
3380 union eth_classify_rule_cmd rules[CLASSIFY_RULES_COUNT];
3381};
3382
3383
3384/*
3385 * The data contain client ID need to the ramrod
3386 */
3387struct eth_common_ramrod_data {
3388 __le32 client_id;
3389 __le32 reserved1;
3390};
3391
3392
3393/*
3394 * The eth storm context of Ustorm
3395 */
3396struct ustorm_eth_st_context {
3397 u32 reserved0[52];
3398};
3399
3400/*
3401 * The eth storm context of Tstorm
3402 */
3403struct tstorm_eth_st_context {
3404 u32 __reserved0[28];
3405};
3406
3407/*
3408 * The eth storm context of Xstorm
3409 */
3410struct xstorm_eth_st_context {
3411 u32 reserved0[60];
3412};
3413
3414/*
3415 * Ethernet connection context
3416 */
3417struct eth_context {
3418 struct ustorm_eth_st_context ustorm_st_context;
3419 struct tstorm_eth_st_context tstorm_st_context;
3420 struct xstorm_eth_ag_context xstorm_ag_context;
3421 struct tstorm_eth_ag_context tstorm_ag_context;
3422 struct cstorm_eth_ag_context cstorm_ag_context;
3423 struct ustorm_eth_ag_context ustorm_ag_context;
3424 struct timers_block_context timers_context;
3425 struct xstorm_eth_st_context xstorm_st_context;
3426 struct cstorm_eth_st_context cstorm_st_context;
3427};
3428
3429
3430/*
3431 * union for sgl and raw data.
3432 */
3433union eth_sgl_or_raw_data {
3434 __le16 sgl[8];
3435 u32 raw_data[4];
3436};
3437
3438/*
3439 * eth FP end aggregation CQE parameters struct
3440 */
3441struct eth_end_agg_rx_cqe {
3442 u8 type_error_flags;
3443#define ETH_END_AGG_RX_CQE_TYPE (0x3<<0)
3444#define ETH_END_AGG_RX_CQE_TYPE_SHIFT 0
3445#define ETH_END_AGG_RX_CQE_SGL_RAW_SEL (0x1<<2)
3446#define ETH_END_AGG_RX_CQE_SGL_RAW_SEL_SHIFT 2
3447#define ETH_END_AGG_RX_CQE_RESERVED0 (0x1F<<3)
3448#define ETH_END_AGG_RX_CQE_RESERVED0_SHIFT 3
3449 u8 reserved1;
3450 u8 queue_index;
3451 u8 reserved2;
3452 __le32 timestamp_delta;
3453 __le16 num_of_coalesced_segs;
3454 __le16 pkt_len;
3455 u8 pure_ack_count;
3456 u8 reserved3;
3457 __le16 reserved4;
3458 union eth_sgl_or_raw_data sgl_or_raw_data;
3459 __le32 reserved5[8];
3460};
3461
3462
3463/*
3464 * regular eth FP CQE parameters struct
3465 */
3466struct eth_fast_path_rx_cqe {
3467 u8 type_error_flags;
3468#define ETH_FAST_PATH_RX_CQE_TYPE (0x3<<0)
3469#define ETH_FAST_PATH_RX_CQE_TYPE_SHIFT 0
3470#define ETH_FAST_PATH_RX_CQE_SGL_RAW_SEL (0x1<<2)
3471#define ETH_FAST_PATH_RX_CQE_SGL_RAW_SEL_SHIFT 2
3472#define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG (0x1<<3)
3473#define ETH_FAST_PATH_RX_CQE_PHY_DECODE_ERR_FLG_SHIFT 3
3474#define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG (0x1<<4)
3475#define ETH_FAST_PATH_RX_CQE_IP_BAD_XSUM_FLG_SHIFT 4
3476#define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG (0x1<<5)
3477#define ETH_FAST_PATH_RX_CQE_L4_BAD_XSUM_FLG_SHIFT 5
3478#define ETH_FAST_PATH_RX_CQE_RESERVED0 (0x3<<6)
3479#define ETH_FAST_PATH_RX_CQE_RESERVED0_SHIFT 6
3480 u8 status_flags;
3481#define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE (0x7<<0)
3482#define ETH_FAST_PATH_RX_CQE_RSS_HASH_TYPE_SHIFT 0
3483#define ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG (0x1<<3)
3484#define ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG_SHIFT 3
3485#define ETH_FAST_PATH_RX_CQE_BROADCAST_FLG (0x1<<4)
3486#define ETH_FAST_PATH_RX_CQE_BROADCAST_FLG_SHIFT 4
3487#define ETH_FAST_PATH_RX_CQE_MAC_MATCH_FLG (0x1<<5)
3488#define ETH_FAST_PATH_RX_CQE_MAC_MATCH_FLG_SHIFT 5
3489#define ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG (0x1<<6)
3490#define ETH_FAST_PATH_RX_CQE_IP_XSUM_NO_VALIDATION_FLG_SHIFT 6
3491#define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG (0x1<<7)
3492#define ETH_FAST_PATH_RX_CQE_L4_XSUM_NO_VALIDATION_FLG_SHIFT 7
3493 u8 queue_index;
3494 u8 placement_offset;
3495 __le32 rss_hash_result;
3496 __le16 vlan_tag;
3497 __le16 pkt_len;
3498 __le16 len_on_bd;
3499 struct parsing_flags pars_flags;
3500 union eth_sgl_or_raw_data sgl_or_raw_data;
3501 __le32 reserved1[8];
3502};
3503
3504
3505/*
3506 * Command for setting classification flags for a client
3507 */
3508struct eth_filter_rules_cmd {
3509 u8 cmd_general_data;
3510#define ETH_FILTER_RULES_CMD_RX_CMD (0x1<<0)
3511#define ETH_FILTER_RULES_CMD_RX_CMD_SHIFT 0
3512#define ETH_FILTER_RULES_CMD_TX_CMD (0x1<<1)
3513#define ETH_FILTER_RULES_CMD_TX_CMD_SHIFT 1
3514#define ETH_FILTER_RULES_CMD_RESERVED0 (0x3F<<2)
3515#define ETH_FILTER_RULES_CMD_RESERVED0_SHIFT 2
3516 u8 func_id;
3517 u8 client_id;
3518 u8 reserved1;
3519 __le16 state;
3520#define ETH_FILTER_RULES_CMD_UCAST_DROP_ALL (0x1<<0)
3521#define ETH_FILTER_RULES_CMD_UCAST_DROP_ALL_SHIFT 0
3522#define ETH_FILTER_RULES_CMD_UCAST_ACCEPT_ALL (0x1<<1)
3523#define ETH_FILTER_RULES_CMD_UCAST_ACCEPT_ALL_SHIFT 1
3524#define ETH_FILTER_RULES_CMD_UCAST_ACCEPT_UNMATCHED (0x1<<2)
3525#define ETH_FILTER_RULES_CMD_UCAST_ACCEPT_UNMATCHED_SHIFT 2
3526#define ETH_FILTER_RULES_CMD_MCAST_DROP_ALL (0x1<<3)
3527#define ETH_FILTER_RULES_CMD_MCAST_DROP_ALL_SHIFT 3
3528#define ETH_FILTER_RULES_CMD_MCAST_ACCEPT_ALL (0x1<<4)
3529#define ETH_FILTER_RULES_CMD_MCAST_ACCEPT_ALL_SHIFT 4
3530#define ETH_FILTER_RULES_CMD_BCAST_ACCEPT_ALL (0x1<<5)
3531#define ETH_FILTER_RULES_CMD_BCAST_ACCEPT_ALL_SHIFT 5
3532#define ETH_FILTER_RULES_CMD_ACCEPT_ANY_VLAN (0x1<<6)
3533#define ETH_FILTER_RULES_CMD_ACCEPT_ANY_VLAN_SHIFT 6
3534#define ETH_FILTER_RULES_CMD_RESERVED2 (0x1FF<<7)
3535#define ETH_FILTER_RULES_CMD_RESERVED2_SHIFT 7
3536 __le16 reserved3;
3537 struct regpair reserved4;
3538};
3539
3540
3541/*
3542 * parameters for eth classification filters ramrod
3543 */
3544struct eth_filter_rules_ramrod_data {
3545 struct eth_classify_header header;
3546 struct eth_filter_rules_cmd rules[FILTER_RULES_COUNT];
3547};
3548
3549
3550/*
3551 * parameters for eth classification configuration ramrod
3552 */
3553struct eth_general_rules_ramrod_data {
3554 struct eth_classify_header header;
3555 union eth_classify_rule_cmd rules[CLASSIFY_RULES_COUNT];
3556};
3557
3558
3559/*
3560 * The data for Halt ramrod
3561 */
3562struct eth_halt_ramrod_data {
3563 __le32 client_id;
3564 __le32 reserved0;
3565};
3566
3567
3568/*
3569 * Command for setting multicast classification for a client
3570 */
3571struct eth_multicast_rules_cmd {
3572 u8 cmd_general_data;
3573#define ETH_MULTICAST_RULES_CMD_RX_CMD (0x1<<0)
3574#define ETH_MULTICAST_RULES_CMD_RX_CMD_SHIFT 0
3575#define ETH_MULTICAST_RULES_CMD_TX_CMD (0x1<<1)
3576#define ETH_MULTICAST_RULES_CMD_TX_CMD_SHIFT 1
3577#define ETH_MULTICAST_RULES_CMD_IS_ADD (0x1<<2)
3578#define ETH_MULTICAST_RULES_CMD_IS_ADD_SHIFT 2
3579#define ETH_MULTICAST_RULES_CMD_RESERVED0 (0x1F<<3)
3580#define ETH_MULTICAST_RULES_CMD_RESERVED0_SHIFT 3
3581 u8 func_id;
3582 u8 bin_id;
3583 u8 engine_id;
3584 __le32 reserved2;
3585 struct regpair reserved3;
3586};
3587
3588
3589/*
3590 * parameters for multicast classification ramrod
3591 */
3592struct eth_multicast_rules_ramrod_data {
3593 struct eth_classify_header header;
3594 struct eth_multicast_rules_cmd rules[MULTICAST_RULES_COUNT];
3595};
3596
3597
3598/*
3599 * Place holder for ramrods protocol specific data
3600 */
3601struct ramrod_data {
3602 __le32 data_lo;
3603 __le32 data_hi;
3604};
3605
3606/*
3607 * union for ramrod data for Ethernet protocol (CQE) (force size of 16 bits)
3608 */
3609union eth_ramrod_data {
3610 struct ramrod_data general;
3611};
3612
3613
3614/*
3615 * RSS toeplitz hash type, as reported in CQE
3616 */
3617enum eth_rss_hash_type {
3618 DEFAULT_HASH_TYPE,
3619 IPV4_HASH_TYPE,
3620 TCP_IPV4_HASH_TYPE,
3621 IPV6_HASH_TYPE,
3622 TCP_IPV6_HASH_TYPE,
3623 VLAN_PRI_HASH_TYPE,
3624 E1HOV_PRI_HASH_TYPE,
3625 DSCP_HASH_TYPE,
3626 MAX_ETH_RSS_HASH_TYPE
3627};
3628
3629
3630/*
3631 * Ethernet RSS mode
3632 */
3633enum eth_rss_mode {
3634 ETH_RSS_MODE_DISABLED,
3635 ETH_RSS_MODE_REGULAR,
3636 ETH_RSS_MODE_VLAN_PRI,
3637 ETH_RSS_MODE_E1HOV_PRI,
3638 ETH_RSS_MODE_IP_DSCP,
3639 MAX_ETH_RSS_MODE
3640};
3641
3642
3643/*
3644 * parameters for RSS update ramrod (E2)
3645 */
3646struct eth_rss_update_ramrod_data {
3647 u8 rss_engine_id;
3648 u8 capabilities;
3649#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_CAPABILITY (0x1<<0)
3650#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_CAPABILITY_SHIFT 0
3651#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_TCP_CAPABILITY (0x1<<1)
3652#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_TCP_CAPABILITY_SHIFT 1
3653#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_UDP_CAPABILITY (0x1<<2)
3654#define ETH_RSS_UPDATE_RAMROD_DATA_IPV4_UDP_CAPABILITY_SHIFT 2
3655#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_CAPABILITY (0x1<<3)
3656#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_CAPABILITY_SHIFT 3
3657#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_TCP_CAPABILITY (0x1<<4)
3658#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_TCP_CAPABILITY_SHIFT 4
3659#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_UDP_CAPABILITY (0x1<<5)
3660#define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_UDP_CAPABILITY_SHIFT 5
3661#define ETH_RSS_UPDATE_RAMROD_DATA_UPDATE_RSS_KEY (0x1<<6)
3662#define ETH_RSS_UPDATE_RAMROD_DATA_UPDATE_RSS_KEY_SHIFT 6
3663#define __ETH_RSS_UPDATE_RAMROD_DATA_RESERVED0 (0x1<<7)
3664#define __ETH_RSS_UPDATE_RAMROD_DATA_RESERVED0_SHIFT 7
3665 u8 rss_result_mask;
3666 u8 rss_mode;
3667 __le32 __reserved2;
3668 u8 indirection_table[T_ETH_INDIRECTION_TABLE_SIZE];
3669 __le32 rss_key[T_ETH_RSS_KEY];
3670 __le32 echo;
3671 __le32 reserved3;
3672};
3673
3674
3675/*
3676 * The eth Rx Buffer Descriptor
3677 */
3678struct eth_rx_bd {
3679 __le32 addr_lo;
3680 __le32 addr_hi;
3681};
3682
3683
3684/*
3685 * Eth Rx Cqe structure- general structure for ramrods
3686 */
3687struct common_ramrod_eth_rx_cqe {
3688 u8 ramrod_type;
3689#define COMMON_RAMROD_ETH_RX_CQE_TYPE (0x3<<0)
3690#define COMMON_RAMROD_ETH_RX_CQE_TYPE_SHIFT 0
3691#define COMMON_RAMROD_ETH_RX_CQE_ERROR (0x1<<2)
3692#define COMMON_RAMROD_ETH_RX_CQE_ERROR_SHIFT 2
3693#define COMMON_RAMROD_ETH_RX_CQE_RESERVED0 (0x1F<<3)
3694#define COMMON_RAMROD_ETH_RX_CQE_RESERVED0_SHIFT 3
3695 u8 conn_type;
3696 __le16 reserved1;
3697 __le32 conn_and_cmd_data;
3698#define COMMON_RAMROD_ETH_RX_CQE_CID (0xFFFFFF<<0)
3699#define COMMON_RAMROD_ETH_RX_CQE_CID_SHIFT 0
3700#define COMMON_RAMROD_ETH_RX_CQE_CMD_ID (0xFF<<24)
3701#define COMMON_RAMROD_ETH_RX_CQE_CMD_ID_SHIFT 24
3702 struct ramrod_data protocol_data;
3703 __le32 echo;
3704 __le32 reserved2[11];
3705};
3706
3707/*
3708 * Rx Last CQE in page (in ETH)
3709 */
3710struct eth_rx_cqe_next_page {
3711 __le32 addr_lo;
3712 __le32 addr_hi;
3713 __le32 reserved[14];
3714};
3715
3716/*
3717 * union for all eth rx cqe types (fix their sizes)
3718 */
3719union eth_rx_cqe {
3720 struct eth_fast_path_rx_cqe fast_path_cqe;
3721 struct common_ramrod_eth_rx_cqe ramrod_cqe;
3722 struct eth_rx_cqe_next_page next_page_cqe;
3723 struct eth_end_agg_rx_cqe end_agg_cqe;
3724};
3725
3726
3727/*
3728 * Values for RX ETH CQE type field
3729 */
3730enum eth_rx_cqe_type {
3731 RX_ETH_CQE_TYPE_ETH_FASTPATH,
3732 RX_ETH_CQE_TYPE_ETH_RAMROD,
3733 RX_ETH_CQE_TYPE_ETH_START_AGG,
3734 RX_ETH_CQE_TYPE_ETH_STOP_AGG,
3735 MAX_ETH_RX_CQE_TYPE
3736};
3737
3738
3739/*
3740 * Type of SGL/Raw field in ETH RX fast path CQE
3741 */
3742enum eth_rx_fp_sel {
3743 ETH_FP_CQE_REGULAR,
3744 ETH_FP_CQE_RAW,
3745 MAX_ETH_RX_FP_SEL
3746};
3747
3748
3749/*
3750 * The eth Rx SGE Descriptor
3751 */
3752struct eth_rx_sge {
3753 __le32 addr_lo;
3754 __le32 addr_hi;
3755};
3756
3757
3758/*
3759 * common data for all protocols
3760 */
3761struct spe_hdr {
3762 __le32 conn_and_cmd_data;
3763#define SPE_HDR_CID (0xFFFFFF<<0)
3764#define SPE_HDR_CID_SHIFT 0
3765#define SPE_HDR_CMD_ID (0xFF<<24)
3766#define SPE_HDR_CMD_ID_SHIFT 24
3767 __le16 type;
3768#define SPE_HDR_CONN_TYPE (0xFF<<0)
3769#define SPE_HDR_CONN_TYPE_SHIFT 0
3770#define SPE_HDR_FUNCTION_ID (0xFF<<8)
3771#define SPE_HDR_FUNCTION_ID_SHIFT 8
3772 __le16 reserved1;
3773};
3774
3775/*
3776 * specific data for ethernet slow path element
3777 */
3778union eth_specific_data {
3779 u8 protocol_data[8];
3780 struct regpair client_update_ramrod_data;
3781 struct regpair client_init_ramrod_init_data;
3782 struct eth_halt_ramrod_data halt_ramrod_data;
3783 struct regpair update_data_addr;
3784 struct eth_common_ramrod_data common_ramrod_data;
3785 struct regpair classify_cfg_addr;
3786 struct regpair filter_cfg_addr;
3787 struct regpair mcast_cfg_addr;
3788};
3789
3790/*
3791 * Ethernet slow path element
3792 */
3793struct eth_spe {
3794 struct spe_hdr hdr;
3795 union eth_specific_data data;
3796};
3797
3798
3799/*
3800 * Ethernet command ID for slow path elements
3801 */
3802enum eth_spqe_cmd_id {
3803 RAMROD_CMD_ID_ETH_UNUSED,
3804 RAMROD_CMD_ID_ETH_CLIENT_SETUP,
3805 RAMROD_CMD_ID_ETH_HALT,
3806 RAMROD_CMD_ID_ETH_FORWARD_SETUP,
3807 RAMROD_CMD_ID_ETH_TX_QUEUE_SETUP,
3808 RAMROD_CMD_ID_ETH_CLIENT_UPDATE,
3809 RAMROD_CMD_ID_ETH_EMPTY,
3810 RAMROD_CMD_ID_ETH_TERMINATE,
3811 RAMROD_CMD_ID_ETH_TPA_UPDATE,
3812 RAMROD_CMD_ID_ETH_CLASSIFICATION_RULES,
3813 RAMROD_CMD_ID_ETH_FILTER_RULES,
3814 RAMROD_CMD_ID_ETH_MULTICAST_RULES,
3815 RAMROD_CMD_ID_ETH_RSS_UPDATE,
3816 RAMROD_CMD_ID_ETH_SET_MAC,
3817 MAX_ETH_SPQE_CMD_ID
3818};
3819
3820
3821/*
3822 * eth tpa update command
3823 */
3824enum eth_tpa_update_command {
3825 TPA_UPDATE_NONE_COMMAND,
3826 TPA_UPDATE_ENABLE_COMMAND,
3827 TPA_UPDATE_DISABLE_COMMAND,
3828 MAX_ETH_TPA_UPDATE_COMMAND
3829};
3830
3831
3832/*
3833 * Tx regular BD structure
3834 */
3835struct eth_tx_bd {
3836 __le32 addr_lo;
3837 __le32 addr_hi;
3838 __le16 total_pkt_bytes;
3839 __le16 nbytes;
3840 u8 reserved[4];
3841};
3842
3843
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003844/*
Eilon Greenstein33471622008-08-13 15:59:08 -07003845 * structure for easy accessibility to assembler
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003846 */
3847struct eth_tx_bd_flags {
3848 u8 as_bitfield;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003849#define ETH_TX_BD_FLAGS_IP_CSUM (0x1<<0)
3850#define ETH_TX_BD_FLAGS_IP_CSUM_SHIFT 0
3851#define ETH_TX_BD_FLAGS_L4_CSUM (0x1<<1)
3852#define ETH_TX_BD_FLAGS_L4_CSUM_SHIFT 1
3853#define ETH_TX_BD_FLAGS_VLAN_MODE (0x3<<2)
3854#define ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT 2
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003855#define ETH_TX_BD_FLAGS_START_BD (0x1<<4)
3856#define ETH_TX_BD_FLAGS_START_BD_SHIFT 4
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003857#define ETH_TX_BD_FLAGS_IS_UDP (0x1<<5)
3858#define ETH_TX_BD_FLAGS_IS_UDP_SHIFT 5
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003859#define ETH_TX_BD_FLAGS_SW_LSO (0x1<<6)
3860#define ETH_TX_BD_FLAGS_SW_LSO_SHIFT 6
3861#define ETH_TX_BD_FLAGS_IPV6 (0x1<<7)
3862#define ETH_TX_BD_FLAGS_IPV6_SHIFT 7
3863};
3864
3865/*
3866 * The eth Tx Buffer Descriptor
3867 */
Eilon Greensteinca003922009-08-12 22:53:28 -07003868struct eth_tx_start_bd {
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003869 __le32 addr_lo;
3870 __le32 addr_hi;
3871 __le16 nbd;
3872 __le16 nbytes;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003873 __le16 vlan_or_ethertype;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003874 struct eth_tx_bd_flags bd_flags;
3875 u8 general_data;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003876#define ETH_TX_START_BD_HDR_NBDS (0xF<<0)
Eilon Greensteinca003922009-08-12 22:53:28 -07003877#define ETH_TX_START_BD_HDR_NBDS_SHIFT 0
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003878#define ETH_TX_START_BD_FORCE_VLAN_MODE (0x1<<4)
3879#define ETH_TX_START_BD_FORCE_VLAN_MODE_SHIFT 4
3880#define ETH_TX_START_BD_RESREVED (0x1<<5)
3881#define ETH_TX_START_BD_RESREVED_SHIFT 5
Eilon Greensteinca003922009-08-12 22:53:28 -07003882#define ETH_TX_START_BD_ETH_ADDR_TYPE (0x3<<6)
3883#define ETH_TX_START_BD_ETH_ADDR_TYPE_SHIFT 6
3884};
3885
3886/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003887 * Tx parsing BD structure for ETH E1/E1h
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003888 */
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003889struct eth_tx_parse_bd_e1x {
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003890 u8 global_data;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003891#define ETH_TX_PARSE_BD_E1X_IP_HDR_START_OFFSET_W (0xF<<0)
3892#define ETH_TX_PARSE_BD_E1X_IP_HDR_START_OFFSET_W_SHIFT 0
3893#define ETH_TX_PARSE_BD_E1X_RESERVED0 (0x1<<4)
3894#define ETH_TX_PARSE_BD_E1X_RESERVED0_SHIFT 4
3895#define ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN (0x1<<5)
3896#define ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN_SHIFT 5
3897#define ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN (0x1<<6)
3898#define ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT 6
3899#define ETH_TX_PARSE_BD_E1X_NS_FLG (0x1<<7)
3900#define ETH_TX_PARSE_BD_E1X_NS_FLG_SHIFT 7
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003901 u8 tcp_flags;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003902#define ETH_TX_PARSE_BD_E1X_FIN_FLG (0x1<<0)
3903#define ETH_TX_PARSE_BD_E1X_FIN_FLG_SHIFT 0
3904#define ETH_TX_PARSE_BD_E1X_SYN_FLG (0x1<<1)
3905#define ETH_TX_PARSE_BD_E1X_SYN_FLG_SHIFT 1
3906#define ETH_TX_PARSE_BD_E1X_RST_FLG (0x1<<2)
3907#define ETH_TX_PARSE_BD_E1X_RST_FLG_SHIFT 2
3908#define ETH_TX_PARSE_BD_E1X_PSH_FLG (0x1<<3)
3909#define ETH_TX_PARSE_BD_E1X_PSH_FLG_SHIFT 3
3910#define ETH_TX_PARSE_BD_E1X_ACK_FLG (0x1<<4)
3911#define ETH_TX_PARSE_BD_E1X_ACK_FLG_SHIFT 4
3912#define ETH_TX_PARSE_BD_E1X_URG_FLG (0x1<<5)
3913#define ETH_TX_PARSE_BD_E1X_URG_FLG_SHIFT 5
3914#define ETH_TX_PARSE_BD_E1X_ECE_FLG (0x1<<6)
3915#define ETH_TX_PARSE_BD_E1X_ECE_FLG_SHIFT 6
3916#define ETH_TX_PARSE_BD_E1X_CWR_FLG (0x1<<7)
3917#define ETH_TX_PARSE_BD_E1X_CWR_FLG_SHIFT 7
3918 u8 ip_hlen_w;
Eilon Greensteinca003922009-08-12 22:53:28 -07003919 s8 reserved;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003920 __le16 total_hlen_w;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003921 __le16 tcp_pseudo_csum;
Eilon Greensteinca003922009-08-12 22:53:28 -07003922 __le16 lso_mss;
Eilon Greenstein4781bfa2009-02-12 08:38:17 +00003923 __le16 ip_id;
3924 __le32 tcp_send_seq;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003925};
3926
3927/*
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00003928 * Tx parsing BD structure for ETH E2
3929 */
3930struct eth_tx_parse_bd_e2 {
3931 __le16 dst_mac_addr_lo;
3932 __le16 dst_mac_addr_mid;
3933 __le16 dst_mac_addr_hi;
3934 __le16 src_mac_addr_lo;
3935 __le16 src_mac_addr_mid;
3936 __le16 src_mac_addr_hi;
3937 __le32 parsing_data;
3938#define ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W (0x1FFF<<0)
3939#define ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT 0
3940#define ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW (0xF<<13)
3941#define ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT 13
3942#define ETH_TX_PARSE_BD_E2_LSO_MSS (0x3FFF<<17)
3943#define ETH_TX_PARSE_BD_E2_LSO_MSS_SHIFT 17
3944#define ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR (0x1<<31)
3945#define ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR_SHIFT 31
3946};
3947
3948/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003949 * The last BD in the BD memory will hold a pointer to the next BD memory
3950 */
3951struct eth_tx_next_bd {
Eilon Greensteinca003922009-08-12 22:53:28 -07003952 __le32 addr_lo;
3953 __le32 addr_hi;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003954 u8 reserved[8];
3955};
3956
3957/*
Eilon Greensteinca003922009-08-12 22:53:28 -07003958 * union for 4 Bd types
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003959 */
3960union eth_tx_bd_types {
Eilon Greensteinca003922009-08-12 22:53:28 -07003961 struct eth_tx_start_bd start_bd;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003962 struct eth_tx_bd reg_bd;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00003963 struct eth_tx_parse_bd_e1x parse_bd_e1x;
Dmitry Kravkovf2e08992010-10-06 03:28:26 +00003964 struct eth_tx_parse_bd_e2 parse_bd_e2;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003965 struct eth_tx_next_bd next_bd;
3966};
3967
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003968/*
Eilon Greensteinca003922009-08-12 22:53:28 -07003969 * array of 13 bds as appears in the eth xstorm context
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003970 */
Eilon Greensteinca003922009-08-12 22:53:28 -07003971struct eth_tx_bds_array {
3972 union eth_tx_bd_types bds[13];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003973};
3974
3975
3976/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003977 * VLAN mode on TX BDs
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003978 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003979enum eth_tx_vlan_type {
3980 X_ETH_NO_VLAN,
3981 X_ETH_OUTBAND_VLAN,
3982 X_ETH_INBAND_VLAN,
3983 X_ETH_FW_ADDED_VLAN,
3984 MAX_ETH_TX_VLAN_TYPE
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003985};
3986
Eilon Greensteinca003922009-08-12 22:53:28 -07003987
3988/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003989 * Ethernet VLAN filtering mode in E1x
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003990 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03003991enum eth_vlan_filter_mode {
3992 ETH_VLAN_FILTER_ANY_VLAN,
3993 ETH_VLAN_FILTER_SPECIFIC_VLAN,
3994 ETH_VLAN_FILTER_CLASSIFY,
3995 MAX_ETH_VLAN_FILTER_MODE
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02003996};
3997
3998
3999/*
4000 * MAC filtering configuration command header
4001 */
4002struct mac_configuration_hdr {
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004003 u8 length;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004004 u8 offset;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004005 __le16 client_id;
4006 __le32 echo;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004007};
4008
4009/*
4010 * MAC address in list for ramrod
4011 */
4012struct mac_configuration_entry {
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004013 __le16 lsb_mac_addr;
4014 __le16 middle_mac_addr;
4015 __le16 msb_mac_addr;
4016 __le16 vlan_id;
4017 u8 pf_id;
4018 u8 flags;
4019#define MAC_CONFIGURATION_ENTRY_ACTION_TYPE (0x1<<0)
4020#define MAC_CONFIGURATION_ENTRY_ACTION_TYPE_SHIFT 0
4021#define MAC_CONFIGURATION_ENTRY_RDMA_MAC (0x1<<1)
4022#define MAC_CONFIGURATION_ENTRY_RDMA_MAC_SHIFT 1
4023#define MAC_CONFIGURATION_ENTRY_VLAN_FILTERING_MODE (0x3<<2)
4024#define MAC_CONFIGURATION_ENTRY_VLAN_FILTERING_MODE_SHIFT 2
4025#define MAC_CONFIGURATION_ENTRY_OVERRIDE_VLAN_REMOVAL (0x1<<4)
4026#define MAC_CONFIGURATION_ENTRY_OVERRIDE_VLAN_REMOVAL_SHIFT 4
4027#define MAC_CONFIGURATION_ENTRY_BROADCAST (0x1<<5)
4028#define MAC_CONFIGURATION_ENTRY_BROADCAST_SHIFT 5
4029#define MAC_CONFIGURATION_ENTRY_RESERVED1 (0x3<<6)
4030#define MAC_CONFIGURATION_ENTRY_RESERVED1_SHIFT 6
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004031 __le16 reserved0;
4032 __le32 clients_bit_vector;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004033};
4034
4035/*
4036 * MAC filtering configuration command
4037 */
4038struct mac_configuration_cmd {
4039 struct mac_configuration_hdr hdr;
4040 struct mac_configuration_entry config_table[64];
4041};
4042
4043
4044/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004045 * Set-MAC command type (in E1x)
4046 */
4047enum set_mac_action_type {
4048 T_ETH_MAC_COMMAND_INVALIDATE,
4049 T_ETH_MAC_COMMAND_SET,
4050 MAX_SET_MAC_ACTION_TYPE
4051};
4052
4053
4054/*
4055 * tpa update ramrod data
4056 */
4057struct tpa_update_ramrod_data {
4058 u8 update_ipv4;
4059 u8 update_ipv6;
4060 u8 client_id;
4061 u8 max_tpa_queues;
4062 u8 max_sges_for_packet;
4063 u8 complete_on_both_clients;
4064 __le16 reserved1;
4065 __le16 sge_buff_size;
4066 __le16 max_agg_size;
4067 __le32 sge_page_base_lo;
4068 __le32 sge_page_base_hi;
4069 __le16 sge_pause_thr_low;
4070 __le16 sge_pause_thr_high;
4071};
4072
4073
4074/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004075 * approximate-match multicast filtering for E1H per function in Tstorm
4076 */
4077struct tstorm_eth_approximate_match_multicast_filtering {
4078 u32 mcast_add_hash_bit_array[8];
4079};
4080
4081
4082/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004083 * Common configuration parameters per function in Tstorm
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004084 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004085struct tstorm_eth_function_common_config {
4086 __le16 config_flags;
4087#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY (0x1<<0)
4088#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY_SHIFT 0
4089#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY (0x1<<1)
4090#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY_SHIFT 1
4091#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY (0x1<<2)
4092#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY_SHIFT 2
4093#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY (0x1<<3)
4094#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY_SHIFT 3
4095#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE (0x7<<4)
4096#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT 4
4097#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE (0x1<<7)
4098#define TSTORM_ETH_FUNCTION_COMMON_CONFIG_VLAN_FILTERING_ENABLE_SHIFT 7
4099#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0 (0xFF<<8)
4100#define __TSTORM_ETH_FUNCTION_COMMON_CONFIG_RESERVED0_SHIFT 8
4101 u8 rss_result_mask;
4102 u8 reserved1;
4103 __le16 vlan_id[2];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004104};
4105
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004106
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004107/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004108 * MAC filtering configuration parameters per port in Tstorm
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004109 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004110struct tstorm_eth_mac_filter_config {
4111 __le32 ucast_drop_all;
4112 __le32 ucast_accept_all;
4113 __le32 mcast_drop_all;
4114 __le32 mcast_accept_all;
4115 __le32 bcast_accept_all;
4116 __le32 vlan_filter[2];
4117 __le32 unmatched_unicast;
4118};
4119
4120
4121/*
4122 * tx only queue init ramrod data
4123 */
4124struct tx_queue_init_ramrod_data {
4125 struct client_init_general_data general;
4126 struct client_init_tx_data tx;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004127};
4128
4129
4130/*
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004131 * Three RX producers for ETH
4132 */
4133struct ustorm_eth_rx_producers {
4134#if defined(__BIG_ENDIAN)
4135 u16 bd_prod;
4136 u16 cqe_prod;
4137#elif defined(__LITTLE_ENDIAN)
4138 u16 cqe_prod;
4139 u16 bd_prod;
4140#endif
4141#if defined(__BIG_ENDIAN)
4142 u16 reserved;
4143 u16 sge_prod;
4144#elif defined(__LITTLE_ENDIAN)
4145 u16 sge_prod;
4146 u16 reserved;
4147#endif
4148};
4149
4150
4151/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004152 * cfc delete event data
4153 */
4154struct cfc_del_event_data {
4155 u32 cid;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004156 u32 reserved0;
4157 u32 reserved1;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004158};
4159
4160
4161/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004162 * per-port SAFC demo variables
4163 */
4164struct cmng_flags_per_port {
Eilon Greenstein8a1c38d2009-02-12 08:36:40 +00004165 u32 cmng_enables;
4166#define CMNG_FLAGS_PER_PORT_FAIRNESS_VN (0x1<<0)
4167#define CMNG_FLAGS_PER_PORT_FAIRNESS_VN_SHIFT 0
4168#define CMNG_FLAGS_PER_PORT_RATE_SHAPING_VN (0x1<<1)
4169#define CMNG_FLAGS_PER_PORT_RATE_SHAPING_VN_SHIFT 1
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004170#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS (0x1<<2)
4171#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_SHIFT 2
4172#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_MODE (0x1<<3)
4173#define CMNG_FLAGS_PER_PORT_FAIRNESS_COS_MODE_SHIFT 3
4174#define __CMNG_FLAGS_PER_PORT_RESERVED0 (0xFFFFFFF<<4)
4175#define __CMNG_FLAGS_PER_PORT_RESERVED0_SHIFT 4
4176 u32 __reserved1;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004177};
4178
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004179
4180/*
4181 * per-port rate shaping variables
4182 */
4183struct rate_shaping_vars_per_port {
4184 u32 rs_periodic_timeout;
4185 u32 rs_threshold;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004186};
4187
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004188/*
4189 * per-port fairness variables
4190 */
4191struct fairness_vars_per_port {
4192 u32 upper_bound;
4193 u32 fair_threshold;
4194 u32 fairness_timeout;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004195 u32 reserved0;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004196};
4197
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004198/*
4199 * per-port SAFC variables
4200 */
4201struct safc_struct_per_port {
4202#if defined(__BIG_ENDIAN)
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004203 u16 __reserved1;
4204 u8 __reserved0;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004205 u8 safc_timeout_usec;
4206#elif defined(__LITTLE_ENDIAN)
4207 u8 safc_timeout_usec;
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004208 u8 __reserved0;
4209 u16 __reserved1;
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004210#endif
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004211 u8 cos_to_traffic_types[MAX_COS_NUMBER];
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004212 u16 cos_to_pause_mask[NUM_OF_SAFC_BITS];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004213};
4214
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004215/*
4216 * Per-port congestion management variables
4217 */
4218struct cmng_struct_per_port {
4219 struct rate_shaping_vars_per_port rs_vars;
4220 struct fairness_vars_per_port fair_vars;
4221 struct safc_struct_per_port safc_vars;
4222 struct cmng_flags_per_port flags;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004223};
4224
4225
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004226/*
4227 * Protocol-common command ID for slow path elements
4228 */
4229enum common_spqe_cmd_id {
4230 RAMROD_CMD_ID_COMMON_UNUSED,
4231 RAMROD_CMD_ID_COMMON_FUNCTION_START,
4232 RAMROD_CMD_ID_COMMON_FUNCTION_STOP,
4233 RAMROD_CMD_ID_COMMON_CFC_DEL,
4234 RAMROD_CMD_ID_COMMON_CFC_DEL_WB,
4235 RAMROD_CMD_ID_COMMON_STAT_QUERY,
4236 RAMROD_CMD_ID_COMMON_STOP_TRAFFIC,
4237 RAMROD_CMD_ID_COMMON_START_TRAFFIC,
4238 RAMROD_CMD_ID_COMMON_RESERVED1,
4239 RAMROD_CMD_ID_COMMON_RESERVED2,
4240 MAX_COMMON_SPQE_CMD_ID
4241};
4242
4243
4244/*
4245 * Per-protocol connection types
4246 */
4247enum connection_type {
4248 ETH_CONNECTION_TYPE,
4249 TOE_CONNECTION_TYPE,
4250 RDMA_CONNECTION_TYPE,
4251 ISCSI_CONNECTION_TYPE,
4252 FCOE_CONNECTION_TYPE,
4253 RESERVED_CONNECTION_TYPE_0,
4254 RESERVED_CONNECTION_TYPE_1,
4255 RESERVED_CONNECTION_TYPE_2,
4256 NONE_CONNECTION_TYPE,
4257 MAX_CONNECTION_TYPE
4258};
4259
4260
4261/*
4262 * Cos modes
4263 */
4264enum cos_mode {
4265 OVERRIDE_COS,
4266 STATIC_COS,
4267 FW_WRR,
4268 MAX_COS_MODE
4269};
4270
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004271
4272/*
4273 * Dynamic HC counters set by the driver
4274 */
4275struct hc_dynamic_drv_counter {
4276 u32 val[HC_SB_MAX_DYNAMIC_INDICES];
4277};
4278
4279/*
4280 * zone A per-queue data
4281 */
4282struct cstorm_queue_zone_data {
4283 struct hc_dynamic_drv_counter hc_dyn_drv_cnt;
4284 struct regpair reserved[2];
4285};
4286
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004287
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004288/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004289 * Vf-PF channel data in cstorm ram (non-triggered zone)
Eilon Greensteinca003922009-08-12 22:53:28 -07004290 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004291struct vf_pf_channel_zone_data {
4292 u32 msg_addr_lo;
4293 u32 msg_addr_hi;
4294};
4295
4296/*
4297 * zone for VF non-triggered data
4298 */
4299struct non_trigger_vf_zone {
4300 struct vf_pf_channel_zone_data vf_pf_channel;
4301};
4302
4303/*
4304 * Vf-PF channel trigger zone in cstorm ram
4305 */
4306struct vf_pf_channel_zone_trigger {
4307 u8 addr_valid;
4308};
4309
4310/*
4311 * zone that triggers the in-bound interrupt
4312 */
4313struct trigger_vf_zone {
4314#if defined(__BIG_ENDIAN)
4315 u16 reserved1;
4316 u8 reserved0;
4317 struct vf_pf_channel_zone_trigger vf_pf_channel;
4318#elif defined(__LITTLE_ENDIAN)
4319 struct vf_pf_channel_zone_trigger vf_pf_channel;
4320 u8 reserved0;
4321 u16 reserved1;
4322#endif
4323 u32 reserved2;
4324};
4325
4326/*
4327 * zone B per-VF data
4328 */
4329struct cstorm_vf_zone_data {
4330 struct non_trigger_vf_zone non_trigger;
4331 struct trigger_vf_zone trigger;
4332};
4333
4334
4335/*
4336 * Dynamic host coalescing init parameters, per state machine
4337 */
4338struct dynamic_hc_sm_config {
Eilon Greensteinca003922009-08-12 22:53:28 -07004339 u32 threshold[3];
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004340 u8 shift_per_protocol[HC_SB_MAX_DYNAMIC_INDICES];
4341 u8 hc_timeout0[HC_SB_MAX_DYNAMIC_INDICES];
4342 u8 hc_timeout1[HC_SB_MAX_DYNAMIC_INDICES];
4343 u8 hc_timeout2[HC_SB_MAX_DYNAMIC_INDICES];
4344 u8 hc_timeout3[HC_SB_MAX_DYNAMIC_INDICES];
Eilon Greensteinca003922009-08-12 22:53:28 -07004345};
4346
Eilon Greensteinca003922009-08-12 22:53:28 -07004347/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004348 * Dynamic host coalescing init parameters
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004349 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004350struct dynamic_hc_config {
4351 struct dynamic_hc_sm_config sm_config[HC_SB_MAX_SM];
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004352};
4353
Yitchak Gertnerbb2a0f72008-06-23 20:33:36 -07004354
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004355struct e2_integ_data {
4356#if defined(__BIG_ENDIAN)
4357 u8 flags;
4358#define E2_INTEG_DATA_TESTING_EN (0x1<<0)
4359#define E2_INTEG_DATA_TESTING_EN_SHIFT 0
4360#define E2_INTEG_DATA_LB_TX (0x1<<1)
4361#define E2_INTEG_DATA_LB_TX_SHIFT 1
4362#define E2_INTEG_DATA_COS_TX (0x1<<2)
4363#define E2_INTEG_DATA_COS_TX_SHIFT 2
4364#define E2_INTEG_DATA_OPPORTUNISTICQM (0x1<<3)
4365#define E2_INTEG_DATA_OPPORTUNISTICQM_SHIFT 3
4366#define E2_INTEG_DATA_DPMTESTRELEASEDQ (0x1<<4)
4367#define E2_INTEG_DATA_DPMTESTRELEASEDQ_SHIFT 4
4368#define E2_INTEG_DATA_RESERVED (0x7<<5)
4369#define E2_INTEG_DATA_RESERVED_SHIFT 5
4370 u8 cos;
4371 u8 voq;
4372 u8 pbf_queue;
4373#elif defined(__LITTLE_ENDIAN)
4374 u8 pbf_queue;
4375 u8 voq;
4376 u8 cos;
4377 u8 flags;
4378#define E2_INTEG_DATA_TESTING_EN (0x1<<0)
4379#define E2_INTEG_DATA_TESTING_EN_SHIFT 0
4380#define E2_INTEG_DATA_LB_TX (0x1<<1)
4381#define E2_INTEG_DATA_LB_TX_SHIFT 1
4382#define E2_INTEG_DATA_COS_TX (0x1<<2)
4383#define E2_INTEG_DATA_COS_TX_SHIFT 2
4384#define E2_INTEG_DATA_OPPORTUNISTICQM (0x1<<3)
4385#define E2_INTEG_DATA_OPPORTUNISTICQM_SHIFT 3
4386#define E2_INTEG_DATA_DPMTESTRELEASEDQ (0x1<<4)
4387#define E2_INTEG_DATA_DPMTESTRELEASEDQ_SHIFT 4
4388#define E2_INTEG_DATA_RESERVED (0x7<<5)
4389#define E2_INTEG_DATA_RESERVED_SHIFT 5
4390#endif
4391#if defined(__BIG_ENDIAN)
4392 u16 reserved3;
4393 u8 reserved2;
4394 u8 ramEn;
4395#elif defined(__LITTLE_ENDIAN)
4396 u8 ramEn;
4397 u8 reserved2;
4398 u16 reserved3;
4399#endif
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004400};
4401
4402
4403/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004404 * set mac event data
4405 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004406struct eth_event_data {
4407 u32 echo;
4408 u32 reserved0;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004409 u32 reserved1;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004410};
4411
4412
4413/*
4414 * pf-vf event data
4415 */
4416struct vf_pf_event_data {
4417 u8 vf_id;
4418 u8 reserved0;
4419 u16 reserved1;
4420 u32 msg_addr_lo;
4421 u32 msg_addr_hi;
4422};
4423
4424/*
4425 * VF FLR event data
4426 */
4427struct vf_flr_event_data {
4428 u8 vf_id;
4429 u8 reserved0;
4430 u16 reserved1;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004431 u32 reserved2;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004432 u32 reserved3;
4433};
4434
4435/*
4436 * malicious VF event data
4437 */
4438struct malicious_vf_event_data {
4439 u8 vf_id;
4440 u8 reserved0;
4441 u16 reserved1;
4442 u32 reserved2;
4443 u32 reserved3;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004444};
4445
4446/*
4447 * union for all event ring message types
4448 */
4449union event_data {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004450 struct vf_pf_event_data vf_pf_event;
4451 struct eth_event_data eth_event;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004452 struct cfc_del_event_data cfc_del_event;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004453 struct vf_flr_event_data vf_flr_event;
4454 struct malicious_vf_event_data malicious_vf_event;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004455};
4456
4457
4458/*
4459 * per PF event ring data
4460 */
4461struct event_ring_data {
4462 struct regpair base_addr;
4463#if defined(__BIG_ENDIAN)
4464 u8 index_id;
4465 u8 sb_id;
4466 u16 producer;
4467#elif defined(__LITTLE_ENDIAN)
4468 u16 producer;
4469 u8 sb_id;
4470 u8 index_id;
4471#endif
4472 u32 reserved0;
4473};
4474
4475
4476/*
4477 * event ring message element (each element is 128 bits)
4478 */
4479struct event_ring_msg {
4480 u8 opcode;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004481 u8 error;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004482 u16 reserved1;
4483 union event_data data;
4484};
4485
4486/*
4487 * event ring next page element (128 bits)
4488 */
4489struct event_ring_next {
4490 struct regpair addr;
4491 u32 reserved[2];
4492};
4493
4494/*
4495 * union for event ring element types (each element is 128 bits)
4496 */
4497union event_ring_elem {
4498 struct event_ring_msg message;
4499 struct event_ring_next next_page;
4500};
4501
4502
4503/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004504 * Common event ring opcodes
4505 */
4506enum event_ring_opcode {
4507 EVENT_RING_OPCODE_VF_PF_CHANNEL,
4508 EVENT_RING_OPCODE_FUNCTION_START,
4509 EVENT_RING_OPCODE_FUNCTION_STOP,
4510 EVENT_RING_OPCODE_CFC_DEL,
4511 EVENT_RING_OPCODE_CFC_DEL_WB,
4512 EVENT_RING_OPCODE_STAT_QUERY,
4513 EVENT_RING_OPCODE_STOP_TRAFFIC,
4514 EVENT_RING_OPCODE_START_TRAFFIC,
4515 EVENT_RING_OPCODE_VF_FLR,
4516 EVENT_RING_OPCODE_MALICIOUS_VF,
4517 EVENT_RING_OPCODE_FORWARD_SETUP,
4518 EVENT_RING_OPCODE_RSS_UPDATE_RULES,
4519 EVENT_RING_OPCODE_RESERVED1,
4520 EVENT_RING_OPCODE_RESERVED2,
4521 EVENT_RING_OPCODE_SET_MAC,
4522 EVENT_RING_OPCODE_CLASSIFICATION_RULES,
4523 EVENT_RING_OPCODE_FILTERS_RULES,
4524 EVENT_RING_OPCODE_MULTICAST_RULES,
4525 MAX_EVENT_RING_OPCODE
4526};
4527
4528
4529/*
4530 * Modes for fairness algorithm
4531 */
4532enum fairness_mode {
4533 FAIRNESS_COS_WRR_MODE,
4534 FAIRNESS_COS_ETS_MODE,
4535 MAX_FAIRNESS_MODE
4536};
4537
4538
4539/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004540 * per-vnic fairness variables
4541 */
4542struct fairness_vars_per_vn {
Eilon Greenstein8a1c38d2009-02-12 08:36:40 +00004543 u32 cos_credit_delta[MAX_COS_NUMBER];
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004544 u32 vn_credit_delta;
4545 u32 __reserved0;
4546};
4547
4548
4549/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004550 * Priority and cos
4551 */
4552struct priority_cos {
4553 u8 priority;
4554 u8 cos;
4555 __le16 reserved1;
4556};
4557
4558/*
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00004559 * The data for flow control configuration
4560 */
4561struct flow_control_configuration {
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004562 struct priority_cos traffic_type_to_priority_cos[MAX_TRAFFIC_TYPES];
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00004563 u8 dcb_enabled;
4564 u8 dcb_version;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004565 u8 dont_add_pri_0_en;
4566 u8 reserved1;
4567 __le32 reserved2;
4568};
4569
4570
4571/*
4572 *
4573 */
4574struct function_start_data {
4575 __le16 function_mode;
4576 __le16 sd_vlan_tag;
4577 u16 reserved;
4578 u8 path_id;
4579 u8 network_cos_mode;
Vladislav Zolotarove4901dd2010-12-13 05:44:18 +00004580};
4581
4582
4583/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004584 * FW version stored in the Xstorm RAM
4585 */
4586struct fw_version {
4587#if defined(__BIG_ENDIAN)
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004588 u8 engineering;
4589 u8 revision;
4590 u8 minor;
4591 u8 major;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004592#elif defined(__LITTLE_ENDIAN)
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004593 u8 major;
4594 u8 minor;
4595 u8 revision;
4596 u8 engineering;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004597#endif
4598 u32 flags;
4599#define FW_VERSION_OPTIMIZED (0x1<<0)
4600#define FW_VERSION_OPTIMIZED_SHIFT 0
4601#define FW_VERSION_BIG_ENDIEN (0x1<<1)
4602#define FW_VERSION_BIG_ENDIEN_SHIFT 1
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004603#define FW_VERSION_CHIP_VERSION (0x3<<2)
4604#define FW_VERSION_CHIP_VERSION_SHIFT 2
4605#define __FW_VERSION_RESERVED (0xFFFFFFF<<4)
4606#define __FW_VERSION_RESERVED_SHIFT 4
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004607};
4608
4609
4610/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004611 * Dynamic Host-Coalescing - Driver(host) counters
4612 */
4613struct hc_dynamic_sb_drv_counters {
4614 u32 dynamic_hc_drv_counter[HC_SB_MAX_DYNAMIC_INDICES];
4615};
4616
4617
4618/*
4619 * 2 bytes. configuration/state parameters for a single protocol index
4620 */
4621struct hc_index_data {
4622#if defined(__BIG_ENDIAN)
4623 u8 flags;
4624#define HC_INDEX_DATA_SM_ID (0x1<<0)
4625#define HC_INDEX_DATA_SM_ID_SHIFT 0
4626#define HC_INDEX_DATA_HC_ENABLED (0x1<<1)
4627#define HC_INDEX_DATA_HC_ENABLED_SHIFT 1
4628#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED (0x1<<2)
4629#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED_SHIFT 2
4630#define HC_INDEX_DATA_RESERVE (0x1F<<3)
4631#define HC_INDEX_DATA_RESERVE_SHIFT 3
4632 u8 timeout;
4633#elif defined(__LITTLE_ENDIAN)
4634 u8 timeout;
4635 u8 flags;
4636#define HC_INDEX_DATA_SM_ID (0x1<<0)
4637#define HC_INDEX_DATA_SM_ID_SHIFT 0
4638#define HC_INDEX_DATA_HC_ENABLED (0x1<<1)
4639#define HC_INDEX_DATA_HC_ENABLED_SHIFT 1
4640#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED (0x1<<2)
4641#define HC_INDEX_DATA_DYNAMIC_HC_ENABLED_SHIFT 2
4642#define HC_INDEX_DATA_RESERVE (0x1F<<3)
4643#define HC_INDEX_DATA_RESERVE_SHIFT 3
4644#endif
4645};
4646
4647
4648/*
4649 * HC state-machine
4650 */
4651struct hc_status_block_sm {
4652#if defined(__BIG_ENDIAN)
4653 u8 igu_seg_id;
4654 u8 igu_sb_id;
4655 u8 timer_value;
4656 u8 __flags;
4657#elif defined(__LITTLE_ENDIAN)
4658 u8 __flags;
4659 u8 timer_value;
4660 u8 igu_sb_id;
4661 u8 igu_seg_id;
4662#endif
4663 u32 time_to_expire;
4664};
4665
4666/*
4667 * hold PCI identification variables- used in various places in firmware
4668 */
4669struct pci_entity {
4670#if defined(__BIG_ENDIAN)
4671 u8 vf_valid;
4672 u8 vf_id;
4673 u8 vnic_id;
4674 u8 pf_id;
4675#elif defined(__LITTLE_ENDIAN)
4676 u8 pf_id;
4677 u8 vnic_id;
4678 u8 vf_id;
4679 u8 vf_valid;
4680#endif
4681};
4682
4683/*
4684 * The fast-path status block meta-data, common to all chips
4685 */
4686struct hc_sb_data {
4687 struct regpair host_sb_addr;
4688 struct hc_status_block_sm state_machine[HC_SB_MAX_SM];
4689 struct pci_entity p_func;
4690#if defined(__BIG_ENDIAN)
4691 u8 rsrv0;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004692 u8 state;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004693 u8 dhc_qzone_id;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004694 u8 same_igu_sb_1b;
4695#elif defined(__LITTLE_ENDIAN)
4696 u8 same_igu_sb_1b;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004697 u8 dhc_qzone_id;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004698 u8 state;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004699 u8 rsrv0;
4700#endif
4701 struct regpair rsrv1[2];
4702};
4703
4704
4705/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004706 * Segment types for host coaslescing
4707 */
4708enum hc_segment {
4709 HC_REGULAR_SEGMENT,
4710 HC_DEFAULT_SEGMENT,
4711 MAX_HC_SEGMENT
4712};
4713
4714
4715/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004716 * The fast-path status block meta-data
4717 */
4718struct hc_sp_status_block_data {
4719 struct regpair host_sb_addr;
4720#if defined(__BIG_ENDIAN)
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004721 u8 rsrv1;
4722 u8 state;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004723 u8 igu_seg_id;
4724 u8 igu_sb_id;
4725#elif defined(__LITTLE_ENDIAN)
4726 u8 igu_sb_id;
4727 u8 igu_seg_id;
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004728 u8 state;
4729 u8 rsrv1;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004730#endif
4731 struct pci_entity p_func;
4732};
4733
4734
4735/*
4736 * The fast-path status block meta-data
4737 */
4738struct hc_status_block_data_e1x {
4739 struct hc_index_data index_data[HC_SB_MAX_INDICES_E1X];
4740 struct hc_sb_data common;
4741};
4742
4743
4744/*
4745 * The fast-path status block meta-data
4746 */
4747struct hc_status_block_data_e2 {
4748 struct hc_index_data index_data[HC_SB_MAX_INDICES_E2];
4749 struct hc_sb_data common;
4750};
4751
4752
4753/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004754 * IGU block operartion modes (in Everest2)
4755 */
4756enum igu_mode {
4757 HC_IGU_BC_MODE,
4758 HC_IGU_NBC_MODE,
4759 MAX_IGU_MODE
4760};
4761
4762
4763/*
4764 * IP versions
4765 */
4766enum ip_ver {
4767 IP_V4,
4768 IP_V6,
4769 MAX_IP_VER
4770};
4771
4772
4773/*
4774 * Multi-function modes
4775 */
4776enum mf_mode {
4777 SINGLE_FUNCTION,
4778 MULTI_FUNCTION_SD,
4779 MULTI_FUNCTION_SI,
4780 MULTI_FUNCTION_RESERVED,
4781 MAX_MF_MODE
4782};
4783
4784/*
4785 * Protocol-common statistics collected by the Tstorm (per pf)
4786 */
4787struct tstorm_per_pf_stats {
4788 struct regpair rcv_error_bytes;
4789};
4790
4791/*
4792 *
4793 */
4794struct per_pf_stats {
4795 struct tstorm_per_pf_stats tstorm_pf_statistics;
4796};
4797
4798
4799/*
4800 * Protocol-common statistics collected by the Tstorm (per port)
4801 */
4802struct tstorm_per_port_stats {
4803 __le32 mac_discard;
4804 __le32 mac_filter_discard;
4805 __le32 brb_truncate_discard;
4806 __le32 mf_tag_discard;
4807 __le32 packet_drop;
4808 __le32 reserved;
4809};
4810
4811/*
4812 *
4813 */
4814struct per_port_stats {
4815 struct tstorm_per_port_stats tstorm_port_statistics;
4816};
4817
4818
4819/*
4820 * Protocol-common statistics collected by the Tstorm (per client)
4821 */
4822struct tstorm_per_queue_stats {
4823 struct regpair rcv_ucast_bytes;
4824 __le32 rcv_ucast_pkts;
4825 __le32 checksum_discard;
4826 struct regpair rcv_bcast_bytes;
4827 __le32 rcv_bcast_pkts;
4828 __le32 pkts_too_big_discard;
4829 struct regpair rcv_mcast_bytes;
4830 __le32 rcv_mcast_pkts;
4831 __le32 ttl0_discard;
4832 __le16 no_buff_discard;
4833 __le16 reserved0;
4834 __le32 reserved1;
4835};
4836
4837/*
4838 * Protocol-common statistics collected by the Ustorm (per client)
4839 */
4840struct ustorm_per_queue_stats {
4841 struct regpair ucast_no_buff_bytes;
4842 struct regpair mcast_no_buff_bytes;
4843 struct regpair bcast_no_buff_bytes;
4844 __le32 ucast_no_buff_pkts;
4845 __le32 mcast_no_buff_pkts;
4846 __le32 bcast_no_buff_pkts;
4847 __le32 coalesced_pkts;
4848 struct regpair coalesced_bytes;
4849 __le32 coalesced_events;
4850 __le32 coalesced_aborts;
4851};
4852
4853/*
4854 * Protocol-common statistics collected by the Xstorm (per client)
4855 */
4856struct xstorm_per_queue_stats {
4857 struct regpair ucast_bytes_sent;
4858 struct regpair mcast_bytes_sent;
4859 struct regpair bcast_bytes_sent;
4860 __le32 ucast_pkts_sent;
4861 __le32 mcast_pkts_sent;
4862 __le32 bcast_pkts_sent;
4863 __le32 error_drop_pkts;
4864};
4865
4866/*
4867 *
4868 */
4869struct per_queue_stats {
4870 struct tstorm_per_queue_stats tstorm_queue_statistics;
4871 struct ustorm_per_queue_stats ustorm_queue_statistics;
4872 struct xstorm_per_queue_stats xstorm_queue_statistics;
4873};
4874
4875
4876/*
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004877 * FW version stored in first line of pram
4878 */
4879struct pram_fw_version {
Eilon Greenstein8d9c5f32009-02-15 23:24:08 -08004880 u8 major;
4881 u8 minor;
4882 u8 revision;
4883 u8 engineering;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004884 u8 flags;
4885#define PRAM_FW_VERSION_OPTIMIZED (0x1<<0)
4886#define PRAM_FW_VERSION_OPTIMIZED_SHIFT 0
4887#define PRAM_FW_VERSION_STORM_ID (0x3<<1)
4888#define PRAM_FW_VERSION_STORM_ID_SHIFT 1
4889#define PRAM_FW_VERSION_BIG_ENDIEN (0x1<<3)
4890#define PRAM_FW_VERSION_BIG_ENDIEN_SHIFT 3
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004891#define PRAM_FW_VERSION_CHIP_VERSION (0x3<<4)
4892#define PRAM_FW_VERSION_CHIP_VERSION_SHIFT 4
4893#define __PRAM_FW_VERSION_RESERVED0 (0x3<<6)
4894#define __PRAM_FW_VERSION_RESERVED0_SHIFT 6
4895};
4896
4897
4898/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004899 * Ethernet slow path element
4900 */
4901union protocol_common_specific_data {
4902 u8 protocol_data[8];
4903 struct regpair phy_address;
4904 struct regpair mac_config_addr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004905};
4906
4907/*
Eilon Greensteinca003922009-08-12 22:53:28 -07004908 * The send queue element
4909 */
4910struct protocol_common_spe {
4911 struct spe_hdr hdr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004912 union protocol_common_specific_data data;
Eilon Greensteinca003922009-08-12 22:53:28 -07004913};
4914
4915
4916/*
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004917 * a single rate shaping counter. can be used as protocol or vnic counter
4918 */
4919struct rate_shaping_counter {
4920 u32 quota;
4921#if defined(__BIG_ENDIAN)
4922 u16 __reserved0;
4923 u16 rate;
4924#elif defined(__LITTLE_ENDIAN)
4925 u16 rate;
4926 u16 __reserved0;
4927#endif
4928};
4929
4930
4931/*
4932 * per-vnic rate shaping variables
4933 */
4934struct rate_shaping_vars_per_vn {
Eilon Greenstein34f80b02008-06-23 20:33:01 -07004935 struct rate_shaping_counter vn_counter;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004936};
4937
4938
4939/*
4940 * The send queue element
4941 */
4942struct slow_path_element {
4943 struct spe_hdr hdr;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004944 struct regpair protocol_data;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004945};
4946
4947
4948/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004949 * Protocol-common statistics counter
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004950 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004951struct stats_counter {
4952 __le16 xstats_counter;
4953 __le16 reserved0;
4954 __le32 reserved1;
4955 __le16 tstats_counter;
4956 __le16 reserved2;
4957 __le32 reserved3;
4958 __le16 ustats_counter;
4959 __le16 reserved4;
4960 __le32 reserved5;
4961 __le16 cstats_counter;
4962 __le16 reserved6;
4963 __le32 reserved7;
Eliezer Tamira2fbb9e2007-11-15 20:09:02 +02004964};
4965
4966
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004967/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004968 *
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004969 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004970struct stats_query_entry {
4971 u8 kind;
4972 u8 index;
4973 __le16 funcID;
4974 __le32 reserved;
4975 struct regpair address;
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004976};
4977
4978/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004979 * statistic command
Dmitry Kravkov523224a2010-10-06 03:23:26 +00004980 */
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03004981struct stats_query_cmd_group {
4982 struct stats_query_entry query[STATS_QUERY_CMD_COUNT];
4983};
4984
4985
4986/*
4987 * statistic command header
4988 */
4989struct stats_query_header {
4990 u8 cmd_num;
4991 u8 reserved0;
4992 __le16 drv_stats_counter;
4993 __le32 reserved1;
4994 struct regpair stats_counters_addrs;
4995};
4996
4997
4998/*
4999 * Types of statistcis query entry
5000 */
5001enum stats_query_type {
5002 STATS_TYPE_QUEUE,
5003 STATS_TYPE_PORT,
5004 STATS_TYPE_PF,
5005 STATS_TYPE_TOE,
5006 STATS_TYPE_FCOE,
5007 MAX_STATS_QUERY_TYPE
5008};
5009
5010
5011/*
5012 * Indicate of the function status block state
5013 */
5014enum status_block_state {
5015 SB_DISABLED,
5016 SB_ENABLED,
5017 SB_CLEANED,
5018 MAX_STATUS_BLOCK_STATE
5019};
5020
5021
5022/*
5023 * Storm IDs (including attentions for IGU related enums)
5024 */
5025enum storm_id {
5026 USTORM_ID,
5027 CSTORM_ID,
5028 XSTORM_ID,
5029 TSTORM_ID,
5030 ATTENTION_ID,
5031 MAX_STORM_ID
5032};
5033
5034
5035/*
5036 * Taffic types used in ETS and flow control algorithms
5037 */
5038enum traffic_type {
5039 LLFC_TRAFFIC_TYPE_NW,
5040 LLFC_TRAFFIC_TYPE_FCOE,
5041 LLFC_TRAFFIC_TYPE_ISCSI,
5042 MAX_TRAFFIC_TYPE
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005043};
5044
5045
5046/*
5047 * zone A per-queue data
5048 */
5049struct tstorm_queue_zone_data {
5050 struct regpair reserved[4];
5051};
5052
5053
5054/*
5055 * zone B per-VF data
5056 */
5057struct tstorm_vf_zone_data {
5058 struct regpair reserved;
5059};
5060
5061
5062/*
5063 * zone A per-queue data
5064 */
5065struct ustorm_queue_zone_data {
5066 struct ustorm_eth_rx_producers eth_rx_producers;
5067 struct regpair reserved[3];
5068};
5069
5070
5071/*
5072 * zone B per-VF data
5073 */
5074struct ustorm_vf_zone_data {
5075 struct regpair reserved;
5076};
5077
5078
5079/*
5080 * data per VF-PF channel
5081 */
5082struct vf_pf_channel_data {
5083#if defined(__BIG_ENDIAN)
5084 u16 reserved0;
5085 u8 valid;
5086 u8 state;
5087#elif defined(__LITTLE_ENDIAN)
5088 u8 state;
5089 u8 valid;
5090 u16 reserved0;
5091#endif
5092 u32 reserved1;
5093};
5094
5095
5096/*
Vlad Zolotarov619c5cb2011-06-14 14:33:44 +03005097 * State of VF-PF channel
5098 */
5099enum vf_pf_channel_state {
5100 VF_PF_CHANNEL_STATE_READY,
5101 VF_PF_CHANNEL_STATE_WAITING_FOR_ACK,
5102 MAX_VF_PF_CHANNEL_STATE
5103};
5104
5105
5106/*
Dmitry Kravkov523224a2010-10-06 03:23:26 +00005107 * zone A per-queue data
5108 */
5109struct xstorm_queue_zone_data {
5110 struct regpair reserved[4];
5111};
5112
5113
5114/*
5115 * zone B per-VF data
5116 */
5117struct xstorm_vf_zone_data {
5118 struct regpair reserved;
5119};
5120
5121#endif /* BNX2X_HSI_H */