1852ba100SJustin Hibbits /* 2852ba100SJustin Hibbits * Copyright 2008-2012 Freescale Semiconductor Inc. 30aeed3e9SJustin Hibbits * 40aeed3e9SJustin Hibbits * Redistribution and use in source and binary forms, with or without 50aeed3e9SJustin Hibbits * modification, are permitted provided that the following conditions are met: 60aeed3e9SJustin Hibbits * * Redistributions of source code must retain the above copyright 70aeed3e9SJustin Hibbits * notice, this list of conditions and the following disclaimer. 80aeed3e9SJustin Hibbits * * Redistributions in binary form must reproduce the above copyright 90aeed3e9SJustin Hibbits * notice, this list of conditions and the following disclaimer in the 100aeed3e9SJustin Hibbits * documentation and/or other materials provided with the distribution. 110aeed3e9SJustin Hibbits * * Neither the name of Freescale Semiconductor nor the 120aeed3e9SJustin Hibbits * names of its contributors may be used to endorse or promote products 130aeed3e9SJustin Hibbits * derived from this software without specific prior written permission. 140aeed3e9SJustin Hibbits * 150aeed3e9SJustin Hibbits * 160aeed3e9SJustin Hibbits * ALTERNATIVELY, this software may be distributed under the terms of the 170aeed3e9SJustin Hibbits * GNU General Public License ("GPL") as published by the Free Software 180aeed3e9SJustin Hibbits * Foundation, either version 2 of that License or (at your option) any 190aeed3e9SJustin Hibbits * later version. 200aeed3e9SJustin Hibbits * 210aeed3e9SJustin Hibbits * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY 220aeed3e9SJustin Hibbits * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 230aeed3e9SJustin Hibbits * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 240aeed3e9SJustin Hibbits * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY 250aeed3e9SJustin Hibbits * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 260aeed3e9SJustin Hibbits * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 270aeed3e9SJustin Hibbits * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 280aeed3e9SJustin Hibbits * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 290aeed3e9SJustin Hibbits * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 300aeed3e9SJustin Hibbits * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 310aeed3e9SJustin Hibbits */ 320aeed3e9SJustin Hibbits 33852ba100SJustin Hibbits 340aeed3e9SJustin Hibbits #ifndef __FM_HC_H 350aeed3e9SJustin Hibbits #define __FM_HC_H 360aeed3e9SJustin Hibbits 370aeed3e9SJustin Hibbits #include "std_ext.h" 380aeed3e9SJustin Hibbits #include "error_ext.h" 39852ba100SJustin Hibbits #include "fsl_fman_kg.h" 400aeed3e9SJustin Hibbits 410aeed3e9SJustin Hibbits #define __ERR_MODULE__ MODULE_FM_PCD 420aeed3e9SJustin Hibbits 430aeed3e9SJustin Hibbits 440aeed3e9SJustin Hibbits typedef struct t_FmHcParams { 450aeed3e9SJustin Hibbits t_Handle h_Fm; 460aeed3e9SJustin Hibbits t_Handle h_FmPcd; 470aeed3e9SJustin Hibbits t_FmPcdHcParams params; 480aeed3e9SJustin Hibbits } t_FmHcParams; 490aeed3e9SJustin Hibbits 500aeed3e9SJustin Hibbits 510aeed3e9SJustin Hibbits t_Handle FmHcConfigAndInit(t_FmHcParams *p_FmHcParams); 520aeed3e9SJustin Hibbits void FmHcFree(t_Handle h_FmHc); 53852ba100SJustin Hibbits t_Error FmHcSetFramesDataMemory(t_Handle h_FmHc, 54852ba100SJustin Hibbits uint8_t memId); 550aeed3e9SJustin Hibbits t_Error FmHcDumpRegs(t_Handle h_FmHc); 560aeed3e9SJustin Hibbits 570aeed3e9SJustin Hibbits void FmHcTxConf(t_Handle h_FmHc, t_DpaaFD *p_Fd); 580aeed3e9SJustin Hibbits 59852ba100SJustin Hibbits t_Error FmHcPcdKgSetScheme(t_Handle h_FmHc, 60852ba100SJustin Hibbits t_Handle h_Scheme, 61852ba100SJustin Hibbits struct fman_kg_scheme_regs *p_SchemeRegs, 62852ba100SJustin Hibbits bool updateCounter); 630aeed3e9SJustin Hibbits t_Error FmHcPcdKgDeleteScheme(t_Handle h_FmHc, t_Handle h_Scheme); 640aeed3e9SJustin Hibbits t_Error FmHcPcdCcCapwapTimeoutReassm(t_Handle h_FmHc, t_FmPcdCcCapwapReassmTimeoutParams *p_CcCapwapReassmTimeoutParams ); 65852ba100SJustin Hibbits t_Error FmHcPcdCcIpFragScratchPollCmd(t_Handle h_FmHc, bool fill, t_FmPcdCcFragScratchPoolCmdParams *p_FmPcdCcFragScratchPoolCmdParams); 66852ba100SJustin Hibbits t_Error FmHcPcdCcTimeoutReassm(t_Handle h_FmHc, t_FmPcdCcReassmTimeoutParams *p_CcReassmTimeoutParams, uint8_t *p_Result); 670aeed3e9SJustin Hibbits t_Error FmHcPcdKgSetClsPlan(t_Handle h_FmHc, t_FmPcdKgInterModuleClsPlanSet *p_Set); 680aeed3e9SJustin Hibbits t_Error FmHcPcdKgDeleteClsPlan(t_Handle h_FmHc, uint8_t clsPlanGrpId); 690aeed3e9SJustin Hibbits 700aeed3e9SJustin Hibbits t_Error FmHcPcdKgSetSchemeCounter(t_Handle h_FmHc, t_Handle h_Scheme, uint32_t value); 710aeed3e9SJustin Hibbits uint32_t FmHcPcdKgGetSchemeCounter(t_Handle h_FmHc, t_Handle h_Scheme); 720aeed3e9SJustin Hibbits 73852ba100SJustin Hibbits t_Error FmHcPcdCcDoDynamicChange(t_Handle h_FmHc, uint32_t oldAdAddrOffset, uint32_t newAdAddrOffset); 740aeed3e9SJustin Hibbits 75852ba100SJustin Hibbits t_Error FmHcPcdPlcrSetProfile(t_Handle h_FmHc, t_Handle h_Profile, t_FmPcdPlcrProfileRegs *p_PlcrRegs); 760aeed3e9SJustin Hibbits t_Error FmHcPcdPlcrDeleteProfile(t_Handle h_FmHc, t_Handle h_Profile); 770aeed3e9SJustin Hibbits 780aeed3e9SJustin Hibbits t_Error FmHcPcdPlcrSetProfileCounter(t_Handle h_FmHc, t_Handle h_Profile, e_FmPcdPlcrProfileCounters counter, uint32_t value); 790aeed3e9SJustin Hibbits uint32_t FmHcPcdPlcrGetProfileCounter(t_Handle h_FmHc, t_Handle h_Profile, e_FmPcdPlcrProfileCounters counter); 800aeed3e9SJustin Hibbits 810aeed3e9SJustin Hibbits t_Error FmHcKgWriteSp(t_Handle h_FmHc, uint8_t hardwarePortId, uint32_t spReg, bool add); 820aeed3e9SJustin Hibbits t_Error FmHcKgWriteCpp(t_Handle h_FmHc, uint8_t hardwarePortId, uint32_t cppReg); 830aeed3e9SJustin Hibbits 84852ba100SJustin Hibbits t_Error FmHcPcdKgCcGetSetParams(t_Handle h_FmHc, t_Handle h_Scheme, uint32_t requiredAction, uint32_t value); 850aeed3e9SJustin Hibbits t_Error FmHcPcdPlcrCcGetSetParams(t_Handle h_FmHc,uint16_t absoluteProfileId, uint32_t requiredAction); 860aeed3e9SJustin Hibbits 87852ba100SJustin Hibbits t_Error FmHcPcdSync(t_Handle h_FmHc); 88852ba100SJustin Hibbits t_Handle FmHcGetPort(t_Handle h_FmHc); 89852ba100SJustin Hibbits 90852ba100SJustin Hibbits 91852ba100SJustin Hibbits 920aeed3e9SJustin Hibbits 930aeed3e9SJustin Hibbits #endif /* __FM_HC_H */ 94