/******************************************************************************* **+--------------------------------------------------------------------------+** **| **** |** **| **** |** **| ******o*** |** **| ********_///_**** |** **| ***** /_//_/ **** |** **| ** ** (__/ **** |** **| ********* |** **| **** |** **| *** |** **| |** **| Copyright (c) 1998-2006 Texas Instruments Incorporated |** **| ALL RIGHTS RESERVED |** **| |** **+--------------------------------------------------------------------------+** *******************************************************************************/ /** \file pal_cppi4Pvt.h \brief CPPI4 PAL internal header file This file contains data structures and interfaces internal to CPPI4 specific PAL implementation.This file is compliant to the PSP Framework 1.0 definitions and prototypes. @author Greg Guyotte */ #ifndef __PAL_CPPI4_PVT_H__ #define __PAL_CPPI4_PVT_H__ /* This file will be included ONLY by CPPI4 PAL "implementation" files and hence must define CPPI4_PAL macro to get the right definition of Cppi4PALObj */ #define CPPI4_PAL /** * \defgroup CPPI4_PAL_Internal CPPI4 PAL Internal * * CPPI4 PAL Layer Internal Data Structures/Functions */ /*@{*/ /* Required for hiding internal object name behind the public name */ #include "pal_cppi4.h" /* PAL CPPI4 Interface */ /** * \brief PAL CPPI4 Debug flags * * The makefile must #define CPPI4_PAL_DEBUG in order to enable debug. * IMPORTANT NOTE: The debug flags need to be enabled carefully as it could * flood the console/sink point of the debug traces and also affect the * functionality of the overall system */ #define CPPI4_DEBUG_FUNCTION_ENTRY (0x1 << 1) #define CPPI4_DEBUG_FUNCTION_EXIT (0x1 << 2) #define CPPI4_DEBUG_BUSY_FUNCTION_ENTRY (0x1 << 3) #define CPPI4_DEBUG_BUSY_FUNCTION_EXIT (0x1 << 4) #define CPPI4_DEBUG_TEARDOWN (0x1 << 5) #ifdef CPPI4_PAL_DEBUG #define CPPI4_PAL_LOGERR(format, args...) printf(format, ##args); #define CPPI4_PAL_LOGMSG(flag, format, args... ) { if (flag & Cppi4PALDebug) printf(format, ## args); } #else /* */ #define CPPI4_PAL_LOGERR(format, args...) #define CPPI4_PAL_LOGMSG(flag, format, args... ) #endif /* */ struct Cppi4PALObj_t; /** * \brief CPPI4 PAL Transmit Channel object * * CPPI4 PAL layer Object - encapsulates all bookeeping and data structures for * CPPI4 PAL */ typedef struct PAL_Cppi4TxChObj_t { CSL_Tx_PushQ_RegsOvly txQueue; CSL_Reg32 * txCompQueue; CSL_Reg32 * txCompQueueIntrEOI; Uint32 chNum; Bool endian; Bool chMode; Uint32 descCopyCnt; Uint32 pktType; Uint32 cqIndex; struct Cppi4PALObj_t *palCppi4Obj; Bool isOpen; Bool isEnabled; #ifdef CPPI4_PAL_GETSTATS Uint32 txPopCount; /**< TX Pop Descriptor count */ Uint32 txPushCount[CPPI4_NUM_TX_PRI_LEVELS]; /**< Tx Push Descriptor count */ BOOL txInterruptDisable; #endif /* */ } PAL_Cppi4TxChObj; /** * \brief CPPI4 PAL Receive Channel object * * CPPI4 PAL layer Object - encapsulates all bookeeping and data structures for * CPPI4 PAL */ typedef struct PAL_Cppi4RxChObj_t { CSL_Rx_PopQ_RegsOvly rxQueue; CSL_Rx_FreeQ_RegsOvly rxFreeQueue; CSL_Reg32 * rxQueueIntrEOI; Uint32 chNum; Bool endian; Bool chMode; Uint32 fbqIndex[4]; Uint32 sopOffset; Uint32 fdbIndex; Uint32 errHandling; Uint32 rqIndex; struct Cppi4PALObj_t *palCppi4Obj; Bool isOpen; Bool isEnabled; #ifdef CPPI4_PAL_GETSTATS Uint32 rxPopCount[CPPI4_NUM_RX_PRI_LEVELS]; /**< TX Pop Descriptor count */ Uint32 rxPushCount; /**< Tx Push Descriptor count */ #endif /* */ } PAL_Cppi4RxChObj; typedef struct Teardown_DescSize_t { Int32 nextPktPtr; /**< next (hardware) packet pointer */ Uint16 channelNo; /**< Channel no to which bd belongs */ Uint16 channelType; /**< Channel type 0=Tx 1=Rx */ }Teardown_DescSize_t; /** * \brief CPPI4 PAL object * * CPPI4 PAL layer Object - encapsulates all bookeeping and data structures for * CPPI4 PAL */ typedef struct Cppi4PALObj_t { Uint32 versionId; /**< Version Id */ Uint32 resetLine; /**< HW Reset Line */ PAL_Cppi4RxChObj rxCh[CPPI4_MAX_CHANNELS]; /**< RX channel status bool */ PAL_Cppi4TxChObj txCh[CPPI4_MAX_CHANNELS]; /**< RX channel status bool */ /* GSG - register additions for CPPI4 - these will probably move to their own module later */ CSL_QueueMgr_RegsOvly qmRegs; /**< Base address for Queue Mgr regs */ CSL_Cppi4Dma_RegsOvly dmaRegs; /**< Base address for DMA regs */ Teardown_DescSize_t * tdDescArray; /**< Teardown descriptor array, includes TX + RX. */ } Cppi4PALObj; /*@}*/ #endif /* __PAL_CPPI4_PVT_H__ */