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_dbg_bus_reset - Resets the Debug block.
75 * - The last recording is erased.
76 * - Recording is directed to the internal buffer.
77 * - Wrap-around recording is selected.
78 * - All HW blocks are disabled.
79 * - All Storms are disabled and all SEM filters are cleared.
81 * @param p_hwfn - HW device data
82 * @param p_ptt - Ptt window used for writing the registers.
83 * @param one_shot_en - Enable/Disable one-shot recording. If disabled,
84 * wrap-around recording is used instead.
85 * @param force_hw_dwords - If set to 0, no. of HW/Storm dwords per cycle is
86 * chosen automatically based on the enabled inputs.
87 * Otherwise, no. of HW dwords per cycle is forced to
88 * the specified value. Valid values: 0/2/4/8.
89 * @param unify_inputs - If true, all recorded data is associated with a
90 * single input, as if all data was received from the
91 * same block. Otherwise, each data unit is associated
92 * with its original input.
93 * @param grc_input_en - Enable/Disable recording GRC input. If enabled, the
94 * GRC input is recorded to the lsb dword of a cycle.
96 * @return error if one of the following holds:
97 * - the version wasn't set
98 * - force_hw_dwords is invalid.
99 * Otherwise, returns ok.
101 enum dbg_status ecore_dbg_bus_reset(struct ecore_hwfn *p_hwfn,
102 struct ecore_ptt *p_ptt,
109 * @brief ecore_dbg_bus_set_pci_output - Directs debug output to a PCI buffer.
111 * @param p_hwfn - HW device data
112 * @param p_ptt - Ptt window used for writing the registers.
113 * @param buf_size_kb - Size of PCI buffer to allocate (in KB). Must be aligned
114 * to PCI request size.
116 * @return error if one of the following holds:
117 * - the Debug block wasn't reset since last recording
118 * - the version wasn't set
119 * - the output was already set
120 * - the PCI buffer size is not aligned to PCI packet size
121 * - the PCI buffer allocation failed
122 * Otherwise, returns ok.
124 enum dbg_status ecore_dbg_bus_set_pci_output(struct ecore_hwfn *p_hwfn,
125 struct ecore_ptt *p_ptt,
129 * @brief ecore_dbg_bus_set_nw_output - Directs debug output to the network.
131 * @param p_hwfn - HW device data
132 * @param p_ptt - Ptt window used for writing the registers.
133 * @param port_id - Port ID to transmit the debug data on
134 * @param dest_addr_lo32 - Destination MAC address (for Eth header)
135 * @param dest_addr_hi16
136 * @param data_limit_size_kb - Data limit size in KB (valid only for one-shot)
137 * If set to 0, data limit won't be configured.
138 * @param send_to_other_engine -If true:
139 * 1) The NW output will be sent to the DBG block
140 * of the other engine.
141 * 2) port_id argument is ignored.
142 * 3) rcv_from_other_engine should be set to false
143 * The other engine DBG block should call this
144 * function with rcv_from_other_engine set to
146 * @param rcv_from_other_engine-If true:
147 * 1) the DBG block receives the NW output sent
148 * from the other engine DBG block, and sends
149 * it to a NW port in the current engine
150 * (according to port_id).
151 * 2) The src/dest addresses and eth_type
152 * arguments are ignored.
153 * 3) send_to_other_engine should be set to false.
154 * The other engine DBG block should call this
155 * function with send_to_other_engine set to
158 * @return error if one of the following holds:
159 * - the Debug block wasn't reset since last recording
160 * - the version wasn't set
161 * - the output was already set
162 * Otherwise, returns ok.
164 enum dbg_status ecore_dbg_bus_set_nw_output(struct ecore_hwfn *p_hwfn,
165 struct ecore_ptt *p_ptt,
169 u16 data_limit_size_kb,
170 bool send_to_other_engine,
171 bool rcv_from_other_engine);
174 * @brief ecore_dbg_bus_enable_block - Enables recording of the specified block
176 * Each recording cycle contains 4 "units". If the recorded HW data requires up
177 * to 4 dwords per cycle, each unit is one dword (32 bits). Otherwise, each
178 * unit is 2 dwords (64 bits).
180 * @param p_hwfn - HW device data
181 * @param block - block to be enabled.
182 * @param line_num - debug line number to select.
183 * @param cycle_en - 4-bit value. If bit i is set, unit i is enabled.
184 * @param right_shift - number of units to right the debug data (0-3).
185 * @param force_valid - 4-bit value. If bit i is set, unit i is forced valid.
186 * @param force_frame - 4-bit value. If bit i is set, the frame bit of unit i
189 * @return error if one of the following holds:
190 * - the Debug block wasn't reset since last recording
191 * - the version wasn't set
192 * - block is not valid
193 * - block was already enabled
194 * - cycle_en, force_valid or force_frame are wider than 4 bits
195 * - right_shift is larger than 3
196 * - cycle unit 0 is enabled, but GRC or timestamp were also enabled.
197 * - Too many inputs were enabled.
198 * Otherwise, returns ok.
200 enum dbg_status ecore_dbg_bus_enable_block(struct ecore_hwfn *p_hwfn,
209 * @brief ecore_dbg_bus_enable_storm - Enables recording of the specified Storm
211 * @param p_hwfn - HW device data
212 * @param storm - Storm to be enabled.
213 * @param storm_mode- Storm mode
215 * @return error if one of the following holds:
216 * - the Debug block wasn't reset since last recording
217 * - the version wasn't set
218 * - the specified storm or mode is invalid
219 * - Storm was already enabled
220 * - only HW data can be recorded
221 * - Too many inputs were enabled.
222 * Otherwise, returns ok.
224 enum dbg_status ecore_dbg_bus_enable_storm(struct ecore_hwfn *p_hwfn,
225 enum dbg_storms storm,
226 enum dbg_bus_storm_modes storm_mode);
229 * @brief ecore_dbg_bus_enable_timestamp - Enables timestamp recording.
231 * When enabled, the timestamp input is always recorded to the lsb dword of
232 * a cycle, with HW ID 0.
234 * @param p_hwfn - HW device data
235 * @param p_ptt - Ptt window used for writing the registers.
236 * @param valid_en - 3-bit value. The Timestamp will be recorded in a cycle if
237 * bit i is set and unit i+1 is valid.
238 * @param frame_en - 3-bit value. The Timestamp will be recorded in a cycle if
239 * bit i is set and unit i+1 has frame bit set.
240 * @param tick_len - timestamp tick length in cycles, minus 1. A value of 0
243 * @return error if one of the following holds:
244 * - the Debug block wasn't reset since last recording
245 * - the version wasn't set
246 * - valid_en or frame_en are wider than 4 bits
247 * - Both timestamp and GRC are enabled.
248 * Otherwise, returns ok.
250 enum dbg_status ecore_dbg_bus_enable_timestamp(struct ecore_hwfn *p_hwfn,
251 struct ecore_ptt *p_ptt,
257 * @brief ecore_dbg_bus_add_eid_range_sem_filter- Add Event ID range SEM filter
259 * @param p_hwfn - HW device data
260 * @param storm - Storm to be filtered.
261 * @param min_eid - minimal Event ID to filter on.
262 * @param max_eid - maximal Event ID to filter on.
264 * @return error if one of the following holds:
265 * - the specified Storm is invalid
266 * - the specified Storm wasn't enabled
267 * - the EID range is not valid
268 * Otherwise, returns ok.
270 enum dbg_status ecore_dbg_bus_add_eid_range_sem_filter(struct ecore_hwfn *p_hwfn,
271 enum dbg_storms storm,
276 * @brief ecore_dbg_bus_add_eid_mask_sem_filter - Add Event ID mask SEM filter
278 * @param p_hwfn - HW device data
279 * @param storm - Storm to be filtered.
280 * @param eid_val - Event ID value.
281 * @param eid_mask - Event ID mask. 0's in the mask = don't care bits.
283 * @return error if one of the following holds:
284 * - the specified Storm is invalid
285 * - the specified Storm wasn't enabled
286 * Otherwise, returns ok.
288 enum dbg_status ecore_dbg_bus_add_eid_mask_sem_filter(struct ecore_hwfn *p_hwfn,
289 enum dbg_storms storm,
294 * @brief ecore_dbg_bus_add_cid_sem_filter - Adds a CID SEM filter.
296 * @param p_hwfn - HW device data
297 * @param storm - Storm to be filtered.
298 * @param cid - CID to filter on.
300 * @return error if one of the following holds:
301 * - the specified Storm is invalid
302 * - the specified Storm wasn't enabled
303 * Otherwise, returns ok.
305 enum dbg_status ecore_dbg_bus_add_cid_sem_filter(struct ecore_hwfn *p_hwfn,
306 enum dbg_storms storm,
310 * @brief ecore_dbg_bus_enable_filter - Enables the recording filter.
312 * A filter contains up to 4 constraints. The data is "filtered in" when the
313 * added constraints hold.
315 * @param p_hwfn - HW device data
316 * @param p_ptt - Ptt window used for writing the registers.
317 * @param block - block to filter on.
318 * @param const_msg_len - Constant message length (in cycles) to be used for
319 * message-based filter constraints. If set to 0,
320 * message length is based only on frame bit received
321 * from HW (no constant message length).
323 * @return error if one of the following holds:
324 * - the Debug block wasn't reset since last recording
325 * - the version wasn't set
326 * - the filter was already enabled
327 * - block is not valid or not enabled
328 * - more than 4 dwords are recorded per-cycle (forbids filters)
329 * Otherwise, returns ok.
331 enum dbg_status ecore_dbg_bus_enable_filter(struct ecore_hwfn *p_hwfn,
332 struct ecore_ptt *p_ptt,
337 * @brief ecore_dbg_bus_enable_trigger - Enables the recording trigger.
339 * A trigger contains up to 3 states, where each state contains up to
340 * 4 constraints. After the constraints of a state hold for a specified number
341 * of times, the DBG block moves to the next state. If there's no next state,
342 * the DBG block triggers.
344 * @param p_hwfn - HW device data
345 * @param p_ptt - Ptt window used for writing the registers.
346 * @param rec_pre_trigger - if true, recording starts before the trigger.
347 * if false, recording starts at the trigger.
348 * @param pre_chunks - max number of chunks to record before the
349 * trigger (1-47). If set to 0, recording starts
350 * from time 0. Ignored if rec_pre_trigger is
352 * @param rec_post_trigger - if true, recording ends after the trigger.
353 * if false, recording ends at the trigger.
354 * @param post_cycles - max number of cycles to record after the
355 * trigger (0x1-0xffffffff). If set to 0,
356 * recording ends only when stopped by the user.
357 * Ignored if rec_post_trigger is false.
358 * @param filter_pre_trigger - if true, data is filtered before the trigger.
359 * Ignored if the filter wasn't enabled.
360 * @param filter_post_trigger - if true, data is filtered after the trigger.
361 * Ignored if the filter wasn't enabled.
363 * @return error if one of the following holds:
364 * - the Debug block wasn't reset since last recording
365 * - the version wasn't set
366 * - the trigger was already enabled
367 * - more than 4 dwords are recorded per-cycle (forbids triggers)
368 * - pre_chunks is not in the range 0-47.
369 * Otherwise, returns ok.
371 enum dbg_status ecore_dbg_bus_enable_trigger(struct ecore_hwfn *p_hwfn,
372 struct ecore_ptt *p_ptt,
373 bool rec_pre_trigger,
375 bool rec_post_trigger,
377 bool filter_pre_trigger,
378 bool filter_post_trigger);
381 * @brief ecore_dbg_bus_add_trigger_state - Adds a trigger state.
383 * Up to 3 trigger states can be added, where each state contains up to
384 * 4 constraints. After the constraints of a state hold for the specified
385 * number of times, the DBG block moves to the next state. If there's no next
386 * state, the DBG block triggers.
388 * @param p_hwfn - HW device data
389 * @param p_ptt - Ptt window used for writing the registers.
390 * @param block - block to trigger on.
391 * @param const_msg_len - Constant message length (in cycles) to be used for
392 * message-based filter constraints. If set to 0,
393 * message length is based only on frame bit received
394 * from HW (no constant message length).
395 * @param count_to_next - The number of times the constraints of the state
396 * should hold before moving to the next state. Must be
399 * @return error if one of the following holds:
400 * - The trigger wasn't enabled.
401 * - more than 3 trigger states were added
402 * - block is not valid or not enabled
403 * - count_to_next is 0
404 * Otherwise, returns ok.
406 enum dbg_status ecore_dbg_bus_add_trigger_state(struct ecore_hwfn *p_hwfn,
407 struct ecore_ptt *p_ptt,
413 * @brief ecore_dbg_bus_add_constraint - Adds a filter/trigger constraint.
415 * The constraint is added to a filter or trigger state, which ever was added
416 * last. The filter/trigger happens if both of the following hold:
417 * 1. All mandatory constraints are true.
418 * 2. At least one optional (non-mandatory) constraints is true.
420 * @param p_hwfn - HW device data
421 * @param p_ptt - Ptt window used for writing the registers.
422 * @param op - constraint operation
423 * @param data - 32-bit data to compare with the recorded
425 * @param data_mask - 32-bit mask for data comparison. If mask bit
426 * i is 1, data bit i is compared, otherwise
428 * For eq/ne operations: any mask can be used.
429 * For other operations: the mask must be
430 * non-zero, and the 1's in the mask must be
432 * @param compare_frame - indicates if the frame bit should be
433 * compared. Must be false for all operations
435 * @param frame_bit - frame bit to compare with the recorded data
436 * (0/1). ignored if compare_frame is false.
437 * @param cycle_offset - offset in cycles from the beginning of the
438 * message, where cycle = 4 dwords.
439 * @param dword_offset_in_cycle - offset in dwords from the beginning of the
441 * @param is_mandatory - indicates if this constraint is mandatory
442 * (true) or optional (false). The data is
443 * filtered-in if all mandatory constraints hold
444 * AND at least one optional constraint (if
447 * @return error if one of the following holds:
448 * - a filter or trigger state weren't enabled
449 * - all 4 filter constraints were added already
450 * - the op string is invalid
451 * - the data mask is invalid.
452 * - frame bit is not 0/1.
453 * - cycle_offset and dword_offset are not in the range 0-3.
454 * - compare_frame is true and operation is not eq/ne.
455 * Otherwise, returns ok.
457 enum dbg_status ecore_dbg_bus_add_constraint(struct ecore_hwfn *p_hwfn,
458 struct ecore_ptt *p_ptt,
459 enum dbg_bus_constraint_ops constraint_op,
465 u8 dword_offset_in_cycle,
469 * @brief ecore_dbg_bus_start - Starts the recording.
471 * @param p_hwfn - HW device data
472 * @param p_ptt - Ptt window used for writing the registers.
474 * @return error if one of the following holds:
475 * - the Debug block wasn't reset since last recording
476 * - the version wasn't set
477 * Otherwise, returns ok.
479 enum dbg_status ecore_dbg_bus_start(struct ecore_hwfn *p_hwfn,
480 struct ecore_ptt *p_ptt);
483 * @brief ecore_dbg_bus_stop - Stops the recording and flushes the internal
486 * @param p_hwfn - HW device data
487 * @param p_ptt - Ptt window used for writing the registers.
489 * @return error if a recording is not in progress, ok otherwise.
491 enum dbg_status ecore_dbg_bus_stop(struct ecore_hwfn *p_hwfn,
492 struct ecore_ptt *p_ptt);
495 * @brief ecore_dbg_bus_get_dump_buf_size - Returns the required buffer size
496 * for Debug Bus recording.
498 * @param p_hwfn - HW device data
499 * @param p_ptt - Ptt window used for writing the registers.
500 * @param buf_size - OUT: the required size (in dwords) of the buffer for
501 * dumping the recorded Debug Bus data. If recording to the
502 * internal buffer, the size of the internal buffer is
503 * returned. If recording to PCI, the size of the PCI buffer
504 * is returned. Otherwise, 0 is returned.
506 * @return error if one of the following holds:
507 * - the version wasn't set
508 * Otherwise, returns ok.
510 enum dbg_status ecore_dbg_bus_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
511 struct ecore_ptt *p_ptt,
515 * @brief ecore_dbg_bus_dump - Dumps the recorded Debug Bus data into the
518 * The dumped data starts with a header. If recording to NW, only a header is
519 * dumped. The dumped size is assigned to num_dumped_dwords.
521 * @param p_hwfn - HW device data
522 * @param p_ptt - Ptt window used for writing the registers.
523 * @param dump_buf - Pointer to copy the recorded data into.
524 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
525 * @param num_dumped_dwords - OUT: number of dumped dwords.
527 * @return error if one of the following holds:
528 * - a recording wasn't started/stopped
529 * - the specified dump buffer is too small
530 * Otherwise, returns ok.
532 enum dbg_status ecore_dbg_bus_dump(struct ecore_hwfn *p_hwfn,
533 struct ecore_ptt *p_ptt,
535 u32 buf_size_in_dwords,
536 u32 *num_dumped_dwords);
539 * @brief ecore_dbg_grc_config - Sets the value of a GRC parameter.
541 * @param p_hwfn - HW device data
542 * @param grc_param - GRC parameter
543 * @param val - Value to set.
545 * @return error if one of the following holds:
546 * - the version wasn't set
547 * - grc_param is invalid
548 * - val is outside the allowed boundaries
550 enum dbg_status ecore_dbg_grc_config(struct ecore_hwfn *p_hwfn,
551 enum dbg_grc_params grc_param,
555 * @brief ecore_dbg_grc_set_params_default - Reverts all GRC parameters to their
558 * @param p_hwfn - HW device data
560 void ecore_dbg_grc_set_params_default(struct ecore_hwfn *p_hwfn);
563 * @brief ecore_dbg_grc_get_dump_buf_size - Returns the required buffer size
566 * @param p_hwfn - HW device data
567 * @param p_ptt - Ptt window used for writing the registers.
568 * @param buf_size - OUT: required buffer size (in dwords) for GRC Dump data.
570 * @return error if one of the following holds:
571 * - the version wasn't set
572 * Otherwise, returns ok.
574 enum dbg_status ecore_dbg_grc_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
575 struct ecore_ptt *p_ptt,
579 * @brief ecore_dbg_grc_dump - Dumps GRC data into the specified buffer.
581 * @param p_hwfn - HW device data
582 * @param p_ptt - Ptt window used for writing the registers.
583 * @param dump_buf - Pointer to write the collected GRC data into.
584 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
585 * @param num_dumped_dwords - OUT: number of dumped dwords.
587 * @return error if one of the following holds:
588 * - the version wasn't set
589 * - the specified dump buffer is too small
590 * Otherwise, returns ok.
592 enum dbg_status ecore_dbg_grc_dump(struct ecore_hwfn *p_hwfn,
593 struct ecore_ptt *p_ptt,
595 u32 buf_size_in_dwords,
596 u32 *num_dumped_dwords);
599 * @brief ecore_dbg_idle_chk_get_dump_buf_size - Returns the required buffer
600 * size for idle check results.
602 * @param p_hwfn - HW device data
603 * @param p_ptt - Ptt window used for writing the registers.
604 * @param buf_size - OUT: required buffer size (in dwords) for idle check data.
606 * @return error if one of the following holds:
607 * - the version wasn't set
608 * Otherwise, returns ok.
610 enum dbg_status ecore_dbg_idle_chk_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
611 struct ecore_ptt *p_ptt,
615 * @brief ecore_dbg_idle_chk_dump - Performs idle check and writes the results
616 * into the specified buffer.
618 * @param p_hwfn - HW device data
619 * @param p_ptt - Ptt window used for writing the registers.
620 * @param dump_buf - Pointer to write the idle check data into.
621 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
622 * @param num_dumped_dwords - OUT: number of dumped dwords.
624 * @return error if one of the following holds:
625 * - the version wasn't set
626 * - the specified buffer is too small
627 * Otherwise, returns ok.
629 enum dbg_status ecore_dbg_idle_chk_dump(struct ecore_hwfn *p_hwfn,
630 struct ecore_ptt *p_ptt,
632 u32 buf_size_in_dwords,
633 u32 *num_dumped_dwords);
636 * @brief ecore_dbg_mcp_trace_get_dump_buf_size - Returns the required buffer
637 * size for mcp trace results.
639 * @param p_hwfn - HW device data
640 * @param p_ptt - Ptt window used for writing the registers.
641 * @param buf_size - OUT: required buffer size (in dwords) for mcp trace data.
643 * @return error if one of the following holds:
644 * - the version wasn't set
645 * - the trace data in MCP scratchpad contain an invalid signature
646 * - the bundle ID in NVRAM is invalid
647 * - the trace meta data cannot be found (in NVRAM or image file)
648 * Otherwise, returns ok.
650 enum dbg_status ecore_dbg_mcp_trace_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
651 struct ecore_ptt *p_ptt,
655 * @brief ecore_dbg_mcp_trace_dump - Performs mcp trace and writes the results
656 * into the specified buffer.
658 * @param p_hwfn - HW device data
659 * @param p_ptt - Ptt window used for writing the registers.
660 * @param dump_buf - Pointer to write the mcp trace data into.
661 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
662 * @param num_dumped_dwords - OUT: number of dumped dwords.
664 * @return error if one of the following holds:
665 * - the version wasn't set
666 * - the specified buffer is too small
667 * - the trace data in MCP scratchpad contain an invalid signature
668 * - the bundle ID in NVRAM is invalid
669 * - the trace meta data cannot be found (in NVRAM or image file)
670 * - the trace meta data cannot be read (from NVRAM or image file)
671 * Otherwise, returns ok.
673 enum dbg_status ecore_dbg_mcp_trace_dump(struct ecore_hwfn *p_hwfn,
674 struct ecore_ptt *p_ptt,
676 u32 buf_size_in_dwords,
677 u32 *num_dumped_dwords);
680 * @brief ecore_dbg_reg_fifo_get_dump_buf_size - Returns the required buffer
681 * size for grc trace fifo results.
683 * @param p_hwfn - HW device data
684 * @param p_ptt - Ptt window used for writing the registers.
685 * @param buf_size - OUT: required buffer size (in dwords) for reg fifo data.
687 * @return error if one of the following holds:
688 * - the version wasn't set
689 * Otherwise, returns ok.
691 enum dbg_status ecore_dbg_reg_fifo_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
692 struct ecore_ptt *p_ptt,
696 * @brief ecore_dbg_reg_fifo_dump - Reads the reg fifo and writes the results
697 * into the specified buffer.
699 * @param p_hwfn - HW device data
700 * @param p_ptt - Ptt window used for writing the registers.
701 * @param dump_buf - Pointer to write the reg fifo data into.
702 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
703 * @param num_dumped_dwords - OUT: number of dumped dwords.
705 * @return error if one of the following holds:
706 * - the version wasn't set
707 * - the specified buffer is too small
708 * - DMAE transaction failed
709 * Otherwise, returns ok.
711 enum dbg_status ecore_dbg_reg_fifo_dump(struct ecore_hwfn *p_hwfn,
712 struct ecore_ptt *p_ptt,
714 u32 buf_size_in_dwords,
715 u32 *num_dumped_dwords);
718 * @brief ecore_dbg_igu_fifo_get_dump_buf_size - Returns the required buffer
719 * size for the IGU fifo results.
721 * @param p_hwfn - HW device data
722 * @param p_ptt - Ptt window used for writing the registers.
723 * @param buf_size - OUT: required buffer size (in dwords) for IGU fifo data.
725 * @return error if one of the following holds:
726 * - the version wasn't set
727 * Otherwise, returns ok.
729 enum dbg_status ecore_dbg_igu_fifo_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
730 struct ecore_ptt *p_ptt,
734 * @brief ecore_dbg_igu_fifo_dump - Reads the IGU fifo and writes the results
735 * into the specified buffer.
737 * @param p_hwfn - HW device data
738 * @param p_ptt - Ptt window used for writing the registers.
739 * @param dump_buf - Pointer to write the IGU fifo data into.
740 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
741 * @param num_dumped_dwords - OUT: number of dumped dwords.
743 * @return error if one of the following holds:
744 * - the version wasn't set
745 * - the specified buffer is too small
746 * - DMAE transaction failed
747 * Otherwise, returns ok.
749 enum dbg_status ecore_dbg_igu_fifo_dump(struct ecore_hwfn *p_hwfn,
750 struct ecore_ptt *p_ptt,
752 u32 buf_size_in_dwords,
753 u32 *num_dumped_dwords);
756 * @brief ecore_dbg_protection_override_get_dump_buf_size - Return the required
757 * buffer size for protection override window results.
759 * @param p_hwfn - HW device data
760 * @param p_ptt - Ptt window used for writing the registers.
761 * @param buf_size - OUT: required buffer size (in dwords) for protection
764 * @return error if one of the following holds:
765 * - the version wasn't set
766 * Otherwise, returns ok.
768 enum dbg_status ecore_dbg_protection_override_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
769 struct ecore_ptt *p_ptt,
772 * @brief ecore_dbg_protection_override_dump - Reads protection override window
773 * entries and writes the results into the specified buffer.
775 * @param p_hwfn - HW device data
776 * @param p_ptt - Ptt window used for writing the registers.
777 * @param dump_buf - Pointer to write the protection override data
779 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
780 * @param num_dumped_dwords - OUT: number of dumped dwords.
782 * @return error if one of the following holds:
783 * - the version wasn't set
784 * - the specified buffer is too small
785 * - DMAE transaction failed
786 * Otherwise, returns ok.
788 enum dbg_status ecore_dbg_protection_override_dump(struct ecore_hwfn *p_hwfn,
789 struct ecore_ptt *p_ptt,
791 u32 buf_size_in_dwords,
792 u32 *num_dumped_dwords);
795 * @brief ecore_dbg_fw_asserts_get_dump_buf_size - Returns the required buffer
796 * size for FW Asserts results.
798 * @param p_hwfn - HW device data
799 * @param p_ptt - Ptt window used for writing the registers.
800 * @param buf_size - OUT: required buffer size (in dwords) for FW Asserts data.
802 * @return error if one of the following holds:
803 * - the version wasn't set
804 * Otherwise, returns ok.
806 enum dbg_status ecore_dbg_fw_asserts_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
807 struct ecore_ptt *p_ptt,
811 * @brief ecore_dbg_fw_asserts_dump - Reads the FW Asserts and writes the
812 * results into the specified buffer.
814 * @param p_hwfn - HW device data
815 * @param p_ptt - Ptt window used for writing the registers.
816 * @param dump_buf - Pointer to write the FW Asserts data into.
817 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
818 * @param num_dumped_dwords - OUT: number of dumped dwords.
820 * @return error if one of the following holds:
821 * - the version wasn't set
822 * - the specified buffer is too small
823 * Otherwise, returns ok.
825 enum dbg_status ecore_dbg_fw_asserts_dump(struct ecore_hwfn *p_hwfn,
826 struct ecore_ptt *p_ptt,
828 u32 buf_size_in_dwords,
829 u32 *num_dumped_dwords);
832 * @brief ecore_dbg_read_attn - Reads the attention registers of the specified
833 * block and type, and writes the results into the specified buffer.
835 * @param p_hwfn - HW device data
836 * @param p_ptt - Ptt window used for writing the registers.
837 * @param block - Block ID.
838 * @param attn_type - Attention type.
839 * @param clear_status - Indicates if the attention status should be cleared.
840 * @param results - OUT: Pointer to write the read results into
842 * @return error if one of the following holds:
843 * - the version wasn't set
844 * Otherwise, returns ok.
846 enum dbg_status ecore_dbg_read_attn(struct ecore_hwfn *p_hwfn,
847 struct ecore_ptt *p_ptt,
849 enum dbg_attn_type attn_type,
851 struct dbg_attn_block_result *results);
854 * @brief ecore_dbg_print_attn - Prints attention registers values in the
855 * specified results struct.
857 * @param p_hwfn - HW device data
858 * @param results - Pointer to the attention read results
860 * @return error if one of the following holds:
861 * - the version wasn't set
862 * Otherwise, returns ok.
864 enum dbg_status ecore_dbg_print_attn(struct ecore_hwfn *p_hwfn,
865 struct dbg_attn_block_result *results);
868 * @brief ecore_is_block_in_reset - Returns true if the specified block is in
869 * reset, false otherwise.
871 * @param p_hwfn - HW device data
872 * @param p_ptt - Ptt window used for writing the registers.
873 * @param block - Block ID.
875 * @return true if the specified block is in reset, false otherwise.
877 bool ecore_is_block_in_reset(struct ecore_hwfn *p_hwfn,
878 struct ecore_ptt *p_ptt,
879 enum block_id block);