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.
31 #ifndef _DBG_FW_FUNCS_H
32 #define _DBG_FW_FUNCS_H
33 /**************************** Public Functions *******************************/
36 * @brief ecore_dbg_set_bin_ptr - Sets a pointer to the binary data with debug
39 * @param bin_ptr - a pointer to the binary data with debug arrays.
41 enum dbg_status ecore_dbg_set_bin_ptr(const u8 * const bin_ptr);
44 * @brief ecore_dbg_set_app_ver - Sets the version of the calling app.
46 * The application should call this function with the TOOLS_VERSION
47 * it compiles with. Must be called before all other debug functions.
49 * @return error if one of the following holds:
50 * - the specified app version is not supported
51 * Otherwise, returns ok.
53 enum dbg_status ecore_dbg_set_app_ver(u32 ver);
56 * @brief ecore_dbg_get_fw_func_ver - Returns the FW func version.
58 * @return the FW func version.
60 u32 ecore_dbg_get_fw_func_ver(void);
63 * @brief ecore_dbg_get_chip_id - Returns the FW func version.
65 * @param p_hwfn - HW device data
67 * @return the chip ID.
69 enum chip_ids ecore_dbg_get_chip_id(struct ecore_hwfn *p_hwfn);
72 * @brief ecore_read_regs - Reads registers into a buffer (using GRC).
74 * @param p_hwfn - HW device data
75 * @param p_ptt - Ptt window used for writing the registers.
76 * @param buf - Destination buffer.
77 * @param addr - Source GRC address in dwords.
78 * @param len - Number of registers to read.
80 void ecore_read_regs(struct ecore_hwfn *p_hwfn,
81 struct ecore_ptt *p_ptt,
87 * @brief ecore_dbg_bus_reset - Resets the Debug block.
90 * - The last recording is erased.
91 * - Recording is directed to the internal buffer.
92 * - Wrap-around recording is selected.
93 * - All HW blocks are disabled.
94 * - All Storms are disabled and all SEM filters are cleared.
96 * @param p_hwfn - HW device data
97 * @param p_ptt - Ptt window used for writing the registers.
98 * @param one_shot_en - Enable/Disable one-shot recording. If disabled,
99 * wrap-around recording is used instead.
100 * @param force_hw_dwords - If set to 0, no. of HW/Storm dwords per cycle is
101 * chosen automatically based on the enabled inputs.
102 * Otherwise, no. of HW dwords per cycle is forced to
103 * the specified value. Valid values: 0/2/4/8.
104 * @param unify_inputs - If true, all recorded data is associated with a
105 * single input, as if all data was received from the
106 * same block. Otherwise, each data unit is associated
107 * with its original input.
108 * @param grc_input_en - Enable/Disable recording GRC input. If enabled, the
109 * GRC input is recorded to the lsb dword of a cycle.
111 * @return error if one of the following holds:
112 * - the version wasn't set
113 * - force_hw_dwords is invalid.
114 * Otherwise, returns ok.
116 enum dbg_status ecore_dbg_bus_reset(struct ecore_hwfn *p_hwfn,
117 struct ecore_ptt *p_ptt,
124 * @brief ecore_dbg_bus_set_pci_output - Directs debug output to a PCI buffer.
126 * @param p_hwfn - HW device data
127 * @param p_ptt - Ptt window used for writing the registers.
128 * @param buf_size_kb - Size of PCI buffer to allocate (in KB). Must be aligned
129 * to PCI request size.
131 * @return error if one of the following holds:
132 * - the Debug block wasn't reset since last recording
133 * - the version wasn't set
134 * - the output was already set
135 * - the PCI buffer size is not aligned to PCI packet size
136 * - the PCI buffer allocation failed
137 * Otherwise, returns ok.
139 enum dbg_status ecore_dbg_bus_set_pci_output(struct ecore_hwfn *p_hwfn,
140 struct ecore_ptt *p_ptt,
144 * @brief ecore_dbg_bus_set_nw_output - Directs debug output to the network.
146 * @param p_hwfn - HW device data
147 * @param p_ptt - Ptt window used for writing the registers.
148 * @param port_id - Port ID to transmit the debug data on
149 * @param dest_addr_lo32 - Destination MAC address (for Eth header)
150 * @param dest_addr_hi16
151 * @param data_limit_size_kb - Data limit size in KB (valid only for one-shot)
152 * If set to 0, data limit won't be configured.
153 * @param send_to_other_engine -If true:
154 * 1) The NW output will be sent to the DBG block
155 * of the other engine.
156 * 2) port_id argument is ignored.
157 * 3) rcv_from_other_engine should be set to false
158 * The other engine DBG block should call this
159 * function with rcv_from_other_engine set to
161 * @param rcv_from_other_engine-If true:
162 * 1) the DBG block receives the NW output sent
163 * from the other engine DBG block, and sends
164 * it to a NW port in the current engine
165 * (according to port_id).
166 * 2) The src/dest addresses and eth_type
167 * arguments are ignored.
168 * 3) send_to_other_engine should be set to false.
169 * The other engine DBG block should call this
170 * function with send_to_other_engine set to
173 * @return error if one of the following holds:
174 * - the Debug block wasn't reset since last recording
175 * - the version wasn't set
176 * - the output was already set
177 * Otherwise, returns ok.
179 enum dbg_status ecore_dbg_bus_set_nw_output(struct ecore_hwfn *p_hwfn,
180 struct ecore_ptt *p_ptt,
184 u16 data_limit_size_kb,
185 bool send_to_other_engine,
186 bool rcv_from_other_engine);
189 * @brief ecore_dbg_bus_enable_block - Enables recording of the specified block
191 * Each recording cycle contains 4 "units". If the recorded HW data requires up
192 * to 4 dwords per cycle, each unit is one dword (32 bits). Otherwise, each
193 * unit is 2 dwords (64 bits).
195 * @param p_hwfn - HW device data
196 * @param block - block to be enabled.
197 * @param line_num - debug line number to select.
198 * @param cycle_en - 4-bit value. If bit i is set, unit i is enabled.
199 * @param right_shift - number of units to right the debug data (0-3).
200 * @param force_valid - 4-bit value. If bit i is set, unit i is forced valid.
201 * @param force_frame - 4-bit value. If bit i is set, the frame bit of unit i
204 * @return error if one of the following holds:
205 * - the Debug block wasn't reset since last recording
206 * - the version wasn't set
207 * - block is not valid
208 * - block was already enabled
209 * - cycle_en, force_valid or force_frame are wider than 4 bits
210 * - right_shift is larger than 3
211 * - cycle unit 0 is enabled, but GRC or timestamp were also enabled.
212 * - Too many inputs were enabled.
213 * Otherwise, returns ok.
215 enum dbg_status ecore_dbg_bus_enable_block(struct ecore_hwfn *p_hwfn,
224 * @brief ecore_dbg_bus_enable_storm - Enables recording of the specified Storm
226 * @param p_hwfn - HW device data
227 * @param storm - Storm to be enabled.
228 * @param storm_mode- Storm mode
230 * @return error if one of the following holds:
231 * - the Debug block wasn't reset since last recording
232 * - the version wasn't set
233 * - the specified storm or mode is invalid
234 * - Storm was already enabled
235 * - only HW data can be recorded
236 * - Too many inputs were enabled.
237 * Otherwise, returns ok.
239 enum dbg_status ecore_dbg_bus_enable_storm(struct ecore_hwfn *p_hwfn,
240 enum dbg_storms storm,
241 enum dbg_bus_storm_modes storm_mode);
244 * @brief ecore_dbg_bus_enable_timestamp - Enables timestamp recording.
246 * When enabled, the timestamp input is always recorded to the lsb dword of
247 * a cycle, with HW ID 0.
249 * @param p_hwfn - HW device data
250 * @param p_ptt - Ptt window used for writing the registers.
251 * @param valid_en - 3-bit value. The Timestamp will be recorded in a cycle if
252 * bit i is set and unit i+1 is valid.
253 * @param frame_en - 3-bit value. The Timestamp will be recorded in a cycle if
254 * bit i is set and unit i+1 has frame bit set.
255 * @param tick_len - timestamp tick length in cycles, minus 1. A value of 0
258 * @return error if one of the following holds:
259 * - the Debug block wasn't reset since last recording
260 * - the version wasn't set
261 * - valid_en or frame_en are wider than 4 bits
262 * - Both timestamp and GRC are enabled.
263 * Otherwise, returns ok.
265 enum dbg_status ecore_dbg_bus_enable_timestamp(struct ecore_hwfn *p_hwfn,
266 struct ecore_ptt *p_ptt,
272 * @brief ecore_dbg_bus_add_eid_range_sem_filter- Add Event ID range SEM filter
274 * @param p_hwfn - HW device data
275 * @param storm - Storm to be filtered.
276 * @param min_eid - minimal Event ID to filter on.
277 * @param max_eid - maximal Event ID to filter on.
279 * @return error if one of the following holds:
280 * - the specified Storm is invalid
281 * - the specified Storm wasn't enabled
282 * - the EID range is not valid
283 * Otherwise, returns ok.
285 enum dbg_status ecore_dbg_bus_add_eid_range_sem_filter(struct ecore_hwfn *p_hwfn,
286 enum dbg_storms storm,
291 * @brief ecore_dbg_bus_add_eid_mask_sem_filter - Add Event ID mask SEM filter
293 * @param p_hwfn - HW device data
294 * @param storm - Storm to be filtered.
295 * @param eid_val - Event ID value.
296 * @param eid_mask - Event ID mask. 0's in the mask = don't care bits.
298 * @return error if one of the following holds:
299 * - the specified Storm is invalid
300 * - the specified Storm wasn't enabled
301 * Otherwise, returns ok.
303 enum dbg_status ecore_dbg_bus_add_eid_mask_sem_filter(struct ecore_hwfn *p_hwfn,
304 enum dbg_storms storm,
309 * @brief ecore_dbg_bus_add_cid_sem_filter - Adds a CID SEM filter.
311 * @param p_hwfn - HW device data
312 * @param storm - Storm to be filtered.
313 * @param cid - CID to filter on.
315 * @return error if one of the following holds:
316 * - the specified Storm is invalid
317 * - the specified Storm wasn't enabled
318 * Otherwise, returns ok.
320 enum dbg_status ecore_dbg_bus_add_cid_sem_filter(struct ecore_hwfn *p_hwfn,
321 enum dbg_storms storm,
325 * @brief ecore_dbg_bus_enable_filter - Enables the recording filter.
327 * A filter contains up to 4 constraints. The data is "filtered in" when the
328 * added constraints hold.
330 * @param p_hwfn - HW device data
331 * @param p_ptt - Ptt window used for writing the registers.
332 * @param block - block to filter on.
333 * @param const_msg_len - Constant message length (in cycles) to be used for
334 * message-based filter constraints. If set to 0,
335 * message length is based only on frame bit received
336 * from HW (no constant message length).
338 * @return error if one of the following holds:
339 * - the Debug block wasn't reset since last recording
340 * - the version wasn't set
341 * - the filter was already enabled
342 * - block is not valid or not enabled
343 * - more than 4 dwords are recorded per-cycle (forbids filters)
344 * Otherwise, returns ok.
346 enum dbg_status ecore_dbg_bus_enable_filter(struct ecore_hwfn *p_hwfn,
347 struct ecore_ptt *p_ptt,
352 * @brief ecore_dbg_bus_enable_trigger - Enables the recording trigger.
354 * A trigger contains up to 3 states, where each state contains up to
355 * 4 constraints. After the constraints of a state hold for a specified number
356 * of times, the DBG block moves to the next state. If there's no next state,
357 * the DBG block triggers.
359 * @param p_hwfn - HW device data
360 * @param p_ptt - Ptt window used for writing the registers.
361 * @param rec_pre_trigger - if true, recording starts before the trigger.
362 * if false, recording starts at the trigger.
363 * @param pre_chunks - max number of chunks to record before the
364 * trigger (1-47). If set to 0, recording starts
365 * from time 0. Ignored if rec_pre_trigger is
367 * @param rec_post_trigger - if true, recording ends after the trigger.
368 * if false, recording ends at the trigger.
369 * @param post_cycles - max number of cycles to record after the
370 * trigger (0x1-0xffffffff). If set to 0,
371 * recording ends only when stopped by the user.
372 * Ignored if rec_post_trigger is false.
373 * @param filter_pre_trigger - if true, data is filtered before the trigger.
374 * Ignored if the filter wasn't enabled.
375 * @param filter_post_trigger - if true, data is filtered after the trigger.
376 * Ignored if the filter wasn't enabled.
378 * @return error if one of the following holds:
379 * - the Debug block wasn't reset since last recording
380 * - the version wasn't set
381 * - the trigger was already enabled
382 * - more than 4 dwords are recorded per-cycle (forbids triggers)
383 * - pre_chunks is not in the range 0-47.
384 * Otherwise, returns ok.
386 enum dbg_status ecore_dbg_bus_enable_trigger(struct ecore_hwfn *p_hwfn,
387 struct ecore_ptt *p_ptt,
388 bool rec_pre_trigger,
390 bool rec_post_trigger,
392 bool filter_pre_trigger,
393 bool filter_post_trigger);
396 * @brief ecore_dbg_bus_add_trigger_state - Adds a trigger state.
398 * Up to 3 trigger states can be added, where each state contains up to
399 * 4 constraints. After the constraints of a state hold for the specified
400 * number of times, the DBG block moves to the next state. If there's no next
401 * state, the DBG block triggers.
403 * @param p_hwfn - HW device data
404 * @param p_ptt - Ptt window used for writing the registers.
405 * @param block - block to trigger on.
406 * @param const_msg_len - Constant message length (in cycles) to be used for
407 * message-based filter constraints. If set to 0,
408 * message length is based only on frame bit received
409 * from HW (no constant message length).
410 * @param count_to_next - The number of times the constraints of the state
411 * should hold before moving to the next state. Must be
414 * @return error if one of the following holds:
415 * - The trigger wasn't enabled.
416 * - more than 3 trigger states were added
417 * - block is not valid or not enabled
418 * - count_to_next is 0
419 * Otherwise, returns ok.
421 enum dbg_status ecore_dbg_bus_add_trigger_state(struct ecore_hwfn *p_hwfn,
422 struct ecore_ptt *p_ptt,
428 * @brief ecore_dbg_bus_add_constraint - Adds a filter/trigger constraint.
430 * The constraint is added to a filter or trigger state, which ever was added
431 * last. The filter/trigger happens if both of the following hold:
432 * 1. All mandatory constraints are true.
433 * 2. At least one optional (non-mandatory) constraints is true.
435 * @param p_hwfn - HW device data
436 * @param p_ptt - Ptt window used for writing the registers.
437 * @param op - constraint operation
438 * @param data - 32-bit data to compare with the recorded
440 * @param data_mask - 32-bit mask for data comparison. If mask bit
441 * i is 1, data bit i is compared, otherwise
443 * For eq/ne operations: any mask can be used.
444 * For other operations: the mask must be
445 * non-zero, and the 1's in the mask must be
447 * @param compare_frame - indicates if the frame bit should be
448 * compared. Must be false for all operations
450 * @param frame_bit - frame bit to compare with the recorded data
451 * (0/1). ignored if compare_frame is false.
452 * @param cycle_offset - offset in cycles from the beginning of the
453 * message, where cycle = 4 dwords.
454 * @param dword_offset_in_cycle - offset in dwords from the beginning of the
456 * @param is_mandatory - indicates if this constraint is mandatory
457 * (true) or optional (false). The data is
458 * filtered-in if all mandatory constraints hold
459 * AND at least one optional constraint (if
462 * @return error if one of the following holds:
463 * - a filter or trigger state weren't enabled
464 * - all 4 filter constraints were added already
465 * - the op string is invalid
466 * - the data mask is invalid.
467 * - frame bit is not 0/1.
468 * - cycle_offset and dword_offset are not in the range 0-3.
469 * - compare_frame is true and operation is not eq/ne.
470 * Otherwise, returns ok.
472 enum dbg_status ecore_dbg_bus_add_constraint(struct ecore_hwfn *p_hwfn,
473 struct ecore_ptt *p_ptt,
474 enum dbg_bus_constraint_ops constraint_op,
480 u8 dword_offset_in_cycle,
484 * @brief ecore_dbg_bus_start - Starts the recording.
486 * @param p_hwfn - HW device data
487 * @param p_ptt - Ptt window used for writing the registers.
489 * @return error if one of the following holds:
490 * - the Debug block wasn't reset since last recording
491 * - the version wasn't set
492 * Otherwise, returns ok.
494 enum dbg_status ecore_dbg_bus_start(struct ecore_hwfn *p_hwfn,
495 struct ecore_ptt *p_ptt);
498 * @brief ecore_dbg_bus_stop - Stops the recording and flushes the internal
501 * @param p_hwfn - HW device data
502 * @param p_ptt - Ptt window used for writing the registers.
504 * @return error if a recording is not in progress, ok otherwise.
506 enum dbg_status ecore_dbg_bus_stop(struct ecore_hwfn *p_hwfn,
507 struct ecore_ptt *p_ptt);
510 * @brief ecore_dbg_bus_get_dump_buf_size - Returns the required buffer size
511 * for Debug Bus recording.
513 * @param p_hwfn - HW device data
514 * @param p_ptt - Ptt window used for writing the registers.
515 * @param buf_size - OUT: the required size (in dwords) of the buffer for
516 * dumping the recorded Debug Bus data. If recording to the
517 * internal buffer, the size of the internal buffer is
518 * returned. If recording to PCI, the size of the PCI buffer
519 * is returned. Otherwise, 0 is returned.
521 * @return error if one of the following holds:
522 * - the version wasn't set
523 * Otherwise, returns ok.
525 enum dbg_status ecore_dbg_bus_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
526 struct ecore_ptt *p_ptt,
530 * @brief ecore_dbg_bus_dump - Dumps the recorded Debug Bus data into the
533 * The dumped data starts with a header. If recording to NW, only a header is
534 * dumped. The dumped size is assigned to num_dumped_dwords.
536 * @param p_hwfn - HW device data
537 * @param p_ptt - Ptt window used for writing the registers.
538 * @param dump_buf - Pointer to copy the recorded data into.
539 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
540 * @param num_dumped_dwords - OUT: number of dumped dwords.
542 * @return error if one of the following holds:
543 * - a recording wasn't started/stopped
544 * - the specified dump buffer is too small
545 * Otherwise, returns ok.
547 enum dbg_status ecore_dbg_bus_dump(struct ecore_hwfn *p_hwfn,
548 struct ecore_ptt *p_ptt,
550 u32 buf_size_in_dwords,
551 u32 *num_dumped_dwords);
554 * @brief ecore_dbg_grc_config - Sets the value of a GRC parameter.
556 * @param p_hwfn - HW device data
557 * @param grc_param - GRC parameter
558 * @param val - Value to set.
560 * @return error if one of the following holds:
561 * - the version wasn't set
562 * - grc_param is invalid
563 * - val is outside the allowed boundaries
565 enum dbg_status ecore_dbg_grc_config(struct ecore_hwfn *p_hwfn,
566 enum dbg_grc_params grc_param,
570 * @brief ecore_dbg_grc_set_params_default - Reverts all GRC parameters to their
573 * @param p_hwfn - HW device data
575 void ecore_dbg_grc_set_params_default(struct ecore_hwfn *p_hwfn);
578 * @brief ecore_dbg_grc_get_dump_buf_size - Returns the required buffer size
581 * @param p_hwfn - HW device data
582 * @param p_ptt - Ptt window used for writing the registers.
583 * @param buf_size - OUT: required buffer size (in dwords) for GRC Dump data.
585 * @return error if one of the following holds:
586 * - the version wasn't set
587 * Otherwise, returns ok.
589 enum dbg_status ecore_dbg_grc_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
590 struct ecore_ptt *p_ptt,
594 * @brief ecore_dbg_grc_dump - Dumps GRC data into the specified buffer.
596 * @param p_hwfn - HW device data
597 * @param p_ptt - Ptt window used for writing the registers.
598 * @param dump_buf - Pointer to write the collected GRC data into.
599 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
600 * @param num_dumped_dwords - OUT: number of dumped dwords.
602 * @return error if one of the following holds:
603 * - the version wasn't set
604 * - the specified dump buffer is too small
605 * Otherwise, returns ok.
607 enum dbg_status ecore_dbg_grc_dump(struct ecore_hwfn *p_hwfn,
608 struct ecore_ptt *p_ptt,
610 u32 buf_size_in_dwords,
611 u32 *num_dumped_dwords);
614 * @brief ecore_dbg_idle_chk_get_dump_buf_size - Returns the required buffer
615 * size for idle check results.
617 * @param p_hwfn - HW device data
618 * @param p_ptt - Ptt window used for writing the registers.
619 * @param buf_size - OUT: required buffer size (in dwords) for idle check data.
621 * @return error if one of the following holds:
622 * - the version wasn't set
623 * Otherwise, returns ok.
625 enum dbg_status ecore_dbg_idle_chk_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
626 struct ecore_ptt *p_ptt,
630 * @brief ecore_dbg_idle_chk_dump - Performs idle check and writes the results
631 * into the specified buffer.
633 * @param p_hwfn - HW device data
634 * @param p_ptt - Ptt window used for writing the registers.
635 * @param dump_buf - Pointer to write the idle check data into.
636 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
637 * @param num_dumped_dwords - OUT: number of dumped dwords.
639 * @return error if one of the following holds:
640 * - the version wasn't set
641 * - the specified buffer is too small
642 * Otherwise, returns ok.
644 enum dbg_status ecore_dbg_idle_chk_dump(struct ecore_hwfn *p_hwfn,
645 struct ecore_ptt *p_ptt,
647 u32 buf_size_in_dwords,
648 u32 *num_dumped_dwords);
651 * @brief ecore_dbg_mcp_trace_get_dump_buf_size - Returns the required buffer
652 * size for mcp trace results.
654 * @param p_hwfn - HW device data
655 * @param p_ptt - Ptt window used for writing the registers.
656 * @param buf_size - OUT: required buffer size (in dwords) for mcp trace data.
658 * @return error if one of the following holds:
659 * - the version wasn't set
660 * - the trace data in MCP scratchpad contain an invalid signature
661 * - the bundle ID in NVRAM is invalid
662 * - the trace meta data cannot be found (in NVRAM or image file)
663 * Otherwise, returns ok.
665 enum dbg_status ecore_dbg_mcp_trace_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
666 struct ecore_ptt *p_ptt,
670 * @brief ecore_dbg_mcp_trace_dump - Performs mcp trace and writes the results
671 * into the specified buffer.
673 * @param p_hwfn - HW device data
674 * @param p_ptt - Ptt window used for writing the registers.
675 * @param dump_buf - Pointer to write the mcp trace data into.
676 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
677 * @param num_dumped_dwords - OUT: number of dumped dwords.
679 * @return error if one of the following holds:
680 * - the version wasn't set
681 * - the specified buffer is too small
682 * - the trace data in MCP scratchpad contain an invalid signature
683 * - the bundle ID in NVRAM is invalid
684 * - the trace meta data cannot be found (in NVRAM or image file)
685 * - the trace meta data cannot be read (from NVRAM or image file)
686 * Otherwise, returns ok.
688 enum dbg_status ecore_dbg_mcp_trace_dump(struct ecore_hwfn *p_hwfn,
689 struct ecore_ptt *p_ptt,
691 u32 buf_size_in_dwords,
692 u32 *num_dumped_dwords);
695 * @brief ecore_dbg_reg_fifo_get_dump_buf_size - Returns the required buffer
696 * size for grc trace fifo results.
698 * @param p_hwfn - HW device data
699 * @param p_ptt - Ptt window used for writing the registers.
700 * @param buf_size - OUT: required buffer size (in dwords) for reg fifo data.
702 * @return error if one of the following holds:
703 * - the version wasn't set
704 * Otherwise, returns ok.
706 enum dbg_status ecore_dbg_reg_fifo_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
707 struct ecore_ptt *p_ptt,
711 * @brief ecore_dbg_reg_fifo_dump - Reads the reg fifo and writes the results
712 * into the specified buffer.
714 * @param p_hwfn - HW device data
715 * @param p_ptt - Ptt window used for writing the registers.
716 * @param dump_buf - Pointer to write the reg fifo data into.
717 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
718 * @param num_dumped_dwords - OUT: number of dumped dwords.
720 * @return error if one of the following holds:
721 * - the version wasn't set
722 * - the specified buffer is too small
723 * - DMAE transaction failed
724 * Otherwise, returns ok.
726 enum dbg_status ecore_dbg_reg_fifo_dump(struct ecore_hwfn *p_hwfn,
727 struct ecore_ptt *p_ptt,
729 u32 buf_size_in_dwords,
730 u32 *num_dumped_dwords);
733 * @brief ecore_dbg_igu_fifo_get_dump_buf_size - Returns the required buffer
734 * size for the IGU fifo results.
736 * @param p_hwfn - HW device data
737 * @param p_ptt - Ptt window used for writing the registers.
738 * @param buf_size - OUT: required buffer size (in dwords) for IGU fifo data.
740 * @return error if one of the following holds:
741 * - the version wasn't set
742 * Otherwise, returns ok.
744 enum dbg_status ecore_dbg_igu_fifo_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
745 struct ecore_ptt *p_ptt,
749 * @brief ecore_dbg_igu_fifo_dump - Reads the IGU fifo and writes the results
750 * into the specified buffer.
752 * @param p_hwfn - HW device data
753 * @param p_ptt - Ptt window used for writing the registers.
754 * @param dump_buf - Pointer to write the IGU fifo data into.
755 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
756 * @param num_dumped_dwords - OUT: number of dumped dwords.
758 * @return error if one of the following holds:
759 * - the version wasn't set
760 * - the specified buffer is too small
761 * - DMAE transaction failed
762 * Otherwise, returns ok.
764 enum dbg_status ecore_dbg_igu_fifo_dump(struct ecore_hwfn *p_hwfn,
765 struct ecore_ptt *p_ptt,
767 u32 buf_size_in_dwords,
768 u32 *num_dumped_dwords);
771 * @brief ecore_dbg_protection_override_get_dump_buf_size - Return the required
772 * buffer size for protection override window results.
774 * @param p_hwfn - HW device data
775 * @param p_ptt - Ptt window used for writing the registers.
776 * @param buf_size - OUT: required buffer size (in dwords) for protection
779 * @return error if one of the following holds:
780 * - the version wasn't set
781 * Otherwise, returns ok.
783 enum dbg_status ecore_dbg_protection_override_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
784 struct ecore_ptt *p_ptt,
787 * @brief ecore_dbg_protection_override_dump - Reads protection override window
788 * entries and writes the results into the specified buffer.
790 * @param p_hwfn - HW device data
791 * @param p_ptt - Ptt window used for writing the registers.
792 * @param dump_buf - Pointer to write the protection override data
794 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
795 * @param num_dumped_dwords - OUT: number of dumped dwords.
797 * @return error if one of the following holds:
798 * - the version wasn't set
799 * - the specified buffer is too small
800 * - DMAE transaction failed
801 * Otherwise, returns ok.
803 enum dbg_status ecore_dbg_protection_override_dump(struct ecore_hwfn *p_hwfn,
804 struct ecore_ptt *p_ptt,
806 u32 buf_size_in_dwords,
807 u32 *num_dumped_dwords);
810 * @brief ecore_dbg_fw_asserts_get_dump_buf_size - Returns the required buffer
811 * size for FW Asserts results.
813 * @param p_hwfn - HW device data
814 * @param p_ptt - Ptt window used for writing the registers.
815 * @param buf_size - OUT: required buffer size (in dwords) for FW Asserts data.
817 * @return error if one of the following holds:
818 * - the version wasn't set
819 * Otherwise, returns ok.
821 enum dbg_status ecore_dbg_fw_asserts_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
822 struct ecore_ptt *p_ptt,
826 * @brief ecore_dbg_fw_asserts_dump - Reads the FW Asserts and writes the
827 * results into the specified buffer.
829 * @param p_hwfn - HW device data
830 * @param p_ptt - Ptt window used for writing the registers.
831 * @param dump_buf - Pointer to write the FW Asserts data into.
832 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
833 * @param num_dumped_dwords - OUT: number of dumped dwords.
835 * @return error if one of the following holds:
836 * - the version wasn't set
837 * - the specified buffer is too small
838 * Otherwise, returns ok.
840 enum dbg_status ecore_dbg_fw_asserts_dump(struct ecore_hwfn *p_hwfn,
841 struct ecore_ptt *p_ptt,
843 u32 buf_size_in_dwords,
844 u32 *num_dumped_dwords);
847 * @brief ecore_dbg_read_attn - Reads the attention registers of the specified
848 * block and type, and writes the results into the specified buffer.
850 * @param p_hwfn - HW device data
851 * @param p_ptt - Ptt window used for writing the registers.
852 * @param block - Block ID.
853 * @param attn_type - Attention type.
854 * @param clear_status - Indicates if the attention status should be cleared.
855 * @param results - OUT: Pointer to write the read results into
857 * @return error if one of the following holds:
858 * - the version wasn't set
859 * Otherwise, returns ok.
861 enum dbg_status ecore_dbg_read_attn(struct ecore_hwfn *p_hwfn,
862 struct ecore_ptt *p_ptt,
864 enum dbg_attn_type attn_type,
866 struct dbg_attn_block_result *results);
869 * @brief ecore_dbg_print_attn - Prints attention registers values in the
870 * specified results struct.
872 * @param p_hwfn - HW device data
873 * @param results - Pointer to the attention read results
875 * @return error if one of the following holds:
876 * - the version wasn't set
877 * Otherwise, returns ok.
879 enum dbg_status ecore_dbg_print_attn(struct ecore_hwfn *p_hwfn,
880 struct dbg_attn_block_result *results);
883 * @brief ecore_is_block_in_reset - Returns true if the specified block is in
884 * reset, false otherwise.
886 * @param p_hwfn - HW device data
887 * @param p_ptt - Ptt window used for writing the registers.
888 * @param block - Block ID.
890 * @return true if the specified block is in reset, false otherwise.
892 bool ecore_is_block_in_reset(struct ecore_hwfn *p_hwfn,
893 struct ecore_ptt *p_ptt,
894 enum block_id block);