1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2017 Chelsio Communications. All rights reserved.
6 #ifndef __CUDBG_ENTITY_H__
7 #define __CUDBG_ENTITY_H__
16 #define CUDBG_ENTITY_SIGNATURE 0xCCEDB001
18 struct cudbg_mbox_log
{
19 struct mbox_cmd entry
;
24 struct cudbg_cim_qcfg
{
26 u16 base
[CIM_NUM_IBQ
+ CIM_NUM_OBQ_T5
];
27 u16 size
[CIM_NUM_IBQ
+ CIM_NUM_OBQ_T5
];
28 u16 thres
[CIM_NUM_IBQ
];
29 u32 obq_wr
[2 * CIM_NUM_OBQ_T5
];
30 u32 stat
[4 * (CIM_NUM_IBQ
+ CIM_NUM_OBQ_T5
)];
33 struct cudbg_rss_vf_conf
{
38 struct cudbg_pm_stats
{
39 u32 tx_cnt
[T6_PM_NSTATS
];
40 u32 rx_cnt
[T6_PM_NSTATS
];
41 u64 tx_cyc
[T6_PM_NSTATS
];
42 u64 rx_cyc
[T6_PM_NSTATS
];
45 struct cudbg_hw_sched
{
48 u32 pace_tab
[NTX_SCHED
];
53 #define SGE_QBASE_DATA_REG_NUM 4
55 struct sge_qbase_reg_field
{
57 u32 reg_data
[SGE_QBASE_DATA_REG_NUM
];
58 /* Max supported PFs */
59 u32 pf_data_value
[PCIE_FW_MASTER_M
+ 1][SGE_QBASE_DATA_REG_NUM
];
60 /* Max supported VFs */
61 u32 vf_data_value
[T6_VF_M
+ 1][SGE_QBASE_DATA_REG_NUM
];
62 u32 vfcount
; /* Actual number of max vfs in current configuration */
68 u32 ireg_local_offset
;
69 u32 ireg_offset_range
;
73 struct ireg_field tp_pio
;
77 struct cudbg_ulprx_la
{
78 u32 data
[ULPRX_LA_SIZE
* 8];
88 static const char * const cudbg_region
[] = {
89 "DBQ contexts:", "IMSG contexts:", "FLM cache:", "TCBs:",
90 "Pstructs:", "Timers:", "Rx FL:", "Tx FL:", "Pstruct FL:",
91 "Tx payload:", "Rx payload:", "LE hash:", "iSCSI region:",
92 "TDDP region:", "TPT region:", "STAG region:", "RQ region:",
93 "RQUDP region:", "PBL region:", "TXPBL region:",
94 "DBVFIFO region:", "ULPRX state:", "ULPTX state:",
98 /* Memory region info relative to current memory (i.e. wrt 0). */
99 struct cudbg_region_info
{
100 bool exist
; /* Does region exists in current memory? */
101 u32 start
; /* Start wrt 0 */
102 u32 end
; /* End wrt 0 */
105 struct cudbg_mem_desc
{
111 #define CUDBG_MEMINFO_REV 1
113 struct cudbg_meminfo
{
114 struct cudbg_mem_desc avail
[4];
115 struct cudbg_mem_desc mem
[ARRAY_SIZE(cudbg_region
) + 3];
122 u32 rx_pages_data
[3];
123 u32 tx_pages_data
[4];
128 u32 loopback_used
[NCHAN
];
129 u32 loopback_alloc
[NCHAN
];
130 u32 p_structs_free_cnt
;
135 struct cudbg_cim_pif_la
{
140 struct cudbg_clk_info
{
143 u64 persist_timer_min
;
144 u64 persist_timer_max
;
145 u64 keepalive_idle_timer
;
146 u64 keepalive_interval
;
156 struct cudbg_tid_info_region
{
184 #define CUDBG_TID_INFO_REV 1
186 struct cudbg_tid_info_region_rev1
{
187 struct cudbg_ver_hdr ver_hdr
;
188 struct cudbg_tid_info_region tid
;
193 #define CUDBG_LOWMEM_MAX_CTXT_QIDS 256
194 #define CUDBG_MAX_FL_QIDS 1024
196 struct cudbg_ch_cntxt
{
199 u32 data
[SGE_CTXT_SIZE
/ 4];
202 #define CUDBG_MAX_RPLC_SIZE 128
204 struct cudbg_mps_tcam
{
223 #define CUDBG_VPD_PF_SIZE 0x800
224 #define CUDBG_SCFG_VER_ADDR 0x06
225 #define CUDBG_SCFG_VER_LEN 4
226 #define CUDBG_VPD_VER_ADDR 0x18c7
227 #define CUDBG_VPD_VER_LEN 2
229 struct cudbg_vpd_data
{
230 u8 sn
[SERNUM_LEN
+ 1];
232 u8 na
[MACADDR_LEN
+ 1];
242 #define CUDBG_MAX_TCAM_TID 0x800
243 #define CUDBG_T6_CLIP 1536
244 #define CUDBG_MAX_TID_COMP_EN 6144
245 #define CUDBG_MAX_TID_COMP_DIS 3072
247 enum cudbg_le_entry_types
{
250 LE_ET_TCAM_SERVER
= 2,
251 LE_ET_TCAM_FILTER
= 3,
253 LE_ET_TCAM_ROUTING
= 5,
255 LE_ET_INVALID_TID
= 8,
267 struct cudbg_tid_data
{
272 u32 data
[NUM_LE_DB_DBGI_RSP_DATA_INSTANCES
];
275 #define CUDBG_NUM_ULPTX 11
276 #define CUDBG_NUM_ULPTX_READ 512
277 #define CUDBG_NUM_ULPTX_ASIC 6
278 #define CUDBG_NUM_ULPTX_ASIC_READ 128
280 #define CUDBG_ULPTX_LA_REV 1
282 struct cudbg_ulptx_la
{
283 u32 rdptr
[CUDBG_NUM_ULPTX
];
284 u32 wrptr
[CUDBG_NUM_ULPTX
];
285 u32 rddata
[CUDBG_NUM_ULPTX
];
286 u32 rd_data
[CUDBG_NUM_ULPTX
][CUDBG_NUM_ULPTX_READ
];
287 u32 rdptr_asic
[CUDBG_NUM_ULPTX_ASIC_READ
];
288 u32 rddata_asic
[CUDBG_NUM_ULPTX_ASIC_READ
][CUDBG_NUM_ULPTX_ASIC
];
291 #define CUDBG_CHAC_PBT_ADDR 0x2800
292 #define CUDBG_CHAC_PBT_LRF 0x3000
293 #define CUDBG_CHAC_PBT_DATA 0x3800
294 #define CUDBG_PBT_DYNAMIC_ENTRIES 8
295 #define CUDBG_PBT_STATIC_ENTRIES 16
296 #define CUDBG_LRF_ENTRIES 8
297 #define CUDBG_PBT_DATA_ENTRIES 512
299 struct cudbg_pbt_tables
{
300 u32 pbt_dynamic
[CUDBG_PBT_DYNAMIC_ENTRIES
];
301 u32 pbt_static
[CUDBG_PBT_STATIC_ENTRIES
];
302 u32 lrf_table
[CUDBG_LRF_ENTRIES
];
303 u32 pbt_data
[CUDBG_PBT_DATA_ENTRIES
];
306 enum cudbg_qdesc_qtype
{
307 CUDBG_QTYPE_UNKNOWN
= 0,
315 CUDBG_QTYPE_OFLD_TXQ
,
316 CUDBG_QTYPE_RDMA_RXQ
,
317 CUDBG_QTYPE_RDMA_FLQ
,
318 CUDBG_QTYPE_RDMA_CIQ
,
319 CUDBG_QTYPE_ISCSI_RXQ
,
320 CUDBG_QTYPE_ISCSI_FLQ
,
321 CUDBG_QTYPE_ISCSIT_RXQ
,
322 CUDBG_QTYPE_ISCSIT_FLQ
,
323 CUDBG_QTYPE_CRYPTO_TXQ
,
324 CUDBG_QTYPE_CRYPTO_RXQ
,
325 CUDBG_QTYPE_CRYPTO_FLQ
,
328 CUDBG_QTYPE_ETHOFLD_TXQ
,
329 CUDBG_QTYPE_ETHOFLD_RXQ
,
330 CUDBG_QTYPE_ETHOFLD_FLQ
,
334 #define CUDBG_QDESC_REV 1
336 struct cudbg_qdesc_entry
{
342 u8 data
[]; /* Must be last */
345 struct cudbg_qdesc_info
{
346 u32 qdesc_entry_size
;
348 u8 data
[]; /* Must be last */
351 #define IREG_NUM_ELEM 4
353 #define CUDBG_NUM_PCIE_CONFIG_REGS 0x61
355 #endif /* __CUDBG_ENTITY_H__ */