1*0aeed3e9SJustin Hibbits /* Copyright (c) 2008-2011 Freescale Semiconductor, Inc. 2*0aeed3e9SJustin Hibbits * All rights reserved. 3*0aeed3e9SJustin Hibbits * 4*0aeed3e9SJustin Hibbits * Redistribution and use in source and binary forms, with or without 5*0aeed3e9SJustin Hibbits * modification, are permitted provided that the following conditions are met: 6*0aeed3e9SJustin Hibbits * * Redistributions of source code must retain the above copyright 7*0aeed3e9SJustin Hibbits * notice, this list of conditions and the following disclaimer. 8*0aeed3e9SJustin Hibbits * * Redistributions in binary form must reproduce the above copyright 9*0aeed3e9SJustin Hibbits * notice, this list of conditions and the following disclaimer in the 10*0aeed3e9SJustin Hibbits * documentation and/or other materials provided with the distribution. 11*0aeed3e9SJustin Hibbits * * Neither the name of Freescale Semiconductor nor the 12*0aeed3e9SJustin Hibbits * names of its contributors may be used to endorse or promote products 13*0aeed3e9SJustin Hibbits * derived from this software without specific prior written permission. 14*0aeed3e9SJustin Hibbits * 15*0aeed3e9SJustin Hibbits * 16*0aeed3e9SJustin Hibbits * ALTERNATIVELY, this software may be distributed under the terms of the 17*0aeed3e9SJustin Hibbits * GNU General Public License ("GPL") as published by the Free Software 18*0aeed3e9SJustin Hibbits * Foundation, either version 2 of that License or (at your option) any 19*0aeed3e9SJustin Hibbits * later version. 20*0aeed3e9SJustin Hibbits * 21*0aeed3e9SJustin Hibbits * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 22*0aeed3e9SJustin Hibbits * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23*0aeed3e9SJustin Hibbits * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24*0aeed3e9SJustin Hibbits * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 25*0aeed3e9SJustin Hibbits * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26*0aeed3e9SJustin Hibbits * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27*0aeed3e9SJustin Hibbits * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28*0aeed3e9SJustin Hibbits * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29*0aeed3e9SJustin Hibbits * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30*0aeed3e9SJustin Hibbits * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31*0aeed3e9SJustin Hibbits */ 32*0aeed3e9SJustin Hibbits 33*0aeed3e9SJustin Hibbits /**************************************************************************//** 34*0aeed3e9SJustin Hibbits @File fm_ext.h 35*0aeed3e9SJustin Hibbits 36*0aeed3e9SJustin Hibbits @Description FM Application Programming Interface. 37*0aeed3e9SJustin Hibbits *//***************************************************************************/ 38*0aeed3e9SJustin Hibbits #ifndef __FM_EXT 39*0aeed3e9SJustin Hibbits #define __FM_EXT 40*0aeed3e9SJustin Hibbits 41*0aeed3e9SJustin Hibbits #include "error_ext.h" 42*0aeed3e9SJustin Hibbits #include "std_ext.h" 43*0aeed3e9SJustin Hibbits #include "dpaa_ext.h" 44*0aeed3e9SJustin Hibbits 45*0aeed3e9SJustin Hibbits 46*0aeed3e9SJustin Hibbits /**************************************************************************//** 47*0aeed3e9SJustin Hibbits @Group FM_grp Frame Manager API 48*0aeed3e9SJustin Hibbits 49*0aeed3e9SJustin Hibbits @Description FM API functions, definitions and enums. 50*0aeed3e9SJustin Hibbits 51*0aeed3e9SJustin Hibbits @{ 52*0aeed3e9SJustin Hibbits *//***************************************************************************/ 53*0aeed3e9SJustin Hibbits 54*0aeed3e9SJustin Hibbits /**************************************************************************//** 55*0aeed3e9SJustin Hibbits @Group FM_lib_grp FM library 56*0aeed3e9SJustin Hibbits 57*0aeed3e9SJustin Hibbits @Description FM API functions, definitions and enums 58*0aeed3e9SJustin Hibbits The FM module is the main driver module and is a mandatory module 59*0aeed3e9SJustin Hibbits for FM driver users. Before any further module initialization, 60*0aeed3e9SJustin Hibbits this module must be initialized. 61*0aeed3e9SJustin Hibbits The FM is a "singletone" module. It is responsible of the common 62*0aeed3e9SJustin Hibbits HW modules: FPM, DMA, common QMI, common BMI initializations and 63*0aeed3e9SJustin Hibbits run-time control routines. This module must be initialized always 64*0aeed3e9SJustin Hibbits when working with any of the FM modules. 65*0aeed3e9SJustin Hibbits NOTE - We assumes that the FML will be initialize only by core No. 0! 66*0aeed3e9SJustin Hibbits 67*0aeed3e9SJustin Hibbits @{ 68*0aeed3e9SJustin Hibbits *//***************************************************************************/ 69*0aeed3e9SJustin Hibbits 70*0aeed3e9SJustin Hibbits /**************************************************************************//** 71*0aeed3e9SJustin Hibbits @Description enum for defining port types 72*0aeed3e9SJustin Hibbits *//***************************************************************************/ 73*0aeed3e9SJustin Hibbits typedef enum e_FmPortType { 74*0aeed3e9SJustin Hibbits e_FM_PORT_TYPE_OH_OFFLINE_PARSING = 0, /**< Offline parsing port (id's: 0-6, share id's with 75*0aeed3e9SJustin Hibbits host command, so must have exclusive id) */ 76*0aeed3e9SJustin Hibbits e_FM_PORT_TYPE_OH_HOST_COMMAND, /**< Host command port (id's: 0-6, share id's with 77*0aeed3e9SJustin Hibbits offline parsing ports, so must have exclusive id) */ 78*0aeed3e9SJustin Hibbits e_FM_PORT_TYPE_RX, /**< 1G Rx port (id's: 0-3) */ 79*0aeed3e9SJustin Hibbits e_FM_PORT_TYPE_RX_10G, /**< 10G Rx port (id's: 0) */ 80*0aeed3e9SJustin Hibbits e_FM_PORT_TYPE_TX, /**< 1G Tx port (id's: 0-3) */ 81*0aeed3e9SJustin Hibbits e_FM_PORT_TYPE_TX_10G, /**< 10G Tx port (id's: 0) */ 82*0aeed3e9SJustin Hibbits e_FM_PORT_TYPE_DUMMY 83*0aeed3e9SJustin Hibbits } e_FmPortType; 84*0aeed3e9SJustin Hibbits 85*0aeed3e9SJustin Hibbits /**************************************************************************//** 86*0aeed3e9SJustin Hibbits @Collection General FM defines 87*0aeed3e9SJustin Hibbits *//***************************************************************************/ 88*0aeed3e9SJustin Hibbits #define FM_MAX_NUM_OF_PARTITIONS 64 /**< Maximum number of partitions */ 89*0aeed3e9SJustin Hibbits #define FM_PHYS_ADDRESS_SIZE 6 /**< FM Physical address size */ 90*0aeed3e9SJustin Hibbits /* @} */ 91*0aeed3e9SJustin Hibbits 92*0aeed3e9SJustin Hibbits 93*0aeed3e9SJustin Hibbits #if defined(__MWERKS__) && !defined(__GNUC__) 94*0aeed3e9SJustin Hibbits #pragma pack(push,1) 95*0aeed3e9SJustin Hibbits #endif /* defined(__MWERKS__) && ... */ 96*0aeed3e9SJustin Hibbits #define MEM_MAP_START 97*0aeed3e9SJustin Hibbits 98*0aeed3e9SJustin Hibbits /**************************************************************************//** 99*0aeed3e9SJustin Hibbits @Description FM physical Address 100*0aeed3e9SJustin Hibbits *//***************************************************************************/ 101*0aeed3e9SJustin Hibbits typedef _Packed struct t_FmPhysAddr { 102*0aeed3e9SJustin Hibbits volatile uint8_t high; /**< High part of the physical address */ 103*0aeed3e9SJustin Hibbits volatile uint32_t low; /**< Low part of the physical address */ 104*0aeed3e9SJustin Hibbits } _PackedType t_FmPhysAddr; 105*0aeed3e9SJustin Hibbits 106*0aeed3e9SJustin Hibbits /**************************************************************************//** 107*0aeed3e9SJustin Hibbits @Description Parse results memory layout 108*0aeed3e9SJustin Hibbits *//***************************************************************************/ 109*0aeed3e9SJustin Hibbits typedef _Packed struct t_FmPrsResult { 110*0aeed3e9SJustin Hibbits volatile uint8_t lpid; /**< Logical port id */ 111*0aeed3e9SJustin Hibbits volatile uint8_t shimr; /**< Shim header result */ 112*0aeed3e9SJustin Hibbits volatile uint16_t l2r; /**< Layer 2 result */ 113*0aeed3e9SJustin Hibbits volatile uint16_t l3r; /**< Layer 3 result */ 114*0aeed3e9SJustin Hibbits volatile uint8_t l4r; /**< Layer 4 result */ 115*0aeed3e9SJustin Hibbits volatile uint8_t cplan; /**< Classification plan id */ 116*0aeed3e9SJustin Hibbits volatile uint16_t nxthdr; /**< Next Header */ 117*0aeed3e9SJustin Hibbits volatile uint16_t cksum; /**< Checksum */ 118*0aeed3e9SJustin Hibbits volatile uint32_t lcv; /**< LCV */ 119*0aeed3e9SJustin Hibbits volatile uint8_t shim_off[3]; /**< Shim offset */ 120*0aeed3e9SJustin Hibbits volatile uint8_t eth_off; /**< ETH offset */ 121*0aeed3e9SJustin Hibbits volatile uint8_t llc_snap_off; /**< LLC_SNAP offset */ 122*0aeed3e9SJustin Hibbits volatile uint8_t vlan_off[2]; /**< VLAN offset */ 123*0aeed3e9SJustin Hibbits volatile uint8_t etype_off; /**< ETYPE offset */ 124*0aeed3e9SJustin Hibbits volatile uint8_t pppoe_off; /**< PPP offset */ 125*0aeed3e9SJustin Hibbits volatile uint8_t mpls_off[2]; /**< MPLS offset */ 126*0aeed3e9SJustin Hibbits volatile uint8_t ip_off[2]; /**< IP offset */ 127*0aeed3e9SJustin Hibbits volatile uint8_t gre_off; /**< GRE offset */ 128*0aeed3e9SJustin Hibbits volatile uint8_t l4_off; /**< Layer 4 offset */ 129*0aeed3e9SJustin Hibbits volatile uint8_t nxthdr_off; /**< Parser end point */ 130*0aeed3e9SJustin Hibbits } _PackedType t_FmPrsResult; 131*0aeed3e9SJustin Hibbits 132*0aeed3e9SJustin Hibbits /**************************************************************************//** 133*0aeed3e9SJustin Hibbits @Collection FM Parser results 134*0aeed3e9SJustin Hibbits *//***************************************************************************/ 135*0aeed3e9SJustin Hibbits #define FM_PR_L2_VLAN_STACK 0x00000100 /**< Parse Result: VLAN stack */ 136*0aeed3e9SJustin Hibbits #define FM_PR_L2_ETHERNET 0x00008000 /**< Parse Result: Ethernet*/ 137*0aeed3e9SJustin Hibbits #define FM_PR_L2_VLAN 0x00004000 /**< Parse Result: VLAN */ 138*0aeed3e9SJustin Hibbits #define FM_PR_L2_LLC_SNAP 0x00002000 /**< Parse Result: LLC_SNAP */ 139*0aeed3e9SJustin Hibbits #define FM_PR_L2_MPLS 0x00001000 /**< Parse Result: MPLS */ 140*0aeed3e9SJustin Hibbits #define FM_PR_L2_PPPoE 0x00000800 /**< Parse Result: PPPoE */ 141*0aeed3e9SJustin Hibbits /* @} */ 142*0aeed3e9SJustin Hibbits 143*0aeed3e9SJustin Hibbits /**************************************************************************//** 144*0aeed3e9SJustin Hibbits @Collection FM Frame descriptor macros 145*0aeed3e9SJustin Hibbits *//***************************************************************************/ 146*0aeed3e9SJustin Hibbits #define FM_FD_CMD_FCO 0x80000000 /**< Frame queue Context Override */ 147*0aeed3e9SJustin Hibbits #define FM_FD_CMD_RPD 0x40000000 /**< Read Prepended Data */ 148*0aeed3e9SJustin Hibbits #define FM_FD_CMD_UPD 0x20000000 /**< Update Prepended Data */ 149*0aeed3e9SJustin Hibbits #define FM_FD_CMD_DTC 0x10000000 /**< Do L4 Checksum */ 150*0aeed3e9SJustin Hibbits #define FM_FD_CMD_DCL4C 0x10000000 /**< Didn't calculate L4 Checksum */ 151*0aeed3e9SJustin Hibbits #define FM_FD_CMD_CFQ 0x00ffffff /**< Confirmation Frame Queue */ 152*0aeed3e9SJustin Hibbits 153*0aeed3e9SJustin Hibbits #define FM_FD_TX_STATUS_ERR_MASK 0x07000000 /**< TX Error FD bits */ 154*0aeed3e9SJustin Hibbits #define FM_FD_RX_STATUS_ERR_MASK 0x070ee3f8 /**< RX Error FD bits */ 155*0aeed3e9SJustin Hibbits /* @} */ 156*0aeed3e9SJustin Hibbits 157*0aeed3e9SJustin Hibbits /**************************************************************************//** 158*0aeed3e9SJustin Hibbits @Description Context A 159*0aeed3e9SJustin Hibbits *//***************************************************************************/ 160*0aeed3e9SJustin Hibbits typedef _Packed struct t_FmContextA { 161*0aeed3e9SJustin Hibbits volatile uint32_t command; /**< ContextA Command */ 162*0aeed3e9SJustin Hibbits volatile uint8_t res0[4]; /**< ContextA Reserved bits */ 163*0aeed3e9SJustin Hibbits } _PackedType t_FmContextA; 164*0aeed3e9SJustin Hibbits 165*0aeed3e9SJustin Hibbits /**************************************************************************//** 166*0aeed3e9SJustin Hibbits @Description Context B 167*0aeed3e9SJustin Hibbits *//***************************************************************************/ 168*0aeed3e9SJustin Hibbits typedef uint32_t t_FmContextB; 169*0aeed3e9SJustin Hibbits 170*0aeed3e9SJustin Hibbits /**************************************************************************//** 171*0aeed3e9SJustin Hibbits @Collection Context A macros 172*0aeed3e9SJustin Hibbits *//***************************************************************************/ 173*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_OVERRIDE_MASK 0x80000000 174*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_ICMD_MASK 0x40000000 175*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_A1_VALID_MASK 0x20000000 176*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_MACCMD_MASK 0x00ff0000 177*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_MACCMD_VALID_MASK 0x00800000 178*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_MACCMD_SECURED_MASK 0x00100000 179*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_MACCMD_SC_MASK 0x000f0000 180*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_A1_MASK 0x0000ffff 181*0aeed3e9SJustin Hibbits 182*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_GET_OVERRIDE(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_OVERRIDE_MASK) >> (31-0)) 183*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_GET_ICMD(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_ICMD_MASK) >> (31-1)) 184*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_GET_A1_VALID(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_A1_VALID_MASK) >> (31-2)) 185*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_GET_A1(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_A1_MASK) >> (31-31)) 186*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_GET_MACCMD(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_MACCMD_MASK) >> (31-15)) 187*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_GET_MACCMD_VALID(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_MACCMD_VALID_MASK) >> (31-8)) 188*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_GET_MACCMD_SECURED(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_MACCMD_SECURED_MASK) >> (31-11)) 189*0aeed3e9SJustin Hibbits #define FM_CONTEXTA_GET_MACCMD_SECURE_CHANNEL(contextA) ((((t_FmContextA *)contextA)->command & FM_CONTEXTA_MACCMD_SC_MASK) >> (31-15)) 190*0aeed3e9SJustin Hibbits 191*0aeed3e9SJustin Hibbits #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) )) 192*0aeed3e9SJustin Hibbits #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) )) 193*0aeed3e9SJustin Hibbits #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) )) 194*0aeed3e9SJustin Hibbits #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) )) 195*0aeed3e9SJustin Hibbits #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) )) 196*0aeed3e9SJustin Hibbits #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) )) 197*0aeed3e9SJustin Hibbits #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) )) 198*0aeed3e9SJustin Hibbits #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) )) 199*0aeed3e9SJustin Hibbits /* @} */ 200*0aeed3e9SJustin Hibbits 201*0aeed3e9SJustin Hibbits /**************************************************************************//** 202*0aeed3e9SJustin Hibbits @Collection Context B macros 203*0aeed3e9SJustin Hibbits *//***************************************************************************/ 204*0aeed3e9SJustin Hibbits #define FM_CONTEXTB_FQID_MASK 0x00ffffff 205*0aeed3e9SJustin Hibbits 206*0aeed3e9SJustin Hibbits #define FM_CONTEXTB_GET_FQID(contextB) (*((t_FmContextB *)contextB) & FM_CONTEXTB_FQID_MASK) 207*0aeed3e9SJustin Hibbits #define FM_CONTEXTB_SET_FQID(contextB,val) (*((t_FmContextB *)contextB) = ((*((t_FmContextB *)contextB) & ~FM_CONTEXTB_FQID_MASK) | ((val) & FM_CONTEXTB_FQID_MASK))) 208*0aeed3e9SJustin Hibbits /* @} */ 209*0aeed3e9SJustin Hibbits 210*0aeed3e9SJustin Hibbits #define MEM_MAP_END 211*0aeed3e9SJustin Hibbits #if defined(__MWERKS__) && !defined(__GNUC__) 212*0aeed3e9SJustin Hibbits #pragma pack(pop) 213*0aeed3e9SJustin Hibbits #endif /* defined(__MWERKS__) && ... */ 214*0aeed3e9SJustin Hibbits 215*0aeed3e9SJustin Hibbits 216*0aeed3e9SJustin Hibbits /**************************************************************************//** 217*0aeed3e9SJustin Hibbits @Description FM Exceptions 218*0aeed3e9SJustin Hibbits *//***************************************************************************/ 219*0aeed3e9SJustin Hibbits typedef enum e_FmExceptions { 220*0aeed3e9SJustin Hibbits e_FM_EX_DMA_BUS_ERROR, /**< DMA bus error. */ 221*0aeed3e9SJustin Hibbits e_FM_EX_DMA_READ_ECC, /**< Read Buffer ECC error */ 222*0aeed3e9SJustin Hibbits e_FM_EX_DMA_SYSTEM_WRITE_ECC, /**< Write Buffer ECC error on system side */ 223*0aeed3e9SJustin Hibbits e_FM_EX_DMA_FM_WRITE_ECC, /**< Write Buffer ECC error on FM side */ 224*0aeed3e9SJustin Hibbits e_FM_EX_FPM_STALL_ON_TASKS, /**< Stall of tasks on FPM */ 225*0aeed3e9SJustin Hibbits e_FM_EX_FPM_SINGLE_ECC, /**< Single ECC on FPM. */ 226*0aeed3e9SJustin Hibbits e_FM_EX_FPM_DOUBLE_ECC, /**< Double ECC error on FPM ram access */ 227*0aeed3e9SJustin Hibbits e_FM_EX_QMI_SINGLE_ECC, /**< Single ECC on QMI. */ 228*0aeed3e9SJustin Hibbits e_FM_EX_QMI_DOUBLE_ECC, /**< Double bit ECC occurred on QMI */ 229*0aeed3e9SJustin Hibbits e_FM_EX_QMI_DEQ_FROM_UNKNOWN_PORTID,/**< Dequeu from unknown port id */ 230*0aeed3e9SJustin Hibbits e_FM_EX_BMI_LIST_RAM_ECC, /**< Linked List RAM ECC error */ 231*0aeed3e9SJustin Hibbits e_FM_EX_BMI_PIPELINE_ECC, /**< Pipeline Table ECC Error */ 232*0aeed3e9SJustin Hibbits e_FM_EX_BMI_STATISTICS_RAM_ECC, /**< Statistics Count RAM ECC Error Enable */ 233*0aeed3e9SJustin Hibbits e_FM_EX_BMI_DISPATCH_RAM_ECC, /**< Dispatch RAM ECC Error Enable */ 234*0aeed3e9SJustin Hibbits e_FM_EX_IRAM_ECC, /**< Double bit ECC occurred on IRAM*/ 235*0aeed3e9SJustin Hibbits e_FM_EX_MURAM_ECC /**< Double bit ECC occurred on MURAM*/ 236*0aeed3e9SJustin Hibbits } e_FmExceptions; 237*0aeed3e9SJustin Hibbits 238*0aeed3e9SJustin Hibbits /**************************************************************************//** 239*0aeed3e9SJustin Hibbits @Group FM_init_grp FM Initialization Unit 240*0aeed3e9SJustin Hibbits 241*0aeed3e9SJustin Hibbits @Description FM Initialization Unit 242*0aeed3e9SJustin Hibbits 243*0aeed3e9SJustin Hibbits Initialization Flow 244*0aeed3e9SJustin Hibbits Initialization of the FM Module will be carried out by the application 245*0aeed3e9SJustin Hibbits according to the following sequence: 246*0aeed3e9SJustin Hibbits a. Calling the configuration routine with basic parameters. 247*0aeed3e9SJustin Hibbits b. Calling the advance initialization routines to change driver's defaults. 248*0aeed3e9SJustin Hibbits c. Calling the initialization routine. 249*0aeed3e9SJustin Hibbits 250*0aeed3e9SJustin Hibbits @{ 251*0aeed3e9SJustin Hibbits *//***************************************************************************/ 252*0aeed3e9SJustin Hibbits 253*0aeed3e9SJustin Hibbits /**************************************************************************//** 254*0aeed3e9SJustin Hibbits @Function t_FmExceptionsCallback 255*0aeed3e9SJustin Hibbits 256*0aeed3e9SJustin Hibbits @Description Exceptions user callback routine, will be called upon an 257*0aeed3e9SJustin Hibbits exception passing the exception identification. 258*0aeed3e9SJustin Hibbits 259*0aeed3e9SJustin Hibbits @Param[in] h_App - User's application descriptor. 260*0aeed3e9SJustin Hibbits @Param[in] exception - The exception. 261*0aeed3e9SJustin Hibbits *//***************************************************************************/ 262*0aeed3e9SJustin Hibbits typedef void (t_FmExceptionsCallback) (t_Handle h_App, 263*0aeed3e9SJustin Hibbits e_FmExceptions exception); 264*0aeed3e9SJustin Hibbits 265*0aeed3e9SJustin Hibbits /**************************************************************************//** 266*0aeed3e9SJustin Hibbits @Function t_FmBusErrorCallback 267*0aeed3e9SJustin Hibbits 268*0aeed3e9SJustin Hibbits @Description Bus error user callback routine, will be called upon a 269*0aeed3e9SJustin Hibbits bus error, passing parameters describing the errors and the owner. 270*0aeed3e9SJustin Hibbits 271*0aeed3e9SJustin Hibbits @Param[in] h_App - User's application descriptor. 272*0aeed3e9SJustin Hibbits @Param[in] portType - Port type (e_FmPortType) 273*0aeed3e9SJustin Hibbits @Param[in] portId - Port id - relative to type. 274*0aeed3e9SJustin Hibbits @Param[in] addr - Address that caused the error 275*0aeed3e9SJustin Hibbits @Param[in] tnum - Owner of error 276*0aeed3e9SJustin Hibbits @Param[in] liodn - Logical IO device number 277*0aeed3e9SJustin Hibbits *//***************************************************************************/ 278*0aeed3e9SJustin Hibbits typedef void (t_FmBusErrorCallback) (t_Handle h_App, 279*0aeed3e9SJustin Hibbits e_FmPortType portType, 280*0aeed3e9SJustin Hibbits uint8_t portId, 281*0aeed3e9SJustin Hibbits uint64_t addr, 282*0aeed3e9SJustin Hibbits uint8_t tnum, 283*0aeed3e9SJustin Hibbits uint16_t liodn); 284*0aeed3e9SJustin Hibbits 285*0aeed3e9SJustin Hibbits /**************************************************************************//** 286*0aeed3e9SJustin Hibbits @Description structure for defining Ucode patch for loading. 287*0aeed3e9SJustin Hibbits *//***************************************************************************/ 288*0aeed3e9SJustin Hibbits typedef struct t_FmPcdFirmwareParams { 289*0aeed3e9SJustin Hibbits uint32_t size; /**< Size of uCode */ 290*0aeed3e9SJustin Hibbits uint32_t *p_Code; /**< A pointer to the uCode */ 291*0aeed3e9SJustin Hibbits } t_FmPcdFirmwareParams; 292*0aeed3e9SJustin Hibbits 293*0aeed3e9SJustin Hibbits /**************************************************************************//** 294*0aeed3e9SJustin Hibbits @Description structure representing FM initialization parameters 295*0aeed3e9SJustin Hibbits *//***************************************************************************/ 296*0aeed3e9SJustin Hibbits #define FM_SIZE_OF_LIODN_TABLE 64 297*0aeed3e9SJustin Hibbits typedef struct t_FmParams { 298*0aeed3e9SJustin Hibbits uint8_t fmId; /**< Index of the FM */ 299*0aeed3e9SJustin Hibbits 300*0aeed3e9SJustin Hibbits uint8_t guestId; /**< FM Partition Id */ 301*0aeed3e9SJustin Hibbits 302*0aeed3e9SJustin Hibbits uintptr_t baseAddr; /**< Relevant when guestId = NCSW_MASSTER_ID only. 303*0aeed3e9SJustin Hibbits A pointer to base of memory mapped FM registers (virtual); 304*0aeed3e9SJustin Hibbits NOTE that this should include ALL common regs of the FM including 305*0aeed3e9SJustin Hibbits the PCD regs area. */ 306*0aeed3e9SJustin Hibbits t_Handle h_FmMuram; /**< Relevant when guestId = NCSW_MASSTER_ID only. 307*0aeed3e9SJustin Hibbits A handle of an initialized MURAM object, 308*0aeed3e9SJustin Hibbits to be used by the FM */ 309*0aeed3e9SJustin Hibbits uint16_t fmClkFreq; /**< Relevant when guestId = NCSW_MASSTER_ID only. 310*0aeed3e9SJustin Hibbits In Mhz */ 311*0aeed3e9SJustin Hibbits #ifdef FM_PARTITION_ARRAY 312*0aeed3e9SJustin Hibbits uint16_t liodnBasePerPort[FM_SIZE_OF_LIODN_TABLE]; 313*0aeed3e9SJustin Hibbits /**< Relevant when guestId = NCSW_MASSTER_ID only. 314*0aeed3e9SJustin Hibbits For each partition, LIODN should be configured here. */ 315*0aeed3e9SJustin Hibbits #endif /* FM_PARTITION_ARRAY */ 316*0aeed3e9SJustin Hibbits t_FmExceptionsCallback *f_Exception; /**< Relevant when guestId = NCSW_MASSTER_ID only. 317*0aeed3e9SJustin Hibbits An application callback routine to 318*0aeed3e9SJustin Hibbits handle exceptions.*/ 319*0aeed3e9SJustin Hibbits t_FmBusErrorCallback *f_BusError; /**< Relevant when guestId = NCSW_MASSTER_ID only. 320*0aeed3e9SJustin Hibbits An application callback routine to 321*0aeed3e9SJustin Hibbits handle exceptions.*/ 322*0aeed3e9SJustin Hibbits t_Handle h_App; /**< Relevant when guestId = NCSW_MASSTER_ID only. 323*0aeed3e9SJustin Hibbits A handle to an application layer object; This handle will 324*0aeed3e9SJustin Hibbits be passed by the driver upon calling the above callbacks */ 325*0aeed3e9SJustin Hibbits int irq; /**< Relevant when guestId = NCSW_MASSTER_ID only. 326*0aeed3e9SJustin Hibbits FM interrupt source for normal events */ 327*0aeed3e9SJustin Hibbits int errIrq; /**< Relevant when guestId = NCSW_MASSTER_ID only. 328*0aeed3e9SJustin Hibbits FM interrupt source for errors */ 329*0aeed3e9SJustin Hibbits t_FmPcdFirmwareParams firmware; /**< Relevant when guestId = NCSW_MASSTER_ID only. 330*0aeed3e9SJustin Hibbits Ucode */ 331*0aeed3e9SJustin Hibbits } t_FmParams; 332*0aeed3e9SJustin Hibbits 333*0aeed3e9SJustin Hibbits 334*0aeed3e9SJustin Hibbits /**************************************************************************//** 335*0aeed3e9SJustin Hibbits @Function FM_Config 336*0aeed3e9SJustin Hibbits 337*0aeed3e9SJustin Hibbits @Description Creates descriptor for the FM module. 338*0aeed3e9SJustin Hibbits 339*0aeed3e9SJustin Hibbits The routine returns a handle (descriptor) to the FM object. 340*0aeed3e9SJustin Hibbits This descriptor must be passed as first parameter to all other 341*0aeed3e9SJustin Hibbits FM function calls. 342*0aeed3e9SJustin Hibbits 343*0aeed3e9SJustin Hibbits No actual initialization or configuration of FM hardware is 344*0aeed3e9SJustin Hibbits done by this routine. 345*0aeed3e9SJustin Hibbits 346*0aeed3e9SJustin Hibbits @Param[in] p_FmParams - A pointer to data structure of parameters 347*0aeed3e9SJustin Hibbits 348*0aeed3e9SJustin Hibbits @Return Handle to FM object, or NULL for Failure. 349*0aeed3e9SJustin Hibbits *//***************************************************************************/ 350*0aeed3e9SJustin Hibbits t_Handle FM_Config(t_FmParams *p_FmParams); 351*0aeed3e9SJustin Hibbits 352*0aeed3e9SJustin Hibbits /**************************************************************************//** 353*0aeed3e9SJustin Hibbits @Function FM_Init 354*0aeed3e9SJustin Hibbits 355*0aeed3e9SJustin Hibbits @Description Initializes the FM module 356*0aeed3e9SJustin Hibbits 357*0aeed3e9SJustin Hibbits @Param[in] h_Fm - FM module descriptor 358*0aeed3e9SJustin Hibbits 359*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 360*0aeed3e9SJustin Hibbits *//***************************************************************************/ 361*0aeed3e9SJustin Hibbits t_Error FM_Init(t_Handle h_Fm); 362*0aeed3e9SJustin Hibbits 363*0aeed3e9SJustin Hibbits /**************************************************************************//** 364*0aeed3e9SJustin Hibbits @Function FM_Free 365*0aeed3e9SJustin Hibbits 366*0aeed3e9SJustin Hibbits @Description Frees all resources that were assigned to FM module. 367*0aeed3e9SJustin Hibbits 368*0aeed3e9SJustin Hibbits Calling this routine invalidates the descriptor. 369*0aeed3e9SJustin Hibbits 370*0aeed3e9SJustin Hibbits @Param[in] h_Fm - FM module descriptor 371*0aeed3e9SJustin Hibbits 372*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 373*0aeed3e9SJustin Hibbits *//***************************************************************************/ 374*0aeed3e9SJustin Hibbits t_Error FM_Free(t_Handle h_Fm); 375*0aeed3e9SJustin Hibbits 376*0aeed3e9SJustin Hibbits 377*0aeed3e9SJustin Hibbits /**************************************************************************//** 378*0aeed3e9SJustin Hibbits @Group FM_advanced_init_grp FM Advanced Configuration Unit 379*0aeed3e9SJustin Hibbits 380*0aeed3e9SJustin Hibbits @Description Configuration functions used to change default values; 381*0aeed3e9SJustin Hibbits Note: Advanced init routines are not available for guest partition. 382*0aeed3e9SJustin Hibbits @{ 383*0aeed3e9SJustin Hibbits *//***************************************************************************/ 384*0aeed3e9SJustin Hibbits 385*0aeed3e9SJustin Hibbits /**************************************************************************//** 386*0aeed3e9SJustin Hibbits @Description DMA debug mode 387*0aeed3e9SJustin Hibbits *//***************************************************************************/ 388*0aeed3e9SJustin Hibbits typedef enum e_FmDmaDbgCntMode { 389*0aeed3e9SJustin Hibbits e_FM_DMA_DBG_NO_CNT = 0, /**< No counting */ 390*0aeed3e9SJustin Hibbits e_FM_DMA_DBG_CNT_DONE, /**< Count DONE commands */ 391*0aeed3e9SJustin Hibbits e_FM_DMA_DBG_CNT_COMM_Q_EM, /**< count command queue emergency signals */ 392*0aeed3e9SJustin Hibbits e_FM_DMA_DBG_CNT_INT_READ_EM, /**< Count Internal Read buffer emergency signal */ 393*0aeed3e9SJustin Hibbits e_FM_DMA_DBG_CNT_INT_WRITE_EM, /**< Count Internal Write buffer emergency signal */ 394*0aeed3e9SJustin Hibbits e_FM_DMA_DBG_CNT_FPM_WAIT, /**< Count FPM WAIT signal */ 395*0aeed3e9SJustin Hibbits e_FM_DMA_DBG_CNT_SIGLE_BIT_ECC, /**< Single bit ECC errors. */ 396*0aeed3e9SJustin Hibbits e_FM_DMA_DBG_CNT_RAW_WAR_PROT /**< Number of times there was a need for RAW & WAR protection. */ 397*0aeed3e9SJustin Hibbits } e_FmDmaDbgCntMode; 398*0aeed3e9SJustin Hibbits 399*0aeed3e9SJustin Hibbits /**************************************************************************//** 400*0aeed3e9SJustin Hibbits @Description DMA Cache Override 401*0aeed3e9SJustin Hibbits *//***************************************************************************/ 402*0aeed3e9SJustin Hibbits typedef enum e_FmDmaCacheOverride { 403*0aeed3e9SJustin Hibbits e_FM_DMA_NO_CACHE_OR = 0, /**< No override of the Cache field */ 404*0aeed3e9SJustin Hibbits e_FM_DMA_NO_STASH_DATA, /**< Data should not be stashed in system level cache */ 405*0aeed3e9SJustin Hibbits e_FM_DMA_MAY_STASH_DATA, /**< Data may be stashed in system level cache */ 406*0aeed3e9SJustin Hibbits e_FM_DMA_STASH_DATA /**< Data should be stashed in system level cache */ 407*0aeed3e9SJustin Hibbits } e_FmDmaCacheOverride; 408*0aeed3e9SJustin Hibbits 409*0aeed3e9SJustin Hibbits /**************************************************************************//** 410*0aeed3e9SJustin Hibbits @Description DMA External Bus Priority 411*0aeed3e9SJustin Hibbits *//***************************************************************************/ 412*0aeed3e9SJustin Hibbits typedef enum e_FmDmaExtBusPri { 413*0aeed3e9SJustin Hibbits e_FM_DMA_EXT_BUS_NORMAL = 0, /**< Normal priority */ 414*0aeed3e9SJustin Hibbits e_FM_DMA_EXT_BUS_EBS, /**< AXI extended bus service priority */ 415*0aeed3e9SJustin Hibbits e_FM_DMA_EXT_BUS_SOS, /**< AXI sos priority */ 416*0aeed3e9SJustin Hibbits e_FM_DMA_EXT_BUS_EBS_AND_SOS /**< AXI ebs + sos priority */ 417*0aeed3e9SJustin Hibbits } e_FmDmaExtBusPri; 418*0aeed3e9SJustin Hibbits 419*0aeed3e9SJustin Hibbits /**************************************************************************//** 420*0aeed3e9SJustin Hibbits @Description enum for choosing the field that will be output on AID 421*0aeed3e9SJustin Hibbits *//***************************************************************************/ 422*0aeed3e9SJustin Hibbits typedef enum e_FmDmaAidMode { 423*0aeed3e9SJustin Hibbits e_FM_DMA_AID_OUT_PORT_ID = 0, /**< 4 LSB of PORT_ID */ 424*0aeed3e9SJustin Hibbits e_FM_DMA_AID_OUT_TNUM /**< 4 LSB of TNUM */ 425*0aeed3e9SJustin Hibbits } e_FmDmaAidMode; 426*0aeed3e9SJustin Hibbits 427*0aeed3e9SJustin Hibbits /**************************************************************************//** 428*0aeed3e9SJustin Hibbits @Description FPM Catasrophic error behaviour 429*0aeed3e9SJustin Hibbits *//***************************************************************************/ 430*0aeed3e9SJustin Hibbits typedef enum e_FmCatastrophicErr { 431*0aeed3e9SJustin Hibbits e_FM_CATASTROPHIC_ERR_STALL_PORT = 0, /**< Port_ID is stalled (only reset can release it) */ 432*0aeed3e9SJustin Hibbits e_FM_CATASTROPHIC_ERR_STALL_TASK /**< Only errornous task is stalled */ 433*0aeed3e9SJustin Hibbits } e_FmCatastrophicErr; 434*0aeed3e9SJustin Hibbits 435*0aeed3e9SJustin Hibbits /**************************************************************************//** 436*0aeed3e9SJustin Hibbits @Description FPM DMA error behaviour 437*0aeed3e9SJustin Hibbits *//***************************************************************************/ 438*0aeed3e9SJustin Hibbits typedef enum e_FmDmaErr { 439*0aeed3e9SJustin Hibbits e_FM_DMA_ERR_CATASTROPHIC = 0, /**< Dma error is treated as a catastrophic error */ 440*0aeed3e9SJustin Hibbits e_FM_DMA_ERR_REPORT /**< Dma error is just reported */ 441*0aeed3e9SJustin Hibbits } e_FmDmaErr; 442*0aeed3e9SJustin Hibbits 443*0aeed3e9SJustin Hibbits /**************************************************************************//** 444*0aeed3e9SJustin Hibbits @Description DMA Emergency level by BMI emergency signal 445*0aeed3e9SJustin Hibbits *//***************************************************************************/ 446*0aeed3e9SJustin Hibbits typedef enum e_FmDmaEmergencyLevel { 447*0aeed3e9SJustin Hibbits e_FM_DMA_EM_EBS = 0, /**< EBS emergency */ 448*0aeed3e9SJustin Hibbits e_FM_DMA_EM_SOS /**< SOS emergency */ 449*0aeed3e9SJustin Hibbits } e_FmDmaEmergencyLevel; 450*0aeed3e9SJustin Hibbits 451*0aeed3e9SJustin Hibbits /**************************************************************************//** 452*0aeed3e9SJustin Hibbits @Collection DMA emergency options 453*0aeed3e9SJustin Hibbits *//***************************************************************************/ 454*0aeed3e9SJustin Hibbits typedef uint32_t fmEmergencyBus_t; /**< DMA emergency options */ 455*0aeed3e9SJustin Hibbits 456*0aeed3e9SJustin Hibbits #define FM_DMA_MURAM_READ_EMERGENCY 0x00800000 /**< Enable emergency for MURAM1 */ 457*0aeed3e9SJustin Hibbits #define FM_DMA_MURAM_WRITE_EMERGENCY 0x00400000 /**< Enable emergency for MURAM2 */ 458*0aeed3e9SJustin Hibbits #define FM_DMA_EXT_BUS_EMERGENCY 0x00100000 /**< Enable emergency for external bus */ 459*0aeed3e9SJustin Hibbits /* @} */ 460*0aeed3e9SJustin Hibbits 461*0aeed3e9SJustin Hibbits /**************************************************************************//** 462*0aeed3e9SJustin Hibbits @Description A structure for defining DMA emergency level 463*0aeed3e9SJustin Hibbits *//***************************************************************************/ 464*0aeed3e9SJustin Hibbits typedef struct t_FmDmaEmergency { 465*0aeed3e9SJustin Hibbits fmEmergencyBus_t emergencyBusSelect; /**< An OR of the busses where emergency 466*0aeed3e9SJustin Hibbits should be enabled */ 467*0aeed3e9SJustin Hibbits e_FmDmaEmergencyLevel emergencyLevel; /**< EBS/SOS */ 468*0aeed3e9SJustin Hibbits } t_FmDmaEmergency; 469*0aeed3e9SJustin Hibbits 470*0aeed3e9SJustin Hibbits /**************************************************************************//** 471*0aeed3e9SJustin Hibbits @Description structure for defining FM threshold 472*0aeed3e9SJustin Hibbits *//***************************************************************************/ 473*0aeed3e9SJustin Hibbits typedef struct t_FmThresholds { 474*0aeed3e9SJustin Hibbits uint8_t dispLimit; /**< The number of times a frames may 475*0aeed3e9SJustin Hibbits be passed in the FM before assumed to 476*0aeed3e9SJustin Hibbits be looping. */ 477*0aeed3e9SJustin Hibbits uint8_t prsDispTh; /**< This is the number pf packets that may be 478*0aeed3e9SJustin Hibbits queued in the parser dispatch queue*/ 479*0aeed3e9SJustin Hibbits uint8_t plcrDispTh; /**< This is the number pf packets that may be 480*0aeed3e9SJustin Hibbits queued in the policer dispatch queue*/ 481*0aeed3e9SJustin Hibbits uint8_t kgDispTh; /**< This is the number pf packets that may be 482*0aeed3e9SJustin Hibbits queued in the keygen dispatch queue*/ 483*0aeed3e9SJustin Hibbits uint8_t bmiDispTh; /**< This is the number pf packets that may be 484*0aeed3e9SJustin Hibbits queued in the BMI dispatch queue*/ 485*0aeed3e9SJustin Hibbits uint8_t qmiEnqDispTh; /**< This is the number pf packets that may be 486*0aeed3e9SJustin Hibbits queued in the QMI enqueue dispatch queue*/ 487*0aeed3e9SJustin Hibbits uint8_t qmiDeqDispTh; /**< This is the number pf packets that may be 488*0aeed3e9SJustin Hibbits queued in the QMI dequeue dispatch queue*/ 489*0aeed3e9SJustin Hibbits uint8_t fmCtl1DispTh; /**< This is the number pf packets that may be 490*0aeed3e9SJustin Hibbits queued in fmCtl1 dispatch queue*/ 491*0aeed3e9SJustin Hibbits uint8_t fmCtl2DispTh; /**< This is the number pf packets that may be 492*0aeed3e9SJustin Hibbits queued in fmCtl2 dispatch queue*/ 493*0aeed3e9SJustin Hibbits } t_FmThresholds; 494*0aeed3e9SJustin Hibbits 495*0aeed3e9SJustin Hibbits 496*0aeed3e9SJustin Hibbits /**************************************************************************//** 497*0aeed3e9SJustin Hibbits @Description structure for defining DMA thresholds 498*0aeed3e9SJustin Hibbits *//***************************************************************************/ 499*0aeed3e9SJustin Hibbits typedef struct t_FmDmaThresholds { 500*0aeed3e9SJustin Hibbits uint8_t assertEmergency; /**< When this value is reached, 501*0aeed3e9SJustin Hibbits assert emergency (Threshold)*/ 502*0aeed3e9SJustin Hibbits uint8_t clearEmergency; /**< After emergency is asserted, it is held 503*0aeed3e9SJustin Hibbits until this value is reached (Hystheresis) */ 504*0aeed3e9SJustin Hibbits } t_FmDmaThresholds; 505*0aeed3e9SJustin Hibbits 506*0aeed3e9SJustin Hibbits 507*0aeed3e9SJustin Hibbits /**************************************************************************//** 508*0aeed3e9SJustin Hibbits @Function FM_ConfigResetOnInit 509*0aeed3e9SJustin Hibbits 510*0aeed3e9SJustin Hibbits @Description Tell the driver whether to reset the FM before initialization or 511*0aeed3e9SJustin Hibbits not. It changes the default configuration [FALSE]. 512*0aeed3e9SJustin Hibbits 513*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 514*0aeed3e9SJustin Hibbits @Param[in] enable When TRUE, FM will be reset before any initialization. 515*0aeed3e9SJustin Hibbits 516*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 517*0aeed3e9SJustin Hibbits 518*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 519*0aeed3e9SJustin Hibbits *//***************************************************************************/ 520*0aeed3e9SJustin Hibbits t_Error FM_ConfigResetOnInit(t_Handle h_Fm, bool enable); 521*0aeed3e9SJustin Hibbits 522*0aeed3e9SJustin Hibbits /**************************************************************************//** 523*0aeed3e9SJustin Hibbits @Function FM_ConfigTotalNumOfTasks 524*0aeed3e9SJustin Hibbits 525*0aeed3e9SJustin Hibbits @Description Change the total number of tasks from its default 526*0aeed3e9SJustin Hibbits configuration [BMI_MAX_NUM_OF_TASKS] 527*0aeed3e9SJustin Hibbits 528*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 529*0aeed3e9SJustin Hibbits @Param[in] totalNumOfTasks The selected new value. 530*0aeed3e9SJustin Hibbits 531*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 532*0aeed3e9SJustin Hibbits 533*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 534*0aeed3e9SJustin Hibbits *//***************************************************************************/ 535*0aeed3e9SJustin Hibbits t_Error FM_ConfigTotalNumOfTasks(t_Handle h_Fm, uint8_t totalNumOfTasks); 536*0aeed3e9SJustin Hibbits 537*0aeed3e9SJustin Hibbits /**************************************************************************//** 538*0aeed3e9SJustin Hibbits @Function FM_ConfigTotalFifoSize 539*0aeed3e9SJustin Hibbits 540*0aeed3e9SJustin Hibbits @Description Change the total Fifo size from its default 541*0aeed3e9SJustin Hibbits configuration [BMI_MAX_FIFO_SIZE] 542*0aeed3e9SJustin Hibbits 543*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 544*0aeed3e9SJustin Hibbits @Param[in] totalFifoSize The selected new value. 545*0aeed3e9SJustin Hibbits 546*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 547*0aeed3e9SJustin Hibbits 548*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 549*0aeed3e9SJustin Hibbits *//***************************************************************************/ 550*0aeed3e9SJustin Hibbits t_Error FM_ConfigTotalFifoSize(t_Handle h_Fm, uint32_t totalFifoSize); 551*0aeed3e9SJustin Hibbits 552*0aeed3e9SJustin Hibbits /**************************************************************************//** 553*0aeed3e9SJustin Hibbits @Function FM_ConfigMaxNumOfOpenDmas 554*0aeed3e9SJustin Hibbits 555*0aeed3e9SJustin Hibbits @Description Change the maximum allowed open DMA's for this FM from its default 556*0aeed3e9SJustin Hibbits configuration [BMI_MAX_NUM_OF_DMAS] 557*0aeed3e9SJustin Hibbits 558*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 559*0aeed3e9SJustin Hibbits @Param[in] maxNumOfOpenDmas The selected new value. 560*0aeed3e9SJustin Hibbits 561*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 562*0aeed3e9SJustin Hibbits 563*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 564*0aeed3e9SJustin Hibbits *//***************************************************************************/ 565*0aeed3e9SJustin Hibbits t_Error FM_ConfigMaxNumOfOpenDmas(t_Handle h_Fm, uint8_t maxNumOfOpenDmas); 566*0aeed3e9SJustin Hibbits 567*0aeed3e9SJustin Hibbits /**************************************************************************//** 568*0aeed3e9SJustin Hibbits @Function FM_ConfigThresholds 569*0aeed3e9SJustin Hibbits 570*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 571*0aeed3e9SJustin Hibbits from its default FM threshold configuration: 572*0aeed3e9SJustin Hibbits dispLimit: [0] 573*0aeed3e9SJustin Hibbits prsDispTh: [16] 574*0aeed3e9SJustin Hibbits plcrDispTh: [16] 575*0aeed3e9SJustin Hibbits kgDispTh: [16] 576*0aeed3e9SJustin Hibbits bmiDispTh: [16] 577*0aeed3e9SJustin Hibbits qmiEnqDispTh: [16] 578*0aeed3e9SJustin Hibbits qmiDeqDispTh: [16] 579*0aeed3e9SJustin Hibbits fmCtl1DispTh: [16] 580*0aeed3e9SJustin Hibbits fmCtl2DispTh: [16] 581*0aeed3e9SJustin Hibbits 582*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 583*0aeed3e9SJustin Hibbits @Param[in] p_FmThresholds A structure of threshold parameters. 584*0aeed3e9SJustin Hibbits 585*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 586*0aeed3e9SJustin Hibbits 587*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 588*0aeed3e9SJustin Hibbits *//***************************************************************************/ 589*0aeed3e9SJustin Hibbits t_Error FM_ConfigThresholds(t_Handle h_Fm, t_FmThresholds *p_FmThresholds); 590*0aeed3e9SJustin Hibbits 591*0aeed3e9SJustin Hibbits /**************************************************************************//** 592*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaCacheOverride 593*0aeed3e9SJustin Hibbits 594*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 595*0aeed3e9SJustin Hibbits from its default configuration of cache override mode [e_FM_DMA_NO_CACHE_OR] 596*0aeed3e9SJustin Hibbits 597*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 598*0aeed3e9SJustin Hibbits @Param[in] cacheOverride The selected new value. 599*0aeed3e9SJustin Hibbits 600*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 601*0aeed3e9SJustin Hibbits 602*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 603*0aeed3e9SJustin Hibbits *//***************************************************************************/ 604*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaCacheOverride(t_Handle h_Fm, e_FmDmaCacheOverride cacheOverride); 605*0aeed3e9SJustin Hibbits 606*0aeed3e9SJustin Hibbits /**************************************************************************//** 607*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaAidOverride 608*0aeed3e9SJustin Hibbits 609*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 610*0aeed3e9SJustin Hibbits from its default configuration of aid override mode [TRUE] 611*0aeed3e9SJustin Hibbits 612*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 613*0aeed3e9SJustin Hibbits @Param[in] aidOverride The selected new value. 614*0aeed3e9SJustin Hibbits 615*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 616*0aeed3e9SJustin Hibbits 617*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 618*0aeed3e9SJustin Hibbits *//***************************************************************************/ 619*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaAidOverride(t_Handle h_Fm, bool aidOverride); 620*0aeed3e9SJustin Hibbits 621*0aeed3e9SJustin Hibbits /**************************************************************************//** 622*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaAidMode 623*0aeed3e9SJustin Hibbits 624*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 625*0aeed3e9SJustin Hibbits from its default configuration of aid mode [e_FM_DMA_AID_OUT_TNUM] 626*0aeed3e9SJustin Hibbits 627*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 628*0aeed3e9SJustin Hibbits @Param[in] aidMode The selected new value. 629*0aeed3e9SJustin Hibbits 630*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 631*0aeed3e9SJustin Hibbits 632*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 633*0aeed3e9SJustin Hibbits *//***************************************************************************/ 634*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaAidMode(t_Handle h_Fm, e_FmDmaAidMode aidMode); 635*0aeed3e9SJustin Hibbits 636*0aeed3e9SJustin Hibbits /**************************************************************************//** 637*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaAxiDbgNumOfBeats 638*0aeed3e9SJustin Hibbits 639*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 640*0aeed3e9SJustin Hibbits from its default configuration of axi debug [1] 641*0aeed3e9SJustin Hibbits 642*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 643*0aeed3e9SJustin Hibbits @Param[in] axiDbgNumOfBeats The selected new value. 644*0aeed3e9SJustin Hibbits 645*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 646*0aeed3e9SJustin Hibbits 647*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 648*0aeed3e9SJustin Hibbits *//***************************************************************************/ 649*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaAxiDbgNumOfBeats(t_Handle h_Fm, uint8_t axiDbgNumOfBeats); 650*0aeed3e9SJustin Hibbits 651*0aeed3e9SJustin Hibbits /**************************************************************************//** 652*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaCamNumOfEntries 653*0aeed3e9SJustin Hibbits 654*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 655*0aeed3e9SJustin Hibbits from its default configuration of number of CAM entries [32] 656*0aeed3e9SJustin Hibbits 657*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 658*0aeed3e9SJustin Hibbits @Param[in] numOfEntries The selected new value. 659*0aeed3e9SJustin Hibbits 660*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 661*0aeed3e9SJustin Hibbits 662*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 663*0aeed3e9SJustin Hibbits *//***************************************************************************/ 664*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaCamNumOfEntries(t_Handle h_Fm, uint8_t numOfEntries); 665*0aeed3e9SJustin Hibbits 666*0aeed3e9SJustin Hibbits /**************************************************************************//** 667*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaWatchdog 668*0aeed3e9SJustin Hibbits 669*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 670*0aeed3e9SJustin Hibbits from its default watchdog configuration, which is disabled 671*0aeed3e9SJustin Hibbits [0]. 672*0aeed3e9SJustin Hibbits 673*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 674*0aeed3e9SJustin Hibbits @Param[in] watchDogValue The selected new value - in microseconds. 675*0aeed3e9SJustin Hibbits 676*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 677*0aeed3e9SJustin Hibbits 678*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 679*0aeed3e9SJustin Hibbits *//***************************************************************************/ 680*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaWatchdog(t_Handle h_Fm, uint32_t watchDogValue); 681*0aeed3e9SJustin Hibbits 682*0aeed3e9SJustin Hibbits /**************************************************************************//** 683*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaWriteBufThresholds 684*0aeed3e9SJustin Hibbits 685*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 686*0aeed3e9SJustin Hibbits from its default configuration of DMA write buffer threshold 687*0aeed3e9SJustin Hibbits assertEmergency: [DMA_THRESH_MAX_BUF] 688*0aeed3e9SJustin Hibbits clearEmergency: [DMA_THRESH_MAX_BUF] 689*0aeed3e9SJustin Hibbits 690*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 691*0aeed3e9SJustin Hibbits @Param[in] p_FmDmaThresholds A structure of thresholds to define emergency behavior - 692*0aeed3e9SJustin Hibbits When 'assertEmergency' value is reached, emergency is asserted, 693*0aeed3e9SJustin Hibbits then it is held until 'clearEmergency' value is reached. 694*0aeed3e9SJustin Hibbits 695*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 696*0aeed3e9SJustin Hibbits 697*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 698*0aeed3e9SJustin Hibbits *//***************************************************************************/ 699*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaWriteBufThresholds(t_Handle h_Fm, t_FmDmaThresholds *p_FmDmaThresholds); 700*0aeed3e9SJustin Hibbits 701*0aeed3e9SJustin Hibbits /**************************************************************************//** 702*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaCommQThresholds 703*0aeed3e9SJustin Hibbits 704*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 705*0aeed3e9SJustin Hibbits from its default configuration of DMA command queue threshold 706*0aeed3e9SJustin Hibbits assertEmergency: [DMA_THRESH_MAX_COMMQ] 707*0aeed3e9SJustin Hibbits clearEmergency: [DMA_THRESH_MAX_COMMQ] 708*0aeed3e9SJustin Hibbits 709*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 710*0aeed3e9SJustin Hibbits @Param[in] p_FmDmaThresholds A structure of thresholds to define emergency behavior - 711*0aeed3e9SJustin Hibbits When 'assertEmergency' value is reached, emergency is asserted, 712*0aeed3e9SJustin Hibbits then it is held until 'clearEmergency' value is reached.. 713*0aeed3e9SJustin Hibbits 714*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 715*0aeed3e9SJustin Hibbits 716*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 717*0aeed3e9SJustin Hibbits *//***************************************************************************/ 718*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaCommQThresholds(t_Handle h_Fm, t_FmDmaThresholds *p_FmDmaThresholds); 719*0aeed3e9SJustin Hibbits 720*0aeed3e9SJustin Hibbits /**************************************************************************//** 721*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaReadBufThresholds 722*0aeed3e9SJustin Hibbits 723*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 724*0aeed3e9SJustin Hibbits from its default configuration of DMA read buffer threshold 725*0aeed3e9SJustin Hibbits assertEmergency: [DMA_THRESH_MAX_BUF] 726*0aeed3e9SJustin Hibbits clearEmergency: [DMA_THRESH_MAX_BUF] 727*0aeed3e9SJustin Hibbits 728*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 729*0aeed3e9SJustin Hibbits @Param[in] p_FmDmaThresholds A structure of thresholds to define emergency behavior - 730*0aeed3e9SJustin Hibbits When 'assertEmergency' value is reached, emergency is asserted, 731*0aeed3e9SJustin Hibbits then it is held until 'clearEmergency' value is reached.. 732*0aeed3e9SJustin Hibbits 733*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 734*0aeed3e9SJustin Hibbits 735*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 736*0aeed3e9SJustin Hibbits *//***************************************************************************/ 737*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaReadBufThresholds(t_Handle h_Fm, t_FmDmaThresholds *p_FmDmaThresholds); 738*0aeed3e9SJustin Hibbits 739*0aeed3e9SJustin Hibbits /**************************************************************************//** 740*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaSosEmergencyThreshold 741*0aeed3e9SJustin Hibbits 742*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 743*0aeed3e9SJustin Hibbits from its default dma SOS emergency configuration [0] 744*0aeed3e9SJustin Hibbits 745*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 746*0aeed3e9SJustin Hibbits @Param[in] dmaSosEmergency The selected new value. 747*0aeed3e9SJustin Hibbits 748*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 749*0aeed3e9SJustin Hibbits 750*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 751*0aeed3e9SJustin Hibbits *//***************************************************************************/ 752*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaSosEmergencyThreshold(t_Handle h_Fm, uint32_t dmaSosEmergency); 753*0aeed3e9SJustin Hibbits 754*0aeed3e9SJustin Hibbits /**************************************************************************//** 755*0aeed3e9SJustin Hibbits @Function FM_ConfigEnableCounters 756*0aeed3e9SJustin Hibbits 757*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 758*0aeed3e9SJustin Hibbits from its default counters configuration where counters are disabled. 759*0aeed3e9SJustin Hibbits 760*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 761*0aeed3e9SJustin Hibbits 762*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 763*0aeed3e9SJustin Hibbits 764*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 765*0aeed3e9SJustin Hibbits *//***************************************************************************/ 766*0aeed3e9SJustin Hibbits t_Error FM_ConfigEnableCounters(t_Handle h_Fm); 767*0aeed3e9SJustin Hibbits 768*0aeed3e9SJustin Hibbits /**************************************************************************//** 769*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaDbgCounter 770*0aeed3e9SJustin Hibbits 771*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 772*0aeed3e9SJustin Hibbits from its default DMA debug counters configuration [e_FM_DMA_DBG_NO_CNT] 773*0aeed3e9SJustin Hibbits 774*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 775*0aeed3e9SJustin Hibbits @Param[in] fmDmaDbgCntMode An enum selecting the debug counter mode. 776*0aeed3e9SJustin Hibbits 777*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 778*0aeed3e9SJustin Hibbits 779*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 780*0aeed3e9SJustin Hibbits *//***************************************************************************/ 781*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaDbgCounter(t_Handle h_Fm, e_FmDmaDbgCntMode fmDmaDbgCntMode); 782*0aeed3e9SJustin Hibbits 783*0aeed3e9SJustin Hibbits /**************************************************************************//** 784*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaStopOnBusErr 785*0aeed3e9SJustin Hibbits 786*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 787*0aeed3e9SJustin Hibbits from its default selection of bus error behavior [FALSE] 788*0aeed3e9SJustin Hibbits 789*0aeed3e9SJustin Hibbits 790*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 791*0aeed3e9SJustin Hibbits @Param[in] stop TRUE to stop on bus error, FALSE to continue. 792*0aeed3e9SJustin Hibbits 793*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 794*0aeed3e9SJustin Hibbits 795*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 796*0aeed3e9SJustin Hibbits Only if bus error is enabled. 797*0aeed3e9SJustin Hibbits *//***************************************************************************/ 798*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaStopOnBusErr(t_Handle h_Fm, bool stop); 799*0aeed3e9SJustin Hibbits 800*0aeed3e9SJustin Hibbits /**************************************************************************//** 801*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaEmergency 802*0aeed3e9SJustin Hibbits 803*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 804*0aeed3e9SJustin Hibbits from its default selection of DMA emergency where's it's disabled. 805*0aeed3e9SJustin Hibbits 806*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 807*0aeed3e9SJustin Hibbits @Param[in] p_Emergency An OR mask of all required options. 808*0aeed3e9SJustin Hibbits 809*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 810*0aeed3e9SJustin Hibbits 811*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 812*0aeed3e9SJustin Hibbits *//***************************************************************************/ 813*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaEmergency(t_Handle h_Fm, t_FmDmaEmergency *p_Emergency); 814*0aeed3e9SJustin Hibbits 815*0aeed3e9SJustin Hibbits /**************************************************************************//** 816*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaEmergencySmoother 817*0aeed3e9SJustin Hibbits 818*0aeed3e9SJustin Hibbits @Description sets the minimum amount of DATA beats transferred on the AXI 819*0aeed3e9SJustin Hibbits READ and WRITE ports before lowering the emergency level. 820*0aeed3e9SJustin Hibbits By default smother is disabled. 821*0aeed3e9SJustin Hibbits 822*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 823*0aeed3e9SJustin Hibbits @Param[in] emergencyCnt emergency switching counter. 824*0aeed3e9SJustin Hibbits 825*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 826*0aeed3e9SJustin Hibbits 827*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 828*0aeed3e9SJustin Hibbits *//***************************************************************************/ 829*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaEmergencySmoother(t_Handle h_Fm, uint32_t emergencyCnt); 830*0aeed3e9SJustin Hibbits 831*0aeed3e9SJustin Hibbits /**************************************************************************//** 832*0aeed3e9SJustin Hibbits @Function FM_ConfigDmaErr 833*0aeed3e9SJustin Hibbits 834*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 835*0aeed3e9SJustin Hibbits from its default DMA error treatment [e_FM_DMA_ERR_CATASTROPHIC] 836*0aeed3e9SJustin Hibbits 837*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 838*0aeed3e9SJustin Hibbits @Param[in] dmaErr The selected new choice. 839*0aeed3e9SJustin Hibbits 840*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 841*0aeed3e9SJustin Hibbits 842*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 843*0aeed3e9SJustin Hibbits *//***************************************************************************/ 844*0aeed3e9SJustin Hibbits t_Error FM_ConfigDmaErr(t_Handle h_Fm, e_FmDmaErr dmaErr); 845*0aeed3e9SJustin Hibbits 846*0aeed3e9SJustin Hibbits /**************************************************************************//** 847*0aeed3e9SJustin Hibbits @Function FM_ConfigCatastrophicErr 848*0aeed3e9SJustin Hibbits 849*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 850*0aeed3e9SJustin Hibbits from its default behavior on catastrophic error [e_FM_CATASTROPHIC_ERR_STALL_PORT] 851*0aeed3e9SJustin Hibbits 852*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 853*0aeed3e9SJustin Hibbits @Param[in] catastrophicErr The selected new choice. 854*0aeed3e9SJustin Hibbits 855*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 856*0aeed3e9SJustin Hibbits 857*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 858*0aeed3e9SJustin Hibbits *//***************************************************************************/ 859*0aeed3e9SJustin Hibbits t_Error FM_ConfigCatastrophicErr(t_Handle h_Fm, e_FmCatastrophicErr catastrophicErr); 860*0aeed3e9SJustin Hibbits 861*0aeed3e9SJustin Hibbits /**************************************************************************//** 862*0aeed3e9SJustin Hibbits @Function FM_ConfigEnableMuramTestMode 863*0aeed3e9SJustin Hibbits 864*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 865*0aeed3e9SJustin Hibbits from its default selection of test mode where it's disabled. 866*0aeed3e9SJustin Hibbits 867*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 868*0aeed3e9SJustin Hibbits 869*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 870*0aeed3e9SJustin Hibbits 871*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 872*0aeed3e9SJustin Hibbits *//***************************************************************************/ 873*0aeed3e9SJustin Hibbits t_Error FM_ConfigEnableMuramTestMode(t_Handle h_Fm); 874*0aeed3e9SJustin Hibbits 875*0aeed3e9SJustin Hibbits /**************************************************************************//** 876*0aeed3e9SJustin Hibbits @Function FM_ConfigEnableIramTestMode 877*0aeed3e9SJustin Hibbits 878*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 879*0aeed3e9SJustin Hibbits from its default selection of test mode where it's disabled. 880*0aeed3e9SJustin Hibbits 881*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 882*0aeed3e9SJustin Hibbits 883*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 884*0aeed3e9SJustin Hibbits 885*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 886*0aeed3e9SJustin Hibbits *//***************************************************************************/ 887*0aeed3e9SJustin Hibbits t_Error FM_ConfigEnableIramTestMode(t_Handle h_Fm); 888*0aeed3e9SJustin Hibbits 889*0aeed3e9SJustin Hibbits /**************************************************************************//** 890*0aeed3e9SJustin Hibbits @Function FM_ConfigHaltOnExternalActivation 891*0aeed3e9SJustin Hibbits 892*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 893*0aeed3e9SJustin Hibbits from its default selection of FM behaviour on external halt 894*0aeed3e9SJustin Hibbits activation [FALSE]. 895*0aeed3e9SJustin Hibbits 896*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 897*0aeed3e9SJustin Hibbits @Param[in] enable TRUE to enable halt on external halt 898*0aeed3e9SJustin Hibbits activation. 899*0aeed3e9SJustin Hibbits 900*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 901*0aeed3e9SJustin Hibbits 902*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 903*0aeed3e9SJustin Hibbits *//***************************************************************************/ 904*0aeed3e9SJustin Hibbits t_Error FM_ConfigHaltOnExternalActivation(t_Handle h_Fm, bool enable); 905*0aeed3e9SJustin Hibbits 906*0aeed3e9SJustin Hibbits /**************************************************************************//** 907*0aeed3e9SJustin Hibbits @Function FM_ConfigHaltOnUnrecoverableEccError 908*0aeed3e9SJustin Hibbits 909*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 910*0aeed3e9SJustin Hibbits from its default selection of FM behaviour on unrecoverable 911*0aeed3e9SJustin Hibbits Ecc error [FALSE]. 912*0aeed3e9SJustin Hibbits 913*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 914*0aeed3e9SJustin Hibbits @Param[in] enable TRUE to enable halt on unrecoverable Ecc error 915*0aeed3e9SJustin Hibbits 916*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 917*0aeed3e9SJustin Hibbits 918*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 919*0aeed3e9SJustin Hibbits *//***************************************************************************/ 920*0aeed3e9SJustin Hibbits t_Error FM_ConfigHaltOnUnrecoverableEccError(t_Handle h_Fm, bool enable); 921*0aeed3e9SJustin Hibbits 922*0aeed3e9SJustin Hibbits /**************************************************************************//** 923*0aeed3e9SJustin Hibbits @Function FM_ConfigException 924*0aeed3e9SJustin Hibbits 925*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 926*0aeed3e9SJustin Hibbits from its default selection of exceptions enablement. 927*0aeed3e9SJustin Hibbits By default all exceptions are enabled. 928*0aeed3e9SJustin Hibbits 929*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 930*0aeed3e9SJustin Hibbits @Param[in] exception The exception to be selected. 931*0aeed3e9SJustin Hibbits @Param[in] enable TRUE to enable interrupt, FALSE to mask it. 932*0aeed3e9SJustin Hibbits 933*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 934*0aeed3e9SJustin Hibbits 935*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 936*0aeed3e9SJustin Hibbits *//***************************************************************************/ 937*0aeed3e9SJustin Hibbits t_Error FM_ConfigException(t_Handle h_Fm, e_FmExceptions exception, bool enable); 938*0aeed3e9SJustin Hibbits 939*0aeed3e9SJustin Hibbits /**************************************************************************//** 940*0aeed3e9SJustin Hibbits @Function FM_ConfigExternalEccRamsEnable 941*0aeed3e9SJustin Hibbits 942*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 943*0aeed3e9SJustin Hibbits from its default [FALSE]. 944*0aeed3e9SJustin Hibbits When this option is enabled Rams ECC enable is not effected 945*0aeed3e9SJustin Hibbits by the FPM RCR bit, but by a JTAG. 946*0aeed3e9SJustin Hibbits 947*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 948*0aeed3e9SJustin Hibbits @Param[in] enable TRUE to enable this option. 949*0aeed3e9SJustin Hibbits 950*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 951*0aeed3e9SJustin Hibbits 952*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 953*0aeed3e9SJustin Hibbits *//***************************************************************************/ 954*0aeed3e9SJustin Hibbits t_Error FM_ConfigExternalEccRamsEnable(t_Handle h_Fm, bool enable); 955*0aeed3e9SJustin Hibbits 956*0aeed3e9SJustin Hibbits /**************************************************************************//** 957*0aeed3e9SJustin Hibbits @Function FM_ConfigTnumAgingPeriod 958*0aeed3e9SJustin Hibbits 959*0aeed3e9SJustin Hibbits @Description Calling this routine changes the internal driver data base 960*0aeed3e9SJustin Hibbits from its default configuration for aging of dequeue TNUM's 961*0aeed3e9SJustin Hibbits in the QMI.[0] 962*0aeed3e9SJustin Hibbits Note that this functionality is not available in all chips. 963*0aeed3e9SJustin Hibbits 964*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 965*0aeed3e9SJustin Hibbits @Param[in] tnumAgingPeriod Tnum Aging Period in microseconds. 966*0aeed3e9SJustin Hibbits Note that period is recalculated in units of 967*0aeed3e9SJustin Hibbits 64 FM clocks. Driver will pick the closest 968*0aeed3e9SJustin Hibbits possible period. 969*0aeed3e9SJustin Hibbits 970*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 971*0aeed3e9SJustin Hibbits 972*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 973*0aeed3e9SJustin Hibbits *//***************************************************************************/ 974*0aeed3e9SJustin Hibbits t_Error FM_ConfigTnumAgingPeriod(t_Handle h_Fm, uint16_t tnumAgingPeriod); 975*0aeed3e9SJustin Hibbits 976*0aeed3e9SJustin Hibbits /** @} */ /* end of FM_advanced_init_grp group */ 977*0aeed3e9SJustin Hibbits /** @} */ /* end of FM_init_grp group */ 978*0aeed3e9SJustin Hibbits 979*0aeed3e9SJustin Hibbits 980*0aeed3e9SJustin Hibbits /**************************************************************************//** 981*0aeed3e9SJustin Hibbits @Group FM_runtime_control_grp FM Runtime Control Unit 982*0aeed3e9SJustin Hibbits 983*0aeed3e9SJustin Hibbits @Description FM Runtime control unit API functions, definitions and enums. 984*0aeed3e9SJustin Hibbits The FM driver provides a set of control routines for each module. 985*0aeed3e9SJustin Hibbits These routines may only be called after the module was fully 986*0aeed3e9SJustin Hibbits initialized (both configuration and initialization routines were 987*0aeed3e9SJustin Hibbits called). They are typically used to get information from hardware 988*0aeed3e9SJustin Hibbits (status, counters/statistics, revision etc.), to modify a current 989*0aeed3e9SJustin Hibbits state or to force/enable a required action. Run-time control may 990*0aeed3e9SJustin Hibbits be called whenever necessary and as many times as needed. 991*0aeed3e9SJustin Hibbits @{ 992*0aeed3e9SJustin Hibbits *//***************************************************************************/ 993*0aeed3e9SJustin Hibbits 994*0aeed3e9SJustin Hibbits /**************************************************************************//** 995*0aeed3e9SJustin Hibbits @Collection General FM defines. 996*0aeed3e9SJustin Hibbits *//***************************************************************************/ 997*0aeed3e9SJustin Hibbits #define FM_MAX_NUM_OF_VALID_PORTS (FM_MAX_NUM_OF_OH_PORTS + \ 998*0aeed3e9SJustin Hibbits FM_MAX_NUM_OF_1G_RX_PORTS + \ 999*0aeed3e9SJustin Hibbits FM_MAX_NUM_OF_10G_RX_PORTS + \ 1000*0aeed3e9SJustin Hibbits FM_MAX_NUM_OF_1G_TX_PORTS + \ 1001*0aeed3e9SJustin Hibbits FM_MAX_NUM_OF_10G_TX_PORTS) 1002*0aeed3e9SJustin Hibbits /* @} */ 1003*0aeed3e9SJustin Hibbits 1004*0aeed3e9SJustin Hibbits /**************************************************************************//** 1005*0aeed3e9SJustin Hibbits @Description Structure for Port bandwidth requirement. Port is identified 1006*0aeed3e9SJustin Hibbits by type and relative id. 1007*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1008*0aeed3e9SJustin Hibbits typedef struct t_FmPortBandwidth { 1009*0aeed3e9SJustin Hibbits e_FmPortType type; /**< FM port type */ 1010*0aeed3e9SJustin Hibbits uint8_t relativePortId; /**< Type relative port id */ 1011*0aeed3e9SJustin Hibbits uint8_t bandwidth; /**< bandwidth - (in term of percents) */ 1012*0aeed3e9SJustin Hibbits } t_FmPortBandwidth; 1013*0aeed3e9SJustin Hibbits 1014*0aeed3e9SJustin Hibbits /**************************************************************************//** 1015*0aeed3e9SJustin Hibbits @Description A Structure containing an array of Port bandwidth requirements. 1016*0aeed3e9SJustin Hibbits The user should state the ports requiring bandwidth in terms of 1017*0aeed3e9SJustin Hibbits percentage - i.e. all port's bandwidths in the array must add 1018*0aeed3e9SJustin Hibbits up to 100. 1019*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1020*0aeed3e9SJustin Hibbits typedef struct t_FmPortsBandwidthParams { 1021*0aeed3e9SJustin Hibbits uint8_t numOfPorts; /**< num of ports listed in the array below */ 1022*0aeed3e9SJustin Hibbits t_FmPortBandwidth portsBandwidths[FM_MAX_NUM_OF_VALID_PORTS]; 1023*0aeed3e9SJustin Hibbits /**< for each port, it's bandwidth (all port's 1024*0aeed3e9SJustin Hibbits bandwidths must add up to 100.*/ 1025*0aeed3e9SJustin Hibbits } t_FmPortsBandwidthParams; 1026*0aeed3e9SJustin Hibbits 1027*0aeed3e9SJustin Hibbits /**************************************************************************//** 1028*0aeed3e9SJustin Hibbits @Description DMA Emergency control on MURAM 1029*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1030*0aeed3e9SJustin Hibbits typedef enum e_FmDmaMuramPort { 1031*0aeed3e9SJustin Hibbits e_FM_DMA_MURAM_PORT_WRITE, /**< MURAM write port */ 1032*0aeed3e9SJustin Hibbits e_FM_DMA_MURAM_PORT_READ /**< MURAM read port */ 1033*0aeed3e9SJustin Hibbits } e_FmDmaMuramPort; 1034*0aeed3e9SJustin Hibbits 1035*0aeed3e9SJustin Hibbits /**************************************************************************//** 1036*0aeed3e9SJustin Hibbits @Description enum for defining FM counters 1037*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1038*0aeed3e9SJustin Hibbits typedef enum e_FmCounters { 1039*0aeed3e9SJustin Hibbits e_FM_COUNTERS_ENQ_TOTAL_FRAME = 0, /**< QMI total enqueued frames counter */ 1040*0aeed3e9SJustin Hibbits e_FM_COUNTERS_DEQ_TOTAL_FRAME, /**< QMI total dequeued frames counter */ 1041*0aeed3e9SJustin Hibbits e_FM_COUNTERS_DEQ_0, /**< QMI 0 frames from QMan counter */ 1042*0aeed3e9SJustin Hibbits e_FM_COUNTERS_DEQ_1, /**< QMI 1 frames from QMan counter */ 1043*0aeed3e9SJustin Hibbits e_FM_COUNTERS_DEQ_2, /**< QMI 2 frames from QMan counter */ 1044*0aeed3e9SJustin Hibbits e_FM_COUNTERS_DEQ_3, /**< QMI 3 frames from QMan counter */ 1045*0aeed3e9SJustin Hibbits e_FM_COUNTERS_DEQ_FROM_DEFAULT, /**< QMI dequeue from default queue counter */ 1046*0aeed3e9SJustin Hibbits e_FM_COUNTERS_DEQ_FROM_CONTEXT, /**< QMI dequeue from FQ context counter */ 1047*0aeed3e9SJustin Hibbits e_FM_COUNTERS_DEQ_FROM_FD, /**< QMI dequeue from FD command field counter */ 1048*0aeed3e9SJustin Hibbits e_FM_COUNTERS_DEQ_CONFIRM, /**< QMI dequeue confirm counter */ 1049*0aeed3e9SJustin Hibbits e_FM_COUNTERS_SEMAPHOR_ENTRY_FULL_REJECT, /**< DMA semaphor reject due to full entry counter */ 1050*0aeed3e9SJustin Hibbits e_FM_COUNTERS_SEMAPHOR_QUEUE_FULL_REJECT, /**< DMA semaphor reject due to full CAM queue counter */ 1051*0aeed3e9SJustin Hibbits e_FM_COUNTERS_SEMAPHOR_SYNC_REJECT /**< DMA semaphor reject due to sync counter */ 1052*0aeed3e9SJustin Hibbits } e_FmCounters; 1053*0aeed3e9SJustin Hibbits 1054*0aeed3e9SJustin Hibbits /**************************************************************************//** 1055*0aeed3e9SJustin Hibbits @Description structure for returning revision information 1056*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1057*0aeed3e9SJustin Hibbits typedef struct t_FmRevisionInfo { 1058*0aeed3e9SJustin Hibbits uint8_t majorRev; /**< Major revision */ 1059*0aeed3e9SJustin Hibbits uint8_t minorRev; /**< Minor revision */ 1060*0aeed3e9SJustin Hibbits } t_FmRevisionInfo; 1061*0aeed3e9SJustin Hibbits 1062*0aeed3e9SJustin Hibbits /**************************************************************************//** 1063*0aeed3e9SJustin Hibbits @Description struct for defining DMA status 1064*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1065*0aeed3e9SJustin Hibbits typedef struct t_FmDmaStatus { 1066*0aeed3e9SJustin Hibbits bool cmqNotEmpty; /**< Command queue is not empty */ 1067*0aeed3e9SJustin Hibbits bool busError; /**< Bus error occurred */ 1068*0aeed3e9SJustin Hibbits bool readBufEccError; /**< Double ECC error on buffer Read */ 1069*0aeed3e9SJustin Hibbits bool writeBufEccSysError; /**< Double ECC error on buffer write from system side */ 1070*0aeed3e9SJustin Hibbits bool writeBufEccFmError; /**< Double ECC error on buffer write from FM side */ 1071*0aeed3e9SJustin Hibbits } t_FmDmaStatus; 1072*0aeed3e9SJustin Hibbits 1073*0aeed3e9SJustin Hibbits 1074*0aeed3e9SJustin Hibbits #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) 1075*0aeed3e9SJustin Hibbits /**************************************************************************//** 1076*0aeed3e9SJustin Hibbits @Function FM_DumpRegs 1077*0aeed3e9SJustin Hibbits 1078*0aeed3e9SJustin Hibbits @Description Dumps all FM registers 1079*0aeed3e9SJustin Hibbits 1080*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1081*0aeed3e9SJustin Hibbits 1082*0aeed3e9SJustin Hibbits @Return E_OK on success; 1083*0aeed3e9SJustin Hibbits 1084*0aeed3e9SJustin Hibbits @Cautions Allowed only FM_Init(). 1085*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1086*0aeed3e9SJustin Hibbits t_Error FM_DumpRegs(t_Handle h_Fm); 1087*0aeed3e9SJustin Hibbits #endif /* (defined(DEBUG_ERRORS) && ... */ 1088*0aeed3e9SJustin Hibbits 1089*0aeed3e9SJustin Hibbits /**************************************************************************//** 1090*0aeed3e9SJustin Hibbits @Function FM_SetException 1091*0aeed3e9SJustin Hibbits 1092*0aeed3e9SJustin Hibbits @Description Calling this routine enables/disables the specified exception. 1093*0aeed3e9SJustin Hibbits Note: Not available for guest partition. 1094*0aeed3e9SJustin Hibbits 1095*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1096*0aeed3e9SJustin Hibbits @Param[in] exception The exception to be selected. 1097*0aeed3e9SJustin Hibbits @Param[in] enable TRUE to enable interrupt, FALSE to mask it. 1098*0aeed3e9SJustin Hibbits 1099*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 1100*0aeed3e9SJustin Hibbits 1101*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Init(). 1102*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1103*0aeed3e9SJustin Hibbits t_Error FM_SetException(t_Handle h_Fm, e_FmExceptions exception, bool enable); 1104*0aeed3e9SJustin Hibbits 1105*0aeed3e9SJustin Hibbits /**************************************************************************//** 1106*0aeed3e9SJustin Hibbits @Function FM_SetPortsBandwidth 1107*0aeed3e9SJustin Hibbits 1108*0aeed3e9SJustin Hibbits @Description Sets relative weights between ports when accessing common resources. 1109*0aeed3e9SJustin Hibbits Note: Not available for guest partition. 1110*0aeed3e9SJustin Hibbits 1111*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1112*0aeed3e9SJustin Hibbits @Param[in] p_PortsBandwidth A structure of ports bandwidths in percentage, i.e. 1113*0aeed3e9SJustin Hibbits total must equal 100. 1114*0aeed3e9SJustin Hibbits 1115*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 1116*0aeed3e9SJustin Hibbits 1117*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Init(). 1118*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1119*0aeed3e9SJustin Hibbits t_Error FM_SetPortsBandwidth(t_Handle h_Fm, t_FmPortsBandwidthParams *p_PortsBandwidth); 1120*0aeed3e9SJustin Hibbits 1121*0aeed3e9SJustin Hibbits /**************************************************************************//** 1122*0aeed3e9SJustin Hibbits @Function FM_EnableRamsEcc 1123*0aeed3e9SJustin Hibbits 1124*0aeed3e9SJustin Hibbits @Description Enables ECC mechanism for all the different FM RAM's; E.g. IRAM, 1125*0aeed3e9SJustin Hibbits MURAM, Parser, Keygen, Policer, etc. 1126*0aeed3e9SJustin Hibbits Note: 1127*0aeed3e9SJustin Hibbits If FM_ConfigExternalEccRamsEnable was called to enable external 1128*0aeed3e9SJustin Hibbits setting of ECC, this routine effects IRAM ECC only. 1129*0aeed3e9SJustin Hibbits This routine is also called by the driver if an ECC exception is 1130*0aeed3e9SJustin Hibbits enabled. 1131*0aeed3e9SJustin Hibbits Note: Not available for guest partition. 1132*0aeed3e9SJustin Hibbits 1133*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1134*0aeed3e9SJustin Hibbits 1135*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 1136*0aeed3e9SJustin Hibbits 1137*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 1138*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1139*0aeed3e9SJustin Hibbits t_Error FM_EnableRamsEcc(t_Handle h_Fm); 1140*0aeed3e9SJustin Hibbits 1141*0aeed3e9SJustin Hibbits /**************************************************************************//** 1142*0aeed3e9SJustin Hibbits @Function FM_DisableRamsEcc 1143*0aeed3e9SJustin Hibbits 1144*0aeed3e9SJustin Hibbits @Description Disables ECC mechanism for all the different FM RAM's; E.g. IRAM, 1145*0aeed3e9SJustin Hibbits MURAM, Parser, Keygen, Policer, etc. 1146*0aeed3e9SJustin Hibbits Note: 1147*0aeed3e9SJustin Hibbits If FM_ConfigExternalEccRamsEnable was called to enable external 1148*0aeed3e9SJustin Hibbits setting of ECC, this routine effects IRAM ECC only. 1149*0aeed3e9SJustin Hibbits In opposed to FM_EnableRamsEcc, this routine must be called 1150*0aeed3e9SJustin Hibbits explicitly to disable all Rams ECC. 1151*0aeed3e9SJustin Hibbits Note: Not available for guest partition. 1152*0aeed3e9SJustin Hibbits 1153*0aeed3e9SJustin Hibbits 1154*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1155*0aeed3e9SJustin Hibbits 1156*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 1157*0aeed3e9SJustin Hibbits 1158*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Config() and before FM_Init(). 1159*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1160*0aeed3e9SJustin Hibbits t_Error FM_DisableRamsEcc(t_Handle h_Fm); 1161*0aeed3e9SJustin Hibbits 1162*0aeed3e9SJustin Hibbits /**************************************************************************//** 1163*0aeed3e9SJustin Hibbits @Function FM_GetRevision 1164*0aeed3e9SJustin Hibbits 1165*0aeed3e9SJustin Hibbits @Description Returns the FM revision 1166*0aeed3e9SJustin Hibbits 1167*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1168*0aeed3e9SJustin Hibbits @Param[out] p_FmRevisionInfo A structure of revision information parameters. 1169*0aeed3e9SJustin Hibbits 1170*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 1171*0aeed3e9SJustin Hibbits 1172*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Init(). 1173*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1174*0aeed3e9SJustin Hibbits t_Error FM_GetRevision(t_Handle h_Fm, t_FmRevisionInfo *p_FmRevisionInfo); 1175*0aeed3e9SJustin Hibbits 1176*0aeed3e9SJustin Hibbits /**************************************************************************//** 1177*0aeed3e9SJustin Hibbits @Function FM_GetCounter 1178*0aeed3e9SJustin Hibbits 1179*0aeed3e9SJustin Hibbits @Description Reads one of the FM counters. 1180*0aeed3e9SJustin Hibbits 1181*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1182*0aeed3e9SJustin Hibbits @Param[in] counter The requested counter. 1183*0aeed3e9SJustin Hibbits 1184*0aeed3e9SJustin Hibbits @Return Counter's current value. 1185*0aeed3e9SJustin Hibbits 1186*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Init(). 1187*0aeed3e9SJustin Hibbits Note that it is user's responsibility to call this routine only 1188*0aeed3e9SJustin Hibbits for enabled counters, and there will be no indication if a 1189*0aeed3e9SJustin Hibbits disabled counter is accessed. 1190*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1191*0aeed3e9SJustin Hibbits uint32_t FM_GetCounter(t_Handle h_Fm, e_FmCounters counter); 1192*0aeed3e9SJustin Hibbits 1193*0aeed3e9SJustin Hibbits /**************************************************************************//** 1194*0aeed3e9SJustin Hibbits @Function FM_ModifyCounter 1195*0aeed3e9SJustin Hibbits 1196*0aeed3e9SJustin Hibbits @Description Sets a value to an enabled counter. Use "0" to reset the counter. 1197*0aeed3e9SJustin Hibbits Note: Not available for guest partition. 1198*0aeed3e9SJustin Hibbits 1199*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1200*0aeed3e9SJustin Hibbits @Param[in] counter The requested counter. 1201*0aeed3e9SJustin Hibbits @Param[in] val The requested value to be written into the counter. 1202*0aeed3e9SJustin Hibbits 1203*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 1204*0aeed3e9SJustin Hibbits 1205*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Init(). 1206*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1207*0aeed3e9SJustin Hibbits t_Error FM_ModifyCounter(t_Handle h_Fm, e_FmCounters counter, uint32_t val); 1208*0aeed3e9SJustin Hibbits 1209*0aeed3e9SJustin Hibbits /**************************************************************************//** 1210*0aeed3e9SJustin Hibbits @Function FM_Resume 1211*0aeed3e9SJustin Hibbits 1212*0aeed3e9SJustin Hibbits @Description Release FM after halt FM command or after unrecoverable ECC error. 1213*0aeed3e9SJustin Hibbits Note: Not available for guest partition. 1214*0aeed3e9SJustin Hibbits 1215*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1216*0aeed3e9SJustin Hibbits 1217*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 1218*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1219*0aeed3e9SJustin Hibbits void FM_Resume(t_Handle h_Fm); 1220*0aeed3e9SJustin Hibbits 1221*0aeed3e9SJustin Hibbits /**************************************************************************//** 1222*0aeed3e9SJustin Hibbits @Function FM_SetDmaEmergency 1223*0aeed3e9SJustin Hibbits 1224*0aeed3e9SJustin Hibbits @Description Manual emergency set 1225*0aeed3e9SJustin Hibbits Note: Not available for guest partition. 1226*0aeed3e9SJustin Hibbits 1227*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1228*0aeed3e9SJustin Hibbits @Param[in] muramPort MURAM direction select. 1229*0aeed3e9SJustin Hibbits @Param[in] enable TRUE to manually enable emergency, FALSE to disable. 1230*0aeed3e9SJustin Hibbits 1231*0aeed3e9SJustin Hibbits @Return None. 1232*0aeed3e9SJustin Hibbits 1233*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Init(). 1234*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1235*0aeed3e9SJustin Hibbits void FM_SetDmaEmergency(t_Handle h_Fm, e_FmDmaMuramPort muramPort, bool enable); 1236*0aeed3e9SJustin Hibbits 1237*0aeed3e9SJustin Hibbits /**************************************************************************//** 1238*0aeed3e9SJustin Hibbits @Function FM_SetDmaExtBusPri 1239*0aeed3e9SJustin Hibbits 1240*0aeed3e9SJustin Hibbits @Description Manual emergency set 1241*0aeed3e9SJustin Hibbits Note: Not available for guest partition. 1242*0aeed3e9SJustin Hibbits 1243*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1244*0aeed3e9SJustin Hibbits @Param[in] pri External bus priority select 1245*0aeed3e9SJustin Hibbits 1246*0aeed3e9SJustin Hibbits @Return None. 1247*0aeed3e9SJustin Hibbits 1248*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Init(). 1249*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1250*0aeed3e9SJustin Hibbits void FM_SetDmaExtBusPri(t_Handle h_Fm, e_FmDmaExtBusPri pri); 1251*0aeed3e9SJustin Hibbits 1252*0aeed3e9SJustin Hibbits /**************************************************************************//** 1253*0aeed3e9SJustin Hibbits @Function FM_ForceIntr 1254*0aeed3e9SJustin Hibbits 1255*0aeed3e9SJustin Hibbits @Description Causes an interrupt event on the requested source. 1256*0aeed3e9SJustin Hibbits Note: Not available for guest partition. 1257*0aeed3e9SJustin Hibbits 1258*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1259*0aeed3e9SJustin Hibbits @Param[in] exception An exception to be forced. 1260*0aeed3e9SJustin Hibbits 1261*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code if the exception is not enabled, 1262*0aeed3e9SJustin Hibbits or is not able to create interrupt. 1263*0aeed3e9SJustin Hibbits 1264*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Init(). 1265*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1266*0aeed3e9SJustin Hibbits t_Error FM_ForceIntr (t_Handle h_Fm, e_FmExceptions exception); 1267*0aeed3e9SJustin Hibbits 1268*0aeed3e9SJustin Hibbits /**************************************************************************//** 1269*0aeed3e9SJustin Hibbits @Function FM_GetDmaStatus 1270*0aeed3e9SJustin Hibbits 1271*0aeed3e9SJustin Hibbits @Description Reads the DMA current status 1272*0aeed3e9SJustin Hibbits 1273*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1274*0aeed3e9SJustin Hibbits @Param[out] p_FmDmaStatus A structure of DMA status parameters. 1275*0aeed3e9SJustin Hibbits 1276*0aeed3e9SJustin Hibbits @Return None 1277*0aeed3e9SJustin Hibbits 1278*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Init(). 1279*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1280*0aeed3e9SJustin Hibbits void FM_GetDmaStatus(t_Handle h_Fm, t_FmDmaStatus *p_FmDmaStatus); 1281*0aeed3e9SJustin Hibbits 1282*0aeed3e9SJustin Hibbits /**************************************************************************//** 1283*0aeed3e9SJustin Hibbits @Function FM_GetPcdHandle 1284*0aeed3e9SJustin Hibbits 1285*0aeed3e9SJustin Hibbits @Description Used by FMC in order to get PCD handle 1286*0aeed3e9SJustin Hibbits 1287*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1288*0aeed3e9SJustin Hibbits 1289*0aeed3e9SJustin Hibbits @Return A handle to the PCD module, NULL if uninitialized. 1290*0aeed3e9SJustin Hibbits 1291*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Init(). 1292*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1293*0aeed3e9SJustin Hibbits t_Handle FM_GetPcdHandle(t_Handle h_Fm); 1294*0aeed3e9SJustin Hibbits 1295*0aeed3e9SJustin Hibbits /**************************************************************************//** 1296*0aeed3e9SJustin Hibbits @Function FM_ErrorIsr 1297*0aeed3e9SJustin Hibbits Note: Not available for guest partition. 1298*0aeed3e9SJustin Hibbits 1299*0aeed3e9SJustin Hibbits @Description FM interrupt-service-routine for errors. 1300*0aeed3e9SJustin Hibbits 1301*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1302*0aeed3e9SJustin Hibbits 1303*0aeed3e9SJustin Hibbits @Return E_OK on success; E_EMPTY if no errors found in register, other 1304*0aeed3e9SJustin Hibbits error code otherwise. 1305*0aeed3e9SJustin Hibbits 1306*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Init(). 1307*0aeed3e9SJustin Hibbits This routine should NOT be called from guest-partition 1308*0aeed3e9SJustin Hibbits (i.e. guestId != NCSW_MASTER_ID) 1309*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1310*0aeed3e9SJustin Hibbits t_Error FM_ErrorIsr(t_Handle h_Fm); 1311*0aeed3e9SJustin Hibbits 1312*0aeed3e9SJustin Hibbits /**************************************************************************//** 1313*0aeed3e9SJustin Hibbits @Function FM_EventIsr 1314*0aeed3e9SJustin Hibbits Note: Not available for guest partition. 1315*0aeed3e9SJustin Hibbits 1316*0aeed3e9SJustin Hibbits @Description FM interrupt-service-routine for normal events. 1317*0aeed3e9SJustin Hibbits 1318*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1319*0aeed3e9SJustin Hibbits 1320*0aeed3e9SJustin Hibbits @Cautions Allowed only following FM_Init(). 1321*0aeed3e9SJustin Hibbits This routine should NOT be called from guest-partition 1322*0aeed3e9SJustin Hibbits (i.e. guestId != NCSW_MASTER_ID) 1323*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1324*0aeed3e9SJustin Hibbits void FM_EventIsr(t_Handle h_Fm); 1325*0aeed3e9SJustin Hibbits 1326*0aeed3e9SJustin Hibbits #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0)) 1327*0aeed3e9SJustin Hibbits /**************************************************************************//** 1328*0aeed3e9SJustin Hibbits @Function FmDumpPortRegs 1329*0aeed3e9SJustin Hibbits 1330*0aeed3e9SJustin Hibbits @Description Dumps FM port registers which are part of FM common registers 1331*0aeed3e9SJustin Hibbits 1332*0aeed3e9SJustin Hibbits @Param[in] h_Fm A handle to an FM Module. 1333*0aeed3e9SJustin Hibbits @Param[in] hardwarePortId HW port id. 1334*0aeed3e9SJustin Hibbits 1335*0aeed3e9SJustin Hibbits @Return E_OK on success; Error code otherwise. 1336*0aeed3e9SJustin Hibbits 1337*0aeed3e9SJustin Hibbits @Cautions Allowed only FM_Init(). 1338*0aeed3e9SJustin Hibbits *//***************************************************************************/ 1339*0aeed3e9SJustin Hibbits t_Error FmDumpPortRegs(t_Handle h_Fm,uint8_t hardwarePortId); 1340*0aeed3e9SJustin Hibbits #endif /* (defined(DEBUG_ERRORS) && ... */ 1341*0aeed3e9SJustin Hibbits 1342*0aeed3e9SJustin Hibbits 1343*0aeed3e9SJustin Hibbits /** @} */ /* end of FM_runtime_control_grp group */ 1344*0aeed3e9SJustin Hibbits /** @} */ /* end of FM_lib_grp group */ 1345*0aeed3e9SJustin Hibbits /** @} */ /* end of FM_grp group */ 1346*0aeed3e9SJustin Hibbits 1347*0aeed3e9SJustin Hibbits #endif /* __FM_EXT */ 1348