1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2016 - 2018 Cavium Inc.
7 #ifndef __ECORE_HSI_DEBUG_TOOLS__
8 #define __ECORE_HSI_DEBUG_TOOLS__
9 /****************************************/
10 /* Debug Tools HSI constants and macros */
11 /****************************************/
102 BLOCK_NIG_LB_FC_PLLH,
103 BLOCK_NIG_TX_FC_PLLH,
105 BLOCK_NIG_RX_FC_PLLH,
112 * binary debug buffer types
114 enum bin_dbg_buffer_type {
115 BIN_BUF_DBG_MODE_TREE /* init modes tree */,
116 BIN_BUF_DBG_DUMP_REG /* GRC Dump registers */,
117 BIN_BUF_DBG_DUMP_MEM /* GRC Dump memories */,
118 BIN_BUF_DBG_IDLE_CHK_REGS /* Idle Check registers */,
119 BIN_BUF_DBG_IDLE_CHK_IMMS /* Idle Check immediates */,
120 BIN_BUF_DBG_IDLE_CHK_RULES /* Idle Check rules */,
121 BIN_BUF_DBG_IDLE_CHK_PARSING_DATA /* Idle Check parsing data */,
122 BIN_BUF_DBG_ATTN_BLOCKS /* Attention blocks */,
123 BIN_BUF_DBG_ATTN_REGS /* Attention registers */,
124 BIN_BUF_DBG_ATTN_INDEXES /* Attention indexes */,
125 BIN_BUF_DBG_ATTN_NAME_OFFSETS /* Attention name offsets */,
126 BIN_BUF_DBG_BLOCKS /* Blocks debug data */,
127 BIN_BUF_DBG_BLOCKS_CHIP_DATA /* Blocks debug chip data */,
128 BIN_BUF_DBG_BUS_LINES /* Blocks debug bus lines */,
129 BIN_BUF_DBG_BLOCKS_USER_DATA /* Blocks debug user data */,
130 BIN_BUF_DBG_BLOCKS_CHIP_USER_DATA /* Blocks debug chip user data */,
131 BIN_BUF_DBG_BUS_LINE_NAME_OFFSETS /* Debug Bus line name offsets */,
132 BIN_BUF_DBG_RESET_REGS /* Reset registers */,
133 BIN_BUF_DBG_PARSING_STRINGS /* Debug Tools parsing strings */,
134 MAX_BIN_DBG_BUFFER_TYPE
139 * Attention bit mapping
141 struct dbg_attn_bit_mapping {
143 /* The index of an attention in the blocks attentions list
144 * (if is_unused_bit_cnt=0), or a number of consecutive unused attention bits
145 * (if is_unused_bit_cnt=1)
147 #define DBG_ATTN_BIT_MAPPING_VAL_MASK 0x7FFF
148 #define DBG_ATTN_BIT_MAPPING_VAL_SHIFT 0
149 /* if set, the val field indicates the number of consecutive unused attention
152 #define DBG_ATTN_BIT_MAPPING_IS_UNUSED_BIT_CNT_MASK 0x1
153 #define DBG_ATTN_BIT_MAPPING_IS_UNUSED_BIT_CNT_SHIFT 15
158 * Attention block per-type data
160 struct dbg_attn_block_type_data {
161 /* Offset of this block attention names in the debug attention name offsets
166 u8 num_regs /* Number of attention registers in this block */;
168 /* Offset of this blocks attention registers in the attention registers array
169 * (in dbg_attn_reg units)
177 struct dbg_attn_block {
178 /* attention block per-type data. Count must match the number of elements in
181 struct dbg_attn_block_type_data per_type_data[2];
186 * Attention register result
188 struct dbg_attn_reg_result {
190 /* STS attention register GRC address (in dwords) */
191 #define DBG_ATTN_REG_RESULT_STS_ADDRESS_MASK 0xFFFFFF
192 #define DBG_ATTN_REG_RESULT_STS_ADDRESS_SHIFT 0
193 /* Number of attention indexes in this register */
194 #define DBG_ATTN_REG_RESULT_NUM_REG_ATTN_MASK 0xFF
195 #define DBG_ATTN_REG_RESULT_NUM_REG_ATTN_SHIFT 24
196 /* The offset of this registers attentions within the blocks attentions list
197 * (a value in the range 0..number of block attentions-1)
199 u16 block_attn_offset;
201 u32 sts_val /* Value read from the STS attention register */;
202 u32 mask_val /* Value read from the MASK attention register */;
206 * Attention block result
208 struct dbg_attn_block_result {
209 u8 block_id /* Registers block ID */;
211 /* Value from dbg_attn_type enum */
212 #define DBG_ATTN_BLOCK_RESULT_ATTN_TYPE_MASK 0x3
213 #define DBG_ATTN_BLOCK_RESULT_ATTN_TYPE_SHIFT 0
214 /* Number of registers in block in which at least one attention bit is set */
215 #define DBG_ATTN_BLOCK_RESULT_NUM_REGS_MASK 0x3F
216 #define DBG_ATTN_BLOCK_RESULT_NUM_REGS_SHIFT 2
217 /* Offset of this registers block attention names in the attention name offsets
221 /* result data for each register in the block in which at least one attention
224 struct dbg_attn_reg_result reg_results[15];
232 struct dbg_mode_hdr {
234 /* indicates if a mode expression should be evaluated (0/1) */
235 #define DBG_MODE_HDR_EVAL_MODE_MASK 0x1
236 #define DBG_MODE_HDR_EVAL_MODE_SHIFT 0
237 /* offset (in bytes) in modes expression buffer. valid only if eval_mode is
240 #define DBG_MODE_HDR_MODES_BUF_OFFSET_MASK 0x7FFF
241 #define DBG_MODE_HDR_MODES_BUF_OFFSET_SHIFT 1
247 struct dbg_attn_reg {
248 /* The offset of this registers attentions within the blocks attentions list
249 * (a value in the range 0..number of block attentions-1)
251 u16 block_attn_offset;
253 /* STS attention register GRC address (in dwords) */
254 #define DBG_ATTN_REG_STS_ADDRESS_MASK 0xFFFFFF
255 #define DBG_ATTN_REG_STS_ADDRESS_SHIFT 0
256 /* Number of attention in this register */
257 #define DBG_ATTN_REG_NUM_REG_ATTN_MASK 0xFF
258 #define DBG_ATTN_REG_NUM_REG_ATTN_SHIFT 24
259 /* STS_CLR attention register GRC address (in dwords) */
261 u32 mask_address /* MASK attention register GRC address (in dwords) */;
280 u8 name[15] /* Block name */;
281 /* The letter (char) of the associated Storm, or 0 if no associated Storm. */
282 u8 associated_storm_letter;
287 * Chip-specific block debug data
289 struct dbg_block_chip {
291 /* Indicates if the block is removed in this chip (0/1). */
292 #define DBG_BLOCK_CHIP_IS_REMOVED_MASK 0x1
293 #define DBG_BLOCK_CHIP_IS_REMOVED_SHIFT 0
294 /* Indicates if this block has a reset register (0/1). */
295 #define DBG_BLOCK_CHIP_HAS_RESET_REG_MASK 0x1
296 #define DBG_BLOCK_CHIP_HAS_RESET_REG_SHIFT 1
297 /* Indicates if this block should be taken out of reset before GRC Dump (0/1).
298 * Valid only if has_reset_reg is set.
300 #define DBG_BLOCK_CHIP_UNRESET_BEFORE_DUMP_MASK 0x1
301 #define DBG_BLOCK_CHIP_UNRESET_BEFORE_DUMP_SHIFT 2
302 /* Indicates if this block has a debug bus (0/1). */
303 #define DBG_BLOCK_CHIP_HAS_DBG_BUS_MASK 0x1
304 #define DBG_BLOCK_CHIP_HAS_DBG_BUS_SHIFT 3
305 /* Indicates if this block has a latency events debug line (0/1). Valid only
306 * if has_dbg_bus is set.
308 #define DBG_BLOCK_CHIP_HAS_LATENCY_EVENTS_MASK 0x1
309 #define DBG_BLOCK_CHIP_HAS_LATENCY_EVENTS_SHIFT 4
310 #define DBG_BLOCK_CHIP_RESERVED0_MASK 0x7
311 #define DBG_BLOCK_CHIP_RESERVED0_SHIFT 5
312 /* The DBG block client ID of this block/chip. Valid only if has_dbg_bus is
316 /* The ID of the reset register of this block/chip in the dbg_reset_reg
320 /* The bit offset of this block/chip in the reset register. Valid only if
321 * has_reset_reg is set.
323 u8 reset_reg_bit_offset;
324 struct dbg_mode_hdr dbg_bus_mode /* Mode header */;
327 /* Number of Debug Bus lines in this block/chip (excluding signature and latency
328 * events). Valid only if has_dbg_bus is set.
330 u8 num_of_dbg_bus_lines;
331 /* Offset of this block/chip Debug Bus lines in the Debug Bus lines array. Valid
332 * only if has_dbg_bus is set.
334 u16 dbg_bus_lines_offset;
335 /* GRC address of the Debug Bus dbg_select register (in dwords). Valid only if
336 * has_dbg_bus is set.
338 u32 dbg_select_reg_addr;
339 /* GRC address of the Debug Bus dbg_dword_enable register (in dwords). Valid
340 * only if has_dbg_bus is set.
342 u32 dbg_dword_enable_reg_addr;
343 /* GRC address of the Debug Bus dbg_shift register (in dwords). Valid only if
344 * has_dbg_bus is set.
346 u32 dbg_shift_reg_addr;
347 /* GRC address of the Debug Bus dbg_force_valid register (in dwords). Valid only
348 * if has_dbg_bus is set.
350 u32 dbg_force_valid_reg_addr;
351 /* GRC address of the Debug Bus dbg_force_frame register (in dwords). Valid only
352 * if has_dbg_bus is set.
354 u32 dbg_force_frame_reg_addr;
359 * Chip-specific block user debug data
361 struct dbg_block_chip_user {
362 /* Number of debug bus lines in this block (excluding signature and latency
365 u8 num_of_dbg_bus_lines;
366 /* Indicates if this block has a latency events debug line (0/1). */
367 u8 has_latency_events;
368 /* Offset of this blocks lines in the debug bus line name offsets array. */
374 * Block user debug data
376 struct dbg_block_user {
377 u8 name[16] /* Block name */;
382 * Block Debug line data
384 struct dbg_bus_line {
386 /* Number of groups in the line (0-3) */
387 #define DBG_BUS_LINE_NUM_OF_GROUPS_MASK 0xF
388 #define DBG_BUS_LINE_NUM_OF_GROUPS_SHIFT 0
389 /* Indicates if this is a 128b line (0) or a 256b line (1). */
390 #define DBG_BUS_LINE_IS_256B_MASK 0x1
391 #define DBG_BUS_LINE_IS_256B_SHIFT 4
392 #define DBG_BUS_LINE_RESERVED_MASK 0x7
393 #define DBG_BUS_LINE_RESERVED_SHIFT 5
394 /* Four 2-bit values, indicating the size of each group minus 1 (i.e.
395 * value=0 means size=1, value=1 means size=2, etc), starting from lsb.
396 * The sizes are in dwords (if is_256b=0) or in qwords (if is_256b=1).
403 * condition header for registers dump
405 struct dbg_dump_cond_hdr {
406 struct dbg_mode_hdr mode /* Mode header */;
407 u8 block_id /* block ID */;
408 u8 data_size /* size in dwords of the data following this header */;
413 * memory data for registers dump
415 struct dbg_dump_mem {
417 /* register address (in dwords) */
418 #define DBG_DUMP_MEM_ADDRESS_MASK 0xFFFFFF
419 #define DBG_DUMP_MEM_ADDRESS_SHIFT 0
420 #define DBG_DUMP_MEM_MEM_GROUP_ID_MASK 0xFF /* memory group ID */
421 #define DBG_DUMP_MEM_MEM_GROUP_ID_SHIFT 24
423 /* register size (in dwords) */
424 #define DBG_DUMP_MEM_LENGTH_MASK 0xFFFFFF
425 #define DBG_DUMP_MEM_LENGTH_SHIFT 0
426 /* indicates if the register is wide-bus */
427 #define DBG_DUMP_MEM_WIDE_BUS_MASK 0x1
428 #define DBG_DUMP_MEM_WIDE_BUS_SHIFT 24
429 #define DBG_DUMP_MEM_RESERVED_MASK 0x7F
430 #define DBG_DUMP_MEM_RESERVED_SHIFT 25
435 * register data for registers dump
437 struct dbg_dump_reg {
439 /* register address (in dwords) */
440 #define DBG_DUMP_REG_ADDRESS_MASK 0x7FFFFF /* register address (in dwords) */
441 #define DBG_DUMP_REG_ADDRESS_SHIFT 0
442 /* indicates if the register is wide-bus */
443 #define DBG_DUMP_REG_WIDE_BUS_MASK 0x1
444 #define DBG_DUMP_REG_WIDE_BUS_SHIFT 23
445 #define DBG_DUMP_REG_LENGTH_MASK 0xFF /* register size (in dwords) */
446 #define DBG_DUMP_REG_LENGTH_SHIFT 24
451 * split header for registers dump
453 struct dbg_dump_split_hdr {
455 /* size in dwords of the data following this header */
456 #define DBG_DUMP_SPLIT_HDR_DATA_SIZE_MASK 0xFFFFFF
457 #define DBG_DUMP_SPLIT_HDR_DATA_SIZE_SHIFT 0
458 #define DBG_DUMP_SPLIT_HDR_SPLIT_TYPE_ID_MASK 0xFF /* split type ID */
459 #define DBG_DUMP_SPLIT_HDR_SPLIT_TYPE_ID_SHIFT 24
464 * condition header for idle check
466 struct dbg_idle_chk_cond_hdr {
467 struct dbg_mode_hdr mode /* Mode header */;
468 u16 data_size /* size in dwords of the data following this header */;
473 * Idle Check condition register
475 struct dbg_idle_chk_cond_reg {
477 /* Register GRC address (in dwords) */
478 #define DBG_IDLE_CHK_COND_REG_ADDRESS_MASK 0x7FFFFF
479 #define DBG_IDLE_CHK_COND_REG_ADDRESS_SHIFT 0
480 /* indicates if the register is wide-bus */
481 #define DBG_IDLE_CHK_COND_REG_WIDE_BUS_MASK 0x1
482 #define DBG_IDLE_CHK_COND_REG_WIDE_BUS_SHIFT 23
483 /* value from block_id enum */
484 #define DBG_IDLE_CHK_COND_REG_BLOCK_ID_MASK 0xFF
485 #define DBG_IDLE_CHK_COND_REG_BLOCK_ID_SHIFT 24
486 u16 num_entries /* number of registers entries to check */;
487 u8 entry_size /* size of registers entry (in dwords) */;
488 u8 start_entry /* index of the first entry to check */;
493 * Idle Check info register
495 struct dbg_idle_chk_info_reg {
497 /* Register GRC address (in dwords) */
498 #define DBG_IDLE_CHK_INFO_REG_ADDRESS_MASK 0x7FFFFF
499 #define DBG_IDLE_CHK_INFO_REG_ADDRESS_SHIFT 0
500 /* indicates if the register is wide-bus */
501 #define DBG_IDLE_CHK_INFO_REG_WIDE_BUS_MASK 0x1
502 #define DBG_IDLE_CHK_INFO_REG_WIDE_BUS_SHIFT 23
503 /* value from block_id enum */
504 #define DBG_IDLE_CHK_INFO_REG_BLOCK_ID_MASK 0xFF
505 #define DBG_IDLE_CHK_INFO_REG_BLOCK_ID_SHIFT 24
506 u16 size /* register size in dwords */;
507 struct dbg_mode_hdr mode /* Mode header */;
512 * Idle Check register
514 union dbg_idle_chk_reg {
515 struct dbg_idle_chk_cond_reg cond_reg /* condition register */;
516 struct dbg_idle_chk_info_reg info_reg /* info register */;
521 * Idle Check result header
523 struct dbg_idle_chk_result_hdr {
524 u16 rule_id /* Failing rule index */;
525 u16 mem_entry_id /* Failing memory entry index */;
526 u8 num_dumped_cond_regs /* number of dumped condition registers */;
527 u8 num_dumped_info_regs /* number of dumped condition registers */;
528 u8 severity /* from dbg_idle_chk_severity_types enum */;
534 * Idle Check result register header
536 struct dbg_idle_chk_result_reg_hdr {
538 /* indicates if this register is a memory */
539 #define DBG_IDLE_CHK_RESULT_REG_HDR_IS_MEM_MASK 0x1
540 #define DBG_IDLE_CHK_RESULT_REG_HDR_IS_MEM_SHIFT 0
541 /* register index within the failing rule */
542 #define DBG_IDLE_CHK_RESULT_REG_HDR_REG_ID_MASK 0x7F
543 #define DBG_IDLE_CHK_RESULT_REG_HDR_REG_ID_SHIFT 1
544 u8 start_entry /* index of the first checked entry */;
545 u16 size /* register size in dwords */;
552 struct dbg_idle_chk_rule {
553 u16 rule_id /* Idle Check rule ID */;
554 u8 severity /* value from dbg_idle_chk_severity_types enum */;
555 u8 cond_id /* Condition ID */;
556 u8 num_cond_regs /* number of condition registers */;
557 u8 num_info_regs /* number of info registers */;
558 u8 num_imms /* number of immediates in the condition */;
560 /* offset of this rules registers in the idle check register array
561 * (in dbg_idle_chk_reg units)
564 /* offset of this rules immediate values in the immediate values array
572 * Idle Check rule parsing data
574 struct dbg_idle_chk_rule_parsing_data {
576 /* indicates if this register has a FW message */
577 #define DBG_IDLE_CHK_RULE_PARSING_DATA_HAS_FW_MSG_MASK 0x1
578 #define DBG_IDLE_CHK_RULE_PARSING_DATA_HAS_FW_MSG_SHIFT 0
579 /* Offset of this rules strings in the debug strings array (in bytes) */
580 #define DBG_IDLE_CHK_RULE_PARSING_DATA_STR_OFFSET_MASK 0x7FFFFFFF
581 #define DBG_IDLE_CHK_RULE_PARSING_DATA_STR_OFFSET_SHIFT 1
586 * idle check severity types
588 enum dbg_idle_chk_severity_types {
589 /* idle check failure should cause an error */
590 IDLE_CHK_SEVERITY_ERROR,
591 /* idle check failure should cause an error only if theres no traffic */
592 IDLE_CHK_SEVERITY_ERROR_NO_TRAFFIC,
593 /* idle check failure should cause a warning */
594 IDLE_CHK_SEVERITY_WARNING,
595 MAX_DBG_IDLE_CHK_SEVERITY_TYPES
603 struct dbg_reset_reg {
605 #define DBG_RESET_REG_ADDR_MASK 0xFFFFFF /* GRC address (in dwords) */
606 #define DBG_RESET_REG_ADDR_SHIFT 0
607 /* indicates if this register is removed (0/1). */
608 #define DBG_RESET_REG_IS_REMOVED_MASK 0x1
609 #define DBG_RESET_REG_IS_REMOVED_SHIFT 24
610 #define DBG_RESET_REG_RESERVED_MASK 0x7F
611 #define DBG_RESET_REG_RESERVED_SHIFT 25
616 * Debug Bus block data
618 struct dbg_bus_block_data {
619 /* 4 bit value, bit i set -> dword/qword i is enabled in block. */
621 /* Number of dwords/qwords to cyclically right the blocks output (0-3). */
623 /* 4 bit value, bit i set -> dword/qword i is forced valid in block. */
625 /* 4 bit value, bit i set -> dword/qword i frame bit is forced in block. */
627 /* bit i set -> dword i contains this blocks data (after shifting). */
629 u8 line_num /* Debug line number to select */;
630 u8 hw_id /* HW ID associated with the block */;
632 /* 0/1. If 1, the debug line is 256b, otherwise its 128b. */
633 #define DBG_BUS_BLOCK_DATA_IS_256B_LINE_MASK 0x1
634 #define DBG_BUS_BLOCK_DATA_IS_256B_LINE_SHIFT 0
635 #define DBG_BUS_BLOCK_DATA_RESERVED_MASK 0x7F
636 #define DBG_BUS_BLOCK_DATA_RESERVED_SHIFT 1
641 * Debug Bus constraint operation types
643 enum dbg_bus_constraint_ops {
644 DBG_BUS_CONSTRAINT_OP_EQ /* equal */,
645 DBG_BUS_CONSTRAINT_OP_NE /* not equal */,
646 DBG_BUS_CONSTRAINT_OP_LT /* less than */,
647 DBG_BUS_CONSTRAINT_OP_LTC /* less than (cyclic) */,
648 DBG_BUS_CONSTRAINT_OP_LE /* less than or equal */,
649 DBG_BUS_CONSTRAINT_OP_LEC /* less than or equal (cyclic) */,
650 DBG_BUS_CONSTRAINT_OP_GT /* greater than */,
651 DBG_BUS_CONSTRAINT_OP_GTC /* greater than (cyclic) */,
652 DBG_BUS_CONSTRAINT_OP_GE /* greater than or equal */,
653 DBG_BUS_CONSTRAINT_OP_GEC /* greater than or equal (cyclic) */,
654 MAX_DBG_BUS_CONSTRAINT_OPS
659 * Debug Bus trigger state data
661 struct dbg_bus_trigger_state_data {
662 /* Message length (in cycles) to be used for message-based trigger constraints.
663 * If set to 0, message length is based only on frame bit received from HW.
666 /* A bit for each dword in the debug bus cycle, indicating if this dword appears
667 * in a trigger constraint (1) or not (0)
669 u8 constraint_dword_mask;
670 /* Storm ID to trigger on. Valid only when triggering on Storm data.
671 * (use enum dbg_storms)
678 * Debug Bus memory address
680 struct dbg_bus_mem_addr {
686 * Debug Bus PCI buffer data
688 struct dbg_bus_pci_buf_data {
689 struct dbg_bus_mem_addr phys_addr /* PCI buffer physical address */;
690 struct dbg_bus_mem_addr virt_addr /* PCI buffer virtual address */;
691 u32 size /* PCI buffer size in bytes */;
695 * Debug Bus Storm EID range filter params
697 struct dbg_bus_storm_eid_range_params {
698 u8 min /* Minimal event ID to filter on */;
699 u8 max /* Maximal event ID to filter on */;
703 * Debug Bus Storm EID mask filter params
705 struct dbg_bus_storm_eid_mask_params {
706 u8 val /* Event ID value */;
707 u8 mask /* Event ID mask. 1s in the mask = dont care bits. */;
711 * Debug Bus Storm EID filter params
713 union dbg_bus_storm_eid_params {
714 /* EID range filter params */
715 struct dbg_bus_storm_eid_range_params range;
716 /* EID mask filter params */
717 struct dbg_bus_storm_eid_mask_params mask;
721 * Debug Bus Storm data
723 struct dbg_bus_storm_data {
724 u8 enabled /* indicates if the Storm is enabled for recording */;
725 u8 mode /* Storm debug mode, valid only if the Storm is enabled */;
726 u8 hw_id /* HW ID associated with the Storm */;
727 u8 eid_filter_en /* Indicates if EID filtering is performed (0/1) */;
728 /* 1 = EID range filter, 0 = EID mask filter. Valid only if eid_filter_en is
731 u8 eid_range_not_mask;
732 u8 cid_filter_en /* Indicates if CID filtering is performed (0/1) */;
733 /* EID filter params to filter on. Valid only if eid_filter_en is set. */
734 union dbg_bus_storm_eid_params eid_filter_params;
735 u32 cid /* CID to filter on. Valid only if cid_filter_en is set. */;
741 struct dbg_bus_data {
742 u32 app_version /* The tools version number of the application */;
743 u8 state /* The current debug bus state */;
744 u8 mode_256b_en /* Indicates if the 256 bit mode is enabled */;
745 u8 num_enabled_blocks /* Number of blocks enabled for recording */;
746 u8 num_enabled_storms /* Number of Storms enabled for recording */;
747 u8 target /* Output target */;
748 u8 one_shot_en /* Indicates if one-shot mode is enabled (0/1) */;
749 u8 grc_input_en /* Indicates if GRC recording is enabled (0/1) */;
750 /* Indicates if timestamp recording is enabled (0/1) */
751 u8 timestamp_input_en;
752 u8 filter_en /* Indicates if the recording filter is enabled (0/1) */;
753 /* If true, the next added constraint belong to the filter. Otherwise,
754 * it belongs to the last added trigger state. Valid only if either filter or
755 * triggers are enabled.
758 /* Indicates if the recording filter should be applied before the trigger.
759 * Valid only if both filter and trigger are enabled (0/1)
761 u8 filter_pre_trigger;
762 /* Indicates if the recording filter should be applied after the trigger.
763 * Valid only if both filter and trigger are enabled (0/1)
765 u8 filter_post_trigger;
766 /* Indicates if the recording trigger is enabled (0/1) */
768 /* A bit for each dword in the debug bus cycle, indicating if this dword
769 * appears in a filter constraint (1) or not (0)
771 u8 filter_constraint_dword_mask;
772 u8 next_trigger_state /* ID of next trigger state to be added */;
773 /* ID of next filter/trigger constraint to be added */
774 u8 next_constraint_id;
775 /* trigger states data */
776 struct dbg_bus_trigger_state_data trigger_states[3];
777 /* Message length (in cycles) to be used for message-based filter constraints.
778 * If set to 0 message length is based only on frame bit received from HW.
781 /* Indicates if the other engine sends it NW recording to this engine (0/1) */
782 u8 rcv_from_other_engine;
783 /* A bit for each dword in the debug bus cycle, indicating if this dword is
784 * recorded (1) or not (0)
786 u8 blocks_dword_mask;
787 /* Indicates if there are dwords in the debug bus cycle which are recorded
788 * by more tan one block (0/1)
790 u8 blocks_dword_overlap;
791 /* The HW IDs of the recorded HW blocks, where bits i*3..i*3+2 contain the
792 * HW ID of dword/qword i
795 /* Debug Bus PCI buffer data. Valid only when the target is
796 * DBG_BUS_TARGET_ID_PCI.
798 struct dbg_bus_pci_buf_data pci_buf;
799 /* Debug Bus data for each block */
800 struct dbg_bus_block_data blocks[132];
801 /* Debug Bus data for each block */
802 struct dbg_bus_storm_data storms[6];
809 enum dbg_bus_states {
810 DBG_BUS_STATE_IDLE /* debug bus idle state (not recording) */,
811 /* debug bus is ready for configuration and recording */
813 DBG_BUS_STATE_RECORDING /* debug bus is currently recording */,
814 DBG_BUS_STATE_STOPPED /* debug bus recording has stopped */,
824 * Debug Bus Storm modes
826 enum dbg_bus_storm_modes {
827 DBG_BUS_STORM_MODE_PRINTF /* store data (fast debug) */,
828 DBG_BUS_STORM_MODE_PRAM_ADDR /* pram address (fast debug) */,
829 DBG_BUS_STORM_MODE_DRA_RW /* DRA read/write data (fast debug) */,
830 DBG_BUS_STORM_MODE_DRA_W /* DRA write data (fast debug) */,
831 DBG_BUS_STORM_MODE_LD_ST_ADDR /* load/store address (fast debug) */,
832 DBG_BUS_STORM_MODE_DRA_FSM /* DRA state machines (fast debug) */,
833 DBG_BUS_STORM_MODE_RH /* recording handlers (fast debug) */,
834 /* recording handlers with store messages (fast debug) */
835 DBG_BUS_STORM_MODE_RH_WITH_STORE,
836 DBG_BUS_STORM_MODE_FOC /* FOC: FIN + DRA Rd (slow debug) */,
837 DBG_BUS_STORM_MODE_EXT_STORE /* FOC: External Store (slow) */,
838 MAX_DBG_BUS_STORM_MODES
843 * Debug bus target IDs
845 enum dbg_bus_targets {
846 /* records debug bus to DBG block internal buffer */
847 DBG_BUS_TARGET_ID_INT_BUF,
848 DBG_BUS_TARGET_ID_NIG /* records debug bus to the NW */,
849 DBG_BUS_TARGET_ID_PCI /* records debug bus to a PCI buffer */,
858 struct dbg_grc_data {
859 /* Indicates if the GRC parameters were initialized */
860 u8 params_initialized;
863 /* Value of each GRC parameter. Array size must match the enum dbg_grc_params.
872 enum dbg_grc_params {
873 DBG_GRC_PARAM_DUMP_TSTORM /* dump Tstorm memories (0/1) */,
874 DBG_GRC_PARAM_DUMP_MSTORM /* dump Mstorm memories (0/1) */,
875 DBG_GRC_PARAM_DUMP_USTORM /* dump Ustorm memories (0/1) */,
876 DBG_GRC_PARAM_DUMP_XSTORM /* dump Xstorm memories (0/1) */,
877 DBG_GRC_PARAM_DUMP_YSTORM /* dump Ystorm memories (0/1) */,
878 DBG_GRC_PARAM_DUMP_PSTORM /* dump Pstorm memories (0/1) */,
879 DBG_GRC_PARAM_DUMP_REGS /* dump non-memory registers (0/1) */,
880 DBG_GRC_PARAM_DUMP_RAM /* dump Storm internal RAMs (0/1) */,
881 DBG_GRC_PARAM_DUMP_PBUF /* dump Storm passive buffer (0/1) */,
882 DBG_GRC_PARAM_DUMP_IOR /* dump Storm IORs (0/1) */,
883 DBG_GRC_PARAM_DUMP_VFC /* dump VFC memories (0/1) */,
884 DBG_GRC_PARAM_DUMP_CM_CTX /* dump CM contexts (0/1) */,
885 DBG_GRC_PARAM_DUMP_PXP /* dump PXP memories (0/1) */,
886 DBG_GRC_PARAM_DUMP_RSS /* dump RSS memories (0/1) */,
887 DBG_GRC_PARAM_DUMP_CAU /* dump CAU memories (0/1) */,
888 DBG_GRC_PARAM_DUMP_QM /* dump QM memories (0/1) */,
889 DBG_GRC_PARAM_DUMP_MCP /* dump MCP memories (0/1) */,
890 DBG_GRC_PARAM_DUMP_DORQ /* dump DORQ memories (0/1) */,
891 DBG_GRC_PARAM_DUMP_CFC /* dump CFC memories (0/1) */,
892 DBG_GRC_PARAM_DUMP_IGU /* dump IGU memories (0/1) */,
893 DBG_GRC_PARAM_DUMP_BRB /* dump BRB memories (0/1) */,
894 DBG_GRC_PARAM_DUMP_BTB /* dump BTB memories (0/1) */,
895 DBG_GRC_PARAM_DUMP_BMB /* dump BMB memories (0/1) */,
896 DBG_GRC_PARAM_RESERVD1 /* reserved */,
897 DBG_GRC_PARAM_DUMP_MULD /* dump MULD memories (0/1) */,
898 DBG_GRC_PARAM_DUMP_PRS /* dump PRS memories (0/1) */,
899 DBG_GRC_PARAM_DUMP_DMAE /* dump PRS memories (0/1) */,
900 DBG_GRC_PARAM_DUMP_TM /* dump TM (timers) memories (0/1) */,
901 DBG_GRC_PARAM_DUMP_SDM /* dump SDM memories (0/1) */,
902 DBG_GRC_PARAM_DUMP_DIF /* dump DIF memories (0/1) */,
903 DBG_GRC_PARAM_DUMP_STATIC /* dump static debug data (0/1) */,
904 DBG_GRC_PARAM_UNSTALL /* un-stall Storms after dump (0/1) */,
905 DBG_GRC_PARAM_RESERVED2 /* reserved */,
906 /* MCP Trace meta data size in bytes */
907 DBG_GRC_PARAM_MCP_TRACE_META_SIZE,
908 /* preset: exclude all memories from dump (1 only) */
909 DBG_GRC_PARAM_EXCLUDE_ALL,
910 /* preset: include memories for crash dump (1 only) */
912 /* perform dump only if MFW is responding (0/1) */
913 DBG_GRC_PARAM_PARITY_SAFE,
914 DBG_GRC_PARAM_DUMP_CM /* dump CM memories (0/1) */,
915 DBG_GRC_PARAM_DUMP_PHY /* dump PHY memories (0/1) */,
916 DBG_GRC_PARAM_NO_MCP /* dont perform MCP commands (0/1) */,
917 DBG_GRC_PARAM_NO_FW_VER /* dont read FW/MFW version (0/1) */,
918 DBG_GRC_PARAM_RESERVED3 /* reserved */,
919 DBG_GRC_PARAM_DUMP_MCP_HW_DUMP /* dump MCP HW Dump (0/1) */,
920 DBG_GRC_PARAM_DUMP_ILT_CDUC /* dump ILT CDUC client (0/1) */,
921 DBG_GRC_PARAM_DUMP_ILT_CDUT /* dump ILT CDUT client (0/1) */,
922 DBG_GRC_PARAM_DUMP_CAU_EXT /* dump CAU extended memories (0/1) */,
932 DBG_STATUS_APP_VERSION_NOT_SET,
933 DBG_STATUS_UNSUPPORTED_APP_VERSION,
934 DBG_STATUS_DBG_BLOCK_NOT_RESET,
935 DBG_STATUS_INVALID_ARGS,
936 DBG_STATUS_OUTPUT_ALREADY_SET,
937 DBG_STATUS_INVALID_PCI_BUF_SIZE,
938 DBG_STATUS_PCI_BUF_ALLOC_FAILED,
939 DBG_STATUS_PCI_BUF_NOT_ALLOCATED,
940 DBG_STATUS_INVALID_FILTER_TRIGGER_DWORDS,
941 DBG_STATUS_NO_MATCHING_FRAMING_MODE,
942 DBG_STATUS_VFC_READ_ERROR,
943 DBG_STATUS_STORM_ALREADY_ENABLED,
944 DBG_STATUS_STORM_NOT_ENABLED,
945 DBG_STATUS_BLOCK_ALREADY_ENABLED,
946 DBG_STATUS_BLOCK_NOT_ENABLED,
947 DBG_STATUS_NO_INPUT_ENABLED,
948 DBG_STATUS_NO_FILTER_TRIGGER_256B,
949 DBG_STATUS_FILTER_ALREADY_ENABLED,
950 DBG_STATUS_TRIGGER_ALREADY_ENABLED,
951 DBG_STATUS_TRIGGER_NOT_ENABLED,
952 DBG_STATUS_CANT_ADD_CONSTRAINT,
953 DBG_STATUS_TOO_MANY_TRIGGER_STATES,
954 DBG_STATUS_TOO_MANY_CONSTRAINTS,
955 DBG_STATUS_RECORDING_NOT_STARTED,
956 DBG_STATUS_DATA_DIDNT_TRIGGER,
957 DBG_STATUS_NO_DATA_RECORDED,
958 DBG_STATUS_DUMP_BUF_TOO_SMALL,
959 DBG_STATUS_DUMP_NOT_CHUNK_ALIGNED,
960 DBG_STATUS_UNKNOWN_CHIP,
961 DBG_STATUS_VIRT_MEM_ALLOC_FAILED,
962 DBG_STATUS_BLOCK_IN_RESET,
963 DBG_STATUS_INVALID_TRACE_SIGNATURE,
964 DBG_STATUS_INVALID_NVRAM_BUNDLE,
965 DBG_STATUS_NVRAM_GET_IMAGE_FAILED,
966 DBG_STATUS_NON_ALIGNED_NVRAM_IMAGE,
967 DBG_STATUS_NVRAM_READ_FAILED,
968 DBG_STATUS_IDLE_CHK_PARSE_FAILED,
969 DBG_STATUS_MCP_TRACE_BAD_DATA,
970 DBG_STATUS_MCP_TRACE_NO_META,
971 DBG_STATUS_MCP_COULD_NOT_HALT,
972 DBG_STATUS_MCP_COULD_NOT_RESUME,
973 DBG_STATUS_RESERVED0,
974 DBG_STATUS_SEMI_FIFO_NOT_EMPTY,
975 DBG_STATUS_IGU_FIFO_BAD_DATA,
976 DBG_STATUS_MCP_COULD_NOT_MASK_PRTY,
977 DBG_STATUS_FW_ASSERTS_PARSE_FAILED,
978 DBG_STATUS_REG_FIFO_BAD_DATA,
979 DBG_STATUS_PROTECTION_OVERRIDE_BAD_DATA,
980 DBG_STATUS_DBG_ARRAY_NOT_SET,
981 DBG_STATUS_RESERVED1,
982 DBG_STATUS_NON_MATCHING_LINES,
983 DBG_STATUS_INSUFFICIENT_HW_IDS,
984 DBG_STATUS_DBG_BUS_IN_USE,
985 DBG_STATUS_INVALID_STORM_DBG_MODE,
986 DBG_STATUS_OTHER_ENGINE_BB_ONLY,
987 DBG_STATUS_FILTER_SINGLE_HW_ID,
988 DBG_STATUS_TRIGGER_SINGLE_HW_ID,
989 DBG_STATUS_MISSING_TRIGGER_STATE_STORM,
1011 struct idle_chk_data {
1012 u32 buf_size /* Idle check buffer size in dwords */;
1013 /* Indicates if the idle check buffer size was set (0/1) */
1020 * Pretend parameters
1022 struct pretend_params {
1023 u8 split_type /* Pretend split type (from enum init_split_types) */;
1025 u16 split_id /* Preted split ID (within the pretend split type) */;
1029 * Debug Tools data (per HW function)
1031 struct dbg_tools_data {
1032 struct dbg_grc_data grc /* GRC Dump data */;
1033 struct dbg_bus_data bus /* Debug Bus data */;
1034 struct idle_chk_data idle_chk /* Idle Check data */;
1035 u8 mode_enable[40] /* Indicates if a mode is enabled (0/1) */;
1036 /* Indicates if a block is in reset state (0/1) */
1037 u8 block_in_reset[132];
1038 u8 chip_id /* Chip ID (from enum chip_ids) */;
1039 u8 hw_type /* HW Type */;
1040 u8 num_ports /* Number of ports in the chip */;
1041 u8 num_pfs_per_port /* Number of PFs in each port */;
1042 u8 num_vfs /* Number of VFs in the chip */;
1043 u8 initialized /* Indicates if the data was initialized */;
1044 u8 use_dmae /* Indicates if DMAE should be used */;
1046 struct pretend_params pretend /* Current pretend parameters */;
1047 /* Numbers of registers that were read since last log */
1053 #endif /* __ECORE_HSI_DEBUG_TOOLS__ */