1 /****************************************************************************\
2 * (C) Copyright 2009, Texas Instruments, Inc. *
3 * *
4 * Redistribution and use in source and binary forms, with or without *
5 * modification, are permitted provided that the following conditions *
6 * are met: *
7 * *
8 * Redistributions of source code must retain the above copyright *
9 * notice, this list of conditions and the following disclaimer. *
10 * *
11 * Redistributions in binary form must reproduce the above copyright *
12 * notice, this list of conditions and the following disclaimer in the *
13 * documentation and/or other materials provided with the *
14 * distribution. *
15 * *
16 * Neither the name of Texas Instruments Incorporated nor the names of *
17 * its contributors may be used to endorse or promote products derived *
18 * from this software without specific prior written permission. *
19 * *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR *
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT *
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, *
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT *
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, *
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY *
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE *
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
31 ****************************************************************************
32 * *
33 * Target processors : TMS320C66xx *
34 * *
35 \****************************************************************************/
37 /**
38 * @file AIF_cfg.h
39 *
40 * @brief Header file for AIF configuration initialization
41 *
42 */
45 /** @addtogroup AIF_FUNCTION AIF Functions
46 * @{
47 */
49 #ifndef __AIF_CFG_H
50 #define __AIF_CFG_H
52 #include <ti/drv/aif2/aif2fl.h>
53 #include <ti/drv/aif2/AIF_defs.h>
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
59 #ifdef K2
60 #define AIF_CFG_MAX_CORE 8
61 #else
62 #define AIF_CFG_MAX_CORE 4
63 #endif
65 typedef struct AIF_CoreCfgObj {
66 //Aif mode
67 AIF_Mode mode;
68 //AIF link enable or disable, 1 or 0
69 uint32_t linkEnable[AIF_MAX_NUM_LINKS];
70 //AIF link rate (1=1x; 2=2x; 4= 4x).
71 uint32_t linkRate[AIF_MAX_NUM_LINKS];
72 //LTE number of AxCs per core.
73 uint32_t numAxC[AIF_MAX_NUM_LINKS];
74 //First AxC per core
75 uint32_t firstAxCIndex[AIF_MAX_NUM_LINKS];
76 //AIF link data type for outbound burst traffic.
77 Aif2Fl_LinkDataType outboundDataType[AIF_MAX_NUM_LINKS];
78 //AIF link data width for outbound burst traffic.
79 Aif2Fl_DataWidth outboundDataWidth[AIF_MAX_NUM_LINKS];
80 //AIF link data type for inbound burst traffic.
81 Aif2Fl_LinkDataType inboundDataType[AIF_MAX_NUM_LINKS];
82 //AIF link data width for inbound burst traffic.
83 Aif2Fl_DataWidth inboundDataWidth[AIF_MAX_NUM_LINKS];
84 //AIF link DIO engine used
85 Aif2Fl_DioEngineIndex dioEngine[AIF_MAX_NUM_LINKS];
86 //link mode, need to select LTE or WCDMA
87 AIF2_LinkMode linkMode[AIF_MAX_NUM_LINKS];
88 //Enable control words
89 uint32_t CWEnable;
90 // PE AxC offset value
91 uint32_t peAxCOffset;
92 // PD AxC offset value
93 uint32_t pdAxCOffset;
94 // Egress Buffer Depth
95 Aif2Fl_DbFifoDepth egressBufDepth;
96 // Ingress Buffer Depth
97 Aif2Fl_DbFifoDepth ingressBufDepth;
98 } AIF_CoreCfgObj, *AIF_CoreCfgHandle;
100 typedef struct AIF_CfgObj {
101 // Test name
102 const unsigned char name[32];
103 //Protocol(CPRI or OBSAI)
104 Aif2Fl_LinkProtocol protocol;
105 //Aif mode
106 AIF_Mode mode;
107 //pktdma or dio
108 Aif2Fl_CppiDio pktdmaOrDioEngine;
109 //
110 AIF_CoreCfgObj coreCfg[AIF_CFG_MAX_CORE];
111 }AIF_CfgObj, *AIF_CfgHandle;
114 #ifndef __AIF_CFG_C
115 extern
116 #endif
118 AIF_CoreCfgObj*
119 AIF_getCfg(
120 AIF_CfgHandle ptrInitCfg,
121 uint32_t maxCfgBlock,
122 uint32_t core
123 );
125 #ifdef __cplusplus
126 }
127 #endif
130 #ifndef __AIF_CFG_C
131 extern
132 #endif
133 //AIF_ConfigHandle
134 void
135 AIF_populateAifObj(
136 AIF_ConfigHandle hAifObj,
137 AIF_CfgHandle hAifCfgObj,
138 uint32_t clockspeed,
139 uint32_t swSync,
140 uint32_t intLoopback,
141 uint32_t lte_rate
142 );
144 #ifndef __AIF_CFG_C
145 extern
146 #endif
147 void
148 AIF_startCfg(
149 );
152 #endif //__AIF_INIT_H
154 /** @} */ // end of module additions