111e25f0dSDavid C Somayajulu /* 211e25f0dSDavid C Somayajulu * Copyright (c) 2017-2018 Cavium, Inc. 311e25f0dSDavid C Somayajulu * All rights reserved. 411e25f0dSDavid C Somayajulu * 511e25f0dSDavid C Somayajulu * Redistribution and use in source and binary forms, with or without 611e25f0dSDavid C Somayajulu * modification, are permitted provided that the following conditions 711e25f0dSDavid C Somayajulu * are met: 811e25f0dSDavid C Somayajulu * 911e25f0dSDavid C Somayajulu * 1. Redistributions of source code must retain the above copyright 1011e25f0dSDavid C Somayajulu * notice, this list of conditions and the following disclaimer. 1111e25f0dSDavid C Somayajulu * 2. Redistributions in binary form must reproduce the above copyright 1211e25f0dSDavid C Somayajulu * notice, this list of conditions and the following disclaimer in the 1311e25f0dSDavid C Somayajulu * documentation and/or other materials provided with the distribution. 1411e25f0dSDavid C Somayajulu * 1511e25f0dSDavid C Somayajulu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 1611e25f0dSDavid C Somayajulu * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1711e25f0dSDavid C Somayajulu * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1811e25f0dSDavid C Somayajulu * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 1911e25f0dSDavid C Somayajulu * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2011e25f0dSDavid C Somayajulu * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2111e25f0dSDavid C Somayajulu * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2211e25f0dSDavid C Somayajulu * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2311e25f0dSDavid C Somayajulu * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2411e25f0dSDavid C Somayajulu * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2511e25f0dSDavid C Somayajulu * POSSIBILITY OF SUCH DAMAGE. 2611e25f0dSDavid C Somayajulu * 2711e25f0dSDavid C Somayajulu */ 2811e25f0dSDavid C Somayajulu 2911e25f0dSDavid C Somayajulu #ifndef __ECORE_MCP_H__ 3011e25f0dSDavid C Somayajulu #define __ECORE_MCP_H__ 3111e25f0dSDavid C Somayajulu 3211e25f0dSDavid C Somayajulu #include "bcm_osal.h" 3311e25f0dSDavid C Somayajulu #include "mcp_public.h" 3411e25f0dSDavid C Somayajulu #include "ecore.h" 3511e25f0dSDavid C Somayajulu #include "ecore_mcp_api.h" 3611e25f0dSDavid C Somayajulu #include "ecore_dev_api.h" 3711e25f0dSDavid C Somayajulu 3811e25f0dSDavid C Somayajulu /* Using hwfn number (and not pf_num) is required since in CMT mode, 3911e25f0dSDavid C Somayajulu * same pf_num may be used by two different hwfn 4011e25f0dSDavid C Somayajulu * TODO - this shouldn't really be in .h file, but until all fields 4111e25f0dSDavid C Somayajulu * required during hw-init will be placed in their correct place in shmem 4211e25f0dSDavid C Somayajulu * we need it in ecore_dev.c [for readin the nvram reflection in shmem]. 4311e25f0dSDavid C Somayajulu */ 4411e25f0dSDavid C Somayajulu #define MCP_PF_ID_BY_REL(p_hwfn, rel_pfid) (ECORE_IS_BB((p_hwfn)->p_dev) ? \ 4511e25f0dSDavid C Somayajulu ((rel_pfid) | \ 4611e25f0dSDavid C Somayajulu ((p_hwfn)->abs_pf_id & 1) << 3) : \ 4711e25f0dSDavid C Somayajulu rel_pfid) 4811e25f0dSDavid C Somayajulu #define MCP_PF_ID(p_hwfn) MCP_PF_ID_BY_REL(p_hwfn, (p_hwfn)->rel_pf_id) 4911e25f0dSDavid C Somayajulu 5011e25f0dSDavid C Somayajulu struct ecore_mcp_info { 519efd0ba7SDavid C Somayajulu /* List for mailbox commands which were sent and wait for a response */ 529efd0ba7SDavid C Somayajulu osal_list_t cmd_list; 5311e25f0dSDavid C Somayajulu 54*1c45a62aSKeith Reynolds /* Lock used for protecting the access to the mailbox commands list 559efd0ba7SDavid C Somayajulu * and the sending of the commands. 569efd0ba7SDavid C Somayajulu */ 57*1c45a62aSKeith Reynolds osal_mutex_t cmd_lock; 589efd0ba7SDavid C Somayajulu 599efd0ba7SDavid C Somayajulu /* Flag to indicate whether sending a MFW mailbox command is blocked */ 609efd0ba7SDavid C Somayajulu bool b_block_cmd; 619efd0ba7SDavid C Somayajulu 629efd0ba7SDavid C Somayajulu /* Spinlock used for syncing SW link-changes and link-changes 6311e25f0dSDavid C Somayajulu * originating from attention context. 6411e25f0dSDavid C Somayajulu */ 65*1c45a62aSKeith Reynolds osal_mutex_t link_lock; 6611e25f0dSDavid C Somayajulu 6711e25f0dSDavid C Somayajulu /* Address of the MCP public area */ 6811e25f0dSDavid C Somayajulu u32 public_base; 6911e25f0dSDavid C Somayajulu /* Address of the driver mailbox */ 7011e25f0dSDavid C Somayajulu u32 drv_mb_addr; 7111e25f0dSDavid C Somayajulu /* Address of the MFW mailbox */ 7211e25f0dSDavid C Somayajulu u32 mfw_mb_addr; 7311e25f0dSDavid C Somayajulu /* Address of the port configuration (link) */ 7411e25f0dSDavid C Somayajulu u32 port_addr; 7511e25f0dSDavid C Somayajulu 7611e25f0dSDavid C Somayajulu /* Current driver mailbox sequence */ 7711e25f0dSDavid C Somayajulu u16 drv_mb_seq; 7811e25f0dSDavid C Somayajulu /* Current driver pulse sequence */ 7911e25f0dSDavid C Somayajulu u16 drv_pulse_seq; 8011e25f0dSDavid C Somayajulu 8111e25f0dSDavid C Somayajulu struct ecore_mcp_link_params link_input; 8211e25f0dSDavid C Somayajulu struct ecore_mcp_link_state link_output; 8311e25f0dSDavid C Somayajulu struct ecore_mcp_link_capabilities link_capabilities; 8411e25f0dSDavid C Somayajulu 8511e25f0dSDavid C Somayajulu struct ecore_mcp_function_info func_info; 8611e25f0dSDavid C Somayajulu 8711e25f0dSDavid C Somayajulu u8 *mfw_mb_cur; 8811e25f0dSDavid C Somayajulu u8 *mfw_mb_shadow; 8911e25f0dSDavid C Somayajulu u16 mfw_mb_length; 909efd0ba7SDavid C Somayajulu u32 mcp_hist; 9111e25f0dSDavid C Somayajulu 9211e25f0dSDavid C Somayajulu /* Capabilties negotiated with the MFW */ 9311e25f0dSDavid C Somayajulu u32 capabilities; 9411e25f0dSDavid C Somayajulu }; 9511e25f0dSDavid C Somayajulu 9611e25f0dSDavid C Somayajulu struct ecore_mcp_mb_params { 9711e25f0dSDavid C Somayajulu u32 cmd; 9811e25f0dSDavid C Somayajulu u32 param; 9911e25f0dSDavid C Somayajulu void *p_data_src; 10011e25f0dSDavid C Somayajulu void *p_data_dst; 10111e25f0dSDavid C Somayajulu u32 mcp_resp; 10211e25f0dSDavid C Somayajulu u32 mcp_param; 103217ec208SDavid C Somayajulu u8 data_src_size; 104217ec208SDavid C Somayajulu u8 data_dst_size; 105217ec208SDavid C Somayajulu u32 flags; 106217ec208SDavid C Somayajulu #define ECORE_MB_FLAG_CAN_SLEEP (0x1 << 0) 107217ec208SDavid C Somayajulu #define ECORE_MB_FLAG_AVOID_BLOCK (0x1 << 1) 108217ec208SDavid C Somayajulu #define ECORE_MB_FLAGS_IS_SET(params, flag) \ 109217ec208SDavid C Somayajulu ((params) != OSAL_NULL && ((params)->flags & ECORE_MB_FLAG_##flag)) 11011e25f0dSDavid C Somayajulu }; 11111e25f0dSDavid C Somayajulu 11211e25f0dSDavid C Somayajulu enum ecore_ov_eswitch { 11311e25f0dSDavid C Somayajulu ECORE_OV_ESWITCH_NONE, 11411e25f0dSDavid C Somayajulu ECORE_OV_ESWITCH_VEB, 11511e25f0dSDavid C Somayajulu ECORE_OV_ESWITCH_VEPA 11611e25f0dSDavid C Somayajulu }; 11711e25f0dSDavid C Somayajulu 11811e25f0dSDavid C Somayajulu struct ecore_drv_tlv_hdr { 11911e25f0dSDavid C Somayajulu u8 tlv_type; /* According to the enum below */ 12011e25f0dSDavid C Somayajulu u8 tlv_length; /* In dwords - not including this header */ 12111e25f0dSDavid C Somayajulu u8 tlv_reserved; 12211e25f0dSDavid C Somayajulu #define ECORE_DRV_TLV_FLAGS_CHANGED 0x01 12311e25f0dSDavid C Somayajulu u8 tlv_flags; 12411e25f0dSDavid C Somayajulu }; 12511e25f0dSDavid C Somayajulu 12611e25f0dSDavid C Somayajulu /** 12711e25f0dSDavid C Somayajulu * @brief Initialize the interface with the MCP 12811e25f0dSDavid C Somayajulu * 12911e25f0dSDavid C Somayajulu * @param p_hwfn - HW func 13011e25f0dSDavid C Somayajulu * @param p_ptt - PTT required for register access 13111e25f0dSDavid C Somayajulu * 13211e25f0dSDavid C Somayajulu * @return enum _ecore_status_t 13311e25f0dSDavid C Somayajulu */ 13411e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_cmd_init(struct ecore_hwfn *p_hwfn, 13511e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 13611e25f0dSDavid C Somayajulu 13711e25f0dSDavid C Somayajulu /** 138217ec208SDavid C Somayajulu * @brief Initialize the port interface with the MCP 13911e25f0dSDavid C Somayajulu * 14011e25f0dSDavid C Somayajulu * @param p_hwfn 14111e25f0dSDavid C Somayajulu * @param p_ptt 1429efd0ba7SDavid C Somayajulu * Can only be called after `num_ports_in_engine' is set 14311e25f0dSDavid C Somayajulu */ 14411e25f0dSDavid C Somayajulu void ecore_mcp_cmd_port_init(struct ecore_hwfn *p_hwfn, 14511e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 14611e25f0dSDavid C Somayajulu /** 14711e25f0dSDavid C Somayajulu * @brief Releases resources allocated during the init process. 14811e25f0dSDavid C Somayajulu * 14911e25f0dSDavid C Somayajulu * @param p_hwfn - HW func 15011e25f0dSDavid C Somayajulu * @param p_ptt - PTT required for register access 15111e25f0dSDavid C Somayajulu * 15211e25f0dSDavid C Somayajulu * @return enum _ecore_status_t 15311e25f0dSDavid C Somayajulu */ 15411e25f0dSDavid C Somayajulu 15511e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_free(struct ecore_hwfn *p_hwfn); 15611e25f0dSDavid C Somayajulu 15711e25f0dSDavid C Somayajulu /** 15811e25f0dSDavid C Somayajulu * @brief This function is called from the DPC context. After 15911e25f0dSDavid C Somayajulu * pointing PTT to the mfw mb, check for events sent by the MCP 16011e25f0dSDavid C Somayajulu * to the driver and ack them. In case a critical event 16111e25f0dSDavid C Somayajulu * detected, it will be handled here, otherwise the work will be 16211e25f0dSDavid C Somayajulu * queued to a sleepable work-queue. 16311e25f0dSDavid C Somayajulu * 16411e25f0dSDavid C Somayajulu * @param p_hwfn - HW function 16511e25f0dSDavid C Somayajulu * @param p_ptt - PTT required for register access 16611e25f0dSDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - operation 16711e25f0dSDavid C Somayajulu * was successul. 16811e25f0dSDavid C Somayajulu */ 16911e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_handle_events(struct ecore_hwfn *p_hwfn, 17011e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 17111e25f0dSDavid C Somayajulu 17211e25f0dSDavid C Somayajulu /** 17311e25f0dSDavid C Somayajulu * @brief When MFW doesn't get driver pulse for couple of seconds, at some 17411e25f0dSDavid C Somayajulu * threshold before timeout expires, it will generate interrupt 17511e25f0dSDavid C Somayajulu * through a dedicated status block (DPSB - Driver Pulse Status 17611e25f0dSDavid C Somayajulu * Block), which the driver should respond immediately, by 17711e25f0dSDavid C Somayajulu * providing keepalive indication after setting the PTT to the 17811e25f0dSDavid C Somayajulu * driver-MFW mailbox. This function is called directly from the 17911e25f0dSDavid C Somayajulu * DPC upon receiving the DPSB attention. 18011e25f0dSDavid C Somayajulu * 18111e25f0dSDavid C Somayajulu * @param p_hwfn - hw function 18211e25f0dSDavid C Somayajulu * @param p_ptt - PTT required for register access 18311e25f0dSDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - operation 18411e25f0dSDavid C Somayajulu * was successful. 18511e25f0dSDavid C Somayajulu */ 18611e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_issue_pulse(struct ecore_hwfn *p_hwfn, 18711e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 18811e25f0dSDavid C Somayajulu 18911e25f0dSDavid C Somayajulu enum ecore_drv_role { 19011e25f0dSDavid C Somayajulu ECORE_DRV_ROLE_OS, 19111e25f0dSDavid C Somayajulu ECORE_DRV_ROLE_KDUMP, 19211e25f0dSDavid C Somayajulu }; 19311e25f0dSDavid C Somayajulu 19411e25f0dSDavid C Somayajulu struct ecore_load_req_params { 19511e25f0dSDavid C Somayajulu /* Input params */ 19611e25f0dSDavid C Somayajulu enum ecore_drv_role drv_role; 19711e25f0dSDavid C Somayajulu u8 timeout_val; /* 1..254, '0' - default value, '255' - no timeout */ 19811e25f0dSDavid C Somayajulu bool avoid_eng_reset; 19911e25f0dSDavid C Somayajulu enum ecore_override_force_load override_force_load; 20011e25f0dSDavid C Somayajulu 20111e25f0dSDavid C Somayajulu /* Output params */ 20211e25f0dSDavid C Somayajulu u32 load_code; 20311e25f0dSDavid C Somayajulu }; 20411e25f0dSDavid C Somayajulu 20511e25f0dSDavid C Somayajulu /** 20611e25f0dSDavid C Somayajulu * @brief Sends a LOAD_REQ to the MFW, and in case the operation succeeds, 20711e25f0dSDavid C Somayajulu * returns whether this PF is the first on the engine/port or function. 20811e25f0dSDavid C Somayajulu * 20911e25f0dSDavid C Somayajulu * @param p_hwfn 21011e25f0dSDavid C Somayajulu * @param p_ptt 21111e25f0dSDavid C Somayajulu * @param p_params 21211e25f0dSDavid C Somayajulu * 21311e25f0dSDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - Operation was successful. 21411e25f0dSDavid C Somayajulu */ 21511e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_load_req(struct ecore_hwfn *p_hwfn, 21611e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt, 21711e25f0dSDavid C Somayajulu struct ecore_load_req_params *p_params); 21811e25f0dSDavid C Somayajulu 21911e25f0dSDavid C Somayajulu /** 220217ec208SDavid C Somayajulu * @brief Sends a LOAD_DONE message to the MFW 221217ec208SDavid C Somayajulu * 222217ec208SDavid C Somayajulu * @param p_hwfn 223217ec208SDavid C Somayajulu * @param p_ptt 224217ec208SDavid C Somayajulu * 225217ec208SDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - Operation was successful. 226217ec208SDavid C Somayajulu */ 227217ec208SDavid C Somayajulu enum _ecore_status_t ecore_mcp_load_done(struct ecore_hwfn *p_hwfn, 228217ec208SDavid C Somayajulu struct ecore_ptt *p_ptt); 229217ec208SDavid C Somayajulu 230217ec208SDavid C Somayajulu /** 231217ec208SDavid C Somayajulu * @brief Sends a CANCEL_LOAD_REQ message to the MFW 232217ec208SDavid C Somayajulu * 233217ec208SDavid C Somayajulu * @param p_hwfn 234217ec208SDavid C Somayajulu * @param p_ptt 235217ec208SDavid C Somayajulu * 236217ec208SDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - Operation was successful. 237217ec208SDavid C Somayajulu */ 238217ec208SDavid C Somayajulu enum _ecore_status_t ecore_mcp_cancel_load_req(struct ecore_hwfn *p_hwfn, 239217ec208SDavid C Somayajulu struct ecore_ptt *p_ptt); 240217ec208SDavid C Somayajulu 241217ec208SDavid C Somayajulu /** 24211e25f0dSDavid C Somayajulu * @brief Sends a UNLOAD_REQ message to the MFW 24311e25f0dSDavid C Somayajulu * 24411e25f0dSDavid C Somayajulu * @param p_hwfn 24511e25f0dSDavid C Somayajulu * @param p_ptt 24611e25f0dSDavid C Somayajulu * 24711e25f0dSDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - Operation was successful. 24811e25f0dSDavid C Somayajulu */ 24911e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_unload_req(struct ecore_hwfn *p_hwfn, 25011e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 25111e25f0dSDavid C Somayajulu 25211e25f0dSDavid C Somayajulu /** 25311e25f0dSDavid C Somayajulu * @brief Sends a UNLOAD_DONE message to the MFW 25411e25f0dSDavid C Somayajulu * 25511e25f0dSDavid C Somayajulu * @param p_hwfn 25611e25f0dSDavid C Somayajulu * @param p_ptt 25711e25f0dSDavid C Somayajulu * 25811e25f0dSDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - Operation was successful. 25911e25f0dSDavid C Somayajulu */ 26011e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_unload_done(struct ecore_hwfn *p_hwfn, 26111e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 26211e25f0dSDavid C Somayajulu 26311e25f0dSDavid C Somayajulu /** 26411e25f0dSDavid C Somayajulu * @brief Read the MFW mailbox into Current buffer. 26511e25f0dSDavid C Somayajulu * 26611e25f0dSDavid C Somayajulu * @param p_hwfn 26711e25f0dSDavid C Somayajulu * @param p_ptt 26811e25f0dSDavid C Somayajulu */ 26911e25f0dSDavid C Somayajulu void ecore_mcp_read_mb(struct ecore_hwfn *p_hwfn, 27011e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 27111e25f0dSDavid C Somayajulu 27211e25f0dSDavid C Somayajulu /** 27311e25f0dSDavid C Somayajulu * @brief Ack to mfw that driver finished FLR process for VFs 27411e25f0dSDavid C Somayajulu * 27511e25f0dSDavid C Somayajulu * @param p_hwfn 27611e25f0dSDavid C Somayajulu * @param p_ptt 27711e25f0dSDavid C Somayajulu * @param vfs_to_ack - bit mask of all engine VFs for which the PF acks. 27811e25f0dSDavid C Somayajulu * 27911e25f0dSDavid C Somayajulu * @param return enum _ecore_status_t - ECORE_SUCCESS upon success. 28011e25f0dSDavid C Somayajulu */ 28111e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_ack_vf_flr(struct ecore_hwfn *p_hwfn, 28211e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt, 28311e25f0dSDavid C Somayajulu u32 *vfs_to_ack); 28411e25f0dSDavid C Somayajulu 28511e25f0dSDavid C Somayajulu /** 28611e25f0dSDavid C Somayajulu * @brief - calls during init to read shmem of all function-related info. 28711e25f0dSDavid C Somayajulu * 28811e25f0dSDavid C Somayajulu * @param p_hwfn 28911e25f0dSDavid C Somayajulu * 29011e25f0dSDavid C Somayajulu * @param return ECORE_SUCCESS upon success. 29111e25f0dSDavid C Somayajulu */ 29211e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_fill_shmem_func_info(struct ecore_hwfn *p_hwfn, 29311e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 29411e25f0dSDavid C Somayajulu 29511e25f0dSDavid C Somayajulu /** 29611e25f0dSDavid C Somayajulu * @brief - Reset the MCP using mailbox command. 29711e25f0dSDavid C Somayajulu * 29811e25f0dSDavid C Somayajulu * @param p_hwfn 29911e25f0dSDavid C Somayajulu * @param p_ptt 30011e25f0dSDavid C Somayajulu * 30111e25f0dSDavid C Somayajulu * @param return ECORE_SUCCESS upon success. 30211e25f0dSDavid C Somayajulu */ 30311e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_reset(struct ecore_hwfn *p_hwfn, 30411e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 30511e25f0dSDavid C Somayajulu 30611e25f0dSDavid C Somayajulu /** 30711e25f0dSDavid C Somayajulu * @brief indicates whether the MFW objects [under mcp_info] are accessible 30811e25f0dSDavid C Somayajulu * 30911e25f0dSDavid C Somayajulu * @param p_hwfn 31011e25f0dSDavid C Somayajulu * 31111e25f0dSDavid C Somayajulu * @return true iff MFW is running and mcp_info is initialized 31211e25f0dSDavid C Somayajulu */ 31311e25f0dSDavid C Somayajulu bool ecore_mcp_is_init(struct ecore_hwfn *p_hwfn); 31411e25f0dSDavid C Somayajulu 31511e25f0dSDavid C Somayajulu /** 31611e25f0dSDavid C Somayajulu * @brief request MFW to configure MSI-X for a VF 31711e25f0dSDavid C Somayajulu * 31811e25f0dSDavid C Somayajulu * @param p_hwfn 31911e25f0dSDavid C Somayajulu * @param p_ptt 32011e25f0dSDavid C Somayajulu * @param vf_id - absolute inside engine 32111e25f0dSDavid C Somayajulu * @param num_sbs - number of entries to request 32211e25f0dSDavid C Somayajulu * 32311e25f0dSDavid C Somayajulu * @return enum _ecore_status_t 32411e25f0dSDavid C Somayajulu */ 32511e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_config_vf_msix(struct ecore_hwfn *p_hwfn, 32611e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt, 32711e25f0dSDavid C Somayajulu u8 vf_id, u8 num); 32811e25f0dSDavid C Somayajulu 32911e25f0dSDavid C Somayajulu /** 33011e25f0dSDavid C Somayajulu * @brief - Halt the MCP. 33111e25f0dSDavid C Somayajulu * 33211e25f0dSDavid C Somayajulu * @param p_hwfn 33311e25f0dSDavid C Somayajulu * @param p_ptt 33411e25f0dSDavid C Somayajulu * 33511e25f0dSDavid C Somayajulu * @param return ECORE_SUCCESS upon success. 33611e25f0dSDavid C Somayajulu */ 33711e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_halt(struct ecore_hwfn *p_hwfn, 33811e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 33911e25f0dSDavid C Somayajulu 34011e25f0dSDavid C Somayajulu /** 34111e25f0dSDavid C Somayajulu * @brief - Wake up the MCP. 34211e25f0dSDavid C Somayajulu * 34311e25f0dSDavid C Somayajulu * @param p_hwfn 34411e25f0dSDavid C Somayajulu * @param p_ptt 34511e25f0dSDavid C Somayajulu * 34611e25f0dSDavid C Somayajulu * @param return ECORE_SUCCESS upon success. 34711e25f0dSDavid C Somayajulu */ 34811e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_resume(struct ecore_hwfn *p_hwfn, 34911e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 35011e25f0dSDavid C Somayajulu int __ecore_configure_pf_max_bandwidth(struct ecore_hwfn *p_hwfn, 35111e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt, 35211e25f0dSDavid C Somayajulu struct ecore_mcp_link_state *p_link, 35311e25f0dSDavid C Somayajulu u8 max_bw); 35411e25f0dSDavid C Somayajulu int __ecore_configure_pf_min_bandwidth(struct ecore_hwfn *p_hwfn, 35511e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt, 35611e25f0dSDavid C Somayajulu struct ecore_mcp_link_state *p_link, 35711e25f0dSDavid C Somayajulu u8 min_bw); 35811e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_mask_parities(struct ecore_hwfn *p_hwfn, 35911e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt, 36011e25f0dSDavid C Somayajulu u32 mask_parities); 36111e25f0dSDavid C Somayajulu #if 0 36211e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_hw_init_first_eth(struct ecore_hwfn *p_hwfn, 36311e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt, 36411e25f0dSDavid C Somayajulu u8 *p_pf); 36511e25f0dSDavid C Somayajulu #endif 36611e25f0dSDavid C Somayajulu 36711e25f0dSDavid C Somayajulu /** 36811e25f0dSDavid C Somayajulu * @brief - Sends crash mdump related info to the MFW. 36911e25f0dSDavid C Somayajulu * 37011e25f0dSDavid C Somayajulu * @param p_hwfn 37111e25f0dSDavid C Somayajulu * @param p_ptt 37211e25f0dSDavid C Somayajulu * @param epoch 37311e25f0dSDavid C Somayajulu * 37411e25f0dSDavid C Somayajulu * @param return ECORE_SUCCESS upon success. 37511e25f0dSDavid C Somayajulu */ 37611e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_mdump_set_values(struct ecore_hwfn *p_hwfn, 37711e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt, 37811e25f0dSDavid C Somayajulu u32 epoch); 37911e25f0dSDavid C Somayajulu 38011e25f0dSDavid C Somayajulu /** 38111e25f0dSDavid C Somayajulu * @brief - Triggers a MFW crash dump procedure. 38211e25f0dSDavid C Somayajulu * 38311e25f0dSDavid C Somayajulu * @param p_hwfn 38411e25f0dSDavid C Somayajulu * @param p_ptt 38511e25f0dSDavid C Somayajulu * 38611e25f0dSDavid C Somayajulu * @param return ECORE_SUCCESS upon success. 38711e25f0dSDavid C Somayajulu */ 38811e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_mdump_trigger(struct ecore_hwfn *p_hwfn, 38911e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 39011e25f0dSDavid C Somayajulu 39111e25f0dSDavid C Somayajulu struct ecore_mdump_retain_data { 39211e25f0dSDavid C Somayajulu u32 valid; 39311e25f0dSDavid C Somayajulu u32 epoch; 39411e25f0dSDavid C Somayajulu u32 pf; 39511e25f0dSDavid C Somayajulu u32 status; 39611e25f0dSDavid C Somayajulu }; 39711e25f0dSDavid C Somayajulu 39811e25f0dSDavid C Somayajulu /** 39911e25f0dSDavid C Somayajulu * @brief - Gets the mdump retained data from the MFW. 40011e25f0dSDavid C Somayajulu * 40111e25f0dSDavid C Somayajulu * @param p_hwfn 40211e25f0dSDavid C Somayajulu * @param p_ptt 40311e25f0dSDavid C Somayajulu * @param p_mdump_retain 40411e25f0dSDavid C Somayajulu * 40511e25f0dSDavid C Somayajulu * @param return ECORE_SUCCESS upon success. 40611e25f0dSDavid C Somayajulu */ 40711e25f0dSDavid C Somayajulu enum _ecore_status_t 40811e25f0dSDavid C Somayajulu ecore_mcp_mdump_get_retain(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, 40911e25f0dSDavid C Somayajulu struct ecore_mdump_retain_data *p_mdump_retain); 41011e25f0dSDavid C Somayajulu 41111e25f0dSDavid C Somayajulu /** 41211e25f0dSDavid C Somayajulu * @brief - Sets the MFW's max value for the given resource 41311e25f0dSDavid C Somayajulu * 41411e25f0dSDavid C Somayajulu * @param p_hwfn 41511e25f0dSDavid C Somayajulu * @param p_ptt 41611e25f0dSDavid C Somayajulu * @param res_id 41711e25f0dSDavid C Somayajulu * @param resc_max_val 41811e25f0dSDavid C Somayajulu * @param p_mcp_resp 41911e25f0dSDavid C Somayajulu * 42011e25f0dSDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful. 42111e25f0dSDavid C Somayajulu */ 42211e25f0dSDavid C Somayajulu enum _ecore_status_t 42311e25f0dSDavid C Somayajulu ecore_mcp_set_resc_max_val(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, 42411e25f0dSDavid C Somayajulu enum ecore_resources res_id, u32 resc_max_val, 42511e25f0dSDavid C Somayajulu u32 *p_mcp_resp); 42611e25f0dSDavid C Somayajulu 42711e25f0dSDavid C Somayajulu /** 42811e25f0dSDavid C Somayajulu * @brief - Gets the MFW allocation info for the given resource 42911e25f0dSDavid C Somayajulu * 43011e25f0dSDavid C Somayajulu * @param p_hwfn 43111e25f0dSDavid C Somayajulu * @param p_ptt 43211e25f0dSDavid C Somayajulu * @param res_id 43311e25f0dSDavid C Somayajulu * @param p_mcp_resp 43411e25f0dSDavid C Somayajulu * @param p_resc_num 43511e25f0dSDavid C Somayajulu * @param p_resc_start 43611e25f0dSDavid C Somayajulu * 43711e25f0dSDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful. 43811e25f0dSDavid C Somayajulu */ 43911e25f0dSDavid C Somayajulu enum _ecore_status_t 44011e25f0dSDavid C Somayajulu ecore_mcp_get_resc_info(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, 44111e25f0dSDavid C Somayajulu enum ecore_resources res_id, u32 *p_mcp_resp, 44211e25f0dSDavid C Somayajulu u32 *p_resc_num, u32 *p_resc_start); 44311e25f0dSDavid C Somayajulu 44411e25f0dSDavid C Somayajulu /** 44511e25f0dSDavid C Somayajulu * @brief - Initiates PF FLR 44611e25f0dSDavid C Somayajulu * 44711e25f0dSDavid C Somayajulu * @param p_hwfn 44811e25f0dSDavid C Somayajulu * @param p_ptt 44911e25f0dSDavid C Somayajulu * 45011e25f0dSDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful. 45111e25f0dSDavid C Somayajulu */ 45211e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_initiate_pf_flr(struct ecore_hwfn *p_hwfn, 45311e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 45411e25f0dSDavid C Somayajulu 45511e25f0dSDavid C Somayajulu /** 45611e25f0dSDavid C Somayajulu * @brief Send eswitch mode to MFW 45711e25f0dSDavid C Somayajulu * 45811e25f0dSDavid C Somayajulu * @param p_hwfn 45911e25f0dSDavid C Somayajulu * @param p_ptt 46011e25f0dSDavid C Somayajulu * @param eswitch - eswitch mode 46111e25f0dSDavid C Somayajulu * 46211e25f0dSDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful. 46311e25f0dSDavid C Somayajulu */ 46411e25f0dSDavid C Somayajulu enum _ecore_status_t 46511e25f0dSDavid C Somayajulu ecore_mcp_ov_update_eswitch(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, 46611e25f0dSDavid C Somayajulu enum ecore_ov_eswitch eswitch); 46711e25f0dSDavid C Somayajulu 46811e25f0dSDavid C Somayajulu #define ECORE_MCP_RESC_LOCK_MIN_VAL RESOURCE_DUMP /* 0 */ 46911e25f0dSDavid C Somayajulu #define ECORE_MCP_RESC_LOCK_MAX_VAL 31 47011e25f0dSDavid C Somayajulu 47111e25f0dSDavid C Somayajulu enum ecore_resc_lock { 47211e25f0dSDavid C Somayajulu ECORE_RESC_LOCK_DBG_DUMP = ECORE_MCP_RESC_LOCK_MIN_VAL, 47311e25f0dSDavid C Somayajulu /* Locks that the MFW is aware of should be added here downwards */ 47411e25f0dSDavid C Somayajulu 47511e25f0dSDavid C Somayajulu /* Ecore only locks should be added here upwards */ 476217ec208SDavid C Somayajulu ECORE_RESC_LOCK_IND_TABLE = 26, 477217ec208SDavid C Somayajulu ECORE_RESC_LOCK_PTP_PORT0 = 27, 478217ec208SDavid C Somayajulu ECORE_RESC_LOCK_PTP_PORT1 = 28, 479217ec208SDavid C Somayajulu ECORE_RESC_LOCK_PTP_PORT2 = 29, 480217ec208SDavid C Somayajulu ECORE_RESC_LOCK_PTP_PORT3 = 30, 4819efd0ba7SDavid C Somayajulu ECORE_RESC_LOCK_RESC_ALLOC = ECORE_MCP_RESC_LOCK_MAX_VAL, 4829efd0ba7SDavid C Somayajulu 4839efd0ba7SDavid C Somayajulu /* A dummy value to be used for auxillary functions in need of 4849efd0ba7SDavid C Somayajulu * returning an 'error' value. 4859efd0ba7SDavid C Somayajulu */ 4869efd0ba7SDavid C Somayajulu ECORE_RESC_LOCK_RESC_INVALID, 48711e25f0dSDavid C Somayajulu }; 48811e25f0dSDavid C Somayajulu 48911e25f0dSDavid C Somayajulu struct ecore_resc_lock_params { 49011e25f0dSDavid C Somayajulu /* Resource number [valid values are 0..31] */ 49111e25f0dSDavid C Somayajulu u8 resource; 49211e25f0dSDavid C Somayajulu 49311e25f0dSDavid C Somayajulu /* Lock timeout value in seconds [default, none or 1..254] */ 49411e25f0dSDavid C Somayajulu u8 timeout; 49511e25f0dSDavid C Somayajulu #define ECORE_MCP_RESC_LOCK_TO_DEFAULT 0 49611e25f0dSDavid C Somayajulu #define ECORE_MCP_RESC_LOCK_TO_NONE 255 49711e25f0dSDavid C Somayajulu 49811e25f0dSDavid C Somayajulu /* Number of times to retry locking */ 49911e25f0dSDavid C Somayajulu u8 retry_num; 5009efd0ba7SDavid C Somayajulu #define ECORE_MCP_RESC_LOCK_RETRY_CNT_DFLT 10 50111e25f0dSDavid C Somayajulu 50211e25f0dSDavid C Somayajulu /* The interval in usec between retries */ 503217ec208SDavid C Somayajulu u32 retry_interval; 5049efd0ba7SDavid C Somayajulu #define ECORE_MCP_RESC_LOCK_RETRY_VAL_DFLT 10000 50511e25f0dSDavid C Somayajulu 50611e25f0dSDavid C Somayajulu /* Use sleep or delay between retries */ 50711e25f0dSDavid C Somayajulu bool sleep_b4_retry; 50811e25f0dSDavid C Somayajulu 50911e25f0dSDavid C Somayajulu /* Will be set as true if the resource is free and granted */ 51011e25f0dSDavid C Somayajulu bool b_granted; 51111e25f0dSDavid C Somayajulu 51211e25f0dSDavid C Somayajulu /* Will be filled with the resource owner. 51311e25f0dSDavid C Somayajulu * [0..15 = PF0-15, 16 = MFW, 17 = diag over serial] 51411e25f0dSDavid C Somayajulu */ 51511e25f0dSDavid C Somayajulu u8 owner; 51611e25f0dSDavid C Somayajulu }; 51711e25f0dSDavid C Somayajulu 51811e25f0dSDavid C Somayajulu /** 51911e25f0dSDavid C Somayajulu * @brief Acquires MFW generic resource lock 52011e25f0dSDavid C Somayajulu * 52111e25f0dSDavid C Somayajulu * @param p_hwfn 52211e25f0dSDavid C Somayajulu * @param p_ptt 52311e25f0dSDavid C Somayajulu * @param p_params 52411e25f0dSDavid C Somayajulu * 52511e25f0dSDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful. 52611e25f0dSDavid C Somayajulu */ 52711e25f0dSDavid C Somayajulu enum _ecore_status_t 52811e25f0dSDavid C Somayajulu ecore_mcp_resc_lock(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, 52911e25f0dSDavid C Somayajulu struct ecore_resc_lock_params *p_params); 53011e25f0dSDavid C Somayajulu 53111e25f0dSDavid C Somayajulu struct ecore_resc_unlock_params { 53211e25f0dSDavid C Somayajulu /* Resource number [valid values are 0..31] */ 53311e25f0dSDavid C Somayajulu u8 resource; 53411e25f0dSDavid C Somayajulu 53511e25f0dSDavid C Somayajulu /* Allow to release a resource even if belongs to another PF */ 53611e25f0dSDavid C Somayajulu bool b_force; 53711e25f0dSDavid C Somayajulu 53811e25f0dSDavid C Somayajulu /* Will be set as true if the resource is released */ 53911e25f0dSDavid C Somayajulu bool b_released; 54011e25f0dSDavid C Somayajulu }; 54111e25f0dSDavid C Somayajulu 54211e25f0dSDavid C Somayajulu /** 54311e25f0dSDavid C Somayajulu * @brief Releases MFW generic resource lock 54411e25f0dSDavid C Somayajulu * 54511e25f0dSDavid C Somayajulu * @param p_hwfn 54611e25f0dSDavid C Somayajulu * @param p_ptt 54711e25f0dSDavid C Somayajulu * @param p_params 54811e25f0dSDavid C Somayajulu * 54911e25f0dSDavid C Somayajulu * @return enum _ecore_status_t - ECORE_SUCCESS - operation was successful. 55011e25f0dSDavid C Somayajulu */ 55111e25f0dSDavid C Somayajulu enum _ecore_status_t 55211e25f0dSDavid C Somayajulu ecore_mcp_resc_unlock(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, 55311e25f0dSDavid C Somayajulu struct ecore_resc_unlock_params *p_params); 55411e25f0dSDavid C Somayajulu 5559efd0ba7SDavid C Somayajulu /** 5569efd0ba7SDavid C Somayajulu * @brief - default initialization for lock/unlock resource structs 5579efd0ba7SDavid C Somayajulu * 5589efd0ba7SDavid C Somayajulu * @param p_lock - lock params struct to be initialized; Can be OSAL_NULL 5599efd0ba7SDavid C Somayajulu * @param p_unlock - unlock params struct to be initialized; Can be OSAL_NULL 5609efd0ba7SDavid C Somayajulu * @param resource - the requested resource 5619efd0ba7SDavid C Somayajulu * @paral b_is_permanent - disable retries & aging when set 5629efd0ba7SDavid C Somayajulu */ 5639efd0ba7SDavid C Somayajulu void ecore_mcp_resc_lock_default_init(struct ecore_resc_lock_params *p_lock, 5649efd0ba7SDavid C Somayajulu struct ecore_resc_unlock_params *p_unlock, 5659efd0ba7SDavid C Somayajulu enum ecore_resc_lock resource, 5669efd0ba7SDavid C Somayajulu bool b_is_permanent); 5679efd0ba7SDavid C Somayajulu 56811e25f0dSDavid C Somayajulu void ecore_mcp_wol_wr(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, 56911e25f0dSDavid C Somayajulu u32 offset, u32 val); 57011e25f0dSDavid C Somayajulu 57111e25f0dSDavid C Somayajulu /** 57211e25f0dSDavid C Somayajulu * @brief Learn of supported MFW features; To be done during early init 57311e25f0dSDavid C Somayajulu * 57411e25f0dSDavid C Somayajulu * @param p_hwfn 57511e25f0dSDavid C Somayajulu * @param p_ptt 57611e25f0dSDavid C Somayajulu */ 57711e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_get_capabilities(struct ecore_hwfn *p_hwfn, 57811e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 57911e25f0dSDavid C Somayajulu 58011e25f0dSDavid C Somayajulu /** 58111e25f0dSDavid C Somayajulu * @brief Inform MFW of set of features supported by driver. Should be done 58211e25f0dSDavid C Somayajulu * inside the contet of the LOAD_REQ. 58311e25f0dSDavid C Somayajulu * 58411e25f0dSDavid C Somayajulu * @param p_hwfn 58511e25f0dSDavid C Somayajulu * @param p_ptt 58611e25f0dSDavid C Somayajulu */ 58711e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_mcp_set_capabilities(struct ecore_hwfn *p_hwfn, 58811e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 58911e25f0dSDavid C Somayajulu 59011e25f0dSDavid C Somayajulu /** 59111e25f0dSDavid C Somayajulu * @brief Initialize MFW mailbox and sequence values for driver interaction. 59211e25f0dSDavid C Somayajulu * 59311e25f0dSDavid C Somayajulu * @param p_hwfn 59411e25f0dSDavid C Somayajulu * @param p_ptt 59511e25f0dSDavid C Somayajulu */ 59611e25f0dSDavid C Somayajulu enum _ecore_status_t ecore_load_mcp_offsets(struct ecore_hwfn *p_hwfn, 59711e25f0dSDavid C Somayajulu struct ecore_ptt *p_ptt); 59811e25f0dSDavid C Somayajulu 599217ec208SDavid C Somayajulu enum ecore_mcp_drv_attr_cmd { 600217ec208SDavid C Somayajulu ECORE_MCP_DRV_ATTR_CMD_READ, 601217ec208SDavid C Somayajulu ECORE_MCP_DRV_ATTR_CMD_WRITE, 602217ec208SDavid C Somayajulu ECORE_MCP_DRV_ATTR_CMD_READ_CLEAR, 603217ec208SDavid C Somayajulu ECORE_MCP_DRV_ATTR_CMD_CLEAR, 604217ec208SDavid C Somayajulu }; 605217ec208SDavid C Somayajulu 606217ec208SDavid C Somayajulu struct ecore_mcp_drv_attr { 607217ec208SDavid C Somayajulu enum ecore_mcp_drv_attr_cmd attr_cmd; 608217ec208SDavid C Somayajulu u32 attr_num; 609217ec208SDavid C Somayajulu 610217ec208SDavid C Somayajulu /* R/RC - will be set with the read value 611217ec208SDavid C Somayajulu * W - should hold the required value to be written 612217ec208SDavid C Somayajulu * C - DC 613217ec208SDavid C Somayajulu */ 614217ec208SDavid C Somayajulu u32 val; 615217ec208SDavid C Somayajulu 616217ec208SDavid C Somayajulu /* W - mask/offset to be applied on the given value 617217ec208SDavid C Somayajulu * R/RC/C - DC 618217ec208SDavid C Somayajulu */ 619217ec208SDavid C Somayajulu u32 mask; 620217ec208SDavid C Somayajulu u32 offset; 621217ec208SDavid C Somayajulu }; 622217ec208SDavid C Somayajulu 623217ec208SDavid C Somayajulu /** 624217ec208SDavid C Somayajulu * @brief Handle the drivers' attributes that are kept by the MFW. 625217ec208SDavid C Somayajulu * 626217ec208SDavid C Somayajulu * @param p_hwfn 627217ec208SDavid C Somayajulu * @param p_ptt 628217ec208SDavid C Somayajulu * @param p_drv_attr 629217ec208SDavid C Somayajulu */ 630217ec208SDavid C Somayajulu enum _ecore_status_t 631217ec208SDavid C Somayajulu ecore_mcp_drv_attribute(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt, 632217ec208SDavid C Somayajulu struct ecore_mcp_drv_attr *p_drv_attr); 633217ec208SDavid C Somayajulu 634217ec208SDavid C Somayajulu /** 635217ec208SDavid C Somayajulu * @brief Read ufp config from the shared memory. 636217ec208SDavid C Somayajulu * 637217ec208SDavid C Somayajulu * @param p_hwfn 638217ec208SDavid C Somayajulu * @param p_ptt 639217ec208SDavid C Somayajulu */ 640217ec208SDavid C Somayajulu void 641217ec208SDavid C Somayajulu ecore_mcp_read_ufp_config(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt); 642217ec208SDavid C Somayajulu 643217ec208SDavid C Somayajulu /** 644217ec208SDavid C Somayajulu * @brief Get the engine affinity configuration. 645217ec208SDavid C Somayajulu * 646217ec208SDavid C Somayajulu * @param p_hwfn 647217ec208SDavid C Somayajulu * @param p_ptt 648217ec208SDavid C Somayajulu */ 649217ec208SDavid C Somayajulu enum _ecore_status_t ecore_mcp_get_engine_config(struct ecore_hwfn *p_hwfn, 650217ec208SDavid C Somayajulu struct ecore_ptt *p_ptt); 651217ec208SDavid C Somayajulu 652217ec208SDavid C Somayajulu /** 653217ec208SDavid C Somayajulu * @brief Get the PPFID bitmap. 654217ec208SDavid C Somayajulu * 655217ec208SDavid C Somayajulu * @param p_hwfn 656217ec208SDavid C Somayajulu * @param p_ptt 657217ec208SDavid C Somayajulu */ 658217ec208SDavid C Somayajulu enum _ecore_status_t ecore_mcp_get_ppfid_bitmap(struct ecore_hwfn *p_hwfn, 659217ec208SDavid C Somayajulu struct ecore_ptt *p_ptt); 660217ec208SDavid C Somayajulu 661217ec208SDavid C Somayajulu /** 662217ec208SDavid C Somayajulu * @brief Acquire MCP lock to access to HW indirection table entries 663217ec208SDavid C Somayajulu * 664217ec208SDavid C Somayajulu * @param p_hwfn 665217ec208SDavid C Somayajulu * @param p_ptt 666217ec208SDavid C Somayajulu * @param retry_num 667217ec208SDavid C Somayajulu * @param retry_interval 668217ec208SDavid C Somayajulu */ 669217ec208SDavid C Somayajulu enum _ecore_status_t 670217ec208SDavid C Somayajulu ecore_mcp_ind_table_lock(struct ecore_hwfn *p_hwfn, 671217ec208SDavid C Somayajulu struct ecore_ptt *p_ptt, 672217ec208SDavid C Somayajulu u8 retry_num, 673217ec208SDavid C Somayajulu u32 retry_interval); 674217ec208SDavid C Somayajulu 675217ec208SDavid C Somayajulu /** 676217ec208SDavid C Somayajulu * @brief Release MCP lock of access to HW indirection table entries 677217ec208SDavid C Somayajulu * 678217ec208SDavid C Somayajulu * @param p_hwfn 679217ec208SDavid C Somayajulu * @param p_ptt 680217ec208SDavid C Somayajulu */ 681217ec208SDavid C Somayajulu enum _ecore_status_t 682217ec208SDavid C Somayajulu ecore_mcp_ind_table_unlock(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt); 683217ec208SDavid C Somayajulu 68411e25f0dSDavid C Somayajulu #endif /* __ECORE_MCP_H__ */ 685