2 /*
3 Copyright (c) 2016, Texas Instruments Incorporated - http://www.ti.com/
4 All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the
16 * distribution.
17 *
18 * Neither the name of Texas Instruments Incorporated nor the names of
19 * its contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 */
36 //
37 //
38 // ACP Algorithm interface implementation augmentation for custom components
39 //
40 //
41 //
43 #include <xdc/std.h> //<std.h>
44 #include <ti/xdais/ialg.h> //<ialg.h>
45 #include <string.h>
47 #include <acptype.h>
48 #include <iacp.h>
49 #include <paftyp.h>
50 #include <pafstd_a.h>
52 #ifdef THX
53 extern Void ACP_main_thx ();
54 #endif /* THX */
56 Void ACP_main_cus ()
57 {
58 #if 0 // FL: initially don't patch STD shortcuts
59 // Patch for STD alpha codes. (Here only to reduce code size).
60 {
61 extern const ACP_Unit default_s[];
62 extern const ACP_Unit lm_unknown_s[];
63 extern const ACP_Unit lm_standard_s[];
64 extern const ACP_Unit lm_pure_s[];
66 extern struct
67 {
68 Int size;
69 const ACP_Unit *pSequence[64];
70 } IACP_STD_SIGMA_TABLE;
72 const ACP_Unit **shortcut = IACP_STD_SIGMA_TABLE.pSequence;
74 // Standard default alpha code
75 shortcut[0x01] = (Ptr) default_s;
76 shortcut[0x10] = (Ptr) lm_unknown_s;
77 shortcut[execSTDListeningModeStandard & 0xff] = (Ptr) lm_standard_s;
78 shortcut[execSTDListeningModePure & 0xff] = (Ptr) lm_pure_s;
79 }
80 #endif
82 // Patch for the CUStom alpha codes.
83 {
84 extern struct
85 {
86 Int size;
87 const ACP_Unit *pSequence[64];
88 } IACP_CUS_SIGMA_TABLE;
90 //extern const ACP_Unit cus_default_s[];
91 extern const ACP_Unit cus_atboot_s_patch[];
93 extern const ACP_Unit cus_sigma32_s[];
94 #ifndef SIMULATE_SIO
95 extern const ACP_Unit cus_sigma33_s[];
96 extern const ACP_Unit cus_sigma34_s[];
97 extern const ACP_Unit cus_sigma35_s[];
98 extern const ACP_Unit cus_sigma36_s[];
99 #else // SIMULATE_SIO
100 //extern const ACP_Unit cus_sigma33_s[];
101 extern const ACP_Unit cus_sigma34_s[];
102 //extern const ACP_Unit cus_sigma35_s[];
103 //extern const ACP_Unit cus_sigma36_s[];
104 #endif // SIMULATE_SIO
105 //extern const ACP_Unit cus_sigma37_s[];
106 //extern const ACP_Unit cus_sigma38_s[];
107 //extern const ACP_Unit cus_sigma39_s[];
108 //extern const ACP_Unit cus_sigma40_s[];
109 //extern const ACP_Unit cus_sigma41_s[];
110 //extern const ACP_Unit cus_sigma42_s[];
111 //extern const ACP_Unit cus_sigma43_s[];
112 //extern const ACP_Unit cus_sigma44_s[];
113 //extern const ACP_Unit cus_sigma45_s[];
114 //extern const ACP_Unit cus_sigma46_s[];
115 //extern const ACP_Unit cus_sigma47_s[];
117 extern const ACP_Unit cus_sigma48_s[];
118 extern const ACP_Unit cus_sigma49_s[];
119 #ifndef SIMULATE_SIO
120 extern const ACP_Unit cus_sigma50_s[];
121 #else // SIMULATE_SIO
122 //extern const ACP_Unit cus_sigma50_s[];
123 #endif // SIMULATE_SIO
124 //extern const ACP_Unit cus_sigma51_s[];
125 //extern const ACP_Unit cus_sigma52_s[];
126 //extern const ACP_Unit cus_sigma53_s[];
127 //extern const ACP_Unit cus_sigma54_s[];
128 //extern const ACP_Unit cus_sigma55_s[];
129 //extern const ACP_Unit cus_sigma56_s[];
130 //extern const ACP_Unit cus_sigma57_s[];
131 //extern const ACP_Unit cus_sigma58_s[];
132 //extern const ACP_Unit cus_sigma59_s[];
133 //extern const ACP_Unit cus_sigma60_s[];
134 //extern const ACP_Unit cus_sigma61_s[];
135 //extern const ACP_Unit cus_sigma62_s[];
136 //extern const ACP_Unit cus_sigma63_s[];
138 const ACP_Unit **shortcut = IACP_CUS_SIGMA_TABLE.pSequence;
140 // CUStom at-boot alpha code
141 //shortcut[1] = cus_default_s;
142 shortcut[2] = cus_atboot_s_patch;
144 // CUStom Input switching alpha codes
145 shortcut[32] = cus_sigma32_s;
146 #ifndef SIMULATE_SIO
147 shortcut[33] = cus_sigma33_s;
148 shortcut[34] = cus_sigma34_s;
149 shortcut[35] = cus_sigma35_s;
150 shortcut[36] = cus_sigma36_s;
151 #else // SIMULATE_SIO
152 //shortcut[33] = cus_sigma33_s;
153 shortcut[34] = cus_sigma34_s;
154 //shortcut[35] = cus_sigma35_s;
155 //shortcut[36] = cus_sigma36_s;
156 #endif // SIMULATE_SIO
157 //shortcut[37] = cus_sigma37_s;
158 //shortcut[38] = cus_sigma38_s;
159 //shortcut[39] = cus_sigma39_s;
160 //shortcut[40] = cus_sigma40_s;
161 //shortcut[41] = cus_sigma41_s;
162 //shortcut[42] = cus_sigma42_s;
163 //shortcut[43] = cus_sigma43_s;
164 //shortcut[44] = cus_sigma44_s;
165 //shortcut[45] = cus_sigma45_s;
166 //shortcut[46] = cus_sigma46_s;
167 //shortcut[47] = cus_sigma47_s;
169 // CUStom Output switching alpha codes
170 #ifndef SIMULATE_SIO
171 shortcut[48] = cus_sigma48_s;
172 shortcut[49] = cus_sigma49_s;
173 shortcut[50] = cus_sigma50_s;
174 #else // SIMULATE_SIO
175 shortcut[48] = cus_sigma48_s;
176 shortcut[49] = cus_sigma49_s;
177 //shortcut[50] = cus_sigma50_s;
178 #endif // SIMULATE_SIO
179 //shortcut[51] = cus_sigma51_s;
180 //shortcut[52] = cus_sigma52_s;
181 //shortcut[53] = cus_sigma53_s;
182 //shortcut[54] = cus_sigma54_s;
183 //shortcut[55] = cus_sigma55_s;
184 //shortcut[56] = cus_sigma56_s;
185 //shortcut[57] = cus_sigma57_s;
186 //shortcut[58] = cus_sigma58_s;
187 //shortcut[59] = cus_sigma59_s;
188 //shortcut[60] = cus_sigma60_s;
189 //shortcut[61] = cus_sigma61_s;
190 //shortcut[62] = cus_sigma62_s;
191 //shortcut[63] = cus_sigma63_s;
192 }
194 // Enable this when custom phi is to be added
195 // (example code below installs custom phi function 0;
196 // up to 8 functions may be installed).
198 #if 0
199 // Patch for the CUStom phi functions.
200 {
201 extern struct
202 {
203 Int size;
204 IACP_PhiFunction *pFunction[8];
205 } IACP_CUS_PHI_TABLE;
207 IACP_PhiFunction **pFunc = IACP_CUS_PHI_TABLE.pFunction;
209 extern IACP_PhiFunction cust_phifun0;
211 pFunc[0] = cust_phifun0;
212 }
213 #endif
215 #ifdef THX
216 ACP_main_thx ();
217 #endif /* THX */
218 }