1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2016 - 2018 Cavium Inc.
7 #ifndef __ECORE_MCP_API_H__
8 #define __ECORE_MCP_API_H__
10 #include "ecore_status.h"
12 struct ecore_mcp_link_speed_params {
14 u32 advertised_speeds; /* bitmask of DRV_SPEED_CAPABILITY */
15 u32 forced_speed; /* In Mb/s */
18 struct ecore_mcp_link_pause_params {
24 enum ecore_mcp_eee_mode {
25 ECORE_MCP_EEE_DISABLED,
26 ECORE_MCP_EEE_ENABLED,
27 ECORE_MCP_EEE_UNSUPPORTED
30 struct ecore_link_eee_params {
32 #define ECORE_EEE_1G_ADV (1 << 0)
33 #define ECORE_EEE_10G_ADV (1 << 1)
34 /* Capabilities are represented using ECORE_EEE_*_ADV values */
41 struct ecore_mcp_link_params {
42 struct ecore_mcp_link_speed_params speed;
43 struct ecore_mcp_link_pause_params pause;
44 u32 loopback_mode; /* in PMM_LOOPBACK values */
45 struct ecore_link_eee_params eee;
48 struct ecore_mcp_link_capabilities {
49 u32 speed_capabilities;
50 bool default_speed_autoneg; /* In Mb/s */
51 u32 default_speed; /* In Mb/s */
52 enum ecore_mcp_eee_mode default_eee;
57 struct ecore_mcp_link_state {
60 u32 min_pf_rate; /* In Mb/s */
62 /* Actual link speed in Mb/s */
65 /* PF max speed in MB/s, deduced from line_speed
66 * according to PF max bandwidth configuration.
73 bool parallel_detection;
76 #define ECORE_LINK_PARTNER_SPEED_1G_HD (1 << 0)
77 #define ECORE_LINK_PARTNER_SPEED_1G_FD (1 << 1)
78 #define ECORE_LINK_PARTNER_SPEED_10G (1 << 2)
79 #define ECORE_LINK_PARTNER_SPEED_20G (1 << 3)
80 #define ECORE_LINK_PARTNER_SPEED_25G (1 << 4)
81 #define ECORE_LINK_PARTNER_SPEED_40G (1 << 5)
82 #define ECORE_LINK_PARTNER_SPEED_50G (1 << 6)
83 #define ECORE_LINK_PARTNER_SPEED_100G (1 << 7)
84 u32 partner_adv_speed;
86 bool partner_tx_flow_ctrl_en;
87 bool partner_rx_flow_ctrl_en;
89 #define ECORE_LINK_PARTNER_SYMMETRIC_PAUSE (1)
90 #define ECORE_LINK_PARTNER_ASYMMETRIC_PAUSE (2)
91 #define ECORE_LINK_PARTNER_BOTH_PAUSE (3)
101 struct ecore_mcp_function_info {
104 enum ecore_pci_personality protocol;
114 #define ECORE_MCP_VLAN_UNSET (0xffff)
120 #ifndef __EXTRACT__LINUX__
121 enum ecore_nvm_images {
122 ECORE_NVM_IMAGE_ISCSI_CFG,
123 ECORE_NVM_IMAGE_FCOE_CFG,
127 struct ecore_mcp_drv_version {
129 u8 name[MCP_DRV_VER_STR_SIZE - 4];
132 struct ecore_mcp_lan_stats {
138 #ifndef ECORE_PROTO_STATS
139 #define ECORE_PROTO_STATS
140 struct ecore_mcp_fcoe_stats {
147 struct ecore_mcp_iscsi_stats {
154 struct ecore_mcp_rdma_stats {
161 enum ecore_mcp_protocol_type {
163 ECORE_MCP_FCOE_STATS,
164 ECORE_MCP_ISCSI_STATS,
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;
176 enum ecore_ov_client {
178 ECORE_OV_CLIENT_USER,
179 ECORE_OV_CLIENT_VENDOR_SPEC
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
188 #define ECORE_MAX_NPIV_ENTRIES 128
189 #define ECORE_WWN_SIZE 8
190 struct ecore_fc_npiv_tbl {
192 u8 wwpn[ECORE_MAX_NPIV_ENTRIES][ECORE_WWN_SIZE];
193 u8 wwnn[ECORE_MAX_NPIV_ENTRIES][ECORE_WWN_SIZE];
196 #ifndef __EXTRACT__LINUX__
197 enum ecore_led_mode {
200 ECORE_LED_MODE_RESTORE
204 struct ecore_temperature_sensor {
211 #define ECORE_MAX_NUM_OF_SENSORS 7
212 struct ecore_temperature_info {
214 struct ecore_temperature_sensor sensors[ECORE_MAX_NUM_OF_SENSORS];
217 enum ecore_mba_img_idx {
218 ECORE_MBA_LEGACY_IDX,
219 ECORE_MBA_PCI3CLP_IDX,
226 ECORE_MAX_NUM_OF_ROMIMG
229 struct ecore_mba_vers {
230 u32 mba_vers[ECORE_MAX_NUM_OF_ROMIMG];
233 enum ecore_mfw_tlv_type {
234 ECORE_MFW_TLV_GENERIC = 0x1, /* Core driver TLVs */
235 ECORE_MFW_TLV_ETH = 0x2, /* L2 driver TLVs */
236 ECORE_MFW_TLV_FCOE = 0x4, /* FCoE protocol TLVs */
237 ECORE_MFW_TLV_ISCSI = 0x8, /* SCSI protocol TLVs */
238 ECORE_MFW_TLV_MAX = 0x16,
241 struct ecore_mfw_tlv_generic {
247 bool additional_mac1_set;
249 bool additional_mac2_set;
253 bool pxe_progress_set;
264 struct ecore_mfw_tlv_eth {
266 bool lso_maxoff_size_set;
268 bool lso_minseg_size_set;
272 bool tx_descr_size_set;
274 bool rx_descr_size_set;
278 bool tcp4_offloads_set;
280 bool tcp6_offloads_set;
282 bool tx_descr_qdepth_set;
284 bool rx_descr_qdepth_set;
286 bool iov_offload_set;
292 bool num_txqs_full_set;
294 bool num_rxqs_full_set;
297 struct ecore_mfw_tlv_fcoe {
299 bool scsi_timeout_set;
313 bool num_npiv_ids_set;
315 bool switch_name_set;
317 bool switch_portnum_set;
319 bool switch_portid_set;
321 bool vendor_name_set;
323 bool switch_model_set;
324 u8 switch_fw_version[8];
325 bool switch_fw_version_set;
332 u16 fip_tx_descr_size;
333 bool fip_tx_descr_size_set;
334 u16 fip_rx_descr_size;
335 bool fip_rx_descr_size_set;
337 bool link_failures_set;
338 u8 fcoe_boot_progress;
339 bool fcoe_boot_progress_set;
345 bool fcoe_txq_depth_set;
347 bool fcoe_rxq_depth_set;
349 bool fcoe_rx_frames_set;
351 bool fcoe_rx_bytes_set;
353 bool fcoe_tx_frames_set;
355 bool fcoe_tx_bytes_set;
358 u32 crc_err_src_fcid[5];
359 bool crc_err_src_fcid_set[5];
360 u8 crc_err_tstamp[5][14];
361 bool crc_err_tstamp_set[5];
367 bool primtive_err_set;
369 bool disparity_err_set;
370 u16 code_violation_err;
371 bool code_violation_err_set;
373 bool flogi_param_set[4];
375 bool flogi_tstamp_set;
376 u32 flogi_acc_param[4];
377 bool flogi_acc_param_set[4];
378 u8 flogi_acc_tstamp[14];
379 bool flogi_acc_tstamp_set;
382 u8 flogi_rjt_tstamp[14];
383 bool flogi_rjt_tstamp_set;
396 u32 plogi_dst_fcid[5];
397 bool plogi_dst_fcid_set[5];
398 u8 plogi_tstamp[5][14];
399 bool plogi_tstamp_set[5];
400 u32 plogi_acc_src_fcid[5];
401 bool plogi_acc_src_fcid_set[5];
402 u8 plogi_acc_tstamp[5][14];
403 bool plogi_acc_tstamp_set[5];
410 u32 plogo_src_fcid[5];
411 bool plogo_src_fcid_set[5];
412 u8 plogo_tstamp[5][14];
413 bool plogo_tstamp_set[5];
425 bool rx_abts_acc_set;
427 bool rx_abts_rjt_set;
428 u32 abts_dst_fcid[5];
429 bool abts_dst_fcid_set[5];
430 u8 abts_tstamp[5][14];
431 bool abts_tstamp_set[5];
434 u32 rx_rscn_nport[4];
435 bool rx_rscn_nport_set[4];
439 bool abort_task_sets_set;
463 bool scsi_cond_met_set;
468 u8 scsi_inter_cond_met;
469 bool scsi_inter_cond_met_set;
470 u8 scsi_rsv_conflicts;
471 bool scsi_rsv_conflicts_set;
473 bool scsi_tsk_full_set;
475 bool scsi_aca_active_set;
477 bool scsi_tsk_abort_set;
479 bool scsi_rx_chk_set[5];
480 u8 scsi_chk_tstamp[5][14];
481 bool scsi_chk_tstamp_set[5];
484 struct ecore_mfw_tlv_iscsi {
486 bool target_llmnr_set;
488 bool header_digest_set;
490 bool data_digest_set;
492 bool auth_method_set;
493 u16 boot_taget_portal;
494 bool boot_taget_portal_set;
498 bool tx_desc_size_set;
500 bool rx_desc_size_set;
502 bool boot_progress_set;
504 bool tx_desc_qdepth_set;
506 bool rx_desc_qdepth_set;
517 union ecore_mfw_tlv_data {
518 struct ecore_mfw_tlv_generic generic;
519 struct ecore_mfw_tlv_eth eth;
520 struct ecore_mfw_tlv_fcoe fcoe;
521 struct ecore_mfw_tlv_iscsi iscsi;
525 * @brief - returns the link params of the hw function
529 * @returns pointer to link params
531 struct ecore_mcp_link_params *ecore_mcp_get_link_params(struct ecore_hwfn *);
534 * @brief - return the link state of the hw function
538 * @returns pointer to link state
540 struct ecore_mcp_link_state *ecore_mcp_get_link_state(struct ecore_hwfn *);
543 * @brief - return the link capabilities of the hw function
547 * @returns pointer to link capabilities
549 struct ecore_mcp_link_capabilities
550 *ecore_mcp_get_link_capabilities(struct ecore_hwfn *p_hwfn);
553 * @brief Request the MFW to set the link according to 'link_input'.
557 * @param b_up - raise link if `true'. Reset link if `false'.
559 * @return enum _ecore_status_t
561 enum _ecore_status_t ecore_mcp_set_link(struct ecore_hwfn *p_hwfn,
562 struct ecore_ptt *p_ptt,
566 * @brief Get the management firmware version value
570 * @param p_mfw_ver - mfw version value
571 * @param p_running_bundle_id - image id in nvram; Optional.
573 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
575 enum _ecore_status_t ecore_mcp_get_mfw_ver(struct ecore_hwfn *p_hwfn,
576 struct ecore_ptt *p_ptt,
578 u32 *p_running_bundle_id);
581 * @brief Get media type value of the port.
583 * @param p_dev - ecore dev pointer
585 * @param mfw_ver - media type value
587 * @return enum _ecore_status_t -
588 * ECORE_SUCCESS - Operation was successful.
589 * ECORE_BUSY - Operation failed
591 enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_hwfn *p_hwfn,
592 struct ecore_ptt *p_ptt,
596 * @brief Get transceiver data of the port.
598 * @param p_dev - ecore dev pointer
600 * @param p_transceiver_type - media type value
602 * @return enum _ecore_status_t -
603 * ECORE_SUCCESS - Operation was successful.
604 * ECORE_BUSY - Operation failed
606 enum _ecore_status_t ecore_mcp_get_transceiver_data(struct ecore_hwfn *p_hwfn,
607 struct ecore_ptt *p_ptt,
608 u32 *p_tranceiver_type);
611 * @brief Get transceiver supported speed mask.
613 * @param p_dev - ecore dev pointer
615 * @param p_speed_mask - Bit mask of all supported speeds.
617 * @return enum _ecore_status_t -
618 * ECORE_SUCCESS - Operation was successful.
619 * ECORE_BUSY - Operation failed
622 enum _ecore_status_t ecore_mcp_trans_speed_mask(struct ecore_hwfn *p_hwfn,
623 struct ecore_ptt *p_ptt,
627 * @brief Get board configuration.
629 * @param p_dev - ecore dev pointer
631 * @param p_board_config - Board config.
633 * @return enum _ecore_status_t -
634 * ECORE_SUCCESS - Operation was successful.
635 * ECORE_BUSY - Operation failed
637 enum _ecore_status_t ecore_mcp_get_board_config(struct ecore_hwfn *p_hwfn,
638 struct ecore_ptt *p_ptt,
639 u32 *p_board_config);
642 * @brief - Sends a command to the MCP mailbox.
644 * @param p_hwfn - hw function
645 * @param p_ptt - PTT required for register access
646 * @param cmd - command to be sent to the MCP
647 * @param param - Optional param
648 * @param o_mcp_resp - The MCP response code (exclude sequence)
649 * @param o_mcp_param - Optional parameter provided by the MCP response
651 * @return enum _ecore_status_t -
652 * ECORE_SUCCESS - operation was successful
653 * ECORE_BUSY - operation failed
655 enum _ecore_status_t ecore_mcp_cmd(struct ecore_hwfn *p_hwfn,
656 struct ecore_ptt *p_ptt, u32 cmd, u32 param,
657 u32 *o_mcp_resp, u32 *o_mcp_param);
660 * @brief - drains the nig, allowing completion to pass in case of pauses.
661 * (Should be called only from sleepable context)
666 enum _ecore_status_t ecore_mcp_drain(struct ecore_hwfn *p_hwfn,
667 struct ecore_ptt *p_ptt);
671 * @brief - return the mcp function info of the hw function
675 * @returns pointer to mcp function info
677 const struct ecore_mcp_function_info
678 *ecore_mcp_get_function_info(struct ecore_hwfn *p_hwfn);
683 * @brief - count number of function with a matching personality on engine.
687 * @param personalities - a bitmask of ecore_pci_personality values
689 * @returns the count of all devices on engine whose personality match one of
692 int ecore_mcp_get_personality_cnt(struct ecore_hwfn *p_hwfn,
693 struct ecore_ptt *p_ptt,
698 * @brief Get the flash size value
702 * @param p_flash_size - flash size in bytes to be filled.
704 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
706 enum _ecore_status_t ecore_mcp_get_flash_size(struct ecore_hwfn *p_hwfn,
707 struct ecore_ptt *p_ptt,
711 * @brief Send driver version to MFW
715 * @param version - Version value
716 * @param name - Protocol driver name
718 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
721 ecore_mcp_send_drv_version(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
722 struct ecore_mcp_drv_version *p_ver);
725 * @brief Read the MFW process kill counter
732 u32 ecore_get_process_kill_counter(struct ecore_hwfn *p_hwfn,
733 struct ecore_ptt *p_ptt);
736 * @brief Trigger a recovery process
741 * @return enum _ecore_status_t
743 enum _ecore_status_t ecore_start_recovery_process(struct ecore_hwfn *p_hwfn,
744 struct ecore_ptt *p_ptt);
747 * @brief A recovery handler must call this function as its first step.
748 * It is assumed that the handler is not run from an interrupt context.
753 * @return enum _ecore_status_t
755 enum _ecore_status_t ecore_recovery_prolog(struct ecore_dev *p_dev);
758 * @brief Notify MFW about the change in base device properties
762 * @param client - ecore client type
764 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
767 ecore_mcp_ov_update_current_config(struct ecore_hwfn *p_hwfn,
768 struct ecore_ptt *p_ptt,
769 enum ecore_ov_client client);
772 * @brief Notify MFW about the driver state
776 * @param drv_state - Driver state
778 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
781 ecore_mcp_ov_update_driver_state(struct ecore_hwfn *p_hwfn,
782 struct ecore_ptt *p_ptt,
783 enum ecore_ov_driver_state drv_state);
786 * @brief Read NPIV settings form the MFW
790 * @param p_table - Array to hold the FC NPIV data. Client need allocate the
791 * required buffer. The field 'count' specifies number of NPIV
792 * entries. A value of 0 means the table was not populated.
794 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
797 ecore_mcp_ov_get_fc_npiv(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
798 struct ecore_fc_npiv_tbl *p_table);
801 * @brief Send MTU size to MFW
805 * @param mtu - MTU size
807 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
809 enum _ecore_status_t ecore_mcp_ov_update_mtu(struct ecore_hwfn *p_hwfn,
810 struct ecore_ptt *p_ptt, u16 mtu);
813 * @brief Set LED status
817 * @param mode - LED mode
819 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
821 enum _ecore_status_t ecore_mcp_set_led(struct ecore_hwfn *p_hwfn,
822 struct ecore_ptt *p_ptt,
823 enum ecore_led_mode mode);
826 * @brief Set secure mode
829 * @param addr - nvm offset
831 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
833 enum _ecore_status_t ecore_mcp_nvm_set_secure_mode(struct ecore_dev *p_dev,
837 * @brief Write to phy
840 * @param addr - nvm offset
841 * @param cmd - nvm command
842 * @param p_buf - nvm write buffer
843 * @param len - buffer len
845 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
847 enum _ecore_status_t ecore_mcp_phy_write(struct ecore_dev *p_dev, u32 cmd,
848 u32 addr, u8 *p_buf, u32 len);
851 * @brief Write to nvm
854 * @param addr - nvm offset
855 * @param cmd - nvm command
856 * @param p_buf - nvm write buffer
857 * @param len - buffer len
859 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
861 enum _ecore_status_t ecore_mcp_nvm_write(struct ecore_dev *p_dev, u32 cmd,
862 u32 addr, u8 *p_buf, u32 len);
865 * @brief Put file begin
868 * @param addr - nvm offset
870 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
872 enum _ecore_status_t ecore_mcp_nvm_put_file_begin(struct ecore_dev *p_dev,
879 * @param addr - nvm offset
881 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
883 enum _ecore_status_t ecore_mcp_nvm_del_file(struct ecore_dev *p_dev,
887 * @brief Check latest response
890 * @param p_buf - nvm write buffer
892 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
894 enum _ecore_status_t ecore_mcp_nvm_resp(struct ecore_dev *p_dev, u8 *p_buf);
897 * @brief Read from phy
900 * @param addr - nvm offset
901 * @param cmd - nvm command
902 * @param p_buf - nvm read buffer
903 * @param len - buffer len
905 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
907 enum _ecore_status_t ecore_mcp_phy_read(struct ecore_dev *p_dev, u32 cmd,
908 u32 addr, u8 *p_buf, u32 len);
911 * @brief Read from nvm
914 * @param addr - nvm offset
915 * @param p_buf - nvm read buffer
916 * @param len - buffer len
918 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
920 enum _ecore_status_t ecore_mcp_nvm_read(struct ecore_dev *p_dev, u32 addr,
924 * @brief - Sends an NVM write command request to the MFW with
929 * @param cmd - Command: Either DRV_MSG_CODE_NVM_WRITE_NVRAM or
930 * DRV_MSG_CODE_NVM_PUT_FILE_DATA
931 * @param param - [0:23] - Offset [24:31] - Size
932 * @param o_mcp_resp - MCP response
933 * @param o_mcp_param - MCP response param
934 * @param i_txn_size - Buffer size
935 * @param i_buf - Pointer to the buffer
937 * @param return ECORE_SUCCESS upon success.
939 enum _ecore_status_t ecore_mcp_nvm_wr_cmd(struct ecore_hwfn *p_hwfn,
940 struct ecore_ptt *p_ptt,
949 * @brief - Sends an NVM read command request to the MFW to get
954 * @param cmd - Command: DRV_MSG_CODE_NVM_GET_FILE_DATA or
955 * DRV_MSG_CODE_NVM_READ_NVRAM commands
956 * @param param - [0:23] - Offset [24:31] - Size
957 * @param o_mcp_resp - MCP response
958 * @param o_mcp_param - MCP response param
959 * @param o_txn_size - Buffer size output
960 * @param o_buf - Pointer to the buffer returned by the MFW.
962 * @param return ECORE_SUCCESS upon success.
964 enum _ecore_status_t ecore_mcp_nvm_rd_cmd(struct ecore_hwfn *p_hwfn,
965 struct ecore_ptt *p_ptt,
974 * @brief Read from sfp
976 * @param p_hwfn - hw function
977 * @param p_ptt - PTT required for register access
978 * @param port - transceiver port
979 * @param addr - I2C address
980 * @param offset - offset in sfp
981 * @param len - buffer length
982 * @param p_buf - buffer to read into
984 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
986 enum _ecore_status_t ecore_mcp_phy_sfp_read(struct ecore_hwfn *p_hwfn,
987 struct ecore_ptt *p_ptt,
988 u32 port, u32 addr, u32 offset,
992 * @brief Write to sfp
994 * @param p_hwfn - hw function
995 * @param p_ptt - PTT required for register access
996 * @param port - transceiver port
997 * @param addr - I2C address
998 * @param offset - offset in sfp
999 * @param len - buffer length
1000 * @param p_buf - buffer to write from
1002 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1004 enum _ecore_status_t ecore_mcp_phy_sfp_write(struct ecore_hwfn *p_hwfn,
1005 struct ecore_ptt *p_ptt,
1006 u32 port, u32 addr, u32 offset,
1007 u32 len, u8 *p_buf);
1012 * @param p_hwfn - hw function
1013 * @param p_ptt - PTT required for register access
1014 * @param gpio - gpio number
1015 * @param gpio_val - value read from gpio
1017 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1019 enum _ecore_status_t ecore_mcp_gpio_read(struct ecore_hwfn *p_hwfn,
1020 struct ecore_ptt *p_ptt,
1021 u16 gpio, u32 *gpio_val);
1026 * @param p_hwfn - hw function
1027 * @param p_ptt - PTT required for register access
1028 * @param gpio - gpio number
1029 * @param gpio_val - value to write to gpio
1031 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1033 enum _ecore_status_t ecore_mcp_gpio_write(struct ecore_hwfn *p_hwfn,
1034 struct ecore_ptt *p_ptt,
1035 u16 gpio, u16 gpio_val);
1038 * @brief Gpio get information
1040 * @param p_hwfn - hw function
1041 * @param p_ptt - PTT required for register access
1042 * @param gpio - gpio number
1043 * @param gpio_direction - gpio is output (0) or input (1)
1044 * @param gpio_ctrl - gpio control is uninitialized (0),
1045 * path 0 (1), path 1 (2) or shared(3)
1047 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1049 enum _ecore_status_t ecore_mcp_gpio_info(struct ecore_hwfn *p_hwfn,
1050 struct ecore_ptt *p_ptt,
1051 u16 gpio, u32 *gpio_direction,
1055 * @brief Bist register test
1057 * @param p_hwfn - hw function
1058 * @param p_ptt - PTT required for register access
1060 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1062 enum _ecore_status_t ecore_mcp_bist_register_test(struct ecore_hwfn *p_hwfn,
1063 struct ecore_ptt *p_ptt);
1066 * @brief Bist clock test
1068 * @param p_hwfn - hw function
1069 * @param p_ptt - PTT required for register access
1071 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1073 enum _ecore_status_t ecore_mcp_bist_clock_test(struct ecore_hwfn *p_hwfn,
1074 struct ecore_ptt *p_ptt);
1077 * @brief Bist nvm test - get number of images
1079 * @param p_hwfn - hw function
1080 * @param p_ptt - PTT required for register access
1081 * @param num_images - number of images if operation was
1082 * successful. 0 if not.
1084 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1086 enum _ecore_status_t ecore_mcp_bist_nvm_test_get_num_images(
1087 struct ecore_hwfn *p_hwfn,
1088 struct ecore_ptt *p_ptt,
1092 * @brief Bist nvm test - get image attributes by index
1094 * @param p_hwfn - hw function
1095 * @param p_ptt - PTT required for register access
1096 * @param p_image_att - Attributes of image
1097 * @param image_index - Index of image to get information for
1099 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1101 enum _ecore_status_t ecore_mcp_bist_nvm_test_get_image_att(
1102 struct ecore_hwfn *p_hwfn,
1103 struct ecore_ptt *p_ptt,
1104 struct bist_nvm_image_att *p_image_att,
1108 * @brief ecore_mcp_get_temperature_info - get the status of the temperature
1111 * @param p_hwfn - hw function
1112 * @param p_ptt - PTT required for register access
1113 * @param p_temp_status - A pointer to an ecore_temperature_info structure to
1114 * be filled with the temperature data
1116 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1118 enum _ecore_status_t
1119 ecore_mcp_get_temperature_info(struct ecore_hwfn *p_hwfn,
1120 struct ecore_ptt *p_ptt,
1121 struct ecore_temperature_info *p_temp_info);
1124 * @brief Get MBA versions - get MBA sub images versions
1126 * @param p_hwfn - hw function
1127 * @param p_ptt - PTT required for register access
1128 * @param p_mba_vers - MBA versions array to fill
1130 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1132 enum _ecore_status_t ecore_mcp_get_mba_versions(
1133 struct ecore_hwfn *p_hwfn,
1134 struct ecore_ptt *p_ptt,
1135 struct ecore_mba_vers *p_mba_vers);
1138 * @brief Count memory ecc events
1140 * @param p_hwfn - hw function
1141 * @param p_ptt - PTT required for register access
1142 * @param num_events - number of memory ecc events
1144 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1146 enum _ecore_status_t ecore_mcp_mem_ecc_events(struct ecore_hwfn *p_hwfn,
1147 struct ecore_ptt *p_ptt,
1150 struct ecore_mdump_info {
1160 * @brief - Gets the MFW crash dump configuration and logs info.
1164 * @param p_mdump_info
1166 * @param return ECORE_SUCCESS upon success.
1168 enum _ecore_status_t
1169 ecore_mcp_mdump_get_info(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
1170 struct ecore_mdump_info *p_mdump_info);
1173 * @brief - Clears the MFW crash dump logs.
1178 * @param return ECORE_SUCCESS upon success.
1180 enum _ecore_status_t ecore_mcp_mdump_clear_logs(struct ecore_hwfn *p_hwfn,
1181 struct ecore_ptt *p_ptt);
1184 * @brief - Clear the mdump retained data.
1189 * @param return ECORE_SUCCESS upon success.
1191 enum _ecore_status_t ecore_mcp_mdump_clr_retain(struct ecore_hwfn *p_hwfn,
1192 struct ecore_ptt *p_ptt);
1195 * @brief - Processes the TLV request from MFW i.e., get the required TLV info
1196 * from the ecore client and send it to the MFW.
1201 * @param return ECORE_SUCCESS upon success.
1203 enum _ecore_status_t ecore_mfw_process_tlv_req(struct ecore_hwfn *p_hwfn,
1204 struct ecore_ptt *p_ptt);
1208 * @brief - Return whether management firmware support smart AN
1212 * @return bool - true iff feature is supported.
1214 bool ecore_mcp_is_smart_an_supported(struct ecore_hwfn *p_hwfn);