Path: blob/main/sys/contrib/ncsw/inc/Peripherals/fm_ext.h
48375 views
/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc1* All rights reserved.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions are met:5* * Redistributions of source code must retain the above copyright6* notice, this list of conditions and the following disclaimer.7* * Redistributions in binary form must reproduce the above copyright8* notice, this list of conditions and the following disclaimer in the9* documentation and/or other materials provided with the distribution.10* * Neither the name of Freescale Semiconductor nor the11* names of its contributors may be used to endorse or promote products12* derived from this software without specific prior written permission.13*14*15* ALTERNATIVELY, this software may be distributed under the terms of the16* GNU General Public License ("GPL") as published by the Free Software17* Foundation, either version 2 of that License or (at your option) any18* later version.19*20* THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY21* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED22* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE23* DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY24* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES25* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;26* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND27* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT28* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS29* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.30*/313233/**************************************************************************//**34@File fm_ext.h3536@Description FM Application Programming Interface.37*//***************************************************************************/38#ifndef __FM_EXT39#define __FM_EXT4041#include "error_ext.h"42#include "std_ext.h"43#include "dpaa_ext.h"44#include "fsl_fman_sp.h"4546/**************************************************************************//**47@Group FM_grp Frame Manager API4849@Description FM API functions, definitions and enums.5051@{52*//***************************************************************************/5354/**************************************************************************//**55@Group FM_lib_grp FM library5657@Description FM API functions, definitions and enums.5859The FM module is the main driver module and is a mandatory module60for FM driver users. This module must be initialized first prior61to any other drivers modules.62The FM is a "singleton" module. It is responsible of the common63HW modules: FPM, DMA, common QMI and common BMI initializations and64run-time control routines. This module must be initialized always65when working with any of the FM modules.66NOTE - We assume that the FM library will be initialized only by core No. 0!6768@{69*//***************************************************************************/7071/**************************************************************************//**72@Description Enum for defining port types73*//***************************************************************************/74typedef enum e_FmPortType {75e_FM_PORT_TYPE_OH_OFFLINE_PARSING = 0, /**< Offline parsing port */76e_FM_PORT_TYPE_RX, /**< 1G Rx port */77e_FM_PORT_TYPE_RX_10G, /**< 10G Rx port */78e_FM_PORT_TYPE_TX, /**< 1G Tx port */79e_FM_PORT_TYPE_TX_10G, /**< 10G Tx port */80e_FM_PORT_TYPE_DUMMY81} e_FmPortType;8283/**************************************************************************//**84@Collection General FM defines85*//***************************************************************************/86#define FM_MAX_NUM_OF_PARTITIONS 64 /**< Maximum number of partitions */87#define FM_PHYS_ADDRESS_SIZE 6 /**< FM Physical address size */88/* @} */899091#if defined(__MWERKS__) && !defined(__GNUC__)92#pragma pack(push,1)93#endif /* defined(__MWERKS__) && ... */9495/**************************************************************************//**96@Description FM physical Address97*//***************************************************************************/98typedef _Packed struct t_FmPhysAddr {99volatile uint8_t high; /**< High part of the physical address */100volatile uint32_t low; /**< Low part of the physical address */101} _PackedType t_FmPhysAddr;102103/**************************************************************************//**104@Description Parse results memory layout105*//***************************************************************************/106typedef _Packed struct t_FmPrsResult {107volatile uint8_t lpid; /**< Logical port id */108volatile uint8_t shimr; /**< Shim header result */109volatile uint16_t l2r; /**< Layer 2 result */110volatile uint16_t l3r; /**< Layer 3 result */111volatile uint8_t l4r; /**< Layer 4 result */112volatile uint8_t cplan; /**< Classification plan id */113volatile uint16_t nxthdr; /**< Next Header */114volatile uint16_t cksum; /**< Running-sum */115volatile uint16_t flags_frag_off; /**< Flags & fragment-offset field of the last IP-header */116volatile uint8_t route_type; /**< Routing type field of a IPv6 routing extension header */117volatile uint8_t rhp_ip_valid; /**< Routing Extension Header Present; last bit is IP valid */118volatile uint8_t shim_off[2]; /**< Shim offset */119volatile uint8_t ip_pid_off; /**< IP PID (last IP-proto) offset */120volatile uint8_t eth_off; /**< ETH offset */121volatile uint8_t llc_snap_off; /**< LLC_SNAP offset */122volatile uint8_t vlan_off[2]; /**< VLAN offset */123volatile uint8_t etype_off; /**< ETYPE offset */124volatile uint8_t pppoe_off; /**< PPP offset */125volatile uint8_t mpls_off[2]; /**< MPLS offset */126volatile uint8_t ip_off[2]; /**< IP offset */127volatile uint8_t gre_off; /**< GRE offset */128volatile uint8_t l4_off; /**< Layer 4 offset */129volatile uint8_t nxthdr_off; /**< Parser end point */130} _PackedType t_FmPrsResult;131132/**************************************************************************//**133@Collection FM Parser results134*//***************************************************************************/135#define FM_PR_L2_VLAN_STACK 0x00000100 /**< Parse Result: VLAN stack */136#define FM_PR_L2_ETHERNET 0x00008000 /**< Parse Result: Ethernet*/137#define FM_PR_L2_VLAN 0x00004000 /**< Parse Result: VLAN */138#define FM_PR_L2_LLC_SNAP 0x00002000 /**< Parse Result: LLC_SNAP */139#define FM_PR_L2_MPLS 0x00001000 /**< Parse Result: MPLS */140#define FM_PR_L2_PPPoE 0x00000800 /**< Parse Result: PPPoE */141/* @} */142143/**************************************************************************//**144@Collection FM Frame descriptor macros145*//***************************************************************************/146#define FM_FD_CMD_FCO 0x80000000 /**< Frame queue Context Override */147#define FM_FD_CMD_RPD 0x40000000 /**< Read Prepended Data */148#define FM_FD_CMD_UPD 0x20000000 /**< Update Prepended Data */149#define FM_FD_CMD_DTC 0x10000000 /**< Do L4 Checksum */150#define FM_FD_CMD_DCL4C 0x10000000 /**< Didn't calculate L4 Checksum */151#define FM_FD_CMD_CFQ 0x00ffffff /**< Confirmation Frame Queue */152153#define FM_FD_ERR_UNSUPPORTED_FORMAT 0x04000000 /**< Not for Rx-Port! Unsupported Format */154#define FM_FD_ERR_LENGTH 0x02000000 /**< Not for Rx-Port! Length Error */155#define FM_FD_ERR_DMA 0x01000000 /**< DMA Data error */156157#define FM_FD_IPR 0x00000001 /**< IPR frame (not error) */158159#define FM_FD_ERR_IPR_NCSP (0x00100000 | FM_FD_IPR) /**< IPR non-consistent-sp */160#define FM_FD_ERR_IPR (0x00200000 | FM_FD_IPR) /**< IPR error */161#define FM_FD_ERR_IPR_TO (0x00300000 | FM_FD_IPR) /**< IPR timeout */162163#ifdef FM_CAPWAP_SUPPORT164#define FM_FD_ERR_CRE 0x00200000165#define FM_FD_ERR_CHE 0x00100000166#endif /* FM_CAPWAP_SUPPORT */167168#define FM_FD_ERR_PHYSICAL 0x00080000 /**< Rx FIFO overflow, FCS error, code error, running disparity169error (SGMII and TBI modes), FIFO parity error. PHY170Sequence error, PHY error control character detected. */171#define FM_FD_ERR_SIZE 0x00040000 /**< Frame too long OR Frame size exceeds max_length_frame */172#define FM_FD_ERR_CLS_DISCARD 0x00020000 /**< classification discard */173#define FM_FD_ERR_EXTRACTION 0x00008000 /**< Extract Out of Frame */174#define FM_FD_ERR_NO_SCHEME 0x00004000 /**< No Scheme Selected */175#define FM_FD_ERR_KEYSIZE_OVERFLOW 0x00002000 /**< Keysize Overflow */176#define FM_FD_ERR_COLOR_RED 0x00000800 /**< Frame color is red */177#define FM_FD_ERR_COLOR_YELLOW 0x00000400 /**< Frame color is yellow */178#define FM_FD_ERR_ILL_PLCR 0x00000200 /**< Illegal Policer Profile selected */179#define FM_FD_ERR_PLCR_FRAME_LEN 0x00000100 /**< Policer frame length error */180#define FM_FD_ERR_PRS_TIMEOUT 0x00000080 /**< Parser Time out Exceed */181#define FM_FD_ERR_PRS_ILL_INSTRUCT 0x00000040 /**< Invalid Soft Parser instruction */182#define FM_FD_ERR_PRS_HDR_ERR 0x00000020 /**< Header error was identified during parsing */183#define FM_FD_ERR_BLOCK_LIMIT_EXCEEDED 0x00000008 /**< Frame parsed beyind 256 first bytes */184185#define FM_FD_TX_STATUS_ERR_MASK (FM_FD_ERR_UNSUPPORTED_FORMAT | \186FM_FD_ERR_LENGTH | \187FM_FD_ERR_DMA) /**< TX Error FD bits */188189#define FM_FD_RX_STATUS_ERR_MASK (FM_FD_ERR_UNSUPPORTED_FORMAT | \190FM_FD_ERR_LENGTH | \191FM_FD_ERR_DMA | \192FM_FD_ERR_IPR | \193FM_FD_ERR_IPR_TO | \194FM_FD_ERR_IPR_NCSP | \195FM_FD_ERR_PHYSICAL | \196FM_FD_ERR_SIZE | \197FM_FD_ERR_CLS_DISCARD | \198FM_FD_ERR_COLOR_RED | \199FM_FD_ERR_COLOR_YELLOW | \200FM_FD_ERR_ILL_PLCR | \201FM_FD_ERR_PLCR_FRAME_LEN | \202FM_FD_ERR_EXTRACTION | \203FM_FD_ERR_NO_SCHEME | \204FM_FD_ERR_KEYSIZE_OVERFLOW | \205FM_FD_ERR_PRS_TIMEOUT | \206FM_FD_ERR_PRS_ILL_INSTRUCT | \207FM_FD_ERR_PRS_HDR_ERR | \208FM_FD_ERR_BLOCK_LIMIT_EXCEEDED) /**< RX Error FD bits */209210#define FM_FD_RX_STATUS_ERR_NON_FM 0x00400000 /**< non Frame-Manager error */211/* @} */212213/**************************************************************************//**214@Description Context A215*//***************************************************************************/216typedef _Packed struct t_FmContextA {217volatile uint32_t command; /**< ContextA Command */218volatile uint8_t res0[4]; /**< ContextA Reserved bits */219} _PackedType t_FmContextA;220221/**************************************************************************//**222@Description Context B223*//***************************************************************************/224typedef uint32_t t_FmContextB;225226/**************************************************************************//**227@Collection Special Operation options228*//***************************************************************************/229typedef uint32_t fmSpecialOperations_t; /**< typedef for defining Special Operation options */230231#define FM_SP_OP_IPSEC 0x80000000 /**< activate features that related to IPSec (e.g fix Eth-type) */232#define FM_SP_OP_IPSEC_UPDATE_UDP_LEN 0x40000000 /**< update the UDP-Len after Encryption */233#define FM_SP_OP_IPSEC_MANIP 0x20000000 /**< handle the IPSec-manip options */234#define FM_SP_OP_RPD 0x10000000 /**< Set the RPD bit */235#define FM_SP_OP_DCL4C 0x08000000 /**< Set the DCL4C bit */236#define FM_SP_OP_CHECK_SEC_ERRORS 0x04000000 /**< Check SEC errors */237#define FM_SP_OP_CLEAR_RPD 0x02000000 /**< Clear the RPD bit */238#define FM_SP_OP_CAPWAP_DTLS_ENC 0x01000000 /**< activate features that related to CAPWAP-DTLS post Encryption */239#define FM_SP_OP_CAPWAP_DTLS_DEC 0x00800000 /**< activate features that related to CAPWAP-DTLS post Decryption */240#define FM_SP_OP_IPSEC_NO_ETH_HDR 0x00400000 /**< activate features that related to IPSec without Eth hdr */241/* @} */242243/**************************************************************************//**244@Collection Context A macros245*//***************************************************************************/246#define FM_CONTEXTA_OVERRIDE_MASK 0x80000000247#define FM_CONTEXTA_ICMD_MASK 0x40000000248#define FM_CONTEXTA_A1_VALID_MASK 0x20000000249#define FM_CONTEXTA_MACCMD_MASK 0x00ff0000250#define FM_CONTEXTA_MACCMD_VALID_MASK 0x00800000251#define FM_CONTEXTA_MACCMD_SECURED_MASK 0x00100000252#define FM_CONTEXTA_MACCMD_SC_MASK 0x000f0000253#define FM_CONTEXTA_A1_MASK 0x0000ffff254255#define FM_CONTEXTA_GET_OVERRIDE(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_OVERRIDE_MASK) >> (31-0))256#define FM_CONTEXTA_GET_ICMD(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_ICMD_MASK) >> (31-1))257#define FM_CONTEXTA_GET_A1_VALID(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_A1_VALID_MASK) >> (31-2))258#define FM_CONTEXTA_GET_A1(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_A1_MASK) >> (31-31))259#define FM_CONTEXTA_GET_MACCMD(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_MACCMD_MASK) >> (31-15))260#define FM_CONTEXTA_GET_MACCMD_VALID(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_MACCMD_VALID_MASK) >> (31-8))261#define FM_CONTEXTA_GET_MACCMD_SECURED(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_MACCMD_SECURED_MASK) >> (31-11))262#define FM_CONTEXTA_GET_MACCMD_SECURE_CHANNEL(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_MACCMD_SC_MASK) >> (31-15))263264#define FM_CONTEXTA_SET_OVERRIDE(contextA,val) (((t_FmContextA *)contextA)->command = (uint32_t)((((t_FmContextA *)contextA)->command & ~FM_CONTEXTA_OVERRIDE_MASK) | (((uint32_t)(val) << (31-0)) & FM_CONTEXTA_OVERRIDE_MASK) ))265#define FM_CONTEXTA_SET_ICMD(contextA,val) (((t_FmContextA *)contextA)->command = (uint32_t)((((t_FmContextA *)contextA)->command & ~FM_CONTEXTA_ICMD_MASK) | (((val) << (31-1)) & FM_CONTEXTA_ICMD_MASK) ))266#define FM_CONTEXTA_SET_A1_VALID(contextA,val) (((t_FmContextA *)contextA)->command = (uint32_t)((((t_FmContextA *)contextA)->command & ~FM_CONTEXTA_A1_VALID_MASK) | (((val) << (31-2)) & FM_CONTEXTA_A1_VALID_MASK) ))267#define FM_CONTEXTA_SET_A1(contextA,val) (((t_FmContextA *)contextA)->command = (uint32_t)((((t_FmContextA *)contextA)->command & ~FM_CONTEXTA_A1_MASK) | (((val) << (31-31)) & FM_CONTEXTA_A1_MASK) ))268#define FM_CONTEXTA_SET_MACCMD(contextA,val) (((t_FmContextA *)contextA)->command = (uint32_t)((((t_FmContextA *)contextA)->command & ~FM_CONTEXTA_MACCMD_MASK) | (((val) << (31-15)) & FM_CONTEXTA_MACCMD_MASK) ))269#define FM_CONTEXTA_SET_MACCMD_VALID(contextA,val) (((t_FmContextA *)contextA)->command = (uint32_t)((((t_FmContextA *)contextA)->command & ~FM_CONTEXTA_MACCMD_VALID_MASK) | (((val) << (31-8)) & FM_CONTEXTA_MACCMD_VALID_MASK) ))270#define FM_CONTEXTA_SET_MACCMD_SECURED(contextA,val) (((t_FmContextA *)contextA)->command = (uint32_t)((((t_FmContextA *)contextA)->command & ~FM_CONTEXTA_MACCMD_SECURED_MASK) | (((val) << (31-11)) & FM_CONTEXTA_MACCMD_SECURED_MASK) ))271#define FM_CONTEXTA_SET_MACCMD_SECURE_CHANNEL(contextA,val) (((t_FmContextA *)contextA)->command = (uint32_t)((((t_FmContextA *)contextA)->command & ~FM_CONTEXTA_MACCMD_SC_MASK) | (((val) << (31-15)) & FM_CONTEXTA_MACCMD_SC_MASK) ))272/* @} */273274/**************************************************************************//**275@Collection Context B macros276*//***************************************************************************/277#define FM_CONTEXTB_FQID_MASK 0x00ffffff278279#define FM_CONTEXTB_GET_FQID(contextB) (*((t_FmContextB *)contextB) & FM_CONTEXTB_FQID_MASK)280#define FM_CONTEXTB_SET_FQID(contextB,val) (*((t_FmContextB *)contextB) = ((*((t_FmContextB *)contextB) & ~FM_CONTEXTB_FQID_MASK) | ((val) & FM_CONTEXTB_FQID_MASK)))281/* @} */282283#if defined(__MWERKS__) && !defined(__GNUC__)284#pragma pack(pop)285#endif /* defined(__MWERKS__) && ... */286287288/**************************************************************************//**289@Description FM Exceptions290*//***************************************************************************/291typedef enum e_FmExceptions {292e_FM_EX_DMA_BUS_ERROR = 0, /**< DMA bus error. */293e_FM_EX_DMA_READ_ECC, /**< Read Buffer ECC error (Valid for FM rev < 6)*/294e_FM_EX_DMA_SYSTEM_WRITE_ECC, /**< Write Buffer ECC error on system side (Valid for FM rev < 6)*/295e_FM_EX_DMA_FM_WRITE_ECC, /**< Write Buffer ECC error on FM side (Valid for FM rev < 6)*/296e_FM_EX_DMA_SINGLE_PORT_ECC, /**< Single Port ECC error on FM side (Valid for FM rev > 6)*/297e_FM_EX_FPM_STALL_ON_TASKS, /**< Stall of tasks on FPM */298e_FM_EX_FPM_SINGLE_ECC, /**< Single ECC on FPM. */299e_FM_EX_FPM_DOUBLE_ECC, /**< Double ECC error on FPM ram access */300e_FM_EX_QMI_SINGLE_ECC, /**< Single ECC on QMI. */301e_FM_EX_QMI_DOUBLE_ECC, /**< Double bit ECC occurred on QMI */302e_FM_EX_QMI_DEQ_FROM_UNKNOWN_PORTID,/**< Dequeue from unknown port id */303e_FM_EX_BMI_LIST_RAM_ECC, /**< Linked List RAM ECC error */304e_FM_EX_BMI_STORAGE_PROFILE_ECC, /**< Storage Profile ECC Error */305e_FM_EX_BMI_STATISTICS_RAM_ECC, /**< Statistics Count RAM ECC Error Enable */306e_FM_EX_BMI_DISPATCH_RAM_ECC, /**< Dispatch RAM ECC Error Enable */307e_FM_EX_IRAM_ECC, /**< Double bit ECC occurred on IRAM*/308e_FM_EX_MURAM_ECC /**< Double bit ECC occurred on MURAM*/309} e_FmExceptions;310311/**************************************************************************//**312@Description Enum for defining port DMA swap mode313*//***************************************************************************/314typedef enum e_FmDmaSwapOption {315e_FM_DMA_NO_SWP = FMAN_DMA_NO_SWP, /**< No swap, transfer data as is.*/316e_FM_DMA_SWP_PPC_LE = FMAN_DMA_SWP_PPC_LE, /**< The transferred data should be swapped317in PowerPc Little Endian mode. */318e_FM_DMA_SWP_BE = FMAN_DMA_SWP_BE /**< The transferred data should be swapped319in Big Endian mode */320} e_FmDmaSwapOption;321322/**************************************************************************//**323@Description Enum for defining port DMA cache attributes324*//***************************************************************************/325typedef enum e_FmDmaCacheOption {326e_FM_DMA_NO_STASH = FMAN_DMA_NO_STASH, /**< Cacheable, no Allocate (No Stashing) */327e_FM_DMA_STASH = FMAN_DMA_STASH /**< Cacheable and Allocate (Stashing on) */328} e_FmDmaCacheOption;329330331/**************************************************************************//**332@Group FM_init_grp FM Initialization Unit333334@Description FM Initialization Unit335336Initialization Flow337Initialization of the FM Module will be carried out by the application338according to the following sequence:339- Calling the configuration routine with basic parameters.340- Calling the advance initialization routines to change driver's defaults.341- Calling the initialization routine.342343@{344*//***************************************************************************/345346/**************************************************************************//**347@Function t_FmExceptionsCallback348349@Description Exceptions user callback routine, will be called upon an350exception passing the exception identification.351352@Param[in] h_App - User's application descriptor.353@Param[in] exception - The exception.354*//***************************************************************************/355typedef void (t_FmExceptionsCallback)(t_Handle h_App,356e_FmExceptions exception);357358359/**************************************************************************//**360@Function t_FmBusErrorCallback361362@Description Bus error user callback routine, will be called upon a363bus error, passing parameters describing the errors and the owner.364365@Param[in] h_App - User's application descriptor.366@Param[in] portType - Port type (e_FmPortType)367@Param[in] portId - Port id - relative to type.368@Param[in] addr - Address that caused the error369@Param[in] tnum - Owner of error370@Param[in] liodn - Logical IO device number371*//***************************************************************************/372typedef void (t_FmBusErrorCallback) (t_Handle h_App,373e_FmPortType portType,374uint8_t portId,375uint64_t addr,376uint8_t tnum,377uint16_t liodn);378379/**************************************************************************//**380@Description A structure for defining buffer prefix area content.381*//***************************************************************************/382typedef struct t_FmBufferPrefixContent {383uint16_t privDataSize; /**< Number of bytes to be left at the beginning384of the external buffer; Note that the private-area will385start from the base of the buffer address. */386bool passPrsResult; /**< TRUE to pass the parse result to/from the FM;387User may use FM_PORT_GetBufferPrsResult() in order to388get the parser-result from a buffer. */389bool passTimeStamp; /**< TRUE to pass the timeStamp to/from the FM390User may use FM_PORT_GetBufferTimeStamp() in order to391get the parser-result from a buffer. */392bool passHashResult; /**< TRUE to pass the KG hash result to/from the FM393User may use FM_PORT_GetBufferHashResult() in order to394get the parser-result from a buffer. */395bool passAllOtherPCDInfo;/**< Add all other Internal-Context information:396AD, hash-result, key, etc. */397uint16_t dataAlign; /**< 0 to use driver's default alignment [DEFAULT_FM_SP_bufferPrefixContent_dataAlign],398other value for selecting a data alignment (must be a power of 2);399if write optimization is used, must be >= 16. */400uint8_t manipExtraSpace; /**< Maximum extra size needed (insertion-size minus removal-size);401Note that this field impacts the size of the buffer-prefix402(i.e. it pushes the data offset);403This field is irrelevant if DPAA_VERSION==10 */404} t_FmBufferPrefixContent;405406/**************************************************************************//**407@Description A structure of information about each of the external408buffer pools used by a port or storage-profile.409*//***************************************************************************/410typedef struct t_FmExtPoolParams {411uint8_t id; /**< External buffer pool id */412uint16_t size; /**< External buffer pool buffer size */413} t_FmExtPoolParams;414415/**************************************************************************//**416@Description A structure for informing the driver about the external417buffer pools allocated in the BM and used by a port or a418storage-profile.419*//***************************************************************************/420typedef struct t_FmExtPools {421uint8_t numOfPoolsUsed; /**< Number of pools use by this port */422t_FmExtPoolParams extBufPool[FM_PORT_MAX_NUM_OF_EXT_POOLS];423/**< Parameters for each port */424} t_FmExtPools;425426/**************************************************************************//**427@Description A structure for defining backup BM Pools.428*//***************************************************************************/429typedef struct t_FmBackupBmPools {430uint8_t numOfBackupPools; /**< Number of BM backup pools -431must be smaller than the total number of432pools defined for the specified port.*/433uint8_t poolIds[FM_PORT_MAX_NUM_OF_EXT_POOLS];434/**< numOfBackupPools pool id's, specifying which435pools should be used only as backup. Pool436id's specified here must be a subset of the437pools used by the specified port.*/438} t_FmBackupBmPools;439440/**************************************************************************//**441@Description A structure for defining BM pool depletion criteria442*//***************************************************************************/443typedef struct t_FmBufPoolDepletion {444bool poolsGrpModeEnable; /**< select mode in which pause frames will be sent after445a number of pools (all together!) are depleted */446uint8_t numOfPools; /**< the number of depleted pools that will invoke447pause frames transmission. */448bool poolsToConsider[BM_MAX_NUM_OF_POOLS];449/**< For each pool, TRUE if it should be considered for450depletion (Note - this pool must be used by this port!). */451bool singlePoolModeEnable; /**< select mode in which pause frames will be sent after452a single-pool is depleted; */453bool poolsToConsiderForSingleMode[BM_MAX_NUM_OF_POOLS];454/**< For each pool, TRUE if it should be considered for455depletion (Note - this pool must be used by this port!) */456#if (DPAA_VERSION >= 11)457bool pfcPrioritiesEn[FM_MAX_NUM_OF_PFC_PRIORITIES];458/**< This field is used by the MAC as the Priority Enable Vector in the PFC frame which is transmitted */459#endif /* (DPAA_VERSION >= 11) */460} t_FmBufPoolDepletion;461462/**************************************************************************//**463@Description A Structure for defining Ucode patch for loading.464*//***************************************************************************/465typedef struct t_FmFirmwareParams {466uint32_t size; /**< Size of uCode */467uint32_t *p_Code; /**< A pointer to the uCode */468} t_FmFirmwareParams;469470/**************************************************************************//**471@Description A Structure for defining FM initialization parameters472*//***************************************************************************/473typedef struct t_FmParams {474uint8_t fmId; /**< Index of the FM */475uint8_t guestId; /**< FM Partition Id */476uintptr_t baseAddr; /**< A pointer to base of memory mapped FM registers (virtual);477this field is optional when the FM runs in "guest-mode"478(i.e. guestId != NCSW_MASTER_ID); in that case, the driver will479use the memory-map instead of calling the IPC where possible;480NOTE that this should include ALL common registers of the FM including481the PCD registers area (i.e. until the VSP pages - 880KB). */482t_Handle h_FmMuram; /**< A handle of an initialized MURAM object,483to be used by the FM. */484uint16_t fmClkFreq; /**< In Mhz;485Relevant when FM not runs in "guest-mode". */486uint16_t fmMacClkRatio; /**< FM MAC Clock ratio, for backward comparability:487when fmMacClkRatio = 0, ratio is 2:1488when fmMacClkRatio = 1, ratio is 1:1 */489t_FmExceptionsCallback *f_Exception; /**< An application callback routine to handle exceptions;490Relevant when FM not runs in "guest-mode". */491t_FmBusErrorCallback *f_BusError; /**< An application callback routine to handle exceptions;492Relevant when FM not runs in "guest-mode". */493t_Handle h_App; /**< A handle to an application layer object; This handle will494be passed by the driver upon calling the above callbacks;495Relevant when FM not runs in "guest-mode". */496uintptr_t irq; /**< FM interrupt source for normal events;497Relevant when FM not runs in "guest-mode". */498uintptr_t errIrq; /**< FM interrupt source for errors;499Relevant when FM not runs in "guest-mode". */500t_FmFirmwareParams firmware; /**< The firmware parameters structure;501Relevant when FM not runs in "guest-mode". */502503#if (DPAA_VERSION >= 11)504uintptr_t vspBaseAddr; /**< A pointer to base of memory mapped FM VSP registers (virtual);505i.e. up to 24KB, depending on the specific chip. */506uint8_t partVSPBase; /**< The first Virtual-Storage-Profile-id dedicated to this partition.507NOTE: this parameter relevant only when working with multiple partitions. */508uint8_t partNumOfVSPs; /**< Number of VSPs dedicated to this partition.509NOTE: this parameter relevant only when working with multiple partitions. */510#endif /* (DPAA_VERSION >= 11) */511} t_FmParams;512513514/**************************************************************************//**515@Function FM_Config516517@Description Creates the FM module and returns its handle (descriptor).518This descriptor must be passed as first parameter to all other519FM function calls.520521No actual initialization or configuration of FM hardware is522done by this routine. All FM parameters get default values that523may be changed by calling one or more of the advance config routines.524525@Param[in] p_FmParams - A pointer to a data structure of mandatory FM parameters526527@Return A handle to the FM object, or NULL for Failure.528*//***************************************************************************/529t_Handle FM_Config(t_FmParams *p_FmParams);530531/**************************************************************************//**532@Function FM_Init533534@Description Initializes the FM module by defining the software structure535and configuring the hardware registers.536537@Param[in] h_Fm - FM module descriptor538539@Return E_OK on success; Error code otherwise.540*//***************************************************************************/541t_Error FM_Init(t_Handle h_Fm);542543/**************************************************************************//**544@Function FM_Free545546@Description Frees all resources that were assigned to FM module.547548Calling this routine invalidates the descriptor.549550@Param[in] h_Fm - FM module descriptor551552@Return E_OK on success; Error code otherwise.553*//***************************************************************************/554t_Error FM_Free(t_Handle h_Fm);555556557/**************************************************************************//**558@Group FM_advanced_init_grp FM Advanced Configuration Unit559560@Description Advanced configuration routines are optional routines that may561be called in order to change the default driver settings.562563Note: Advanced configuration routines are not available for guest partition.564@{565*//***************************************************************************/566567/**************************************************************************//**568@Description Enum for selecting DMA debug mode569*//***************************************************************************/570typedef enum e_FmDmaDbgCntMode {571e_FM_DMA_DBG_NO_CNT = 0, /**< No counting */572e_FM_DMA_DBG_CNT_DONE, /**< Count DONE commands */573e_FM_DMA_DBG_CNT_COMM_Q_EM, /**< count command queue emergency signals */574e_FM_DMA_DBG_CNT_INT_READ_EM, /**< Count Internal Read buffer emergency signal */575e_FM_DMA_DBG_CNT_INT_WRITE_EM, /**< Count Internal Write buffer emergency signal */576e_FM_DMA_DBG_CNT_FPM_WAIT, /**< Count FPM WAIT signal */577e_FM_DMA_DBG_CNT_SIGLE_BIT_ECC, /**< Single bit ECC errors. */578e_FM_DMA_DBG_CNT_RAW_WAR_PROT /**< Number of times there was a need for RAW & WAR protection. */579} e_FmDmaDbgCntMode;580581/**************************************************************************//**582@Description Enum for selecting DMA Cache Override583*//***************************************************************************/584typedef enum e_FmDmaCacheOverride {585e_FM_DMA_NO_CACHE_OR = 0, /**< No override of the Cache field */586e_FM_DMA_NO_STASH_DATA, /**< Data should not be stashed in system level cache */587e_FM_DMA_MAY_STASH_DATA, /**< Data may be stashed in system level cache */588e_FM_DMA_STASH_DATA /**< Data should be stashed in system level cache */589} e_FmDmaCacheOverride;590591/**************************************************************************//**592@Description Enum for selecting DMA External Bus Priority593*//***************************************************************************/594typedef enum e_FmDmaExtBusPri {595e_FM_DMA_EXT_BUS_NORMAL = 0, /**< Normal priority */596e_FM_DMA_EXT_BUS_EBS, /**< AXI extended bus service priority */597e_FM_DMA_EXT_BUS_SOS, /**< AXI sos priority */598e_FM_DMA_EXT_BUS_EBS_AND_SOS /**< AXI ebs + sos priority */599} e_FmDmaExtBusPri;600601/**************************************************************************//**602@Description Enum for choosing the field that will be output on AID603*//***************************************************************************/604typedef enum e_FmDmaAidMode {605e_FM_DMA_AID_OUT_PORT_ID = 0, /**< 4 LSB of PORT_ID */606e_FM_DMA_AID_OUT_TNUM /**< 4 LSB of TNUM */607} e_FmDmaAidMode;608609/**************************************************************************//**610@Description Enum for selecting FPM Catastrophic error behavior611*//***************************************************************************/612typedef enum e_FmCatastrophicErr {613e_FM_CATASTROPHIC_ERR_STALL_PORT = 0, /**< Port_ID is stalled (only reset can release it) */614e_FM_CATASTROPHIC_ERR_STALL_TASK /**< Only erroneous task is stalled */615} e_FmCatastrophicErr;616617/**************************************************************************//**618@Description Enum for selecting FPM DMA Error behavior619*//***************************************************************************/620typedef enum e_FmDmaErr {621e_FM_DMA_ERR_CATASTROPHIC = 0, /**< Dma error is treated as a catastrophic622error (e_FmCatastrophicErr)*/623e_FM_DMA_ERR_REPORT /**< Dma error is just reported */624} e_FmDmaErr;625626/**************************************************************************//**627@Description Enum for selecting DMA Emergency level by BMI emergency signal628*//***************************************************************************/629typedef enum e_FmDmaEmergencyLevel {630e_FM_DMA_EM_EBS = 0, /**< EBS emergency */631e_FM_DMA_EM_SOS /**< SOS emergency */632} e_FmDmaEmergencyLevel;633634/**************************************************************************//**635@Collection Enum for selecting DMA Emergency options636*//***************************************************************************/637typedef uint32_t fmEmergencyBus_t; /**< DMA emergency options */638639#define FM_DMA_MURAM_READ_EMERGENCY 0x00800000 /**< Enable emergency for MURAM1 */640#define FM_DMA_MURAM_WRITE_EMERGENCY 0x00400000 /**< Enable emergency for MURAM2 */641#define FM_DMA_EXT_BUS_EMERGENCY 0x00100000 /**< Enable emergency for external bus */642/* @} */643644/**************************************************************************//**645@Description A structure for defining DMA emergency level646*//***************************************************************************/647typedef struct t_FmDmaEmergency {648fmEmergencyBus_t emergencyBusSelect; /**< An OR of the busses where emergency649should be enabled */650e_FmDmaEmergencyLevel emergencyLevel; /**< EBS/SOS */651} t_FmDmaEmergency;652653/**************************************************************************//*654@Description structure for defining FM threshold655*//***************************************************************************/656typedef struct t_FmThresholds {657uint8_t dispLimit; /**< The number of times a frames may658be passed in the FM before assumed to659be looping. */660uint8_t prsDispTh; /**< This is the number pf packets that may be661queued in the parser dispatch queue*/662uint8_t plcrDispTh; /**< This is the number pf packets that may be663queued in the policer dispatch queue*/664uint8_t kgDispTh; /**< This is the number pf packets that may be665queued in the keygen dispatch queue*/666uint8_t bmiDispTh; /**< This is the number pf packets that may be667queued in the BMI dispatch queue*/668uint8_t qmiEnqDispTh; /**< This is the number pf packets that may be669queued in the QMI enqueue dispatch queue*/670uint8_t qmiDeqDispTh; /**< This is the number pf packets that may be671queued in the QMI dequeue dispatch queue*/672uint8_t fmCtl1DispTh; /**< This is the number pf packets that may be673queued in fmCtl1 dispatch queue*/674uint8_t fmCtl2DispTh; /**< This is the number pf packets that may be675queued in fmCtl2 dispatch queue*/676} t_FmThresholds;677678/**************************************************************************//*679@Description structure for defining DMA thresholds680*//***************************************************************************/681typedef struct t_FmDmaThresholds {682uint8_t assertEmergency; /**< When this value is reached,683assert emergency (Threshold)*/684uint8_t clearEmergency; /**< After emergency is asserted, it is held685until this value is reached (Hystheresis) */686} t_FmDmaThresholds;687688/**************************************************************************//**689@Function t_FmResetOnInitOverrideCallback690691@Description FMan specific reset on init user callback routine,692will be used to override the standard FMan reset on init procedure693694@Param[in] h_Fm - FMan handler695*//***************************************************************************/696typedef void (t_FmResetOnInitOverrideCallback)(t_Handle h_Fm);697698/**************************************************************************//**699@Function FM_ConfigResetOnInit700701@Description Define whether to reset the FM before initialization.702Change the default configuration [DEFAULT_resetOnInit].703704@Param[in] h_Fm A handle to an FM Module.705@Param[in] enable When TRUE, FM will be reset before any initialization.706707@Return E_OK on success; Error code otherwise.708709@Cautions Allowed only following FM_Config() and before FM_Init().710This routine should NOT be called from guest-partition711(i.e. guestId != NCSW_MASTER_ID)712*//***************************************************************************/713t_Error FM_ConfigResetOnInit(t_Handle h_Fm, bool enable);714715/**************************************************************************//**716@Function FM_ConfigResetOnInitOverrideCallback717718@Description Define a special reset of FM before initialization.719Change the default configuration [DEFAULT_resetOnInitOverrideCallback].720721@Param[in] h_Fm A handle to an FM Module.722@Param[in] f_ResetOnInitOverride FM specific reset on init user callback routine.723724@Return E_OK on success; Error code otherwise.725726@Cautions Allowed only following FM_Config() and before FM_Init().727This routine should NOT be called from guest-partition728(i.e. guestId != NCSW_MASTER_ID)729*//***************************************************************************/730t_Error FM_ConfigResetOnInitOverrideCallback(t_Handle h_Fm, t_FmResetOnInitOverrideCallback *f_ResetOnInitOverride);731732/**************************************************************************//**733@Function FM_ConfigTotalFifoSize734735@Description Define Total FIFO size for the whole FM.736Calling this routine changes the total Fifo size in the internal driver737data base from its default configuration [DEFAULT_totalFifoSize]738739@Param[in] h_Fm A handle to an FM Module.740@Param[in] totalFifoSize The selected new value.741742@Return E_OK on success; Error code otherwise.743744@Cautions Allowed only following FM_Config() and before FM_Init().745This routine should NOT be called from guest-partition746(i.e. guestId != NCSW_MASTER_ID)747*//***************************************************************************/748t_Error FM_ConfigTotalFifoSize(t_Handle h_Fm, uint32_t totalFifoSize);749750/**************************************************************************//**751@Function FM_ConfigDmaCacheOverride752753@Description Define cache override mode.754Calling this routine changes the cache override mode755in the internal driver data base from its default configuration [DEFAULT_cacheOverride]756757@Param[in] h_Fm A handle to an FM Module.758@Param[in] cacheOverride The selected new value.759760@Return E_OK on success; Error code otherwise.761762@Cautions Allowed only following FM_Config() and before FM_Init().763This routine should NOT be called from guest-partition764(i.e. guestId != NCSW_MASTER_ID)765*//***************************************************************************/766t_Error FM_ConfigDmaCacheOverride(t_Handle h_Fm, e_FmDmaCacheOverride cacheOverride);767768/**************************************************************************//**769@Function FM_ConfigDmaAidOverride770771@Description Define DMA AID override mode.772Calling this routine changes the AID override mode773in the internal driver data base from its default configuration [DEFAULT_aidOverride]774775@Param[in] h_Fm A handle to an FM Module.776@Param[in] aidOverride The selected new value.777778@Return E_OK on success; Error code otherwise.779780@Cautions Allowed only following FM_Config() and before FM_Init().781This routine should NOT be called from guest-partition782(i.e. guestId != NCSW_MASTER_ID)783*//***************************************************************************/784t_Error FM_ConfigDmaAidOverride(t_Handle h_Fm, bool aidOverride);785786/**************************************************************************//**787@Function FM_ConfigDmaAidMode788789@Description Define DMA AID mode.790Calling this routine changes the AID mode in the internal791driver data base from its default configuration [DEFAULT_aidMode]792793@Param[in] h_Fm A handle to an FM Module.794@Param[in] aidMode The selected new value.795796@Return E_OK on success; Error code otherwise.797798@Cautions Allowed only following FM_Config() and before FM_Init().799This routine should NOT be called from guest-partition800(i.e. guestId != NCSW_MASTER_ID)801*//***************************************************************************/802t_Error FM_ConfigDmaAidMode(t_Handle h_Fm, e_FmDmaAidMode aidMode);803804/**************************************************************************//**805@Function FM_ConfigDmaAxiDbgNumOfBeats806807@Description Define DMA AXI number of beats.808Calling this routine changes the AXI number of beats in the internal809driver data base from its default configuration [DEFAULT_axiDbgNumOfBeats]810811@Param[in] h_Fm A handle to an FM Module.812@Param[in] axiDbgNumOfBeats The selected new value.813814@Return E_OK on success; Error code otherwise.815816@Cautions Allowed only following FM_Config() and before FM_Init().817This routine should NOT be called from guest-partition818(i.e. guestId != NCSW_MASTER_ID)819*//***************************************************************************/820t_Error FM_ConfigDmaAxiDbgNumOfBeats(t_Handle h_Fm, uint8_t axiDbgNumOfBeats);821822/**************************************************************************//**823@Function FM_ConfigDmaCamNumOfEntries824825@Description Define number of CAM entries.826Calling this routine changes the number of CAM entries in the internal827driver data base from its default configuration [DEFAULT_dmaCamNumOfEntries].828829@Param[in] h_Fm A handle to an FM Module.830@Param[in] numOfEntries The selected new value.831832@Return E_OK on success; Error code otherwise.833834@Cautions Allowed only following FM_Config() and before FM_Init().835This routine should NOT be called from guest-partition836(i.e. guestId != NCSW_MASTER_ID)837*//***************************************************************************/838t_Error FM_ConfigDmaCamNumOfEntries(t_Handle h_Fm, uint8_t numOfEntries);839840/**************************************************************************//**841@Function FM_ConfigEnableCounters842843@Description Obsolete, always return E_OK.844845@Param[in] h_Fm A handle to an FM Module.846847@Return E_OK on success; Error code otherwise.848*//***************************************************************************/849t_Error FM_ConfigEnableCounters(t_Handle h_Fm);850851/**************************************************************************//**852@Function FM_ConfigDmaDbgCounter853854@Description Define DMA debug counter.855Calling this routine changes the number of the DMA debug counter in the internal856driver data base from its default configuration [DEFAULT_dmaDbgCntMode].857858@Param[in] h_Fm A handle to an FM Module.859@Param[in] fmDmaDbgCntMode An enum selecting the debug counter mode.860861@Return E_OK on success; Error code otherwise.862863@Cautions Allowed only following FM_Config() and before FM_Init().864This routine should NOT be called from guest-partition865(i.e. guestId != NCSW_MASTER_ID)866*//***************************************************************************/867t_Error FM_ConfigDmaDbgCounter(t_Handle h_Fm, e_FmDmaDbgCntMode fmDmaDbgCntMode);868869/**************************************************************************//**870@Function FM_ConfigDmaStopOnBusErr871872@Description Define bus error behavior.873Calling this routine changes the bus error behavior definition874in the internal driver data base from its default875configuration [DEFAULT_dmaStopOnBusError].876877@Param[in] h_Fm A handle to an FM Module.878@Param[in] stop TRUE to stop on bus error, FALSE to continue.879880@Return E_OK on success; Error code otherwise.881882@Cautions Allowed only following FM_Config() and before FM_Init().883Only if bus error is enabled.884This routine should NOT be called from guest-partition885(i.e. guestId != NCSW_MASTER_ID)886*//***************************************************************************/887t_Error FM_ConfigDmaStopOnBusErr(t_Handle h_Fm, bool stop);888889/**************************************************************************//**890@Function FM_ConfigDmaEmergency891892@Description Define DMA emergency.893Calling this routine changes the DMA emergency definition894in the internal driver data base from its default895configuration where's it's disabled.896897@Param[in] h_Fm A handle to an FM Module.898@Param[in] p_Emergency An OR mask of all required options.899900@Return E_OK on success; Error code otherwise.901902@Cautions Allowed only following FM_Config() and before FM_Init().903This routine should NOT be called from guest-partition904(i.e. guestId != NCSW_MASTER_ID)905*//***************************************************************************/906t_Error FM_ConfigDmaEmergency(t_Handle h_Fm, t_FmDmaEmergency *p_Emergency);907908/**************************************************************************//**909@Function FM_ConfigDmaErr910911@Description DMA error treatment.912Calling this routine changes the DMA error treatment913in the internal driver data base from its default914configuration [DEFAULT_dmaErr].915916@Param[in] h_Fm A handle to an FM Module.917@Param[in] dmaErr The selected new choice.918919@Return E_OK on success; Error code otherwise.920921@Cautions Allowed only following FM_Config() and before FM_Init().922This routine should NOT be called from guest-partition923(i.e. guestId != NCSW_MASTER_ID)924*//***************************************************************************/925t_Error FM_ConfigDmaErr(t_Handle h_Fm, e_FmDmaErr dmaErr);926927/**************************************************************************//**928@Function FM_ConfigCatastrophicErr929930@Description Define FM behavior on catastrophic error.931Calling this routine changes the FM behavior on catastrophic932error in the internal driver data base from its default933[DEFAULT_catastrophicErr].934935@Param[in] h_Fm A handle to an FM Module.936@Param[in] catastrophicErr The selected new choice.937938@Return E_OK on success; Error code otherwise.939940@Cautions Allowed only following FM_Config() and before FM_Init().941This routine should NOT be called from guest-partition942(i.e. guestId != NCSW_MASTER_ID)943*//***************************************************************************/944t_Error FM_ConfigCatastrophicErr(t_Handle h_Fm, e_FmCatastrophicErr catastrophicErr);945946/**************************************************************************//**947@Function FM_ConfigEnableMuramTestMode948949@Description Enable MURAM test mode.950Calling this routine changes the internal driver data base951from its default selection of test mode where it's disabled.952This routine is only avaiable on old FM revisions (FMan v2).953954@Param[in] h_Fm A handle to an FM Module.955956@Return E_OK on success; Error code otherwise.957958@Cautions Allowed only following FM_Config() and before FM_Init().959This routine should NOT be called from guest-partition960(i.e. guestId != NCSW_MASTER_ID)961*//***************************************************************************/962t_Error FM_ConfigEnableMuramTestMode(t_Handle h_Fm);963964/**************************************************************************//**965@Function FM_ConfigEnableIramTestMode966967@Description Enable IRAM test mode.968Calling this routine changes the internal driver data base969from its default selection of test mode where it's disabled.970This routine is only avaiable on old FM revisions (FMan v2).971972@Param[in] h_Fm A handle to an FM Module.973974@Return E_OK on success; Error code otherwise.975976@Cautions Allowed only following FM_Config() and before FM_Init().977This routine should NOT be called from guest-partition978(i.e. guestId != NCSW_MASTER_ID)979*//***************************************************************************/980t_Error FM_ConfigEnableIramTestMode(t_Handle h_Fm);981982/**************************************************************************//**983@Function FM_ConfigHaltOnExternalActivation984985@Description Define FM behavior on external halt activation.986Calling this routine changes the FM behavior on external halt987activation in the internal driver data base from its default988[DEFAULT_haltOnExternalActivation].989990@Param[in] h_Fm A handle to an FM Module.991@Param[in] enable TRUE to enable halt on external halt992activation.993994@Return E_OK on success; Error code otherwise.995996@Cautions Allowed only following FM_Config() and before FM_Init().997This routine should NOT be called from guest-partition998(i.e. guestId != NCSW_MASTER_ID)999*//***************************************************************************/1000t_Error FM_ConfigHaltOnExternalActivation(t_Handle h_Fm, bool enable);10011002/**************************************************************************//**1003@Function FM_ConfigHaltOnUnrecoverableEccError10041005@Description Define FM behavior on external halt activation.1006Calling this routine changes the FM behavior on unrecoverable1007ECC error in the internal driver data base from its default1008[DEFAULT_haltOnUnrecoverableEccError].1009This routine is only avaiable on old FM revisions (FMan v2).10101011@Param[in] h_Fm A handle to an FM Module.1012@Param[in] enable TRUE to enable halt on unrecoverable Ecc error10131014@Return E_OK on success; Error code otherwise.10151016@Cautions Allowed only following FM_Config() and before FM_Init().1017This routine should NOT be called from guest-partition1018(i.e. guestId != NCSW_MASTER_ID)1019*//***************************************************************************/1020t_Error FM_ConfigHaltOnUnrecoverableEccError(t_Handle h_Fm, bool enable);10211022/**************************************************************************//**1023@Function FM_ConfigException10241025@Description Define FM exceptions.1026Calling this routine changes the exceptions defaults in the1027internal driver data base where all exceptions are enabled.10281029@Param[in] h_Fm A handle to an FM Module.1030@Param[in] exception The exception to be selected.1031@Param[in] enable TRUE to enable interrupt, FALSE to mask it.10321033@Return E_OK on success; Error code otherwise.10341035@Cautions Allowed only following FM_Config() and before FM_Init().1036This routine should NOT be called from guest-partition1037(i.e. guestId != NCSW_MASTER_ID)1038*//***************************************************************************/1039t_Error FM_ConfigException(t_Handle h_Fm, e_FmExceptions exception, bool enable);10401041/**************************************************************************//**1042@Function FM_ConfigExternalEccRamsEnable10431044@Description Select external ECC enabling.1045Calling this routine changes the ECC enabling control in the internal1046driver data base from its default [DEFAULT_externalEccRamsEnable].1047When this option is enabled Rams ECC enabling is not effected1048by FM_EnableRamsEcc/FM_DisableRamsEcc, but by a JTAG.10491050@Param[in] h_Fm A handle to an FM Module.1051@Param[in] enable TRUE to enable this option.10521053@Return E_OK on success; Error code otherwise.10541055@Cautions Allowed only following FM_Config() and before FM_Init().1056This routine should NOT be called from guest-partition1057(i.e. guestId != NCSW_MASTER_ID)1058*//***************************************************************************/1059t_Error FM_ConfigExternalEccRamsEnable(t_Handle h_Fm, bool enable);10601061/**************************************************************************//**1062@Function FM_ConfigTnumAgingPeriod10631064@Description Define Tnum aging period.1065Calling this routine changes the Tnum aging of dequeue TNUMs1066in the QMI in the internal driver data base from its default1067[DEFAULT_tnumAgingPeriod].10681069@Param[in] h_Fm A handle to an FM Module.1070@Param[in] tnumAgingPeriod Tnum Aging Period in microseconds.1071Note that period is recalculated in units of107264 FM clocks. Driver will pick the closest1073possible period.10741075@Return E_OK on success; Error code otherwise.10761077@Cautions Allowed only following FM_Config() and before FM_Init().1078This routine should NOT be called from guest-partition1079(i.e. guestId != NCSW_MASTER_ID)1080NOTE that if some MAC is configured for PFC, '0' value is NOT1081allowed.1082*//***************************************************************************/1083t_Error FM_ConfigTnumAgingPeriod(t_Handle h_Fm, uint16_t tnumAgingPeriod);10841085/**************************************************************************//*1086@Function FM_ConfigDmaEmergencySmoother10871088@Description Define DMA emergency smoother.1089Calling this routine changes the definition of the minimum1090amount of DATA beats transferred on the AXI READ and WRITE1091ports before lowering the emergency level.1092By default smoother is disabled.10931094@Param[in] h_Fm A handle to an FM Module.1095@Param[in] emergencyCnt emergency switching counter.10961097@Return E_OK on success; Error code otherwise.10981099@Cautions Allowed only following FM_Config() and before FM_Init().1100This routine should NOT be called from guest-partition1101(i.e. guestId != NCSW_MASTER_ID)1102*//***************************************************************************/1103t_Error FM_ConfigDmaEmergencySmoother(t_Handle h_Fm, uint32_t emergencyCnt);11041105/**************************************************************************//*1106@Function FM_ConfigThresholds11071108@Description Calling this routine changes the internal driver data base1109from its default FM threshold configuration:1110dispLimit: [DEFAULT_dispLimit]1111prsDispTh: [DEFAULT_prsDispTh]1112plcrDispTh: [DEFAULT_plcrDispTh]1113kgDispTh: [DEFAULT_kgDispTh]1114bmiDispTh: [DEFAULT_bmiDispTh]1115qmiEnqDispTh: [DEFAULT_qmiEnqDispTh]1116qmiDeqDispTh: [DEFAULT_qmiDeqDispTh]1117fmCtl1DispTh: [DEFAULT_fmCtl1DispTh]1118fmCtl2DispTh: [DEFAULT_fmCtl2DispTh]111911201121@Param[in] h_Fm A handle to an FM Module.1122@Param[in] p_FmThresholds A structure of threshold parameters.11231124@Return E_OK on success; Error code otherwise.11251126@Cautions Allowed only following FM_Config() and before FM_Init().1127This routine should NOT be called from guest-partition1128(i.e. guestId != NCSW_MASTER_ID)1129*//***************************************************************************/1130t_Error FM_ConfigThresholds(t_Handle h_Fm, t_FmThresholds *p_FmThresholds);11311132/**************************************************************************//*1133@Function FM_ConfigDmaSosEmergencyThreshold11341135@Description Calling this routine changes the internal driver data base1136from its default dma SOS emergency configuration [DEFAULT_dmaSosEmergency]11371138@Param[in] h_Fm A handle to an FM Module.1139@Param[in] dmaSosEmergency The selected new value.11401141@Return E_OK on success; Error code otherwise.11421143@Cautions Allowed only following FM_Config() and before FM_Init().1144This routine should NOT be called from guest-partition1145(i.e. guestId != NCSW_MASTER_ID)1146*//***************************************************************************/1147t_Error FM_ConfigDmaSosEmergencyThreshold(t_Handle h_Fm, uint32_t dmaSosEmergency);11481149/**************************************************************************//*1150@Function FM_ConfigDmaWriteBufThresholds11511152@Description Calling this routine changes the internal driver data base1153from its default configuration of DMA write buffer threshold1154assertEmergency: [DEFAULT_dmaWriteIntBufLow]1155clearEmergency: [DEFAULT_dmaWriteIntBufHigh]1156This routine is only avaiable on old FM revisions (FMan v2).11571158@Param[in] h_Fm A handle to an FM Module.1159@Param[in] p_FmDmaThresholds A structure of thresholds to define emergency behavior -1160When 'assertEmergency' value is reached, emergency is asserted,1161then it is held until 'clearEmergency' value is reached.11621163@Return E_OK on success; Error code otherwise.11641165@Cautions Allowed only following FM_Config() and before FM_Init().1166This routine should NOT be called from guest-partition1167(i.e. guestId != NCSW_MASTER_ID)1168*//***************************************************************************/1169t_Error FM_ConfigDmaWriteBufThresholds(t_Handle h_Fm, t_FmDmaThresholds *p_FmDmaThresholds);11701171/**************************************************************************//*1172@Function FM_ConfigDmaCommQThresholds11731174@Description Calling this routine changes the internal driver data base1175from its default configuration of DMA command queue threshold1176assertEmergency: [DEFAULT_dmaCommQLow]1177clearEmergency: [DEFAULT_dmaCommQHigh]11781179@Param[in] h_Fm A handle to an FM Module.1180@Param[in] p_FmDmaThresholds A structure of thresholds to define emergency behavior -1181When 'assertEmergency' value is reached, emergency is asserted,1182then it is held until 'clearEmergency' value is reached..11831184@Return E_OK on success; Error code otherwise.11851186@Cautions Allowed only following FM_Config() and before FM_Init().1187This routine should NOT be called from guest-partition1188(i.e. guestId != NCSW_MASTER_ID)1189*//***************************************************************************/1190t_Error FM_ConfigDmaCommQThresholds(t_Handle h_Fm, t_FmDmaThresholds *p_FmDmaThresholds);11911192/**************************************************************************//*1193@Function FM_ConfigDmaReadBufThresholds11941195@Description Calling this routine changes the internal driver data base1196from its default configuration of DMA read buffer threshold1197assertEmergency: [DEFAULT_dmaReadIntBufLow]1198clearEmergency: [DEFAULT_dmaReadIntBufHigh]1199This routine is only avaiable on old FM revisions (FMan v2).12001201@Param[in] h_Fm A handle to an FM Module.1202@Param[in] p_FmDmaThresholds A structure of thresholds to define emergency behavior -1203When 'assertEmergency' value is reached, emergency is asserted,1204then it is held until 'clearEmergency' value is reached..12051206@Return E_OK on success; Error code otherwise.12071208@Cautions Allowed only following FM_Config() and before FM_Init().1209This routine should NOT be called from guest-partition1210(i.e. guestId != NCSW_MASTER_ID)1211*//***************************************************************************/1212t_Error FM_ConfigDmaReadBufThresholds(t_Handle h_Fm, t_FmDmaThresholds *p_FmDmaThresholds);12131214/**************************************************************************//*1215@Function FM_ConfigDmaWatchdog12161217@Description Calling this routine changes the internal driver data base1218from its default watchdog configuration, which is disabled1219[DEFAULT_dmaWatchdog].12201221@Param[in] h_Fm A handle to an FM Module.1222@Param[in] watchDogValue The selected new value - in microseconds.12231224@Return E_OK on success; Error code otherwise.12251226@Cautions Allowed only following FM_Config() and before FM_Init().1227This routine should NOT be called from guest-partition1228(i.e. guestId != NCSW_MASTER_ID)1229*//***************************************************************************/1230t_Error FM_ConfigDmaWatchdog(t_Handle h_Fm, uint32_t watchDogValue);12311232/** @} */ /* end of FM_advanced_init_grp group */1233/** @} */ /* end of FM_init_grp group */123412351236/**************************************************************************//**1237@Group FM_runtime_control_grp FM Runtime Control Unit12381239@Description FM Runtime control unit API functions, definitions and enums.1240The FM driver provides a set of control routines.1241These routines may only be called after the module was fully1242initialized (both configuration and initialization routines were1243called). They are typically used to get information from hardware1244(status, counters/statistics, revision etc.), to modify a current1245state or to force/enable a required action. Run-time control may1246be called whenever necessary and as many times as needed.1247@{1248*//***************************************************************************/12491250/**************************************************************************//**1251@Collection General FM defines.1252*//***************************************************************************/1253#define FM_MAX_NUM_OF_VALID_PORTS (FM_MAX_NUM_OF_OH_PORTS + \1254FM_MAX_NUM_OF_1G_RX_PORTS + \1255FM_MAX_NUM_OF_10G_RX_PORTS + \1256FM_MAX_NUM_OF_1G_TX_PORTS + \1257FM_MAX_NUM_OF_10G_TX_PORTS) /**< Number of available FM ports */1258/* @} */12591260/**************************************************************************//*1261@Description A Structure for Port bandwidth requirement. Port is identified1262by type and relative id.1263*//***************************************************************************/1264typedef struct t_FmPortBandwidth {1265e_FmPortType type; /**< FM port type */1266uint8_t relativePortId; /**< Type relative port id */1267uint8_t bandwidth; /**< bandwidth - (in term of percents) */1268} t_FmPortBandwidth;12691270/**************************************************************************//*1271@Description A Structure containing an array of Port bandwidth requirements.1272The user should state the ports requiring bandwidth in terms of1273percentage - i.e. all port's bandwidths in the array must add1274up to 100.1275*//***************************************************************************/1276typedef struct t_FmPortsBandwidthParams {1277uint8_t numOfPorts; /**< The number of relevant ports, which is the1278number of valid entries in the array below */1279t_FmPortBandwidth portsBandwidths[FM_MAX_NUM_OF_VALID_PORTS];1280/**< for each port, it's bandwidth (all port's1281bandwidths must add up to 100.*/1282} t_FmPortsBandwidthParams;12831284/**************************************************************************//**1285@Description DMA Emergency control on MURAM1286*//***************************************************************************/1287typedef enum e_FmDmaMuramPort {1288e_FM_DMA_MURAM_PORT_WRITE, /**< MURAM write port */1289e_FM_DMA_MURAM_PORT_READ /**< MURAM read port */1290} e_FmDmaMuramPort;12911292/**************************************************************************//**1293@Description Enum for defining FM counters1294*//***************************************************************************/1295typedef enum e_FmCounters {1296e_FM_COUNTERS_ENQ_TOTAL_FRAME = 0, /**< QMI total enqueued frames counter */1297e_FM_COUNTERS_DEQ_TOTAL_FRAME, /**< QMI total dequeued frames counter */1298e_FM_COUNTERS_DEQ_0, /**< QMI 0 frames from QMan counter */1299e_FM_COUNTERS_DEQ_1, /**< QMI 1 frames from QMan counter */1300e_FM_COUNTERS_DEQ_2, /**< QMI 2 frames from QMan counter */1301e_FM_COUNTERS_DEQ_3, /**< QMI 3 frames from QMan counter */1302e_FM_COUNTERS_DEQ_FROM_DEFAULT, /**< QMI dequeue from default queue counter */1303e_FM_COUNTERS_DEQ_FROM_CONTEXT, /**< QMI dequeue from FQ context counter */1304e_FM_COUNTERS_DEQ_FROM_FD, /**< QMI dequeue from FD command field counter */1305e_FM_COUNTERS_DEQ_CONFIRM /**< QMI dequeue confirm counter */1306} e_FmCounters;13071308/**************************************************************************//**1309@Description A Structure for returning FM revision information1310*//***************************************************************************/1311typedef struct t_FmRevisionInfo {1312uint8_t majorRev; /**< Major revision */1313uint8_t minorRev; /**< Minor revision */1314} t_FmRevisionInfo;13151316/**************************************************************************//**1317@Description A Structure for returning FM ctrl code revision information1318*//***************************************************************************/1319typedef struct t_FmCtrlCodeRevisionInfo {1320uint16_t packageRev; /**< Package revision */1321uint8_t majorRev; /**< Major revision */1322uint8_t minorRev; /**< Minor revision */1323} t_FmCtrlCodeRevisionInfo;13241325/**************************************************************************//**1326@Description A Structure for defining DMA status1327*//***************************************************************************/1328typedef struct t_FmDmaStatus {1329bool cmqNotEmpty; /**< Command queue is not empty */1330bool busError; /**< Bus error occurred */1331bool readBufEccError; /**< Double ECC error on buffer Read (Valid for FM rev < 6)*/1332bool writeBufEccSysError; /**< Double ECC error on buffer write from system side (Valid for FM rev < 6)*/1333bool writeBufEccFmError; /**< Double ECC error on buffer write from FM side (Valid for FM rev < 6) */1334bool singlePortEccError; /**< Single Port ECC error from FM side (Valid for FM rev >= 6)*/1335} t_FmDmaStatus;13361337/**************************************************************************//**1338@Description A Structure for obtaining FM controller monitor values1339*//***************************************************************************/1340typedef struct t_FmCtrlMon {1341uint8_t percentCnt[2]; /**< Percentage value */1342} t_FmCtrlMon;134313441345#if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0))1346/**************************************************************************//**1347@Function FM_DumpRegs13481349@Description Dumps all FM registers13501351@Param[in] h_Fm A handle to an FM Module.13521353@Return E_OK on success;13541355@Cautions Allowed only following FM_Init().1356*//***************************************************************************/1357t_Error FM_DumpRegs(t_Handle h_Fm);1358#endif /* (defined(DEBUG_ERRORS) && ... */13591360/**************************************************************************//**1361@Function FM_SetException13621363@Description Calling this routine enables/disables the specified exception.13641365@Param[in] h_Fm A handle to an FM Module.1366@Param[in] exception The exception to be selected.1367@Param[in] enable TRUE to enable interrupt, FALSE to mask it.13681369@Return E_OK on success; Error code otherwise.13701371@Cautions Allowed only following FM_Init().1372This routine should NOT be called from guest-partition1373(i.e. guestId != NCSW_MASTER_ID)1374*//***************************************************************************/1375t_Error FM_SetException(t_Handle h_Fm, e_FmExceptions exception, bool enable);13761377/**************************************************************************//**1378@Function FM_EnableRamsEcc13791380@Description Enables ECC mechanism for all the different FM RAM's; E.g. IRAM,1381MURAM, Parser, Keygen, Policer, etc.1382Note:1383If FM_ConfigExternalEccRamsEnable was called to enable external1384setting of ECC, this routine effects IRAM ECC only.1385This routine is also called by the driver if an ECC exception is1386enabled.13871388@Param[in] h_Fm A handle to an FM Module.13891390@Return E_OK on success; Error code otherwise.13911392@Cautions Allowed only following FM_Config() and before FM_Init().1393This routine should NOT be called from guest-partition1394(i.e. guestId != NCSW_MASTER_ID)1395*//***************************************************************************/1396t_Error FM_EnableRamsEcc(t_Handle h_Fm);13971398/**************************************************************************//**1399@Function FM_DisableRamsEcc14001401@Description Disables ECC mechanism for all the different FM RAM's; E.g. IRAM,1402MURAM, Parser, Keygen, Policer, etc.1403Note:1404If FM_ConfigExternalEccRamsEnable was called to enable external1405setting of ECC, this routine effects IRAM ECC only.1406In opposed to FM_EnableRamsEcc, this routine must be called1407explicitly to disable all Rams ECC.14081409@Param[in] h_Fm A handle to an FM Module.14101411@Return E_OK on success; Error code otherwise.14121413@Cautions Allowed only following FM_Config() and before FM_Init().1414This routine should NOT be called from guest-partition1415(i.e. guestId != NCSW_MASTER_ID)1416*//***************************************************************************/1417t_Error FM_DisableRamsEcc(t_Handle h_Fm);14181419/**************************************************************************//**1420@Function FM_GetRevision14211422@Description Returns the FM revision14231424@Param[in] h_Fm A handle to an FM Module.1425@Param[out] p_FmRevisionInfo A structure of revision information parameters.14261427@Return E_OK on success; Error code otherwise.14281429@Cautions Allowed only following FM_Init().1430*//***************************************************************************/1431t_Error FM_GetRevision(t_Handle h_Fm, t_FmRevisionInfo *p_FmRevisionInfo);14321433/**************************************************************************//**1434@Function FM_GetFmanCtrlCodeRevision14351436@Description Returns the Fman controller code revision14371438@Param[in] h_Fm A handle to an FM Module.1439@Param[out] p_RevisionInfo A structure of revision information parameters.14401441@Return E_OK on success; Error code otherwise.14421443@Cautions Allowed only following FM_Init().1444*//***************************************************************************/1445t_Error FM_GetFmanCtrlCodeRevision(t_Handle h_Fm, t_FmCtrlCodeRevisionInfo *p_RevisionInfo);14461447/**************************************************************************//**1448@Function FM_GetCounter14491450@Description Reads one of the FM counters.14511452@Param[in] h_Fm A handle to an FM Module.1453@Param[in] counter The requested counter.14541455@Return Counter's current value.14561457@Cautions Allowed only following FM_Init().1458Note that it is user's responsibility to call this routine only1459for enabled counters, and there will be no indication if a1460disabled counter is accessed.1461*//***************************************************************************/1462uint32_t FM_GetCounter(t_Handle h_Fm, e_FmCounters counter);14631464/**************************************************************************//**1465@Function FM_ModifyCounter14661467@Description Sets a value to an enabled counter. Use "0" to reset the counter.14681469@Param[in] h_Fm A handle to an FM Module.1470@Param[in] counter The requested counter.1471@Param[in] val The requested value to be written into the counter.14721473@Return E_OK on success; Error code otherwise.14741475@Cautions Allowed only following FM_Init().1476This routine should NOT be called from guest-partition1477(i.e. guestId != NCSW_MASTER_ID)1478*//***************************************************************************/1479t_Error FM_ModifyCounter(t_Handle h_Fm, e_FmCounters counter, uint32_t val);14801481/**************************************************************************//**1482@Function FM_Resume14831484@Description Release FM after halt FM command or after unrecoverable ECC error.14851486@Param[in] h_Fm A handle to an FM Module.14871488@Return E_OK on success; Error code otherwise.14891490@Cautions Allowed only following FM_Init().1491This routine should NOT be called from guest-partition1492(i.e. guestId != NCSW_MASTER_ID)1493*//***************************************************************************/1494void FM_Resume(t_Handle h_Fm);14951496/**************************************************************************//**1497@Function FM_SetDmaEmergency14981499@Description Manual emergency set15001501@Param[in] h_Fm A handle to an FM Module.1502@Param[in] muramPort MURAM direction select.1503@Param[in] enable TRUE to manually enable emergency, FALSE to disable.15041505@Return None.15061507@Cautions Allowed only following FM_Init().1508This routine should NOT be called from guest-partition1509(i.e. guestId != NCSW_MASTER_ID)1510*//***************************************************************************/1511void FM_SetDmaEmergency(t_Handle h_Fm, e_FmDmaMuramPort muramPort, bool enable);15121513/**************************************************************************//**1514@Function FM_SetDmaExtBusPri15151516@Description Set the DMA external bus priority15171518@Param[in] h_Fm A handle to an FM Module.1519@Param[in] pri External bus priority select15201521@Return None.15221523@Cautions Allowed only following FM_Init().1524This routine should NOT be called from guest-partition1525(i.e. guestId != NCSW_MASTER_ID)1526*//***************************************************************************/1527void FM_SetDmaExtBusPri(t_Handle h_Fm, e_FmDmaExtBusPri pri);15281529/**************************************************************************//**1530@Function FM_GetDmaStatus15311532@Description Reads the DMA current status15331534@Param[in] h_Fm A handle to an FM Module.1535@Param[out] p_FmDmaStatus A structure of DMA status parameters.15361537@Cautions Allowed only following FM_Init().1538*//***************************************************************************/1539void FM_GetDmaStatus(t_Handle h_Fm, t_FmDmaStatus *p_FmDmaStatus);15401541/**************************************************************************//**1542@Function FM_ErrorIsr15431544@Description FM interrupt-service-routine for errors.15451546@Param[in] h_Fm A handle to an FM Module.15471548@Return E_OK on success; E_EMPTY if no errors found in register, other1549error code otherwise.15501551@Cautions Allowed only following FM_Init().1552This routine should NOT be called from guest-partition1553(i.e. guestId != NCSW_MASTER_ID)1554*//***************************************************************************/1555t_Error FM_ErrorIsr(t_Handle h_Fm);15561557/**************************************************************************//**1558@Function FM_EventIsr15591560@Description FM interrupt-service-routine for normal events.15611562@Param[in] h_Fm A handle to an FM Module.15631564@Cautions Allowed only following FM_Init().1565This routine should NOT be called from guest-partition1566(i.e. guestId != NCSW_MASTER_ID)1567*//***************************************************************************/1568void FM_EventIsr(t_Handle h_Fm);15691570/**************************************************************************//**1571@Function FM_GetSpecialOperationCoding15721573@Description Return a specific coding according to the input mask.15741575@Param[in] h_Fm A handle to an FM Module.1576@Param[in] spOper special operation mask.1577@Param[out] p_SpOperCoding special operation code.15781579@Return E_OK on success; Error code otherwise.15801581@Cautions Allowed only following FM_Init().1582*//***************************************************************************/1583t_Error FM_GetSpecialOperationCoding(t_Handle h_Fm,1584fmSpecialOperations_t spOper,1585uint8_t *p_SpOperCoding);15861587/**************************************************************************//**1588@Function FM_CtrlMonStart15891590@Description Start monitoring utilization of all available FM controllers.15911592In order to obtain FM controllers utilization the following sequence1593should be used:1594-# FM_CtrlMonStart()1595-# FM_CtrlMonStop()1596-# FM_CtrlMonGetCounters() - issued for each FM controller15971598@Param[in] h_Fm A handle to an FM Module.15991600@Return E_OK on success; Error code otherwise.16011602@Cautions Allowed only following FM_Init().1603This routine should NOT be called from guest-partition1604(i.e. guestId != NCSW_MASTER_ID).1605*//***************************************************************************/1606t_Error FM_CtrlMonStart(t_Handle h_Fm);16071608/**************************************************************************//**1609@Function FM_CtrlMonStop16101611@Description Stop monitoring utilization of all available FM controllers.16121613In order to obtain FM controllers utilization the following sequence1614should be used:1615-# FM_CtrlMonStart()1616-# FM_CtrlMonStop()1617-# FM_CtrlMonGetCounters() - issued for each FM controller16181619@Param[in] h_Fm A handle to an FM Module.16201621@Return E_OK on success; Error code otherwise.16221623@Cautions Allowed only following FM_Init().1624This routine should NOT be called from guest-partition1625(i.e. guestId != NCSW_MASTER_ID).1626*//***************************************************************************/1627t_Error FM_CtrlMonStop(t_Handle h_Fm);16281629/**************************************************************************//**1630@Function FM_CtrlMonGetCounters16311632@Description Obtain FM controller utilization parameters.16331634In order to obtain FM controllers utilization the following sequence1635should be used:1636-# FM_CtrlMonStart()1637-# FM_CtrlMonStop()1638-# FM_CtrlMonGetCounters() - issued for each FM controller16391640@Param[in] h_Fm A handle to an FM Module.1641@Param[in] fmCtrlIndex FM Controller index for that utilization results1642are requested.1643@Param[in] p_Mon Pointer to utilization results structure.16441645@Return E_OK on success; Error code otherwise.16461647@Cautions Allowed only following FM_Init().1648This routine should NOT be called from guest-partition1649(i.e. guestId != NCSW_MASTER_ID).1650*//***************************************************************************/1651t_Error FM_CtrlMonGetCounters(t_Handle h_Fm, uint8_t fmCtrlIndex, t_FmCtrlMon *p_Mon);165216531654/**************************************************************************//*1655@Function FM_ForceIntr16561657@Description Causes an interrupt event on the requested source.16581659@Param[in] h_Fm A handle to an FM Module.1660@Param[in] exception An exception to be forced.16611662@Return E_OK on success; Error code if the exception is not enabled,1663or is not able to create interrupt.16641665@Cautions Allowed only following FM_Init().1666This routine should NOT be called from guest-partition1667(i.e. guestId != NCSW_MASTER_ID)1668*//***************************************************************************/1669t_Error FM_ForceIntr (t_Handle h_Fm, e_FmExceptions exception);16701671/**************************************************************************//*1672@Function FM_SetPortsBandwidth16731674@Description Sets relative weights between ports when accessing common resources.16751676@Param[in] h_Fm A handle to an FM Module.1677@Param[in] p_PortsBandwidth A structure of ports bandwidths in percentage, i.e.1678total must equal 100.16791680@Return E_OK on success; Error code otherwise.16811682@Cautions Allowed only following FM_Init().1683This routine should NOT be called from guest-partition1684(i.e. guestId != NCSW_MASTER_ID)1685*//***************************************************************************/1686t_Error FM_SetPortsBandwidth(t_Handle h_Fm, t_FmPortsBandwidthParams *p_PortsBandwidth);16871688/**************************************************************************//*1689@Function FM_GetMuramHandle16901691@Description Gets the corresponding MURAM handle16921693@Param[in] h_Fm A handle to an FM Module.16941695@Return MURAM handle; NULL otherwise.16961697@Cautions Allowed only following FM_Init().1698This routine should NOT be called from guest-partition1699(i.e. guestId != NCSW_MASTER_ID)1700*//***************************************************************************/1701t_Handle FM_GetMuramHandle(t_Handle h_Fm);17021703/** @} */ /* end of FM_runtime_control_grp group */1704/** @} */ /* end of FM_lib_grp group */1705/** @} */ /* end of FM_grp group */170617071708#ifdef NCSW_BACKWARD_COMPATIBLE_API1709typedef t_FmFirmwareParams t_FmPcdFirmwareParams;1710typedef t_FmBufferPrefixContent t_FmPortBufferPrefixContent;1711typedef t_FmExtPoolParams t_FmPortExtPoolParams;1712typedef t_FmExtPools t_FmPortExtPools;1713typedef t_FmBackupBmPools t_FmPortBackupBmPools;1714typedef t_FmBufPoolDepletion t_FmPortBufPoolDepletion;1715typedef e_FmDmaSwapOption e_FmPortDmaSwapOption;1716typedef e_FmDmaCacheOption e_FmPortDmaCacheOption;17171718#define FM_CONTEXTA_GET_OVVERIDE FM_CONTEXTA_GET_OVERRIDE1719#define FM_CONTEXTA_SET_OVVERIDE FM_CONTEXTA_SET_OVERRIDE17201721#define e_FM_EX_BMI_PIPELINE_ECC e_FM_EX_BMI_STORAGE_PROFILE_ECC1722#define e_FM_PORT_DMA_NO_SWP e_FM_DMA_NO_SWP1723#define e_FM_PORT_DMA_SWP_PPC_LE e_FM_DMA_SWP_PPC_LE1724#define e_FM_PORT_DMA_SWP_BE e_FM_DMA_SWP_BE1725#define e_FM_PORT_DMA_NO_STASH e_FM_DMA_NO_STASH1726#define e_FM_PORT_DMA_STASH e_FM_DMA_STASH1727#endif /* NCSW_BACKWARD_COMPATIBLE_API */172817291730#endif /* __FM_EXT */173117321733