1 /*
2 * Copyright (c) 2018, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the 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 "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32 /**
33 * \file sciclient_dummy.c
34 *
35 * \brief File containing the SCICLIENT driver APIs for platforms not yet
36 * dmsc firmware is supported.
37 *
38 */
40 /* ========================================================================== */
41 /* Include Files */
42 /* ========================================================================== */
44 #include <ti/drv/sciclient/src/sciclient/sciclient_priv.h>
45 #include <ti/csl/soc.h>
47 /* ========================================================================== */
48 /* Macros & Typedefs */
49 /* ========================================================================== */
51 /* None */
53 /* ========================================================================== */
54 /* Structure Declarations */
55 /* ========================================================================== */
57 /* None */
59 /* ========================================================================== */
60 /* Function Declarations */
61 /* ========================================================================== */
63 extern void Sciclient_rmInit(void);
65 /* ========================================================================== */
66 /* Global Variables */
67 /* ========================================================================== */
69 /* None */
71 /* ========================================================================== */
72 /* Function Definitions */
73 /* ========================================================================== */
75 int32_t Sciclient_loadFirmware(const uint32_t *pSciclient_firmware)
76 {
77 int32_t status = CSL_PASS;
79 return status;
80 }
82 int32_t Sciclient_init(const Sciclient_ConfigPrms_t *pCfgPrms)
83 {
84 int32_t status = CSL_PASS;
86 Sciclient_rmInit();
88 return status;
89 }
91 int32_t Sciclient_service(const Sciclient_ReqPrm_t *pReqPrm,
92 Sciclient_RespPrm_t *pRespPrm)
93 {
94 int32_t status = CSL_PASS;
96 return status;
97 }
99 int32_t Sciclient_deinit(void)
100 {
101 int32_t status = CSL_PASS;
103 return status;
104 }
106 int32_t Sciclient_pmSetModuleClkFreq(uint32_t moduleId,
107 uint32_t clockId,
108 uint64_t freqHz,
109 uint32_t additionalFlag,
110 uint32_t timeout)
111 {
112 int32_t retVal = CSL_PASS;
113 return retVal;
114 }
116 int32_t Sciclient_pmSetModuleState(uint32_t moduleId,
117 uint32_t state,
118 uint32_t reqFlag,
119 uint32_t timeout)
120 {
121 int32_t retVal = CSL_PASS;
122 return retVal;
123 }
125 int32_t Sciclient_pmGetModuleState(uint32_t moduleId,
126 uint32_t *moduleState,
127 uint32_t *resetState,
128 uint32_t *contextLossState,
129 uint32_t timeout)
130 {
131 int32_t retVal = CSL_PASS;
132 return retVal;
133 }
135 int32_t Sciclient_pmIsModuleValid(uint32_t modId)
136 {
137 int32_t retVal = CSL_PASS;
138 return retVal;
139 }
141 int32_t Sciclient_pmSetModuleRst(uint32_t moduleId,
142 uint32_t resetBit,
143 uint32_t timeout)
144 {
145 int32_t retVal = CSL_PASS;
146 return retVal;
147 }
149 int32_t Sciclient_procBootGetProcessorState(
150 uint8_t processorId,
151 struct tisci_msg_proc_get_status_resp * procStatus,
152 uint32_t timeout)
153 {
154 int32_t retVal = CSL_PASS;
155 return retVal;
156 }
158 int32_t Sciclient_procBootReleaseProcessor(uint8_t processorId,
159 uint32_t reqFlag,
160 uint32_t timeout)
161 {
162 int32_t retVal = CSL_PASS;
163 return retVal;
164 }
166 int32_t Sciclient_procBootRequestProcessor(uint8_t processorId,
167 uint32_t timeout)
168 {
169 int32_t retVal = CSL_PASS;
170 return retVal;
171 }
173 int32_t Sciclient_procBootSetProcessorCfg (
174 const struct tisci_msg_proc_set_config_req * configReq,
175 uint32_t timeout)
176 {
177 int32_t retVal = CSL_PASS;
178 return retVal;
179 }
181 int32_t Sciclient_procBootSetSequenceCtrl(uint8_t processorId,
182 uint32_t control_flags_1_set,
183 uint32_t control_flags_1_clear,
184 uint32_t reqFlag,
185 uint32_t timeout)
186 {
187 int32_t retVal = CSL_PASS;
188 return retVal;
189 }
191 int32_t Sciclient_procBootWaitProcessorState(
192 uint8_t processorId,
193 uint8_t num_match_iterations,
194 uint8_t delay_per_iteration_us,
195 uint32_t status_flags_1_set_all_wait,
196 uint32_t status_flags_1_set_any_wait,
197 uint32_t status_flags_1_clr_all_wait,
198 uint32_t status_flags_1_clr_any_wait,
199 uint32_t reqFlag,
200 uint32_t timeout)
201 {
202 int32_t retVal = CSL_PASS;
203 return retVal;
204 }
206 int32_t Sciclient_procBootAuthAndStart(
207 const struct tisci_msg_proc_auth_boot_req * authBootCfg,
208 uint32_t timeout)
209 {
210 int32_t retVal = CSL_PASS;
211 return retVal;
212 }
214 /* Loki build also uses host emulation dma flow so enable host emulation */
215 #if defined (LOKI_BUILD)
216 #define HOST_EMULATION (1U)
217 #endif
220 /* Below function was not available in host emulation build, hence adding an empty function */
221 #if defined (HOST_EMULATION)
222 int32_t Sciclient_rmSetProxyCfg(const struct tisci_msg_rm_proxy_cfg_req *req, uint32_t timeout)
223 {
224 int32_t r = CSL_PASS;
225 return r;
226 }
228 int32_t Sciclient_rmIrqTranslateIrOutput(uint16_t ir_dev_id,
229 uint16_t ir_output,
230 uint16_t dst_dev_id,
231 uint16_t *dst_input)
232 {
233 int32_t r = CSL_PASS;
234 return r;
235 }
237 int32_t Sciclient_rmIrqTranslateIaOutput(uint16_t ia_dev_id,
238 uint16_t ia_output,
239 uint16_t dst_dev_id,
240 uint16_t *dst_input)
241 {
242 int32_t r = CSL_PASS;
243 return r;
244 }
246 int32_t Sciclient_rmIrqTranslateIrqInput(uint16_t dst_dev_id,
247 uint16_t dst_input,
248 uint16_t src_dev_id,
249 uint16_t *src_output)
250 {
251 int32_t r = CSL_PASS;
252 return r;
253 }
255 int32_t Sciclient_rmGetResourceRange(
256 const struct tisci_msg_rm_get_resource_range_req *req,
257 struct tisci_msg_rm_get_resource_range_resp *resp,
258 uint32_t timeout)
259 {
260 int32_t retVal = CSL_PASS;
262 /* In Host Emulation mode, it is sufficent that we give some range.
263 * So we are passing 0-4 as primary range and 5-9 as secondary range
264 * which will work for most of the cases. */
265 resp->range_start = 0U;
266 resp->range_num = 5U;
267 resp->range_start_sec = 5U;
268 resp->range_num_sec = 5U;
270 #if defined (BUILD_C7X_1)
271 if(TISCI_RESASG_SUBTYPE_UDMAP_TX_ECHAN == req->subtype)
272 {
273 /* Return 16 DRU Channels for c7x-host-emu */
274 resp->range_start = 0U;
275 resp->range_num = 16U;
276 }
277 else if(TISCI_RESASG_SUBTYPE_RA_GP == req->subtype)
278 {
279 /* Return 32 Free Rings for c7x-host-emu */
280 resp->range_start = 662U;
281 resp->range_num = 32U;
282 }
283 #endif
285 return retVal;
286 }
287 #endif
289 #if defined (BUILD_MCU1_0)
290 int32_t Sciclient_boardCfg(Sciclient_BoardCfgPrms_t * pInPrms)
291 {
292 int32_t retVal = CSL_PASS;
294 return retVal;
295 }
297 int32_t Sciclient_boardCfgPm(Sciclient_BoardCfgPrms_t * pInPrms)
298 {
299 int32_t retVal = CSL_PASS;
301 return retVal;
302 }
304 int32_t Sciclient_boardCfgRm(Sciclient_BoardCfgPrms_t * pInPrms)
305 {
306 int32_t retVal = CSL_PASS;
308 return retVal;
309 }
311 int32_t Sciclient_boardCfgSec(Sciclient_BoardCfgPrms_t * pInPrms)
312 {
313 int32_t retVal = CSL_PASS;
315 return retVal;
316 }
318 #endif