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 enum ecore_ov_eswitch {
189 ECORE_OV_ESWITCH_NONE,
190 ECORE_OV_ESWITCH_VEB,
191 ECORE_OV_ESWITCH_VEPA
194 #define ECORE_MAX_NPIV_ENTRIES 128
195 #define ECORE_WWN_SIZE 8
196 struct ecore_fc_npiv_tbl {
198 u8 wwpn[ECORE_MAX_NPIV_ENTRIES][ECORE_WWN_SIZE];
199 u8 wwnn[ECORE_MAX_NPIV_ENTRIES][ECORE_WWN_SIZE];
202 #ifndef __EXTRACT__LINUX__
203 enum ecore_led_mode {
206 ECORE_LED_MODE_RESTORE
210 struct ecore_temperature_sensor {
217 #define ECORE_MAX_NUM_OF_SENSORS 7
218 struct ecore_temperature_info {
220 struct ecore_temperature_sensor sensors[ECORE_MAX_NUM_OF_SENSORS];
223 enum ecore_mba_img_idx {
224 ECORE_MBA_LEGACY_IDX,
225 ECORE_MBA_PCI3CLP_IDX,
232 ECORE_MAX_NUM_OF_ROMIMG
235 struct ecore_mba_vers {
236 u32 mba_vers[ECORE_MAX_NUM_OF_ROMIMG];
239 enum ecore_mfw_tlv_type {
240 ECORE_MFW_TLV_GENERIC = 0x1, /* Core driver TLVs */
241 ECORE_MFW_TLV_ETH = 0x2, /* L2 driver TLVs */
242 ECORE_MFW_TLV_FCOE = 0x4, /* FCoE protocol TLVs */
243 ECORE_MFW_TLV_ISCSI = 0x8, /* SCSI protocol TLVs */
244 ECORE_MFW_TLV_MAX = 0x16,
247 struct ecore_mfw_tlv_generic {
253 bool additional_mac1_set;
255 bool additional_mac2_set;
259 bool pxe_progress_set;
270 struct ecore_mfw_tlv_eth {
272 bool lso_maxoff_size_set;
274 bool lso_minseg_size_set;
278 bool tx_descr_size_set;
280 bool rx_descr_size_set;
284 bool tcp4_offloads_set;
286 bool tcp6_offloads_set;
288 bool tx_descr_qdepth_set;
290 bool rx_descr_qdepth_set;
292 bool iov_offload_set;
298 bool num_txqs_full_set;
300 bool num_rxqs_full_set;
303 struct ecore_mfw_tlv_fcoe {
305 bool scsi_timeout_set;
319 bool num_npiv_ids_set;
321 bool switch_name_set;
323 bool switch_portnum_set;
325 bool switch_portid_set;
327 bool vendor_name_set;
329 bool switch_model_set;
330 u8 switch_fw_version[8];
331 bool switch_fw_version_set;
338 u16 fip_tx_descr_size;
339 bool fip_tx_descr_size_set;
340 u16 fip_rx_descr_size;
341 bool fip_rx_descr_size_set;
343 bool link_failures_set;
344 u8 fcoe_boot_progress;
345 bool fcoe_boot_progress_set;
351 bool fcoe_txq_depth_set;
353 bool fcoe_rxq_depth_set;
355 bool fcoe_rx_frames_set;
357 bool fcoe_rx_bytes_set;
359 bool fcoe_tx_frames_set;
361 bool fcoe_tx_bytes_set;
364 u32 crc_err_src_fcid[5];
365 bool crc_err_src_fcid_set[5];
366 u8 crc_err_tstamp[5][14];
367 bool crc_err_tstamp_set[5];
373 bool primtive_err_set;
375 bool disparity_err_set;
376 u16 code_violation_err;
377 bool code_violation_err_set;
379 bool flogi_param_set[4];
381 bool flogi_tstamp_set;
382 u32 flogi_acc_param[4];
383 bool flogi_acc_param_set[4];
384 u8 flogi_acc_tstamp[14];
385 bool flogi_acc_tstamp_set;
388 u8 flogi_rjt_tstamp[14];
389 bool flogi_rjt_tstamp_set;
402 u32 plogi_dst_fcid[5];
403 bool plogi_dst_fcid_set[5];
404 u8 plogi_tstamp[5][14];
405 bool plogi_tstamp_set[5];
406 u32 plogi_acc_src_fcid[5];
407 bool plogi_acc_src_fcid_set[5];
408 u8 plogi_acc_tstamp[5][14];
409 bool plogi_acc_tstamp_set[5];
416 u32 plogo_src_fcid[5];
417 bool plogo_src_fcid_set[5];
418 u8 plogo_tstamp[5][14];
419 bool plogo_tstamp_set[5];
431 bool rx_abts_acc_set;
433 bool rx_abts_rjt_set;
434 u32 abts_dst_fcid[5];
435 bool abts_dst_fcid_set[5];
436 u8 abts_tstamp[5][14];
437 bool abts_tstamp_set[5];
440 u32 rx_rscn_nport[4];
441 bool rx_rscn_nport_set[4];
445 bool abort_task_sets_set;
469 bool scsi_cond_met_set;
474 u8 scsi_inter_cond_met;
475 bool scsi_inter_cond_met_set;
476 u8 scsi_rsv_conflicts;
477 bool scsi_rsv_conflicts_set;
479 bool scsi_tsk_full_set;
481 bool scsi_aca_active_set;
483 bool scsi_tsk_abort_set;
485 bool scsi_rx_chk_set[5];
486 u8 scsi_chk_tstamp[5][14];
487 bool scsi_chk_tstamp_set[5];
490 struct ecore_mfw_tlv_iscsi {
492 bool target_llmnr_set;
494 bool header_digest_set;
496 bool data_digest_set;
498 bool auth_method_set;
499 u16 boot_taget_portal;
500 bool boot_taget_portal_set;
504 bool tx_desc_size_set;
506 bool rx_desc_size_set;
508 bool boot_progress_set;
510 bool tx_desc_qdepth_set;
512 bool rx_desc_qdepth_set;
523 union ecore_mfw_tlv_data {
524 struct ecore_mfw_tlv_generic generic;
525 struct ecore_mfw_tlv_eth eth;
526 struct ecore_mfw_tlv_fcoe fcoe;
527 struct ecore_mfw_tlv_iscsi iscsi;
530 enum ecore_hw_info_change {
531 ECORE_HW_INFO_CHANGE_OVLAN,
535 * @brief - returns the link params of the hw function
539 * @returns pointer to link params
541 struct ecore_mcp_link_params *ecore_mcp_get_link_params(struct ecore_hwfn *);
544 * @brief - return the link state of the hw function
548 * @returns pointer to link state
550 struct ecore_mcp_link_state *ecore_mcp_get_link_state(struct ecore_hwfn *);
553 * @brief - return the link capabilities of the hw function
557 * @returns pointer to link capabilities
559 struct ecore_mcp_link_capabilities
560 *ecore_mcp_get_link_capabilities(struct ecore_hwfn *p_hwfn);
563 * @brief Request the MFW to set the link according to 'link_input'.
567 * @param b_up - raise link if `true'. Reset link if `false'.
569 * @return enum _ecore_status_t
571 enum _ecore_status_t ecore_mcp_set_link(struct ecore_hwfn *p_hwfn,
572 struct ecore_ptt *p_ptt,
576 * @brief Get the management firmware version value
580 * @param p_mfw_ver - mfw version value
581 * @param p_running_bundle_id - image id in nvram; Optional.
583 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
585 enum _ecore_status_t ecore_mcp_get_mfw_ver(struct ecore_hwfn *p_hwfn,
586 struct ecore_ptt *p_ptt,
588 u32 *p_running_bundle_id);
591 * @brief Get media type value of the port.
593 * @param p_dev - ecore dev pointer
595 * @param mfw_ver - media type value
597 * @return enum _ecore_status_t -
598 * ECORE_SUCCESS - Operation was successful.
599 * ECORE_BUSY - Operation failed
601 enum _ecore_status_t ecore_mcp_get_media_type(struct ecore_hwfn *p_hwfn,
602 struct ecore_ptt *p_ptt,
606 * @brief Get transceiver data of the port.
608 * @param p_dev - ecore dev pointer
610 * @param p_transceiver_type - media type value
612 * @return enum _ecore_status_t -
613 * ECORE_SUCCESS - Operation was successful.
614 * ECORE_BUSY - Operation failed
616 enum _ecore_status_t ecore_mcp_get_transceiver_data(struct ecore_hwfn *p_hwfn,
617 struct ecore_ptt *p_ptt,
618 u32 *p_tranceiver_type);
621 * @brief Get transceiver supported speed mask.
623 * @param p_dev - ecore dev pointer
625 * @param p_speed_mask - Bit mask of all supported speeds.
627 * @return enum _ecore_status_t -
628 * ECORE_SUCCESS - Operation was successful.
629 * ECORE_BUSY - Operation failed
632 enum _ecore_status_t ecore_mcp_trans_speed_mask(struct ecore_hwfn *p_hwfn,
633 struct ecore_ptt *p_ptt,
637 * @brief Get board configuration.
639 * @param p_dev - ecore dev pointer
641 * @param p_board_config - Board config.
643 * @return enum _ecore_status_t -
644 * ECORE_SUCCESS - Operation was successful.
645 * ECORE_BUSY - Operation failed
647 enum _ecore_status_t ecore_mcp_get_board_config(struct ecore_hwfn *p_hwfn,
648 struct ecore_ptt *p_ptt,
649 u32 *p_board_config);
652 * @brief - Sends a command to the MCP mailbox.
654 * @param p_hwfn - hw function
655 * @param p_ptt - PTT required for register access
656 * @param cmd - command to be sent to the MCP
657 * @param param - Optional param
658 * @param o_mcp_resp - The MCP response code (exclude sequence)
659 * @param o_mcp_param - Optional parameter provided by the MCP response
661 * @return enum _ecore_status_t -
662 * ECORE_SUCCESS - operation was successful
663 * ECORE_BUSY - operation failed
665 enum _ecore_status_t ecore_mcp_cmd(struct ecore_hwfn *p_hwfn,
666 struct ecore_ptt *p_ptt, u32 cmd, u32 param,
667 u32 *o_mcp_resp, u32 *o_mcp_param);
670 * @brief - drains the nig, allowing completion to pass in case of pauses.
671 * (Should be called only from sleepable context)
676 enum _ecore_status_t ecore_mcp_drain(struct ecore_hwfn *p_hwfn,
677 struct ecore_ptt *p_ptt);
681 * @brief - return the mcp function info of the hw function
685 * @returns pointer to mcp function info
687 const struct ecore_mcp_function_info
688 *ecore_mcp_get_function_info(struct ecore_hwfn *p_hwfn);
693 * @brief - count number of function with a matching personality on engine.
697 * @param personalities - a bitmask of ecore_pci_personality values
699 * @returns the count of all devices on engine whose personality match one of
702 int ecore_mcp_get_personality_cnt(struct ecore_hwfn *p_hwfn,
703 struct ecore_ptt *p_ptt,
708 * @brief Get the flash size value
712 * @param p_flash_size - flash size in bytes to be filled.
714 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
716 enum _ecore_status_t ecore_mcp_get_flash_size(struct ecore_hwfn *p_hwfn,
717 struct ecore_ptt *p_ptt,
721 * @brief Send driver version to MFW
725 * @param version - Version value
726 * @param name - Protocol driver name
728 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
731 ecore_mcp_send_drv_version(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
732 struct ecore_mcp_drv_version *p_ver);
735 * @brief Read the MFW process kill counter
742 u32 ecore_get_process_kill_counter(struct ecore_hwfn *p_hwfn,
743 struct ecore_ptt *p_ptt);
746 * @brief Trigger a recovery process
751 * @return enum _ecore_status_t
753 enum _ecore_status_t ecore_start_recovery_process(struct ecore_hwfn *p_hwfn,
754 struct ecore_ptt *p_ptt);
757 * @brief A recovery handler must call this function as its first step.
758 * It is assumed that the handler is not run from an interrupt context.
763 * @return enum _ecore_status_t
765 enum _ecore_status_t ecore_recovery_prolog(struct ecore_dev *p_dev);
768 * @brief Notify MFW about the change in base device properties
772 * @param client - ecore client type
774 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
777 ecore_mcp_ov_update_current_config(struct ecore_hwfn *p_hwfn,
778 struct ecore_ptt *p_ptt,
779 enum ecore_ov_client client);
782 * @brief Notify MFW about the driver state
786 * @param drv_state - Driver state
788 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
791 ecore_mcp_ov_update_driver_state(struct ecore_hwfn *p_hwfn,
792 struct ecore_ptt *p_ptt,
793 enum ecore_ov_driver_state drv_state);
796 * @brief Read NPIV settings form the MFW
800 * @param p_table - Array to hold the FC NPIV data. Client need allocate the
801 * required buffer. The field 'count' specifies number of NPIV
802 * entries. A value of 0 means the table was not populated.
804 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
807 ecore_mcp_ov_get_fc_npiv(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
808 struct ecore_fc_npiv_tbl *p_table);
811 * @brief Send MTU size to MFW
815 * @param mtu - MTU size
817 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
819 enum _ecore_status_t ecore_mcp_ov_update_mtu(struct ecore_hwfn *p_hwfn,
820 struct ecore_ptt *p_ptt, u16 mtu);
823 * @brief Send MAC address to MFW
827 * @param mac - MAC address
829 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
832 ecore_mcp_ov_update_mac(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
836 * @brief Send eswitch mode to MFW
840 * @param eswitch - eswitch mode
842 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
845 ecore_mcp_ov_update_eswitch(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
846 enum ecore_ov_eswitch eswitch);
849 * @brief Set LED status
853 * @param mode - LED mode
855 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
857 enum _ecore_status_t ecore_mcp_set_led(struct ecore_hwfn *p_hwfn,
858 struct ecore_ptt *p_ptt,
859 enum ecore_led_mode mode);
862 * @brief Set secure mode
865 * @param addr - nvm offset
867 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
869 enum _ecore_status_t ecore_mcp_nvm_set_secure_mode(struct ecore_dev *p_dev,
873 * @brief Write to phy
876 * @param addr - nvm offset
877 * @param cmd - nvm command
878 * @param p_buf - nvm write buffer
879 * @param len - buffer len
881 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
883 enum _ecore_status_t ecore_mcp_phy_write(struct ecore_dev *p_dev, u32 cmd,
884 u32 addr, u8 *p_buf, u32 len);
887 * @brief Write to nvm
890 * @param addr - nvm offset
891 * @param cmd - nvm command
892 * @param p_buf - nvm write buffer
893 * @param len - buffer len
895 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
897 enum _ecore_status_t ecore_mcp_nvm_write(struct ecore_dev *p_dev, u32 cmd,
898 u32 addr, u8 *p_buf, u32 len);
901 * @brief Put file begin
904 * @param addr - nvm offset
906 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
908 enum _ecore_status_t ecore_mcp_nvm_put_file_begin(struct ecore_dev *p_dev,
915 * @param addr - nvm offset
917 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
919 enum _ecore_status_t ecore_mcp_nvm_del_file(struct ecore_dev *p_dev,
923 * @brief Check latest response
926 * @param p_buf - nvm write buffer
928 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
930 enum _ecore_status_t ecore_mcp_nvm_resp(struct ecore_dev *p_dev, u8 *p_buf);
933 * @brief Read from phy
936 * @param addr - nvm offset
937 * @param cmd - nvm command
938 * @param p_buf - nvm read buffer
939 * @param len - buffer len
941 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
943 enum _ecore_status_t ecore_mcp_phy_read(struct ecore_dev *p_dev, u32 cmd,
944 u32 addr, u8 *p_buf, u32 len);
947 * @brief Read from nvm
950 * @param addr - nvm offset
951 * @param p_buf - nvm read buffer
952 * @param len - buffer len
954 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
956 enum _ecore_status_t ecore_mcp_nvm_read(struct ecore_dev *p_dev, u32 addr,
960 * @brief - Sends an NVM write command request to the MFW with
965 * @param cmd - Command: Either DRV_MSG_CODE_NVM_WRITE_NVRAM or
966 * DRV_MSG_CODE_NVM_PUT_FILE_DATA
967 * @param param - [0:23] - Offset [24:31] - Size
968 * @param o_mcp_resp - MCP response
969 * @param o_mcp_param - MCP response param
970 * @param i_txn_size - Buffer size
971 * @param i_buf - Pointer to the buffer
973 * @param return ECORE_SUCCESS upon success.
975 enum _ecore_status_t ecore_mcp_nvm_wr_cmd(struct ecore_hwfn *p_hwfn,
976 struct ecore_ptt *p_ptt,
985 * @brief - Sends an NVM read command request to the MFW to get
990 * @param cmd - Command: DRV_MSG_CODE_NVM_GET_FILE_DATA or
991 * DRV_MSG_CODE_NVM_READ_NVRAM commands
992 * @param param - [0:23] - Offset [24:31] - Size
993 * @param o_mcp_resp - MCP response
994 * @param o_mcp_param - MCP response param
995 * @param o_txn_size - Buffer size output
996 * @param o_buf - Pointer to the buffer returned by the MFW.
998 * @param return ECORE_SUCCESS upon success.
1000 enum _ecore_status_t ecore_mcp_nvm_rd_cmd(struct ecore_hwfn *p_hwfn,
1001 struct ecore_ptt *p_ptt,
1010 * @brief Read from sfp
1012 * @param p_hwfn - hw function
1013 * @param p_ptt - PTT required for register access
1014 * @param port - transceiver port
1015 * @param addr - I2C address
1016 * @param offset - offset in sfp
1017 * @param len - buffer length
1018 * @param p_buf - buffer to read into
1020 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1022 enum _ecore_status_t ecore_mcp_phy_sfp_read(struct ecore_hwfn *p_hwfn,
1023 struct ecore_ptt *p_ptt,
1024 u32 port, u32 addr, u32 offset,
1025 u32 len, u8 *p_buf);
1028 * @brief Write to sfp
1030 * @param p_hwfn - hw function
1031 * @param p_ptt - PTT required for register access
1032 * @param port - transceiver port
1033 * @param addr - I2C address
1034 * @param offset - offset in sfp
1035 * @param len - buffer length
1036 * @param p_buf - buffer to write from
1038 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1040 enum _ecore_status_t ecore_mcp_phy_sfp_write(struct ecore_hwfn *p_hwfn,
1041 struct ecore_ptt *p_ptt,
1042 u32 port, u32 addr, u32 offset,
1043 u32 len, u8 *p_buf);
1048 * @param p_hwfn - hw function
1049 * @param p_ptt - PTT required for register access
1050 * @param gpio - gpio number
1051 * @param gpio_val - value read from gpio
1053 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1055 enum _ecore_status_t ecore_mcp_gpio_read(struct ecore_hwfn *p_hwfn,
1056 struct ecore_ptt *p_ptt,
1057 u16 gpio, u32 *gpio_val);
1062 * @param p_hwfn - hw function
1063 * @param p_ptt - PTT required for register access
1064 * @param gpio - gpio number
1065 * @param gpio_val - value to write to gpio
1067 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1069 enum _ecore_status_t ecore_mcp_gpio_write(struct ecore_hwfn *p_hwfn,
1070 struct ecore_ptt *p_ptt,
1071 u16 gpio, u16 gpio_val);
1074 * @brief Gpio get information
1076 * @param p_hwfn - hw function
1077 * @param p_ptt - PTT required for register access
1078 * @param gpio - gpio number
1079 * @param gpio_direction - gpio is output (0) or input (1)
1080 * @param gpio_ctrl - gpio control is uninitialized (0),
1081 * path 0 (1), path 1 (2) or shared(3)
1083 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1085 enum _ecore_status_t ecore_mcp_gpio_info(struct ecore_hwfn *p_hwfn,
1086 struct ecore_ptt *p_ptt,
1087 u16 gpio, u32 *gpio_direction,
1091 * @brief Bist register test
1093 * @param p_hwfn - hw function
1094 * @param p_ptt - PTT required for register access
1096 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1098 enum _ecore_status_t ecore_mcp_bist_register_test(struct ecore_hwfn *p_hwfn,
1099 struct ecore_ptt *p_ptt);
1102 * @brief Bist clock test
1104 * @param p_hwfn - hw function
1105 * @param p_ptt - PTT required for register access
1107 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1109 enum _ecore_status_t ecore_mcp_bist_clock_test(struct ecore_hwfn *p_hwfn,
1110 struct ecore_ptt *p_ptt);
1113 * @brief Bist nvm test - get number of images
1115 * @param p_hwfn - hw function
1116 * @param p_ptt - PTT required for register access
1117 * @param num_images - number of images if operation was
1118 * successful. 0 if not.
1120 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1122 enum _ecore_status_t ecore_mcp_bist_nvm_test_get_num_images(
1123 struct ecore_hwfn *p_hwfn,
1124 struct ecore_ptt *p_ptt,
1128 * @brief Bist nvm test - get image attributes by index
1130 * @param p_hwfn - hw function
1131 * @param p_ptt - PTT required for register access
1132 * @param p_image_att - Attributes of image
1133 * @param image_index - Index of image to get information for
1135 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1137 enum _ecore_status_t ecore_mcp_bist_nvm_test_get_image_att(
1138 struct ecore_hwfn *p_hwfn,
1139 struct ecore_ptt *p_ptt,
1140 struct bist_nvm_image_att *p_image_att,
1144 * @brief ecore_mcp_get_temperature_info - get the status of the temperature
1147 * @param p_hwfn - hw function
1148 * @param p_ptt - PTT required for register access
1149 * @param p_temp_status - A pointer to an ecore_temperature_info structure to
1150 * be filled with the temperature data
1152 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1154 enum _ecore_status_t
1155 ecore_mcp_get_temperature_info(struct ecore_hwfn *p_hwfn,
1156 struct ecore_ptt *p_ptt,
1157 struct ecore_temperature_info *p_temp_info);
1160 * @brief Get MBA versions - get MBA sub images versions
1162 * @param p_hwfn - hw function
1163 * @param p_ptt - PTT required for register access
1164 * @param p_mba_vers - MBA versions array to fill
1166 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1168 enum _ecore_status_t ecore_mcp_get_mba_versions(
1169 struct ecore_hwfn *p_hwfn,
1170 struct ecore_ptt *p_ptt,
1171 struct ecore_mba_vers *p_mba_vers);
1174 * @brief Count memory ecc events
1176 * @param p_hwfn - hw function
1177 * @param p_ptt - PTT required for register access
1178 * @param num_events - number of memory ecc events
1180 * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful.
1182 enum _ecore_status_t ecore_mcp_mem_ecc_events(struct ecore_hwfn *p_hwfn,
1183 struct ecore_ptt *p_ptt,
1186 struct ecore_mdump_info {
1196 * @brief - Gets the MFW crash dump configuration and logs info.
1200 * @param p_mdump_info
1202 * @param return ECORE_SUCCESS upon success.
1204 enum _ecore_status_t
1205 ecore_mcp_mdump_get_info(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
1206 struct ecore_mdump_info *p_mdump_info);
1209 * @brief - Clears the MFW crash dump logs.
1214 * @param return ECORE_SUCCESS upon success.
1216 enum _ecore_status_t ecore_mcp_mdump_clear_logs(struct ecore_hwfn *p_hwfn,
1217 struct ecore_ptt *p_ptt);
1220 * @brief - Clear the mdump retained data.
1225 * @param return ECORE_SUCCESS upon success.
1227 enum _ecore_status_t ecore_mcp_mdump_clr_retain(struct ecore_hwfn *p_hwfn,
1228 struct ecore_ptt *p_ptt);
1231 * @brief - Processes the TLV request from MFW i.e., get the required TLV info
1232 * from the ecore client and send it to the MFW.
1237 * @param return ECORE_SUCCESS upon success.
1239 enum _ecore_status_t ecore_mfw_process_tlv_req(struct ecore_hwfn *p_hwfn,
1240 struct ecore_ptt *p_ptt);
1244 * @brief - Return whether management firmware support smart AN
1248 * @return bool - true iff feature is supported.
1250 bool ecore_mcp_is_smart_an_supported(struct ecore_hwfn *p_hwfn);