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