net/qede/base: add selftest and query sensor info
[dpdk.git] / drivers / net / qede / base / ecore_mcp_api.h
1 /*
2  * Copyright (c) 2016 QLogic Corporation.
3  * All rights reserved.
4  * www.qlogic.com
5  *
6  * See LICENSE.qede_pmd for copyright and licensing details.
7  */
8
9 #ifndef __ECORE_MCP_API_H__
10 #define __ECORE_MCP_API_H__
11
12 #include "ecore_status.h"
13
14 struct ecore_mcp_link_speed_params {
15         bool autoneg;
16         u32 advertised_speeds; /* bitmask of DRV_SPEED_CAPABILITY */
17         u32 forced_speed; /* In Mb/s */
18 };
19
20 struct ecore_mcp_link_pause_params {
21         bool autoneg;
22         bool forced_rx;
23         bool forced_tx;
24 };
25
26 struct ecore_mcp_link_params {
27         struct ecore_mcp_link_speed_params speed;
28         struct ecore_mcp_link_pause_params pause;
29         u32 loopback_mode; /* in PMM_LOOPBACK values */
30 };
31
32 struct ecore_mcp_link_capabilities {
33         u32 speed_capabilities;
34 };
35
36 struct ecore_mcp_link_state {
37         bool link_up;
38
39         u32 line_speed; /* In Mb/s */
40         u32 min_pf_rate; /* In Mb/s */
41         u32 speed; /* In Mb/s */
42         bool full_duplex;
43
44         bool an;
45         bool an_complete;
46         bool parallel_detection;
47         bool pfc_enabled;
48
49 #define ECORE_LINK_PARTNER_SPEED_1G_HD  (1 << 0)
50 #define ECORE_LINK_PARTNER_SPEED_1G_FD  (1 << 1)
51 #define ECORE_LINK_PARTNER_SPEED_10G    (1 << 2)
52 #define ECORE_LINK_PARTNER_SPEED_20G    (1 << 3)
53 #define ECORE_LINK_PARTNER_SPEED_25G    (1 << 4)
54 #define ECORE_LINK_PARTNER_SPEED_40G    (1 << 5)
55 #define ECORE_LINK_PARTNER_SPEED_50G    (1 << 6)
56 #define ECORE_LINK_PARTNER_SPEED_100G   (1 << 7)
57         u32 partner_adv_speed;
58
59         bool partner_tx_flow_ctrl_en;
60         bool partner_rx_flow_ctrl_en;
61
62 #define ECORE_LINK_PARTNER_SYMMETRIC_PAUSE (1)
63 #define ECORE_LINK_PARTNER_ASYMMETRIC_PAUSE (2)
64 #define ECORE_LINK_PARTNER_BOTH_PAUSE (3)
65         u8 partner_adv_pause;
66
67         bool sfp_tx_fault;
68 };
69
70 struct ecore_mcp_function_info {
71         u8 pause_on_host;
72
73         enum ecore_pci_personality protocol;
74
75         u8 bandwidth_min;
76         u8 bandwidth_max;
77
78         u8 mac[ETH_ALEN];
79
80         u64 wwn_port;
81         u64 wwn_node;
82
83 #define ECORE_MCP_VLAN_UNSET            (0xffff)
84         u16 ovlan;
85 };
86
87 struct ecore_mcp_nvm_common {
88         u32 offset;
89         u32 param;
90         u32 resp;
91         u32 cmd;
92 };
93
94 struct ecore_mcp_nvm_rd {
95         u32 *buf_size;
96         u32 *buf;
97 };
98
99 struct ecore_mcp_nvm_wr {
100         u32 buf_size;
101         u32 *buf;
102 };
103
104 struct ecore_mcp_nvm_params {
105 #define ECORE_MCP_CMD           (1 << 0)
106 #define ECORE_MCP_NVM_RD        (1 << 1)
107 #define ECORE_MCP_NVM_WR        (1 << 2)
108         u8 type;
109
110         struct ecore_mcp_nvm_common nvm_common;
111
112         union {
113                 struct ecore_mcp_nvm_rd nvm_rd;
114                 struct ecore_mcp_nvm_wr nvm_wr;
115         };
116 };
117
118 enum ecore_nvm_images {
119         ECORE_NVM_IMAGE_ISCSI_CFG,
120         ECORE_NVM_IMAGE_FCOE_CFG,
121 };
122
123 struct ecore_mcp_drv_version {
124         u32 version;
125         u8 name[MCP_DRV_VER_STR_SIZE - 4];
126 };
127
128 struct ecore_mcp_lan_stats {
129         u64 ucast_rx_pkts;
130         u64 ucast_tx_pkts;
131         u32 fcs_err;
132 };
133
134 #ifndef ECORE_PROTO_STATS
135 #define ECORE_PROTO_STATS
136
137 enum ecore_mcp_protocol_type {
138         ECORE_MCP_LAN_STATS,
139 };
140
141 union ecore_mcp_protocol_stats {
142         struct ecore_mcp_lan_stats lan_stats;
143 };
144 #endif
145
146 enum ecore_ov_config_method {
147         ECORE_OV_CONFIG_MTU,
148         ECORE_OV_CONFIG_MAC,
149         ECORE_OV_CONFIG_WOL
150 };
151
152 enum ecore_ov_client {
153         ECORE_OV_CLIENT_DRV,
154         ECORE_OV_CLIENT_USER
155 };
156
157 enum ecore_ov_driver_state {
158         ECORE_OV_DRIVER_STATE_NOT_LOADED,
159         ECORE_OV_DRIVER_STATE_DISABLED,
160         ECORE_OV_DRIVER_STATE_ACTIVE
161 };
162
163 #define ECORE_MAX_NPIV_ENTRIES 128
164 #define ECORE_WWN_SIZE 8
165 struct ecore_fc_npiv_tbl {
166         u32 count;
167         u8 wwpn[ECORE_MAX_NPIV_ENTRIES][ECORE_WWN_SIZE];
168         u8 wwnn[ECORE_MAX_NPIV_ENTRIES][ECORE_WWN_SIZE];
169 };
170
171 #ifndef __EXTRACT__LINUX__
172 enum ecore_led_mode {
173         ECORE_LED_MODE_OFF,
174         ECORE_LED_MODE_ON,
175         ECORE_LED_MODE_RESTORE
176 };
177 #endif
178
179 struct ecore_temperature_sensor {
180         u8 sensor_location;
181         u8 threshold_high;
182         u8 critical;
183         u8 current_temp;
184 };
185
186 #define ECORE_MAX_NUM_OF_SENSORS        7
187 struct ecore_temperature_info {
188         u32 num_sensors;
189         struct ecore_temperature_sensor sensors[ECORE_MAX_NUM_OF_SENSORS];
190 };
191
192 enum ecore_mba_img_idx {
193         ECORE_MBA_LEGACY_IDX,
194         ECORE_MBA_PCI3CLP_IDX,
195         ECORE_MBA_PCI3_IDX,
196         ECORE_MBA_FCODE_IDX,
197         ECORE_EFI_X86_IDX,
198         ECORE_EFI_IPF_IDX,
199         ECORE_EFI_EBC_IDX,
200         ECORE_EFI_X64_IDX,
201         ECORE_MAX_NUM_OF_ROMIMG
202 };
203
204 struct ecore_mba_vers {
205         u32 mba_vers[ECORE_MAX_NUM_OF_ROMIMG];
206 };
207
208 /**
209  * @brief - returns the link params of the hw function
210  *
211  * @param p_hwfn
212  *
213  * @returns pointer to link params
214  */
215 struct ecore_mcp_link_params *ecore_mcp_get_link_params(struct ecore_hwfn *);
216
217 /**
218  * @brief - return the link state of the hw function
219  *
220  * @param p_hwfn
221  *
222  * @returns pointer to link state
223  */
224 struct ecore_mcp_link_state *ecore_mcp_get_link_state(struct ecore_hwfn *);
225
226 /**
227  * @brief - return the link capabilities of the hw function
228  *
229  * @param p_hwfn
230  *
231  * @returns pointer to link capabilities
232  */
233 struct ecore_mcp_link_capabilities
234 *ecore_mcp_get_link_capabilities(struct ecore_hwfn *p_hwfn);
235
236 /**
237  * @brief Request the MFW to set the the link according to 'link_input'.
238  *
239  * @param p_hwfn
240  * @param p_ptt
241  * @param b_up - raise link if `true'. Reset link if `false'.
242  *
243  * @return enum _ecore_status_t
244  */
245 enum _ecore_status_t ecore_mcp_set_link(struct ecore_hwfn *p_hwfn,
246                                         struct ecore_ptt *p_ptt, bool b_up);
247
248 /**
249  * @brief Get the management firmware version value
250  *
251  * @param p_dev       - ecore dev pointer
252  * @param p_ptt
253  * @param p_mfw_ver    - mfw version value
254  * @param p_running_bundle_id   - image id in nvram; Optional.
255  *
256  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
257  */
258 enum _ecore_status_t ecore_mcp_get_mfw_ver(struct ecore_dev *p_dev,
259                                            struct ecore_ptt *p_ptt,
260                                            u32 *p_mfw_ver,
261                                            u32 *p_running_bundle_id);
262
263 /**
264  * @brief Get media type value of the port.
265  *
266  * @param p_dev      - ecore dev pointer
267  * @param mfw_ver    - media type value
268  *
269  * @return enum _ecore_status_t -
270  *      ECORE_SUCCESS - Operation was successful.
271  *      ECORE_BUSY - Operation failed
272  */
273 enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_dev *p_dev,
274                                            u32 *media_type);
275
276 /**
277  * @brief - Sends a command to the MCP mailbox.
278  *
279  * @param p_hwfn      - hw function
280  * @param p_ptt       - PTT required for register access
281  * @param cmd         - command to be sent to the MCP
282  * @param param       - optional param
283  * @param o_mcp_resp  - the MCP response code (exclude sequence)
284  * @param o_mcp_param - optional parameter provided by the MCP response
285  *
286  * @return enum _ecore_status_t -
287  *      ECORE_SUCCESS - operation was successful
288  *      ECORE_BUSY    - operation failed
289  */
290 enum _ecore_status_t ecore_mcp_cmd(struct ecore_hwfn *p_hwfn,
291                                    struct ecore_ptt *p_ptt, u32 cmd, u32 param,
292                                    u32 *o_mcp_resp, u32 *o_mcp_param);
293
294 /**
295  * @brief - drains the nig, allowing completion to pass in case of pauses.
296  *          (Should be called only from sleepable context)
297  *
298  * @param p_hwfn
299  * @param p_ptt
300  */
301 enum _ecore_status_t ecore_mcp_drain(struct ecore_hwfn *p_hwfn,
302                                      struct ecore_ptt *p_ptt);
303
304 /**
305  * @brief - return the mcp function info of the hw function
306  *
307  * @param p_hwfn
308  *
309  * @returns pointer to mcp function info
310  */
311 const struct ecore_mcp_function_info
312 *ecore_mcp_get_function_info(struct ecore_hwfn *p_hwfn);
313
314 /**
315  * @brief - Function for reading/manipulating the nvram. Following are supported
316  *          functionalities.
317  *          1. Read: Read the specified nvram offset.
318  *             input values:
319  *               type   - ECORE_MCP_NVM_RD
320  *               cmd    - command code (e.g. DRV_MSG_CODE_NVM_READ_NVRAM)
321  *               offset - nvm offset
322  *
323  *             output values:
324  *               buf      - buffer
325  *               buf_size - buffer size
326  *
327  *          2. Write: Write the data at the specified nvram offset
328  *             input values:
329  *               type     - ECORE_MCP_NVM_WR
330  *               cmd      - command code (e.g. DRV_MSG_CODE_NVM_WRITE_NVRAM)
331  *               offset   - nvm offset
332  *               buf      - buffer
333  *               buf_size - buffer size
334  *
335  *          3. Command: Send the NVM command to MCP.
336  *             input values:
337  *               type   - ECORE_MCP_CMD
338  *               cmd    - command code (e.g. DRV_MSG_CODE_NVM_DEL_FILE)
339  *               offset - nvm offset
340  *
341  *
342  * @param p_hwfn
343  * @param p_ptt
344  * @param params
345  *
346  * @return ECORE_SUCCESS - operation was successful.
347  */
348 enum _ecore_status_t ecore_mcp_nvm_command(struct ecore_hwfn *p_hwfn,
349                                            struct ecore_ptt *p_ptt,
350                                            struct ecore_mcp_nvm_params *params);
351
352 /**
353  * @brief - count number of function with a matching personality on engine.
354  *
355  * @param p_hwfn
356  * @param p_ptt
357  * @param personalities - a bitmask of ecore_pci_personality values
358  *
359  * @returns the count of all devices on engine whose personality match one of
360  *          the bitsmasks.
361  */
362 int ecore_mcp_get_personality_cnt(struct ecore_hwfn *p_hwfn,
363                                   struct ecore_ptt *p_ptt, u32 personalities);
364
365 /**
366  * @brief Get the flash size value
367  *
368  * @param p_hwfn
369  * @param p_ptt
370  * @param p_flash_size  - flash size in bytes to be filled.
371  *
372  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
373  */
374 enum _ecore_status_t ecore_mcp_get_flash_size(struct ecore_hwfn *p_hwfn,
375                                               struct ecore_ptt *p_ptt,
376                                               u32 *p_flash_size);
377
378 /**
379  * @brief Send driver version to MFW
380  *
381  * @param p_hwfn
382  * @param p_ptt
383  * @param version - Version value
384  * @param name - Protocol driver name
385  *
386  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
387  */
388 enum _ecore_status_t
389 ecore_mcp_send_drv_version(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
390                            struct ecore_mcp_drv_version *p_ver);
391
392 /**
393  * @brief Read the MFW process kill counter
394  *
395  * @param p_hwfn
396  * @param p_ptt
397  *
398  * @return u32
399  */
400 u32 ecore_get_process_kill_counter(struct ecore_hwfn *p_hwfn,
401                                    struct ecore_ptt *p_ptt);
402
403 /**
404  * @brief Trigger a recovery process
405  *
406  *  @param p_hwfn
407  *  @param p_ptt
408  *
409  * @return enum _ecore_status_t
410  */
411 enum _ecore_status_t ecore_start_recovery_process(struct ecore_hwfn *p_hwfn,
412                                                   struct ecore_ptt *p_ptt);
413
414 /**
415  * @brief Notify MFW about the change in base device properties
416  *
417  *  @param p_hwfn
418  *  @param p_ptt
419  *  @param config - Configuation that has been updated
420  *  @param client - ecore client type
421  *
422  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
423  */
424 enum _ecore_status_t
425 ecore_mcp_ov_update_current_config(struct ecore_hwfn *p_hwfn,
426                                    struct ecore_ptt *p_ptt,
427                                    enum ecore_ov_config_method config,
428                                    enum ecore_ov_client client);
429
430 /**
431  * @brief Notify MFW about the driver state
432  *
433  *  @param p_hwfn
434  *  @param p_ptt
435  *  @param drv_state - Driver state
436  *
437  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
438  */
439 enum _ecore_status_t
440 ecore_mcp_ov_update_driver_state(struct ecore_hwfn *p_hwfn,
441                                  struct ecore_ptt *p_ptt,
442                                  enum ecore_ov_driver_state drv_state);
443
444 /**
445  * @brief Read NPIV settings form the MFW
446  *
447  *  @param p_hwfn
448  *  @param p_ptt
449  *  @param p_table - Array to hold the FC NPIV data. Client need allocate the
450  *                   required buffer. The field 'count' specifies number of NPIV
451  *                   entries. A value of 0 means the table was not populated.
452  *
453  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
454  */
455 enum _ecore_status_t
456 ecore_mcp_ov_get_fc_npiv(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
457                          struct ecore_fc_npiv_tbl *p_table);
458
459 /**
460  * @brief Send MTU size to MFW
461  *
462  *  @param p_hwfn
463  *  @param p_ptt
464  *  @param mtu - MTU size
465  *
466  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
467  */
468 enum _ecore_status_t ecore_mcp_ov_update_mtu(struct ecore_hwfn *p_hwfn,
469                                              struct ecore_ptt *p_ptt, u16 mtu);
470
471 /**
472  * @brief Set LED status
473  *
474  *  @param p_hwfn
475  *  @param p_ptt
476  *  @param mode - LED mode
477  *
478  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
479  */
480 enum _ecore_status_t ecore_mcp_set_led(struct ecore_hwfn *p_hwfn,
481                                        struct ecore_ptt *p_ptt,
482                                        enum ecore_led_mode mode);
483
484 /**
485  * @brief Set secure mode
486  *
487  *  @param p_dev
488  *  @param addr - nvm offset
489  *
490  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
491  */
492 enum _ecore_status_t ecore_mcp_nvm_set_secure_mode(struct ecore_dev *p_dev,
493                                                    u32 addr);
494
495 /**
496  * @brief Write to phy
497  *
498  *  @param p_dev
499  *  @param addr - nvm offset
500  *  @param cmd - nvm command
501  *  @param p_buf - nvm write buffer
502  *  @param len - buffer len
503  *
504  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
505  */
506 enum _ecore_status_t ecore_mcp_phy_write(struct ecore_dev *p_dev, u32 cmd,
507                                          u32 addr, u8 *p_buf, u32 len);
508
509 /**
510  * @brief Write to nvm
511  *
512  *  @param p_dev
513  *  @param addr - nvm offset
514  *  @param cmd - nvm command
515  *  @param p_buf - nvm write buffer
516  *  @param len - buffer len
517  *
518  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
519  */
520 enum _ecore_status_t ecore_mcp_nvm_write(struct ecore_dev *p_dev, u32 cmd,
521                                          u32 addr, u8 *p_buf, u32 len);
522
523 /**
524  * @brief Put file begin
525  *
526  *  @param p_dev
527  *  @param addr - nvm offset
528  *
529  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
530  */
531 enum _ecore_status_t ecore_mcp_nvm_put_file_begin(struct ecore_dev *p_dev,
532                                                   u32 addr);
533
534 /**
535  * @brief Delete file
536  *
537  *  @param p_dev
538  *  @param addr - nvm offset
539  *
540  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
541  */
542 enum _ecore_status_t ecore_mcp_nvm_del_file(struct ecore_dev *p_dev, u32 addr);
543
544 /**
545  * @brief Check latest response
546  *
547  *  @param p_dev
548  *  @param p_buf - nvm write buffer
549  *
550  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
551  */
552 enum _ecore_status_t ecore_mcp_nvm_resp(struct ecore_dev *p_dev, u8 *p_buf);
553
554 /**
555  * @brief Read from phy
556  *
557  *  @param p_dev
558  *  @param addr - nvm offset
559  *  @param cmd - nvm command
560  *  @param p_buf - nvm write buffer
561  *  @param len - buffer len
562  *
563  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
564  */
565 enum _ecore_status_t ecore_mcp_phy_read(struct ecore_dev *p_dev, u32 cmd,
566                                         u32 addr, u8 *p_buf, u32 len);
567
568 /**
569  * @brief Read from nvm
570  *
571  *  @param p_dev
572  *  @param addr - nvm offset
573  *  @param p_buf - nvm write buffer
574  *  @param len - buffer len
575  *
576  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
577  */
578 enum _ecore_status_t ecore_mcp_nvm_read(struct ecore_dev *p_dev, u32 addr,
579                            u8 *p_buf, u32 len);
580
581 /**
582  * @brief Read from sfp
583  *
584  *  @param p_hwfn - hw function
585  *  @param p_ptt  - PTT required for register access
586  *  @param port   - transceiver port
587  *  @param addr   - I2C address
588  *  @param offset - offset in sfp
589  *  @param len    - buffer length
590  *  @param p_buf  - buffer to read into
591  *
592  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
593  */
594 enum _ecore_status_t ecore_mcp_phy_sfp_read(struct ecore_hwfn *p_hwfn,
595                                             struct ecore_ptt *p_ptt,
596                                             u32 port, u32 addr, u32 offset,
597                                             u32 len, u8 *p_buf);
598
599 /**
600  * @brief Write to sfp
601  *
602  *  @param p_hwfn - hw function
603  *  @param p_ptt  - PTT required for register access
604  *  @param port   - transceiver port
605  *  @param addr   - I2C address
606  *  @param offset - offset in sfp
607  *  @param len    - buffer length
608  *  @param p_buf  - buffer to write from
609  *
610  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
611  */
612 enum _ecore_status_t ecore_mcp_phy_sfp_write(struct ecore_hwfn *p_hwfn,
613                                              struct ecore_ptt *p_ptt,
614                                              u32 port, u32 addr, u32 offset,
615                                              u32 len, u8 *p_buf);
616
617 /**
618  * @brief Gpio read
619  *
620  *  @param p_hwfn    - hw function
621  *  @param p_ptt     - PTT required for register access
622  *  @param gpio      - gpio number
623  *  @param gpio_val  - value read from gpio
624  *
625  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
626  */
627 enum _ecore_status_t ecore_mcp_gpio_read(struct ecore_hwfn *p_hwfn,
628                                          struct ecore_ptt *p_ptt,
629                                          u16 gpio, u32 *gpio_val);
630
631 /**
632  * @brief Gpio write
633  *
634  *  @param p_hwfn    - hw function
635  *  @param p_ptt     - PTT required for register access
636  *  @param gpio      - gpio number
637  *  @param gpio_val  - value to write to gpio
638  *
639  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
640  */
641 enum _ecore_status_t ecore_mcp_gpio_write(struct ecore_hwfn *p_hwfn,
642                                           struct ecore_ptt *p_ptt,
643                                           u16 gpio, u16 gpio_val);
644 /**
645  * @brief Gpio get information
646  *
647  *  @param p_hwfn          - hw function
648  *  @param p_ptt           - PTT required for register access
649  *  @param gpio            - gpio number
650  *  @param gpio_direction  - gpio is output (0) or input (1)
651  *  @param gpio_ctrl       - gpio control is uninitialized (0),
652  *                         path 0 (1), path 1 (2) or shared(3)
653  *
654  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
655  */
656 enum _ecore_status_t ecore_mcp_gpio_info(struct ecore_hwfn *p_hwfn,
657                                          struct ecore_ptt *p_ptt,
658                                          u16 gpio, u32 *gpio_direction,
659                                          u32 *gpio_ctrl);
660
661 /**
662  * @brief Bist register test
663  *
664  *  @param p_hwfn    - hw function
665  *  @param p_ptt     - PTT required for register access
666  *
667  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
668  */
669 enum _ecore_status_t ecore_mcp_bist_register_test(struct ecore_hwfn *p_hwfn,
670                                                    struct ecore_ptt *p_ptt);
671
672 /**
673  * @brief Bist clock test
674  *
675  *  @param p_hwfn    - hw function
676  *  @param p_ptt     - PTT required for register access
677  *
678  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
679  */
680 enum _ecore_status_t ecore_mcp_bist_clock_test(struct ecore_hwfn *p_hwfn,
681                                                 struct ecore_ptt *p_ptt);
682
683 /**
684  * @brief Bist nvm test - get number of images
685  *
686  *  @param p_hwfn       - hw function
687  *  @param p_ptt        - PTT required for register access
688  *  @param num_images   - number of images if operation was
689  *                        successful. 0 if not.
690  *
691  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
692  */
693 enum _ecore_status_t
694 ecore_mcp_bist_nvm_test_get_num_images(struct ecore_hwfn *p_hwfn,
695                                        struct ecore_ptt *p_ptt,
696                                        u32 *num_images);
697
698 /**
699  * @brief Bist nvm test - get image attributes by index
700  *
701  *  @param p_hwfn      - hw function
702  *  @param p_ptt       - PTT required for register access
703  *  @param p_image_att - Attributes of image
704  *  @param image_index - Index of image to get information for
705  *
706  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
707  */
708 enum _ecore_status_t
709 ecore_mcp_bist_nvm_test_get_image_att(struct ecore_hwfn *p_hwfn,
710                                       struct ecore_ptt *p_ptt,
711                                       struct bist_nvm_image_att *p_image_att,
712                                       u32 image_index);
713
714 /**
715  * @brief ecore_mcp_get_temperature_info - get the status of the temperature
716  *                                         sensors
717  *
718  *  @param p_hwfn        - hw function
719  *  @param p_ptt         - PTT required for register access
720  *  @param p_temp_status - A pointer to an ecore_temperature_info structure to
721  *                         be filled with the temperature data
722  *
723  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
724  */
725 enum _ecore_status_t
726 ecore_mcp_get_temperature_info(struct ecore_hwfn *p_hwfn,
727                                struct ecore_ptt *p_ptt,
728                                struct ecore_temperature_info *p_temp_info);
729 /**
730  * @brief Get MBA versions - get MBA sub images versions
731  *
732  *  @param p_hwfn      - hw function
733  *  @param p_ptt       - PTT required for register access
734  *  @param p_mba_vers  - MBA versions array to fill
735  *
736  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
737  */
738 enum _ecore_status_t ecore_mcp_get_mba_versions(
739         struct ecore_hwfn *p_hwfn,
740         struct ecore_ptt *p_ptt,
741         struct ecore_mba_vers *p_mba_vers);
742
743 /**
744  * @brief Count memory ecc events
745  *
746  *  @param p_hwfn      - hw function
747  *  @param p_ptt       - PTT required for register access
748  *  @param num_events  - number of memory ecc events
749  *
750  * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
751  */
752 enum _ecore_status_t ecore_mcp_mem_ecc_events(struct ecore_hwfn *p_hwfn,
753                                               struct ecore_ptt *p_ptt,
754                                               u64 *num_events);
755
756 /**
757  * @brief Sets whether a critical error notification from the MFW is acked, or
758  *        is it being ignored and thus allowing the MFW crash dump.
759  *
760  * @param p_dev
761  * @param mdump_enable
762  *
763  */
764 void ecore_mcp_mdump_enable(struct ecore_dev *p_dev, bool mdump_enable);
765
766 #endif