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