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