946697de46e932953334b6099fac3bbcf2ce9df6
1 /*\r
2 *\r
3 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ \r
4 * \r
5 * \r
6 * Redistribution and use in source and binary forms, with or without \r
7 * modification, are permitted provided that the following conditions \r
8 * are met:\r
9 *\r
10 * Redistributions of source code must retain the above copyright \r
11 * notice, this list of conditions and the following disclaimer.\r
12 *\r
13 * Redistributions in binary form must reproduce the above copyright\r
14 * notice, this list of conditions and the following disclaimer in the \r
15 * documentation and/or other materials provided with the \r
16 * distribution.\r
17 *\r
18 * Neither the name of Texas Instruments Incorporated nor the names of\r
19 * its contributors may be used to endorse or promote products derived\r
20 * from this software without specific prior written permission.\r
21 *\r
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \r
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT \r
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT \r
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, \r
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT \r
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\r
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\r
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE \r
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
33 *\r
34 */\r
35 \r
36 #ifndef _TCP3D_MULTI_INST_H_\r
37 #define _TCP3D_MULTI_INST_H_\r
38 \r
39 /**\r
40 * Test TCP3D Notification Events\r
41 */\r
42 #define TCP3D_A_TEST_EVENT 7\r
43 #define TCP3D_B_TEST_EVENT 23\r
44 \r
45 /**\r
46 * This gives the channel numbers to which the TCP3 decoder REVTs are mapped.\r
47 * ((per spec intc_1.3.4.12.xlsx, TPCC2)\r
48 */\r
49 #define TCP3D_A_REVT0_CH_NUMBER 34\r
50 #define TCP3D_A_REVT1_CH_NUMBER 35\r
51 #define TCP3D_B_REVT0_CH_NUMBER 36\r
52 #define TCP3D_B_REVT1_CH_NUMBER 37\r
53 \r
54 INLINE UInt32 getHostIntrNum(UInt32 dspCoreID)\r
55 {\r
56 /* Host Interrupts for CPINTC0 (per spec intc_1.3.4.12.xls) */\r
57 UInt32 hostIntr[] = {13u, 29u, 45u, 61u};\r
58 \r
59 return hostIntr[dspCoreID];\r
60 }\r
61 \r
62 INLINE UInt32 getNotifyEventNum(UInt8 instNum)\r
63 {\r
64 UInt32 testEvt;\r
65 \r
66 if ( instNum == CSL_TCP3D_0 )\r
67 testEvt = TCP3D_A_TEST_EVENT; // First instance\r
68 else\r
69 testEvt = TCP3D_B_TEST_EVENT; // Second instance\r
70 \r
71 return testEvt;\r
72 }\r
73 \r
74 INLINE CSL_TPCC_ShadowRegs * getEdma3ShadowRegsBase(UInt32 regionNum)\r
75 {\r
76 CSL_TpccRegs *tpcc2Regs = (CSL_TpccRegs *) CSL_EDMACC_2_REGS;\r
77 \r
78 return (CSL_TPCC_ShadowRegs *) &tpcc2Regs->SHADOW[regionNum];\r
79 }\r
80 \r
81 INLINE UInt32 getCpIntc0RegsBase()\r
82 {\r
83 return CSL_CIC_0_REGS;\r
84 }\r
85 \r
86 INLINE UInt32 getRevt0ChannelNum(UInt8 instNum)\r
87 {\r
88 UInt32 chNum;\r
89 \r
90 if ( instNum == CSL_TCP3D_0 )\r
91 chNum = TCP3D_A_REVT0_CH_NUMBER; // First instance\r
92 else\r
93 chNum = TCP3D_B_REVT0_CH_NUMBER; // Second instance\r
94 \r
95 return chNum;\r
96 }\r
97 \r
98 INLINE UInt32 getRevt1ChannelNum(UInt8 instNum)\r
99 {\r
100 UInt32 chNum;\r
101 \r
102 if ( instNum == CSL_TCP3D_0 )\r
103 chNum = TCP3D_A_REVT1_CH_NUMBER; // First instance\r
104 else\r
105 chNum = TCP3D_B_REVT1_CH_NUMBER; // Second instance\r
106 \r
107 return chNum;\r
108 }\r
109 \r
110 INLINE UInt8 getTcp3dInstNum(UInt32 dspCoreID)\r
111 {\r
112 UInt8 instNum;\r
113 \r
114 if ( dspCoreID == 0 )\r
115 instNum = CSL_TCP3D_0; // First instance\r
116 else\r
117 instNum = CSL_TCP3D_1; // Second instance\r
118 \r
119 return instNum;\r
120 }\r
121 \r
122 INLINE UInt32 getTcp3dCfgRegsBase(UInt8 instNum)\r
123 {\r
124 UInt32 regBase;\r
125 \r
126 if ( instNum == CSL_TCP3D_0 )\r
127 regBase = CSL_TCP3D_0_CFG_REGS; // First instance\r
128 else\r
129 regBase = CSL_TCP3D_1_CFG_REGS; // Second instance\r
130 \r
131 return regBase;\r
132 }\r
133 \r
134 INLINE UInt32 getTcp3dDataRegsBase(UInt8 instNum)\r
135 {\r
136 UInt32 regBase;\r
137 \r
138 if ( instNum == CSL_TCP3D_0 )\r
139 regBase = CSL_TCP3D_0_DATA_REGS; // First instance\r
140 else\r
141 regBase = CSL_TCP3D_1_DATA_REGS; // Second instance\r
142 \r
143 return regBase;\r
144 }\r
145 \r
146 #endif /* _TCP3D_MULTI_INST_H_ */\r
147 \r