9506 Want support for QLogic QL41000/45000 series devices
[unleashed.git] / usr / src / uts / common / io / qede / 579xx / drivers / ecore / ecore_dbg_fw_funcs.h
blobda33a3290a84b189e9fccb43c8fd85934ac1caa7
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, v.1, (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://opensource.org/licenses/CDDL-1.0.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2014-2017 Cavium, Inc.
24 * The contents of this file are subject to the terms of the Common Development
25 * and Distribution License, v.1, (the "License").
27 * You may not use this file except in compliance with the License.
29 * You can obtain a copy of the License at available
30 * at http://opensource.org/licenses/CDDL-1.0
32 * See the License for the specific language governing permissions and
33 * limitations under the License.
36 #ifndef _DBG_FW_FUNCS_H
37 #define _DBG_FW_FUNCS_H
38 /**************************** Public Functions *******************************/
40 /**
41 * @brief ecore_dbg_set_bin_ptr - Sets a pointer to the binary data with debug
42 * arrays.
44 * @param bin_ptr - a pointer to the binary data with debug arrays.
46 enum dbg_status ecore_dbg_set_bin_ptr(const u8 * const bin_ptr);
48 /**
49 * @brief ecore_dbg_set_app_ver - Sets the version of the calling app.
51 * The application should call this function with the TOOLS_VERSION
52 * it compiles with. Must be called before all other debug functions.
54 * @return error if one of the following holds:
55 * - the specified app version is not supported
56 * Otherwise, returns ok.
58 enum dbg_status ecore_dbg_set_app_ver(u32 ver);
60 /**
61 * @brief ecore_dbg_get_fw_func_ver - Returns the FW func version.
63 * @return the FW func version.
65 u32 ecore_dbg_get_fw_func_ver(void);
67 /**
68 * @brief ecore_dbg_get_chip_id - Returns the FW func version.
70 * @param p_hwfn - HW device data
72 * @return the chip ID.
74 enum chip_ids ecore_dbg_get_chip_id(struct ecore_hwfn *p_hwfn);
76 /**
77 * @brief ecore_dbg_bus_reset - Resets the Debug block.
79 * After reset:
80 * - The last recording is erased.
81 * - Recording is directed to the internal buffer.
82 * - Wrap-around recording is selected.
83 * - All HW blocks are disabled.
84 * - All Storms are disabled and all SEM filters are cleared.
86 * @param p_hwfn - HW device data
87 * @param p_ptt - Ptt window used for writing the registers.
88 * @param one_shot_en - Enable/Disable one-shot recording. If disabled,
89 * wrap-around recording is used instead.
90 * @param force_hw_dwords - If set to 0, no. of HW/Storm dwords per cycle is
91 * chosen automatically based on the enabled inputs.
92 * Otherwise, no. of HW dwords per cycle is forced to
93 * the specified value. Valid values: 0/2/4/8.
94 * @param unify_inputs - If true, all recorded data is associated with a
95 * single input, as if all data was received from the
96 * same block. Otherwise, each data unit is associated
97 * with its original input.
98 * @param grc_input_en - Enable/Disable recording GRC input. If enabled, the
99 * GRC input is recorded to the lsb dword of a cycle.
101 * @return error if one of the following holds:
102 * - the version wasn't set
103 * - force_hw_dwords is invalid.
104 * Otherwise, returns ok.
106 enum dbg_status ecore_dbg_bus_reset(struct ecore_hwfn *p_hwfn,
107 struct ecore_ptt *p_ptt,
108 bool one_shot_en,
109 u8 force_hw_dwords,
110 bool unify_inputs,
111 bool grc_input_en);
114 * @brief ecore_dbg_bus_set_pci_output - Directs debug output to a PCI buffer.
116 * @param p_hwfn - HW device data
117 * @param p_ptt - Ptt window used for writing the registers.
118 * @param buf_size_kb - Size of PCI buffer to allocate (in KB). Must be aligned
119 * to PCI request size.
121 * @return error if one of the following holds:
122 * - the Debug block wasn't reset since last recording
123 * - the version wasn't set
124 * - the output was already set
125 * - the PCI buffer size is not aligned to PCI packet size
126 * - the PCI buffer allocation failed
127 * Otherwise, returns ok.
129 enum dbg_status ecore_dbg_bus_set_pci_output(struct ecore_hwfn *p_hwfn,
130 struct ecore_ptt *p_ptt,
131 u16 buf_size_kb);
134 * @brief ecore_dbg_bus_set_nw_output - Directs debug output to the network.
136 * @param p_hwfn - HW device data
137 * @param p_ptt - Ptt window used for writing the registers.
138 * @param port_id - Port ID to transmit the debug data on
139 * @param dest_addr_lo32 - Destination MAC address (for Eth header)
140 * @param dest_addr_hi16
141 * @param data_limit_size_kb - Data limit size in KB (valid only for one-shot)
142 * If set to 0, data limit won't be configured.
143 * @param send_to_other_engine -If true:
144 * 1) The NW output will be sent to the DBG block
145 * of the other engine.
146 * 2) port_id argument is ignored.
147 * 3) rcv_from_other_engine should be set to false
148 * The other engine DBG block should call this
149 * function with rcv_from_other_engine set to
150 * true.
151 * @param rcv_from_other_engine-If true:
152 * 1) the DBG block receives the NW output sent
153 * from the other engine DBG block, and sends
154 * it to a NW port in the current engine
155 * (according to port_id).
156 * 2) The src/dest addresses and eth_type
157 * arguments are ignored.
158 * 3) send_to_other_engine should be set to false.
159 * The other engine DBG block should call this
160 * function with send_to_other_engine set to
161 * true.
163 * @return error if one of the following holds:
164 * - the Debug block wasn't reset since last recording
165 * - the version wasn't set
166 * - the output was already set
167 * Otherwise, returns ok.
169 enum dbg_status ecore_dbg_bus_set_nw_output(struct ecore_hwfn *p_hwfn,
170 struct ecore_ptt *p_ptt,
171 u8 port_id,
172 u32 dest_addr_lo32,
173 u16 dest_addr_hi16,
174 u16 data_limit_size_kb,
175 bool send_to_other_engine,
176 bool rcv_from_other_engine);
179 * @brief ecore_dbg_bus_enable_block - Enables recording of the specified block
181 * Each recording cycle contains 4 "units". If the recorded HW data requires up
182 * to 4 dwords per cycle, each unit is one dword (32 bits). Otherwise, each
183 * unit is 2 dwords (64 bits).
185 * @param p_hwfn - HW device data
186 * @param p_ptt - Ptt window used for writing the registers.
187 * @param block - block to be enabled.
188 * @param line_num - debug line number to select.
189 * @param cycle_en - 4-bit value. If bit i is set, unit i is enabled.
190 * @param right_shift - number of units to right the debug data (0-3).
191 * @param force_valid - 4-bit value. If bit i is set, unit i is forced valid.
192 * @param force_frame - 4-bit value. If bit i is set, the frame bit of unit i
193 * is forced.
195 * @return error if one of the following holds:
196 * - the Debug block wasn't reset since last recording
197 * - the version wasn't set
198 * - block is not valid
199 * - block was already enabled
200 * - cycle_en, force_valid or force_frame are wider than 4 bits
201 * - right_shift is larger than 3
202 * - cycle unit 0 is enabled, but GRC or timestamp were also enabled.
203 * - Too many inputs were enabled.
204 * Otherwise, returns ok.
206 enum dbg_status ecore_dbg_bus_enable_block(struct ecore_hwfn *p_hwfn,
207 struct ecore_ptt *p_ptt,
208 enum block_id block,
209 u8 line_num,
210 u8 cycle_en,
211 u8 right_shift,
212 u8 force_valid,
213 u8 force_frame);
216 * @brief ecore_dbg_bus_enable_storm - Enables recording of the specified Storm
218 * @param p_hwfn - HW device data
219 * @param storm - Storm to be enabled.
220 * @param storm_mode- Storm mode
222 * @return error if one of the following holds:
223 * - the Debug block wasn't reset since last recording
224 * - the version wasn't set
225 * - the specified storm or mode is invalid
226 * - Storm was already enabled
227 * - only HW data can be recorded
228 * - Too many inputs were enabled.
229 * Otherwise, returns ok.
231 enum dbg_status ecore_dbg_bus_enable_storm(struct ecore_hwfn *p_hwfn,
232 enum dbg_storms storm,
233 enum dbg_bus_storm_modes storm_mode);
236 * @brief ecore_dbg_bus_enable_timestamp - Enables timestamp recording.
238 * When enabled, the timestamp input is always recorded to the lsb dword of
239 * a cycle, with HW ID 0.
241 * @param p_hwfn - HW device data
242 * @param p_ptt - Ptt window used for writing the registers.
243 * @param valid_en - 3-bit value. The Timestamp will be recorded in a cycle if
244 * bit i is set and unit i+1 is valid.
245 * @param frame_en - 3-bit value. The Timestamp will be recorded in a cycle if
246 * bit i is set and unit i+1 has frame bit set.
247 * @param tick_len - timestamp tick length in cycles, minus 1. A value of 0
248 * means one cycle.
250 * @return error if one of the following holds:
251 * - the Debug block wasn't reset since last recording
252 * - the version wasn't set
253 * - valid_en or frame_en are wider than 4 bits
254 * - Both timestamp and GRC are enabled.
255 * Otherwise, returns ok.
257 enum dbg_status ecore_dbg_bus_enable_timestamp(struct ecore_hwfn *p_hwfn,
258 struct ecore_ptt *p_ptt,
259 u8 valid_en,
260 u8 frame_en,
261 u32 tick_len);
264 * @brief ecore_dbg_bus_add_eid_range_sem_filter- Add Event ID range SEM filter
266 * @param p_hwfn - HW device data
267 * @param storm - Storm to be filtered.
268 * @param min_eid - minimal Event ID to filter on.
269 * @param max_eid - maximal Event ID to filter on.
271 * @return error if one of the following holds:
272 * - the specified Storm is invalid
273 * - the specified Storm wasn't enabled
274 * - the EID range is not valid
275 * Otherwise, returns ok.
277 enum dbg_status ecore_dbg_bus_add_eid_range_sem_filter(struct ecore_hwfn *p_hwfn,
278 enum dbg_storms storm,
279 u8 min_eid,
280 u8 max_eid);
283 * @brief ecore_dbg_bus_add_eid_mask_sem_filter - Add Event ID mask SEM filter
285 * @param p_hwfn - HW device data
286 * @param storm - Storm to be filtered.
287 * @param eid_val - Event ID value.
288 * @param eid_mask - Event ID mask. 0's in the mask = don't care bits.
290 * @return error if one of the following holds:
291 * - the specified Storm is invalid
292 * - the specified Storm wasn't enabled
293 * Otherwise, returns ok.
295 enum dbg_status ecore_dbg_bus_add_eid_mask_sem_filter(struct ecore_hwfn *p_hwfn,
296 enum dbg_storms storm,
297 u8 eid_val,
298 u8 eid_mask);
301 * @brief ecore_dbg_bus_add_cid_sem_filter - Adds a CID SEM filter.
303 * @param p_hwfn - HW device data
304 * @param storm - Storm to be filtered.
305 * @param cid - CID to filter on.
307 * @return error if one of the following holds:
308 * - the specified Storm is invalid
309 * - the specified Storm wasn't enabled
310 * Otherwise, returns ok.
312 enum dbg_status ecore_dbg_bus_add_cid_sem_filter(struct ecore_hwfn *p_hwfn,
313 enum dbg_storms storm,
314 u32 cid);
317 * @brief ecore_dbg_bus_enable_filter - Enables the recording filter.
319 * A filter contains up to 4 constraints. The data is "filtered in" when the
320 * added constraints hold.
322 * @param p_hwfn - HW device data
323 * @param p_ptt - Ptt window used for writing the registers.
324 * @param block - block to filter on.
325 * @param const_msg_len - Constant message length (in cycles) to be used for
326 * message-based filter constraints. If set to 0,
327 * message length is based only on frame bit received
328 * from HW (no constant message length).
330 * @return error if one of the following holds:
331 * - the Debug block wasn't reset since last recording
332 * - the version wasn't set
333 * - the filter was already enabled
334 * - block is not valid or not enabled
335 * - more than 4 dwords are recorded per-cycle (forbids filters)
336 * Otherwise, returns ok.
338 enum dbg_status ecore_dbg_bus_enable_filter(struct ecore_hwfn *p_hwfn,
339 struct ecore_ptt *p_ptt,
340 enum block_id block,
341 u8 const_msg_len);
344 * @brief ecore_dbg_bus_enable_trigger - Enables the recording trigger.
346 * A trigger contains up to 3 states, where each state contains up to
347 * 4 constraints. After the constraints of a state hold for a specified number
348 * of times, the DBG block moves to the next state. If there's no next state,
349 * the DBG block triggers.
351 * @param p_hwfn - HW device data
352 * @param p_ptt - Ptt window used for writing the registers.
353 * @param rec_pre_trigger - if true, recording starts before the trigger.
354 * if false, recording starts at the trigger.
355 * @param pre_chunks - max number of chunks to record before the
356 * trigger (1-47). If set to 0, recording starts
357 * from time 0. Ignored if rec_pre_trigger is
358 * false.
359 * @param rec_post_trigger - if true, recording ends after the trigger.
360 * if false, recording ends at the trigger.
361 * @param post_cycles - max number of cycles to record after the
362 * trigger (0x1-0xffffffff). If set to 0,
363 * recording ends only when stopped by the user.
364 * Ignored if rec_post_trigger is false.
365 * @param filter_pre_trigger - if true, data is filtered before the trigger.
366 * Ignored if the filter wasn't enabled.
367 * @param filter_post_trigger - if true, data is filtered after the trigger.
368 * Ignored if the filter wasn't enabled.
370 * @return error if one of the following holds:
371 * - the Debug block wasn't reset since last recording
372 * - the version wasn't set
373 * - the trigger was already enabled
374 * - more than 4 dwords are recorded per-cycle (forbids triggers)
375 * - pre_chunks is not in the range 0-47.
376 * Otherwise, returns ok.
378 enum dbg_status ecore_dbg_bus_enable_trigger(struct ecore_hwfn *p_hwfn,
379 struct ecore_ptt *p_ptt,
380 bool rec_pre_trigger,
381 u8 pre_chunks,
382 bool rec_post_trigger,
383 u32 post_cycles,
384 bool filter_pre_trigger,
385 bool filter_post_trigger);
388 * @brief ecore_dbg_bus_add_trigger_state - Adds a trigger state.
390 * Up to 3 trigger states can be added, where each state contains up to
391 * 4 constraints. After the constraints of a state hold for the specified
392 * number of times, the DBG block moves to the next state. If there's no next
393 * state, the DBG block triggers.
395 * @param p_hwfn - HW device data
396 * @param p_ptt - Ptt window used for writing the registers.
397 * @param block - block to trigger on.
398 * @param const_msg_len - Constant message length (in cycles) to be used for
399 * message-based filter constraints. If set to 0,
400 * message length is based only on frame bit received
401 * from HW (no constant message length).
402 * @param count_to_next - The number of times the constraints of the state
403 * should hold before moving to the next state. Must be
404 * non-zero.
406 * @return error if one of the following holds:
407 * - The trigger wasn't enabled.
408 * - more than 3 trigger states were added
409 * - block is not valid or not enabled
410 * - count_to_next is 0
411 * Otherwise, returns ok.
413 enum dbg_status ecore_dbg_bus_add_trigger_state(struct ecore_hwfn *p_hwfn,
414 struct ecore_ptt *p_ptt,
415 enum block_id block,
416 u8 const_msg_len,
417 u16 count_to_next);
420 * @brief ecore_dbg_bus_add_constraint - Adds a filter/trigger constraint.
422 * The constraint is added to a filter or trigger state, which ever was added
423 * last. The filter/trigger happens if both of the following hold:
424 * 1. All mandatory constraints are true.
425 * 2. At least one optional (non-mandatory) constraints is true.
427 * @param p_hwfn - HW device data
428 * @param p_ptt - Ptt window used for writing the registers.
429 * @param op - constraint operation
430 * @param data - 32-bit data to compare with the recorded
431 * data.
432 * @param data_mask - 32-bit mask for data comparison. If mask bit
433 * i is 1, data bit i is compared, otherwise
434 * it's ignored.
435 * For eq/ne operations: any mask can be used.
436 * For other operations: the mask must be
437 * non-zero, and the 1's in the mask must be
438 * continuous.
439 * @param compare_frame - indicates if the frame bit should be
440 * compared. Must be false for all operations
441 * other than eq/ne.
442 * @param frame_bit - frame bit to compare with the recorded data
443 * (0/1). ignored if compare_frame is false.
444 * @param cycle_offset - offset in cycles from the beginning of the
445 * message, where cycle = 4 dwords.
446 * @param dword_offset_in_cycle - offset in dwords from the beginning of the
447 * cycle (0-3).
448 * @param is_mandatory - indicates if this constraint is mandatory
449 * (true) or optional (false). The data is
450 * filtered-in if all mandatory constraints hold
451 * AND at least one optional constraint (if
452 * added) holds.
454 * @return error if one of the following holds:
455 * - a filter or trigger state weren't enabled
456 * - all 4 filter constraints were added already
457 * - the op string is invalid
458 * - the data mask is invalid.
459 * - frame bit is not 0/1.
460 * - cycle_offset and dword_offset are not in the range 0-3.
461 * - compare_frame is true and operation is not eq/ne.
462 * Otherwise, returns ok.
464 enum dbg_status ecore_dbg_bus_add_constraint(struct ecore_hwfn *p_hwfn,
465 struct ecore_ptt *p_ptt,
466 enum dbg_bus_constraint_ops constraint_op,
467 u32 data,
468 u32 data_mask,
469 bool compare_frame,
470 u8 frame_bit,
471 u8 cycle_offset,
472 u8 dword_offset_in_cycle,
473 bool is_mandatory);
476 * @brief ecore_dbg_bus_start - Starts the recording.
478 * @param p_hwfn - HW device data
479 * @param p_ptt - Ptt window used for writing the registers.
481 * @return error if one of the following holds:
482 * - the Debug block wasn't reset since last recording
483 * - the version wasn't set
484 * Otherwise, returns ok.
486 enum dbg_status ecore_dbg_bus_start(struct ecore_hwfn *p_hwfn,
487 struct ecore_ptt *p_ptt);
490 * @brief ecore_dbg_bus_stop - Stops the recording and flushes the internal
491 * buffer.
493 * @param p_hwfn - HW device data
494 * @param p_ptt - Ptt window used for writing the registers.
496 * @return error if a recording is not in progress, ok otherwise.
498 enum dbg_status ecore_dbg_bus_stop(struct ecore_hwfn *p_hwfn,
499 struct ecore_ptt *p_ptt);
502 * @brief ecore_dbg_bus_get_dump_buf_size - Returns the required buffer size
503 * for Debug Bus recording.
505 * @param p_hwfn - HW device data
506 * @param p_ptt - Ptt window used for writing the registers.
507 * @param buf_size - OUT: the required size (in dwords) of the buffer for
508 * dumping the recorded Debug Bus data. If recording to the
509 * internal buffer, the size of the internal buffer is
510 * returned. If recording to PCI, the size of the PCI buffer
511 * is returned. Otherwise, 0 is returned.
513 * @return error if one of the following holds:
514 * - the version wasn't set
515 * Otherwise, returns ok.
517 enum dbg_status ecore_dbg_bus_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
518 struct ecore_ptt *p_ptt,
519 u32 *buf_size);
522 * @brief ecore_dbg_bus_dump - Dumps the recorded Debug Bus data into the
523 * specified buffer.
525 * The dumped data starts with a header. If recording to NW, only a header is
526 * dumped. The dumped size is assigned to num_dumped_dwords.
528 * @param p_hwfn - HW device data
529 * @param p_ptt - Ptt window used for writing the registers.
530 * @param dump_buf - Pointer to copy the recorded data into.
531 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
532 * @param num_dumped_dwords - OUT: number of dumped dwords.
534 * @return error if one of the following holds:
535 * - a recording wasn't started/stopped
536 * - the specified dump buffer is too small
537 * Otherwise, returns ok.
539 enum dbg_status ecore_dbg_bus_dump(struct ecore_hwfn *p_hwfn,
540 struct ecore_ptt *p_ptt,
541 u32 *dump_buf,
542 u32 buf_size_in_dwords,
543 u32 *num_dumped_dwords);
546 * @brief ecore_dbg_grc_config - Sets the value of a GRC parameter.
548 * @param p_hwfn - HW device data
549 * @param grc_param - GRC parameter
550 * @param val - Value to set.
552 * @return error if one of the following holds:
553 * - the version wasn't set
554 * - grc_param is invalid
555 * - val is outside the allowed boundaries
557 enum dbg_status ecore_dbg_grc_config(struct ecore_hwfn *p_hwfn,
558 enum dbg_grc_params grc_param,
559 u32 val);
562 * @brief ecore_dbg_grc_set_params_default - Reverts all GRC parameters to their
563 * default value.
565 * @param p_hwfn - HW device data
567 void ecore_dbg_grc_set_params_default(struct ecore_hwfn *p_hwfn);
570 * @brief ecore_dbg_grc_get_dump_buf_size - Returns the required buffer size
571 * for GRC Dump.
573 * @param p_hwfn - HW device data
574 * @param p_ptt - Ptt window used for writing the registers.
575 * @param buf_size - OUT: required buffer size (in dwords) for GRC Dump data.
577 * @return error if one of the following holds:
578 * - the version wasn't set
579 * Otherwise, returns ok.
581 enum dbg_status ecore_dbg_grc_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
582 struct ecore_ptt *p_ptt,
583 u32 *buf_size);
586 * @brief ecore_dbg_grc_dump - Dumps GRC data into the specified buffer.
588 * @param p_hwfn - HW device data
589 * @param p_ptt - Ptt window used for writing the registers.
590 * @param dump_buf - Pointer to write the collected GRC data into.
591 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
592 * @param num_dumped_dwords - OUT: number of dumped dwords.
594 * @return error if one of the following holds:
595 * - the version wasn't set
596 * - the specified dump buffer is too small
597 * Otherwise, returns ok.
599 enum dbg_status ecore_dbg_grc_dump(struct ecore_hwfn *p_hwfn,
600 struct ecore_ptt *p_ptt,
601 u32 *dump_buf,
602 u32 buf_size_in_dwords,
603 u32 *num_dumped_dwords);
606 * @brief ecore_dbg_idle_chk_get_dump_buf_size - Returns the required buffer
607 * size for idle check results.
609 * @param p_hwfn - HW device data
610 * @param p_ptt - Ptt window used for writing the registers.
611 * @param buf_size - OUT: required buffer size (in dwords) for idle check data.
613 * @return error if one of the following holds:
614 * - the version wasn't set
615 * Otherwise, returns ok.
617 enum dbg_status ecore_dbg_idle_chk_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
618 struct ecore_ptt *p_ptt,
619 u32 *buf_size);
622 * @brief ecore_dbg_idle_chk_dump - Performs idle check and writes the results
623 * into the specified buffer.
625 * @param p_hwfn - HW device data
626 * @param p_ptt - Ptt window used for writing the registers.
627 * @param dump_buf - Pointer to write the idle check data into.
628 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
629 * @param num_dumped_dwords - OUT: number of dumped dwords.
631 * @return error if one of the following holds:
632 * - the version wasn't set
633 * - the specified buffer is too small
634 * Otherwise, returns ok.
636 enum dbg_status ecore_dbg_idle_chk_dump(struct ecore_hwfn *p_hwfn,
637 struct ecore_ptt *p_ptt,
638 u32 *dump_buf,
639 u32 buf_size_in_dwords,
640 u32 *num_dumped_dwords);
643 * @brief ecore_dbg_mcp_trace_get_dump_buf_size - Returns the required buffer
644 * size for mcp trace results.
646 * @param p_hwfn - HW device data
647 * @param p_ptt - Ptt window used for writing the registers.
648 * @param buf_size - OUT: required buffer size (in dwords) for mcp trace data.
650 * @return error if one of the following holds:
651 * - the version wasn't set
652 * - the trace data in MCP scratchpad contain an invalid signature
653 * - the bundle ID in NVRAM is invalid
654 * - the trace meta data cannot be found (in NVRAM or image file)
655 * Otherwise, returns ok.
657 enum dbg_status ecore_dbg_mcp_trace_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
658 struct ecore_ptt *p_ptt,
659 u32 *buf_size);
662 * @brief ecore_dbg_mcp_trace_dump - Performs mcp trace and writes the results
663 * into the specified buffer.
665 * @param p_hwfn - HW device data
666 * @param p_ptt - Ptt window used for writing the registers.
667 * @param dump_buf - Pointer to write the mcp trace data into.
668 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
669 * @param num_dumped_dwords - OUT: number of dumped dwords.
671 * @return error if one of the following holds:
672 * - the version wasn't set
673 * - the specified buffer is too small
674 * - the trace data in MCP scratchpad contain an invalid signature
675 * - the bundle ID in NVRAM is invalid
676 * - the trace meta data cannot be found (in NVRAM or image file)
677 * - the trace meta data cannot be read (from NVRAM or image file)
678 * Otherwise, returns ok.
680 enum dbg_status ecore_dbg_mcp_trace_dump(struct ecore_hwfn *p_hwfn,
681 struct ecore_ptt *p_ptt,
682 u32 *dump_buf,
683 u32 buf_size_in_dwords,
684 u32 *num_dumped_dwords);
687 * @brief ecore_dbg_reg_fifo_get_dump_buf_size - Returns the required buffer
688 * size for grc trace fifo results.
690 * @param p_hwfn - HW device data
691 * @param p_ptt - Ptt window used for writing the registers.
692 * @param buf_size - OUT: required buffer size (in dwords) for reg fifo data.
694 * @return error if one of the following holds:
695 * - the version wasn't set
696 * Otherwise, returns ok.
698 enum dbg_status ecore_dbg_reg_fifo_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
699 struct ecore_ptt *p_ptt,
700 u32 *buf_size);
703 * @brief ecore_dbg_reg_fifo_dump - Reads the reg fifo and writes the results
704 * into the specified buffer.
706 * @param p_hwfn - HW device data
707 * @param p_ptt - Ptt window used for writing the registers.
708 * @param dump_buf - Pointer to write the reg fifo data into.
709 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
710 * @param num_dumped_dwords - OUT: number of dumped dwords.
712 * @return error if one of the following holds:
713 * - the version wasn't set
714 * - the specified buffer is too small
715 * - DMAE transaction failed
716 * Otherwise, returns ok.
718 enum dbg_status ecore_dbg_reg_fifo_dump(struct ecore_hwfn *p_hwfn,
719 struct ecore_ptt *p_ptt,
720 u32 *dump_buf,
721 u32 buf_size_in_dwords,
722 u32 *num_dumped_dwords);
725 * @brief ecore_dbg_igu_fifo_get_dump_buf_size - Returns the required buffer
726 * size for the IGU fifo results.
728 * @param p_hwfn - HW device data
729 * @param p_ptt - Ptt window used for writing the registers.
730 * @param buf_size - OUT: required buffer size (in dwords) for IGU fifo data.
732 * @return error if one of the following holds:
733 * - the version wasn't set
734 * Otherwise, returns ok.
736 enum dbg_status ecore_dbg_igu_fifo_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
737 struct ecore_ptt *p_ptt,
738 u32 *buf_size);
741 * @brief ecore_dbg_igu_fifo_dump - Reads the IGU fifo and writes the results
742 * into the specified buffer.
744 * @param p_hwfn - HW device data
745 * @param p_ptt - Ptt window used for writing the registers.
746 * @param dump_buf - Pointer to write the IGU fifo data into.
747 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
748 * @param num_dumped_dwords - OUT: number of dumped dwords.
750 * @return error if one of the following holds:
751 * - the version wasn't set
752 * - the specified buffer is too small
753 * - DMAE transaction failed
754 * Otherwise, returns ok.
756 enum dbg_status ecore_dbg_igu_fifo_dump(struct ecore_hwfn *p_hwfn,
757 struct ecore_ptt *p_ptt,
758 u32 *dump_buf,
759 u32 buf_size_in_dwords,
760 u32 *num_dumped_dwords);
763 * @brief ecore_dbg_protection_override_get_dump_buf_size - Return the required
764 * buffer size for protection override window results.
766 * @param p_hwfn - HW device data
767 * @param p_ptt - Ptt window used for writing the registers.
768 * @param buf_size - OUT: required buffer size (in dwords) for protection
769 * override data.
771 * @return error if one of the following holds:
772 * - the version wasn't set
773 * Otherwise, returns ok.
775 enum dbg_status ecore_dbg_protection_override_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
776 struct ecore_ptt *p_ptt,
777 u32 *buf_size);
779 * @brief ecore_dbg_protection_override_dump - Reads protection override window
780 * entries and writes the results into the specified buffer.
782 * @param p_hwfn - HW device data
783 * @param p_ptt - Ptt window used for writing the registers.
784 * @param dump_buf - Pointer to write the protection override data
785 * into.
786 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
787 * @param num_dumped_dwords - OUT: number of dumped dwords.
789 * @return error if one of the following holds:
790 * - the version wasn't set
791 * - the specified buffer is too small
792 * - DMAE transaction failed
793 * Otherwise, returns ok.
795 enum dbg_status ecore_dbg_protection_override_dump(struct ecore_hwfn *p_hwfn,
796 struct ecore_ptt *p_ptt,
797 u32 *dump_buf,
798 u32 buf_size_in_dwords,
799 u32 *num_dumped_dwords);
802 * @brief ecore_dbg_fw_asserts_get_dump_buf_size - Returns the required buffer
803 * size for FW Asserts results.
805 * @param p_hwfn - HW device data
806 * @param p_ptt - Ptt window used for writing the registers.
807 * @param buf_size - OUT: required buffer size (in dwords) for FW Asserts data.
809 * @return error if one of the following holds:
810 * - the version wasn't set
811 * Otherwise, returns ok.
813 enum dbg_status ecore_dbg_fw_asserts_get_dump_buf_size(struct ecore_hwfn *p_hwfn,
814 struct ecore_ptt *p_ptt,
815 u32 *buf_size);
818 * @brief ecore_dbg_fw_asserts_dump - Reads the FW Asserts and writes the
819 * results into the specified buffer.
821 * @param p_hwfn - HW device data
822 * @param p_ptt - Ptt window used for writing the registers.
823 * @param dump_buf - Pointer to write the FW Asserts data into.
824 * @param buf_size_in_dwords - Size of the specified buffer in dwords.
825 * @param num_dumped_dwords - OUT: number of dumped dwords.
827 * @return error if one of the following holds:
828 * - the version wasn't set
829 * - the specified buffer is too small
830 * Otherwise, returns ok.
832 enum dbg_status ecore_dbg_fw_asserts_dump(struct ecore_hwfn *p_hwfn,
833 struct ecore_ptt *p_ptt,
834 u32 *dump_buf,
835 u32 buf_size_in_dwords,
836 u32 *num_dumped_dwords);
839 * @brief ecore_dbg_read_attn - Reads the attention registers of the specified
840 * block and type, and writes the results into the specified buffer.
842 * @param p_hwfn - HW device data
843 * @param p_ptt - Ptt window used for writing the registers.
844 * @param block - Block ID.
845 * @param attn_type - Attention type.
846 * @param clear_status - Indicates if the attention status should be cleared.
847 * @param results - OUT: Pointer to write the read results into
849 * @return error if one of the following holds:
850 * - the version wasn't set
851 * Otherwise, returns ok.
853 enum dbg_status ecore_dbg_read_attn(struct ecore_hwfn *p_hwfn,
854 struct ecore_ptt *p_ptt,
855 enum block_id block,
856 enum dbg_attn_type attn_type,
857 bool clear_status,
858 struct dbg_attn_block_result *results);
861 * @brief ecore_dbg_print_attn - Prints attention registers values in the
862 * specified results struct.
864 * @param p_hwfn - HW device data
865 * @param results - Pointer to the attention read results
867 * @return error if one of the following holds:
868 * - the version wasn't set
869 * Otherwise, returns ok.
871 enum dbg_status ecore_dbg_print_attn(struct ecore_hwfn *p_hwfn,
872 struct dbg_attn_block_result *results);
875 * @brief ecore_is_block_in_reset - Returns true if the specified block is in
876 * reset, false otherwise.
878 * @param p_hwfn - HW device data
879 * @param p_ptt - Ptt window used for writing the registers.
880 * @param block - Block ID.
882 * @return true if the specified block is in reset, false otherwise.
884 bool ecore_is_block_in_reset(struct ecore_hwfn *p_hwfn,
885 struct ecore_ptt *p_ptt,
886 enum block_id block);
889 #endif