2 * Copyright (c) 2017-2018 Cavium, Inc.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _DBG_FW_FUNCS_H
33 #define _DBG_FW_FUNCS_H
34 /**************************** Public Functions *******************************/
37 * @brief ecore_dbg_set_bin_ptr - Sets a pointer to the binary data with debug
40 * @param bin_ptr - a pointer to the binary data with debug arrays.
42 enum dbg_status ecore_dbg_set_bin_ptr(const u8 * const bin_ptr);
45 * @brief ecore_dbg_set_app_ver - Sets the version of the calling app.
47 * The application should call this function with the TOOLS_VERSION
48 * it compiles with. Must be called before all other debug functions.
50 * @return error if one of the following holds:
51 * - the specified app version is not supported
52 * Otherwise, returns ok.
54 enum dbg_status ecore_dbg_set_app_ver(u32 ver);
57 * @brief ecore_dbg_get_fw_func_ver - Returns the FW func version.
59 * @return the FW func version.
61 u32 ecore_dbg_get_fw_func_ver(void);
64 * @brief ecore_dbg_get_chip_id - Returns the FW func version.
66 * @param p_hwfn - HW device data
68 * @return the chip ID.
70 enum chip_ids ecore_dbg_get_chip_id(struct ecore_hwfn *p_hwfn);
73 * @brief ecore_dbg_bus_reset - Resets the Debug block.
76 * - The last recording is erased.
77 * - Recording is directed to the internal buffer.
78 * - Wrap-around recording is selected.
79 * - All HW blocks are disabled.
80 * - All Storms are disabled and all SEM filters are cleared.
82 * @param p_hwfn - HW device data
83 * @param p_ptt - Ptt window used for writing the registers.
84 * @param one_shot_en - Enable/Disable one-shot recording. If disabled,
85 * wrap-around recording is used instead.
86 * @param force_hw_dwords - If set to 0, no. of HW/Storm dwords per cycle is
87 * chosen automatically based on the enabled inputs.
88 * Otherwise, no. of HW dwords per cycle is forced to
89 * the specified value. Valid values: 0/2/4/8.
90 * @param unify_inputs - If true, all recorded data is associated with a
91 * single input, as if all data was received from the
92 * same block. Otherwise, each data unit is associated
93 * with its original input.
94 * @param grc_input_en - Enable/Disable recording GRC input. If enabled, the
95 * GRC input is recorded to the lsb dword of a cycle.
97 * @return error if one of the following holds:
98 * - the version wasn't set
99 * - force_hw_dwords is invalid.
100 * Otherwise, returns ok.
102 enum dbg_status ecore_dbg_bus_reset(struct ecore_hwfn *p_hwfn,
103 struct ecore_ptt *p_ptt,
110 * @brief ecore_dbg_bus_set_pci_output - Directs debug output to a PCI buffer.
112 * @param p_hwfn - HW device data
113 * @param p_ptt - Ptt window used for writing the registers.
114 * @param buf_size_kb - Size of PCI buffer to allocate (in KB). Must be aligned
115 * to PCI request size.
117 * @return error if one of the following holds:
118 * - the Debug block wasn't reset since last recording
119 * - the version wasn't set
120 * - the output was already set
121 * - the PCI buffer size is not aligned to PCI packet size
122 * - the PCI buffer allocation failed
123 * Otherwise, returns ok.
125 enum dbg_status ecore_dbg_bus_set_pci_output(struct ecore_hwfn *p_hwfn,
126 struct ecore_ptt *p_ptt,
130 * @brief ecore_dbg_bus_set_nw_output - Directs debug output to the network.
132 * @param p_hwfn - HW device data
133 * @param p_ptt - Ptt window used for writing the registers.
134 * @param port_id - Port ID to transmit the debug data on
135 * @param dest_addr_lo32 - Destination MAC address (for Eth header)
136 * @param dest_addr_hi16
137 * @param data_limit_size_kb - Data limit size in KB (valid only for one-shot)
138 * If set to 0, data limit won't be configured.
139 * @param send_to_other_engine -If true:
140 * 1) The NW output will be sent to the DBG block
141 * of the other engine.
142 * 2) port_id argument is ignored.
143 * 3) rcv_from_other_engine should be set to false
144 * The other engine DBG block should call this
145 * function with rcv_from_other_engine set to
147 * @param rcv_from_other_engine-If true:
148 * 1) the DBG block receives the NW output sent
149 * from the other engine DBG block, and sends
150 * it to a NW port in the current engine
151 * (according to port_id).
152 * 2) The src/dest addresses and eth_type
153 * arguments are ignored.
154 * 3) send_to_other_engine should be set to false.
155 * The other engine DBG block should call this
156 * function with send_to_other_engine set to
159 * @return error if one of the following holds:
160 * - the Debug block wasn't reset since last recording
161 * - the version wasn't set
162 * - the output was already set
163 * Otherwise, returns ok.
165 enum dbg_status ecore_dbg_bus_set_nw_output(struct ecore_hwfn *p_hwfn,
166 struct ecore_ptt *p_ptt,
170 u16 data_limit_size_kb,
171 bool send_to_other_engine,
172 bool rcv_from_other_engine);
175 * @brief ecore_dbg_bus_enable_block - Enables recording of the specified block
177 * Each recording cycle contains 4 "units". If the recorded HW data requires up
178 * to 4 dwords per cycle, each unit is one dword (32 bits). Otherwise, each
179 * unit is 2 dwords (64 bits).
181 * @param p_hwfn - HW device data
182 * @param p_ptt - Ptt window used for writing the registers.
183 * @param block - block to be enabled.
184 * @param line_num - debug line number to select.
185 * @param cycle_en - 4-bit value. If bit i is set, unit i is enabled.
186 * @param right_shift - number of units to right the debug data (0-3).
187 * @param force_valid - 4-bit value. If bit i is set, unit i is forced valid.
188 * @param force_frame - 4-bit value. If bit i is set, the frame bit of unit i
191 * @return error if one of the following holds:
192 * - the Debug block wasn't reset since last recording
193 * - the version wasn't set
194 * - block is not valid
195 * - block was already enabled
196 * - cycle_en, force_valid or force_frame are wider than 4 bits
197 * - right_shift is larger than 3
198 * - cycle unit 0 is enabled, but GRC or timestamp were also enabled.
199 * - Too many inputs were enabled.
200 * Otherwise, returns ok.
202 enum dbg_status ecore_dbg_bus_enable_block(struct ecore_hwfn *p_hwfn,
203 struct ecore_ptt *p_ptt,
212 * @brief ecore_dbg_bus_enable_storm - Enables recording of the specified Storm
214 * @param p_hwfn - HW device data
215 * @param storm - Storm to be enabled.
216 * @param storm_mode- Storm mode
218 * @return error if one of the following holds:
219 * - the Debug block wasn't reset since last recording
220 * - the version wasn't set
221 * - the specified storm or mode is invalid
222 * - Storm was already enabled
223 * - only HW data can be recorded
224 * - Too many inputs were enabled.
225 * Otherwise, returns ok.
227 enum dbg_status ecore_dbg_bus_enable_storm(struct ecore_hwfn *p_hwfn,
228 enum dbg_storms storm,
229 enum dbg_bus_storm_modes storm_mode);
232 * @brief ecore_dbg_bus_enable_timestamp - Enables timestamp recording.
234 * When enabled, the timestamp input is always recorded to the lsb dword of
235 * a cycle, with HW ID 0.
237 * @param p_hwfn - HW device data
238 * @param p_ptt - Ptt window used for writing the registers.
239 * @param valid_en - 3-bit value. The Timestamp will be recorded in a cycle if
240 * bit i is set and unit i+1 is valid.
241 * @param frame_en - 3-bit value. The Timestamp will be recorded in a cycle if
242 * bit i is set and unit i+1 has frame bit set.
243 * @param tick_len - timestamp tick length in cycles, minus 1. A value of 0
246 * @return error if one of the following holds:
247 * - the Debug block wasn't reset since last recording
248 * - the version wasn't set
249 * - valid_en or frame_en are wider than 4 bits
250 * - Both timestamp and GRC are enabled.
251 * Otherwise, returns ok.
253 enum dbg_status ecore_dbg_bus_enable_timestamp(struct ecore_hwfn *p_hwfn,
254 struct ecore_ptt *p_ptt,
260 * @brief ecore_dbg_bus_add_eid_range_sem_filter- Add Event ID range SEM filter
262 * @param p_hwfn - HW device data
263 * @param storm - Storm to be filtered.
264 * @param min_eid - minimal Event ID to filter on.
265 * @param max_eid - maximal Event ID to filter on.
267 * @return error if one of the following holds:
268 * - the specified Storm is invalid
269 * - the specified Storm wasn't enabled
270 * - the EID range is not valid
271 * Otherwise, returns ok.
273 enum dbg_status ecore_dbg_bus_add_eid_range_sem_filter(struct ecore_hwfn *p_hwfn,
274 enum dbg_storms storm,
279 * @brief ecore_dbg_bus_add_eid_mask_sem_filter - Add Event ID mask SEM filter
281 * @param p_hwfn - HW device data
282 * @param storm - Storm to be filtered.
283 * @param eid_val - Event ID value.
284 * @param eid_mask - Event ID mask. 0's in the mask = don't care bits.
286 * @return error if one of the following holds:
287 * - the specified Storm is invalid
288 * - the specified Storm wasn't enabled
289 * Otherwise, returns ok.
291 enum dbg_status ecore_dbg_bus_add_eid_mask_sem_filter(struct ecore_hwfn *p_hwfn,
292 enum dbg_storms storm,
297 * @brief ecore_dbg_bus_add_cid_sem_filter - Adds a CID SEM filter.
299 * @param p_hwfn - HW device data
300 * @param storm - Storm to be filtered.
301 * @param cid - CID to filter on.
303 * @return error if one of the following holds:
304 * - the specified Storm is invalid
305 * - the specified Storm wasn't enabled
306 * Otherwise, returns ok.
308 enum dbg_status ecore_dbg_bus_add_cid_sem_filter(struct ecore_hwfn *p_hwfn,
309 enum dbg_storms storm,
313 * @brief ecore_dbg_bus_enable_filter - Enables the recording filter.
315 * A filter contains up to 4 constraints. The data is "filtered in" when the
316 * added constraints hold.
318 * @param p_hwfn - HW device data
319 * @param p_ptt - Ptt window used for writing the registers.
320 * @param block - block to filter on.
321 * @param const_msg_len - Constant message length (in cycles) to be used for
322 * message-based filter constraints. If set to 0,
323 * message length is based only on frame bit received
324 * from HW (no constant message length).
326 * @return error if one of the following holds:
327 * - the Debug block wasn't reset since last recording
328 * - the version wasn't set
329 * - the filter was already enabled
330 * - block is not valid or not enabled
331 * - more than 4 dwords are recorded per-cycle (forbids filters)
332 * Otherwise, returns ok.
334 enum dbg_status ecore_dbg_bus_enable_filter(struct ecore_hwfn *p_hwfn,
335 struct ecore_ptt *p_ptt,
340 * @brief ecore_dbg_bus_enable_trigger - Enables the recording trigger.
342 * A trigger contains up to 3 states, where each state contains up to
343 * 4 constraints. After the constraints of a state hold for a specified number
344 * of times, the DBG block moves to the next state. If there's no next state,
345 * the DBG block triggers.
347 * @param p_hwfn - HW device data
348 * @param p_ptt - Ptt window used for writing the registers.
349 * @param rec_pre_trigger - if true, recording starts before the trigger.
350 * if false, recording starts at the trigger.
351 * @param pre_chunks - max number of chunks to record before the
352 * trigger (1-47). If set to 0, recording starts
353 * from time 0. Ignored if rec_pre_trigger is
355 * @param rec_post_trigger - if true, recording ends after the trigger.
356 * if false, recording ends at the trigger.
357 * @param post_cycles - max number of cycles to record after the
358 * trigger (0x1-0xffffffff). If set to 0,
359 * recording ends only when stopped by the user.
360 * Ignored if rec_post_trigger is false.
361 * @param filter_pre_trigger - if true, data is filtered before the trigger.
362 * Ignored if the filter wasn't enabled.
363 * @param filter_post_trigger - if true, data is filtered after the trigger.
364 * Ignored if the filter wasn't enabled.
366 * @return error if one of the following holds:
367 * - the Debug block wasn't reset since last recording
368 * - the version wasn't set
369 * - the trigger was already enabled
370 * - more than 4 dwords are recorded per-cycle (forbids triggers)
371 * - pre_chunks is not in the range 0-47.
372 * Otherwise, returns ok.
374 enum dbg_status ecore_dbg_bus_enable_trigger(struct ecore_hwfn *p_hwfn,
375 struct ecore_ptt *p_ptt,
376 bool rec_pre_trigger,
378 bool rec_post_trigger,
380 bool filter_pre_trigger,
381 bool filter_post_trigger);
384 * @brief ecore_dbg_bus_add_trigger_state - Adds a trigger state.
386 * Up to 3 trigger states can be added, where each state contains up to
387 * 4 constraints. After the constraints of a state hold for the specified
388 * number of times, the DBG block moves to the next state. If there's no next
389 * state, the DBG block triggers.
391 * @param p_hwfn - HW device data
392 * @param p_ptt - Ptt window used for writing the registers.
393 * @param block - block to trigger on.
394 * @param const_msg_len - Constant message length (in cycles) to be used for
395 * message-based filter constraints. If set to 0,
396 * message length is based only on frame bit received
397 * from HW (no constant message length).
398 * @param count_to_next - The number of times the constraints of the state
399 * should hold before moving to the next state. Must be
402 * @return error if one of the following holds:
403 * - The trigger wasn't enabled.
404 * - more than 3 trigger states were added
405 * - block is not valid or not enabled
406 * - count_to_next is 0
407 * Otherwise, returns ok.
409 enum dbg_status ecore_dbg_bus_add_trigger_state(struct ecore_hwfn *p_hwfn,
410 struct ecore_ptt *p_ptt,
416 * @brief ecore_dbg_bus_add_constraint - Adds a filter/trigger constraint.
418 * The constraint is added to a filter or trigger state, which ever was added
419 * last. The filter/trigger happens if both of the following hold:
420 * 1. All mandatory constraints are true.
421 * 2. At least one optional (non-mandatory) constraints is true.
423 * @param p_hwfn - HW device data
424 * @param p_ptt - Ptt window used for writing the registers.
425 * @param op - constraint operation
426 * @param data - 32-bit data to compare with the recorded
428 * @param data_mask - 32-bit mask for data comparison. If mask bit
429 * i is 1, data bit i is compared, otherwise
431 * For eq/ne operations: any mask can be used.
432 * For other operations: the mask must be
433 * non-zero, and the 1's in the mask must be
435 * @param compare_frame - indicates if the frame bit should be
436 * compared. Must be false for all operations
438 * @param frame_bit - frame bit to compare with the recorded data
439 * (0/1). ignored if compare_frame is false.
440 * @param cycle_offset - offset in cycles from the beginning of the
441 * message, where cycle = 4 dwords.
442 * @param dword_offset_in_cycle - offset in dwords from the beginning of the
444 * @param is_mandatory - indicates if this constraint is mandatory
445 * (true) or optional (false). The data is
446 * filtered-in if all mandatory constraints hold
447 * AND at least one optional constraint (if
450 * @return error if one of the following holds:
451 * - a filter or trigger state weren't enabled
452 * - all 4 filter constraints were added already
453 * - the op string is invalid
454 * - the data mask is invalid.
455 * - frame bit is not 0/1.
456 * - cycle_offset and dword_offset are not in the range 0-3.
457 * - compare_frame is true and operation is not eq/ne.
458 * Otherwise, returns ok.
460 enum dbg_status ecore_dbg_bus_add_constraint(struct ecore_hwfn *p_hwfn,
461 struct ecore_ptt *p_ptt,
462 enum dbg_bus_constraint_ops constraint_op,
468 u8 dword_offset_in_cycle,
472 * @brief ecore_dbg_bus_start - Starts the recording.
474 * @param p_hwfn - HW device data
475 * @param p_ptt - Ptt window used for writing the registers.
477 * @return error if one of the following holds:
478 * - the Debug block wasn't reset since last recording
479 * - the version wasn't set
480 * Otherwise, returns ok.
482 enum dbg_status ecore_dbg_bus_start(struct ecore_hwfn *p_hwfn,
483 struct ecore_ptt *p_ptt);
486 * @brief ecore_dbg_bus_stop - Stops the recording and flushes the internal
489 * @param p_hwfn - HW device data
490 * @param p_ptt - Ptt window used for writing the registers.
492 * @return error if a recording is not in progress, ok otherwise.
494 enum dbg_status ecore_dbg_bus_stop(struct ecore_hwfn *p_hwfn,
495 struct ecore_ptt *p_ptt);
498 * @brief ecore_dbg_bus_get_dump_buf_size - Returns the required buffer size
499 * for Debug Bus recording.
501 * @param p_hwfn - HW device data
502 * @param p_ptt - Ptt window used for writing the registers.
503 * @param buf_size - OUT: the required size (in dwords) of the buffer for
504 * dumping the recorded Debug Bus data. If recording to the
505 * internal buffer, the size of the internal buffer is
506 * returned. If recording to PCI, the size of the PCI buffer
507 * is returned. Otherwise, 0 is returned.
509 * @return error if one of the following holds:
510 * - the version wasn't set
511 * Otherwise, returns ok.
513 enum dbg_status ecore_dbg_bus_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
514 struct ecore_ptt *p_ptt,
518 * @brief ecore_dbg_bus_dump - Dumps the recorded Debug Bus data into the
521 * The dumped data starts with a header. If recording to NW, only a header is
522 * dumped. The dumped size is assigned to num_dumped_dwords.
524 * @param p_hwfn - HW device data
525 * @param p_ptt - Ptt window used for writing the registers.
526 * @param dump_buf - Pointer to copy the recorded data into.
527 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
528 * @param num_dumped_dwords - OUT: number of dumped dwords.
530 * @return error if one of the following holds:
531 * - a recording wasn't started/stopped
532 * - the specified dump buffer is too small
533 * Otherwise, returns ok.
535 enum dbg_status ecore_dbg_bus_dump(struct ecore_hwfn *p_hwfn,
536 struct ecore_ptt *p_ptt,
538 u32 buf_size_in_dwords,
539 u32 *num_dumped_dwords);
542 * @brief ecore_dbg_grc_config - Sets the value of a GRC parameter.
544 * @param p_hwfn - HW device data
545 * @param grc_param - GRC parameter
546 * @param val - Value to set.
548 * @return error if one of the following holds:
549 * - the version wasn't set
550 * - grc_param is invalid
551 * - val is outside the allowed boundaries
553 enum dbg_status ecore_dbg_grc_config(struct ecore_hwfn *p_hwfn,
554 enum dbg_grc_params grc_param,
558 * @brief ecore_dbg_grc_set_params_default - Reverts all GRC parameters to their
561 * @param p_hwfn - HW device data
563 void ecore_dbg_grc_set_params_default(struct ecore_hwfn *p_hwfn);
566 * @brief ecore_dbg_grc_get_dump_buf_size - Returns the required buffer size
569 * @param p_hwfn - HW device data
570 * @param p_ptt - Ptt window used for writing the registers.
571 * @param buf_size - OUT: required buffer size (in dwords) for GRC Dump data.
573 * @return error if one of the following holds:
574 * - the version wasn't set
575 * Otherwise, returns ok.
577 enum dbg_status ecore_dbg_grc_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
578 struct ecore_ptt *p_ptt,
582 * @brief ecore_dbg_grc_dump - Dumps GRC data into the specified buffer.
584 * @param p_hwfn - HW device data
585 * @param p_ptt - Ptt window used for writing the registers.
586 * @param dump_buf - Pointer to write the collected GRC data into.
587 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
588 * @param num_dumped_dwords - OUT: number of dumped dwords.
590 * @return error if one of the following holds:
591 * - the version wasn't set
592 * - the specified dump buffer is too small
593 * Otherwise, returns ok.
595 enum dbg_status ecore_dbg_grc_dump(struct ecore_hwfn *p_hwfn,
596 struct ecore_ptt *p_ptt,
598 u32 buf_size_in_dwords,
599 u32 *num_dumped_dwords);
602 * @brief ecore_dbg_idle_chk_get_dump_buf_size - Returns the required buffer
603 * size for idle check results.
605 * @param p_hwfn - HW device data
606 * @param p_ptt - Ptt window used for writing the registers.
607 * @param buf_size - OUT: required buffer size (in dwords) for idle check data.
609 * @return error if one of the following holds:
610 * - the version wasn't set
611 * Otherwise, returns ok.
613 enum dbg_status ecore_dbg_idle_chk_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
614 struct ecore_ptt *p_ptt,
618 * @brief ecore_dbg_idle_chk_dump - Performs idle check and writes the results
619 * into the specified buffer.
621 * @param p_hwfn - HW device data
622 * @param p_ptt - Ptt window used for writing the registers.
623 * @param dump_buf - Pointer to write the idle check data into.
624 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
625 * @param num_dumped_dwords - OUT: number of dumped dwords.
627 * @return error if one of the following holds:
628 * - the version wasn't set
629 * - the specified buffer is too small
630 * Otherwise, returns ok.
632 enum dbg_status ecore_dbg_idle_chk_dump(struct ecore_hwfn *p_hwfn,
633 struct ecore_ptt *p_ptt,
635 u32 buf_size_in_dwords,
636 u32 *num_dumped_dwords);
639 * @brief ecore_dbg_mcp_trace_get_dump_buf_size - Returns the required buffer
640 * size for mcp trace results.
642 * @param p_hwfn - HW device data
643 * @param p_ptt - Ptt window used for writing the registers.
644 * @param buf_size - OUT: required buffer size (in dwords) for mcp trace data.
646 * @return error if one of the following holds:
647 * - the version wasn't set
648 * - the trace data in MCP scratchpad contain an invalid signature
649 * - the bundle ID in NVRAM is invalid
650 * - the trace meta data cannot be found (in NVRAM or image file)
651 * Otherwise, returns ok.
653 enum dbg_status ecore_dbg_mcp_trace_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
654 struct ecore_ptt *p_ptt,
658 * @brief ecore_dbg_mcp_trace_dump - Performs mcp trace and writes the results
659 * into the specified buffer.
661 * @param p_hwfn - HW device data
662 * @param p_ptt - Ptt window used for writing the registers.
663 * @param dump_buf - Pointer to write the mcp trace data into.
664 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
665 * @param num_dumped_dwords - OUT: number of dumped dwords.
667 * @return error if one of the following holds:
668 * - the version wasn't set
669 * - the specified buffer is too small
670 * - the trace data in MCP scratchpad contain an invalid signature
671 * - the bundle ID in NVRAM is invalid
672 * - the trace meta data cannot be found (in NVRAM or image file)
673 * - the trace meta data cannot be read (from NVRAM or image file)
674 * Otherwise, returns ok.
676 enum dbg_status ecore_dbg_mcp_trace_dump(struct ecore_hwfn *p_hwfn,
677 struct ecore_ptt *p_ptt,
679 u32 buf_size_in_dwords,
680 u32 *num_dumped_dwords);
683 * @brief ecore_dbg_reg_fifo_get_dump_buf_size - Returns the required buffer
684 * size for grc trace fifo results.
686 * @param p_hwfn - HW device data
687 * @param p_ptt - Ptt window used for writing the registers.
688 * @param buf_size - OUT: required buffer size (in dwords) for reg fifo data.
690 * @return error if one of the following holds:
691 * - the version wasn't set
692 * Otherwise, returns ok.
694 enum dbg_status ecore_dbg_reg_fifo_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
695 struct ecore_ptt *p_ptt,
699 * @brief ecore_dbg_reg_fifo_dump - Reads the reg fifo and writes the results
700 * into the specified buffer.
702 * @param p_hwfn - HW device data
703 * @param p_ptt - Ptt window used for writing the registers.
704 * @param dump_buf - Pointer to write the reg fifo data into.
705 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
706 * @param num_dumped_dwords - OUT: number of dumped dwords.
708 * @return error if one of the following holds:
709 * - the version wasn't set
710 * - the specified buffer is too small
711 * - DMAE transaction failed
712 * Otherwise, returns ok.
714 enum dbg_status ecore_dbg_reg_fifo_dump(struct ecore_hwfn *p_hwfn,
715 struct ecore_ptt *p_ptt,
717 u32 buf_size_in_dwords,
718 u32 *num_dumped_dwords);
721 * @brief ecore_dbg_igu_fifo_get_dump_buf_size - Returns the required buffer
722 * size for the IGU fifo results.
724 * @param p_hwfn - HW device data
725 * @param p_ptt - Ptt window used for writing the registers.
726 * @param buf_size - OUT: required buffer size (in dwords) for IGU fifo data.
728 * @return error if one of the following holds:
729 * - the version wasn't set
730 * Otherwise, returns ok.
732 enum dbg_status ecore_dbg_igu_fifo_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
733 struct ecore_ptt *p_ptt,
737 * @brief ecore_dbg_igu_fifo_dump - Reads the IGU fifo and writes the results
738 * into the specified buffer.
740 * @param p_hwfn - HW device data
741 * @param p_ptt - Ptt window used for writing the registers.
742 * @param dump_buf - Pointer to write the IGU fifo data into.
743 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
744 * @param num_dumped_dwords - OUT: number of dumped dwords.
746 * @return error if one of the following holds:
747 * - the version wasn't set
748 * - the specified buffer is too small
749 * - DMAE transaction failed
750 * Otherwise, returns ok.
752 enum dbg_status ecore_dbg_igu_fifo_dump(struct ecore_hwfn *p_hwfn,
753 struct ecore_ptt *p_ptt,
755 u32 buf_size_in_dwords,
756 u32 *num_dumped_dwords);
759 * @brief ecore_dbg_protection_override_get_dump_buf_size - Return the required
760 * buffer size for protection override window results.
762 * @param p_hwfn - HW device data
763 * @param p_ptt - Ptt window used for writing the registers.
764 * @param buf_size - OUT: required buffer size (in dwords) for protection
767 * @return error if one of the following holds:
768 * - the version wasn't set
769 * Otherwise, returns ok.
771 enum dbg_status ecore_dbg_protection_override_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
772 struct ecore_ptt *p_ptt,
775 * @brief ecore_dbg_protection_override_dump - Reads protection override window
776 * entries and writes the results into the specified buffer.
778 * @param p_hwfn - HW device data
779 * @param p_ptt - Ptt window used for writing the registers.
780 * @param dump_buf - Pointer to write the protection override data
782 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
783 * @param num_dumped_dwords - OUT: number of dumped dwords.
785 * @return error if one of the following holds:
786 * - the version wasn't set
787 * - the specified buffer is too small
788 * - DMAE transaction failed
789 * Otherwise, returns ok.
791 enum dbg_status ecore_dbg_protection_override_dump(struct ecore_hwfn *p_hwfn,
792 struct ecore_ptt *p_ptt,
794 u32 buf_size_in_dwords,
795 u32 *num_dumped_dwords);
798 * @brief ecore_dbg_fw_asserts_get_dump_buf_size - Returns the required buffer
799 * size for FW Asserts results.
801 * @param p_hwfn - HW device data
802 * @param p_ptt - Ptt window used for writing the registers.
803 * @param buf_size - OUT: required buffer size (in dwords) for FW Asserts data.
805 * @return error if one of the following holds:
806 * - the version wasn't set
807 * Otherwise, returns ok.
809 enum dbg_status ecore_dbg_fw_asserts_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
810 struct ecore_ptt *p_ptt,
814 * @brief ecore_dbg_fw_asserts_dump - Reads the FW Asserts and writes the
815 * results into the specified buffer.
817 * @param p_hwfn - HW device data
818 * @param p_ptt - Ptt window used for writing the registers.
819 * @param dump_buf - Pointer to write the FW Asserts data into.
820 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
821 * @param num_dumped_dwords - OUT: number of dumped dwords.
823 * @return error if one of the following holds:
824 * - the version wasn't set
825 * - the specified buffer is too small
826 * Otherwise, returns ok.
828 enum dbg_status ecore_dbg_fw_asserts_dump(struct ecore_hwfn *p_hwfn,
829 struct ecore_ptt *p_ptt,
831 u32 buf_size_in_dwords,
832 u32 *num_dumped_dwords);
835 * @brief ecore_dbg_read_attn - Reads the attention registers of the specified
836 * block and type, and writes the results into the specified buffer.
838 * @param p_hwfn - HW device data
839 * @param p_ptt - Ptt window used for writing the registers.
840 * @param block - Block ID.
841 * @param attn_type - Attention type.
842 * @param clear_status - Indicates if the attention status should be cleared.
843 * @param results - OUT: Pointer to write the read results into
845 * @return error if one of the following holds:
846 * - the version wasn't set
847 * Otherwise, returns ok.
849 enum dbg_status ecore_dbg_read_attn(struct ecore_hwfn *p_hwfn,
850 struct ecore_ptt *p_ptt,
852 enum dbg_attn_type attn_type,
854 struct dbg_attn_block_result *results);
857 * @brief ecore_dbg_print_attn - Prints attention registers values in the
858 * specified results struct.
860 * @param p_hwfn - HW device data
861 * @param results - Pointer to the attention read results
863 * @return error if one of the following holds:
864 * - the version wasn't set
865 * Otherwise, returns ok.
867 enum dbg_status ecore_dbg_print_attn(struct ecore_hwfn *p_hwfn,
868 struct dbg_attn_block_result *results);
871 * @brief ecore_is_block_in_reset - Returns true if the specified block is in
872 * reset, false otherwise.
874 * @param p_hwfn - HW device data
875 * @param p_ptt - Ptt window used for writing the registers.
876 * @param block - Block ID.
878 * @return true if the specified block is in reset, false otherwise.
880 bool ecore_is_block_in_reset(struct ecore_hwfn *p_hwfn,
881 struct ecore_ptt *p_ptt,
882 enum block_id block);