PDK API Guide for AM65xx
sciclient.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2020, 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 
151 /* @} */
152 
211 #ifndef SCICLIENT_H_
212 #define SCICLIENT_H_
213 
214 /* ========================================================================== */
215 /* Include Files */
216 /* ========================================================================== */
217 
218 #include <stdint.h>
219 #include <stddef.h>
220 
221 /* Windows Visual Studio build doesn't __attribute__ indentifier, so forcing it be to dummy for getting build working */
222 #ifdef _MSC_VER
223  #ifndef __attribute__
224  #define __attribute__()
225  #endif
226 #endif
227 
228 /* TISCI Include */
229 #define TISCI_BIT(n) (1UL << (n))
230 
235 typedef uint8_t domgrp_t;
236 
237 #ifndef SYSFW_DEVGRPS_H
238 
242 typedef uint8_t devgrp_t;
243 
244 /* External definitions */
245 
250 #define DEVGRP_ALL (0x00U)
251 
253 #define DEVGRP_00 ((0x01U) << 0U)
254 
255 #define DEVGRP_01 ((0x01U) << 1U)
256 
257 #define DEVGRP_02 ((0x01U) << 2U)
258 
259 #define DEVGRP_03 ((0x01U) << 3U)
260 
261 #define DEVGRP_04 ((0x01U) << 4U)
262 
263 #define DEVGRP_05 ((0x01U) << 5U)
264 
265 #define DEVGRP_06 ((0x01U) << 6U)
266 
270 #define DEVGRP_DMSC ((0x01U) << 7U)
271 
272 #define DEVGRP_DMSC_ALL (0xFFU)
273 
274 #endif
275 
280 #define MAX_NUM_DEVGRPS (8U)
281 
287 #if defined (SOC_AM65XX)
288 #include <ti/drv/sciclient/soc/sysfw/include/am65x/tisci_resasg_types.h>
289 #include <ti/drv/sciclient/soc/sysfw/include/am65x/tisci_hosts.h>
290 #include <ti/drv/sciclient/soc/sysfw/include/am65x/tisci_sec_proxy.h>
291 #include <ti/drv/sciclient/soc/sysfw/include/am65x/tisci_boardcfg_constraints.h>
292 #include <ti/drv/sciclient/soc/sysfw/include/am65x/tisci_clocks.h>
293 #include <ti/drv/sciclient/soc/sysfw/include/am65x_sr2/tisci_clocks.h>
294 #endif
295 #if defined (SOC_J721E)
296 #include <ti/drv/sciclient/soc/sysfw/include/j721e/tisci_resasg_types.h>
297 #include <ti/drv/sciclient/soc/sysfw/include/j721e/tisci_hosts.h>
298 #include <ti/drv/sciclient/soc/sysfw/include/j721e/tisci_sec_proxy.h>
299 #include <ti/drv/sciclient/soc/sysfw/include/j721e/tisci_boardcfg_constraints.h>
300 #endif
301 #if defined (SOC_J7200)
302 #include <ti/drv/sciclient/soc/sysfw/include/j7200/tisci_resasg_types.h>
303 #include <ti/drv/sciclient/soc/sysfw/include/j7200/tisci_hosts.h>
304 #include <ti/drv/sciclient/soc/sysfw/include/j7200/tisci_sec_proxy.h>
305 #include <ti/drv/sciclient/soc/sysfw/include/j7200/tisci_boardcfg_constraints.h>
306 #endif
307 #if defined (SOC_AM64X)
308 #include <ti/drv/sciclient/soc/sysfw/include/am64x/tisci_resasg_types.h>
309 #include <ti/drv/sciclient/soc/sysfw/include/am64x/tisci_hosts.h>
310 #include <ti/drv/sciclient/soc/sysfw/include/am64x/tisci_sec_proxy.h>
311 #include <ti/drv/sciclient/soc/sysfw/include/am64x/tisci_boardcfg_constraints.h>
312 #endif
313 #if defined (SOC_J721S2)
314 #include <ti/drv/sciclient/soc/sysfw/include/j721s2/tisci_resasg_types.h>
315 #include <ti/drv/sciclient/soc/sysfw/include/j721s2/tisci_hosts.h>
316 #include <ti/drv/sciclient/soc/sysfw/include/j721s2/tisci_sec_proxy.h>
317 #include <ti/drv/sciclient/soc/sysfw/include/j721s2/tisci_boardcfg_constraints.h>
318 
319 /* Translate "DM2TIFS" to "DM2DMSC" related macros for existing sources */
320 #define TISCI_HOST_ID_DMSC2DM TISCI_HOST_ID_TIFS2DM
321 
322 #define TISCI_SEC_PROXY_DM2DMSC_WRITE_NOTIFY_RESP_THREAD_ID \
323  TISCI_SEC_PROXY_DM2TIFS_WRITE_NOTIFY_RESP_THREAD_ID
324 #define TISCI_SEC_PROXY_DM2DMSC_READ_RESPONSE_THREAD_ID \
325  TISCI_SEC_PROXY_DM2TIFS_READ_RESPONSE_THREAD_ID
326 #endif
327 
350 #include <ti/drv/sciclient/soc/sciclient_soc_priv.h>
360 
361 #ifdef __cplusplus
362 extern "C" {
363 #endif
364 
365 /* ========================================================================== */
366 /* Macros & Typedefs */
367 /* ========================================================================== */
368 
381 #define SCICLIENT_SERVICE_OPERATION_MODE_POLLED (0U)
382 #define SCICLIENT_SERVICE_OPERATION_MODE_INTERRUPT (1U)
383 /* @} */
384 
394 #define SCICLIENT_SERVICE_WAIT_FOREVER (0xFFFFFFFFU)
395 #define SCICLIENT_SERVICE_NO_WAIT (0x0U)
396 /* @} */
397 
399 #define SCICLIENT_FT_PASS (0xA5A5U)
400 
401 #define SCICLIENT_FT_FAIL (0x5A5AU)
402 
403 
404 /* ========================================================================== */
405 /* Structure Declarations */
406 /* ========================================================================== */
407 
412 typedef struct
413 {
414  uint32_t opModeFlag;
422  uint32_t isSecureMode;
426  uint32_t c66xRatRegion;
436 
440 typedef struct
441 {
442  uint16_t messageType;
444  uint32_t flags;
448  const uint8_t *pReqPayload;
450  uint32_t reqPayloadSize;
452  uint32_t timeout;
455  uint8_t forwardStatus;
460 
464 typedef struct
465 {
466  uint32_t flags;
468  uint8_t *pRespPayload;
474  uint32_t respPayloadSize;
477 
481 typedef struct
482 {
483  const uint32_t *boardCfgLow;
485  const uint32_t *boardCfgLowRm;
487  const uint32_t *boardCfgLowSec;
489  const uint32_t *boardCfgLowPm;
491  uint32_t boardCfgLowSize;
500 
501 /* ========================================================================== */
502 /* Function Declarations */
503 /* ========================================================================== */
504 
516 int32_t Sciclient_loadFirmware(const uint32_t *pSciclient_firmware);
517 
538 int32_t Sciclient_init(const Sciclient_ConfigPrms_t *pCfgPrms);
539 
573 int32_t Sciclient_service(const Sciclient_ReqPrm_t *pReqPrm,
574  Sciclient_RespPrm_t *pRespPrm);
575 
588 int32_t Sciclient_deinit(void);
589 
595 int32_t Sciclient_abiCheck(void);
596 
603 
604 /*
605  * Structure Init functions
606  *
607  * Requirement: DOX_REQ_TAG(PDK-2936)
608  */
616 
625 
634 
654  uint8_t * pCommonHeader, uint8_t * pBoardCfgHeader,
655  const Sciclient_BoardCfgPrms_t * pInPmPrms,
656  const Sciclient_BoardCfgPrms_t * pInRmPrms);
657 
670  uint8_t * pCommonHeader,
671  Sciclient_BoardCfgPrms_t * pInPmPrms,
672  Sciclient_BoardCfgPrms_t * pInRmPrms);
673 
674 /* ========================================================================== */
675 /* Static Function Definitions */
676 /* ========================================================================== */
677 
678 #ifdef __cplusplus
679 }
680 #endif
681 
682 #endif /* #ifndef SCICLIENT_H_ */
683 
684 /* @} */
685 
721 /* @} */
722 
uint32_t boardCfgLowSize
Definition: sciclient.h:491
int32_t Sciclient_init(const Sciclient_ConfigPrms_t *pCfgPrms)
This API is called once for registering interrupts and creating semaphore handles to be able to talk ...
int32_t Sciclient_getDefaultBoardCfgInfo(Sciclient_DefaultBoardCfgInfo_t *pBoardCfgInfo)
API to get the default board config info.
This file contains the definition of all the shim layer functions which request DMSC for generic serv...
This file contains the definition of all the message IDs, message formats to be able to interact with...
Input parameters for Sciclient_service function.
Definition: sciclient.h:481
struct tisci_header hdr
Definition: tisci_core.h:438
int32_t Sciclient_boardCfgPrepHeader(uint8_t *pCommonHeader, uint8_t *pBoardCfgHeader, const Sciclient_BoardCfgPrms_t *pInPmPrms, const Sciclient_BoardCfgPrms_t *pInRmPrms)
Prepare the header for the board configuration. This API is typically only used by SBL where it will ...
Output parameters for Sciclient_service function.
Definition: sciclient.h:464
This file contains the definition of all the message IDs, message formats to be able to interact with...
const uint8_t * pReqPayload
Definition: sciclient.h:448
const uint32_t * boardCfgLowSec
Definition: sciclient.h:487
int32_t Sciclient_abiCheck(void)
void Sciclient_TisciMsgSetAckResp(struct tisci_header *hdr)
Send the Response in Ack. Used only with Sciserver or Sciclient Direct.
const uint32_t * boardCfgLowPm
Definition: sciclient.h:489
uint32_t timeout
Definition: sciclient.h:452
SCICLIENT Low Level Driver SOC specific file.
This file contains the definition of all the message IDs, message formats to be able to interact with...
uint8_t domgrp_t
Defines the sysfw DOMGRP type. This is meant to be used in code or data structures that require disti...
Definition: sciclient.h:235
uint8_t devgrp_t
Defines the sysfw DEVGRP type. This is meant to be used in code or data structures that require disti...
Definition: sciclient.h:242
uint32_t opModeFlag
Definition: sciclient.h:414
Sciclient_BoardCfgPrms_t inRmPrms
Definition: sciclient.h:433
uint32_t flags
Definition: sciclient.h:466
int32_t Sciclient_deinit(void)
De-initialization of sciclient. This de-initialization is specific to the application....
This file contains the definition of all the message IDs, message formats to be able to interact with...
uint8_t * pRespPayload
Definition: sciclient.h:468
uint16_t messageType
Definition: sciclient.h:442
uint32_t reqPayloadSize
Definition: sciclient.h:450
void Sciclient_TisciMsgSetNakResp(struct tisci_header *hdr)
Send the Response in NAK. Used only with Sciserver or Sciclient Direct.
Wrapper function to send the board configuration message to DMSC.
uint32_t c66xRatRegion
Definition: sciclient.h:426
uint32_t boardCfgLowRmSize
Definition: sciclient.h:493
uint32_t isSecureMode
Definition: sciclient.h:422
This file contains the definition of all the message IDs, message formats to be able to interact with...
int32_t Sciclient_boardCfgParseHeader(uint8_t *pCommonHeader, Sciclient_BoardCfgPrms_t *pInPmPrms, Sciclient_BoardCfgPrms_t *pInRmPrms)
Parse the header left behind by the SBL in the SCISERVER. This is used in the SCISERVER App to read t...
const uint32_t * boardCfgLow
Definition: sciclient.h:483
uint8_t skipLocalBoardCfgProcess
Definition: sciclient.h:428
uint8_t forwardStatus
Definition: sciclient.h:455
Initialization parameters for sciclient. Pointer to this is passed to Sciclient_init.
Definition: sciclient.h:412
int32_t Sciclient_service(const Sciclient_ReqPrm_t *pReqPrm, Sciclient_RespPrm_t *pRespPrm)
This API allows communicating with the System firmware which can be called to perform various functio...
Sciclient_BoardCfgPrms_t inPmPrms
Definition: sciclient.h:431
Parameters for Sciclient_boardCfg Pointer to this is passed to Sciclient_boardCfg.
Definition: sciclient_boardcfg.h:58
uint32_t boardCfgLowSecSize
Definition: sciclient.h:495
uint32_t respPayloadSize
Definition: sciclient.h:474
This file contains the definition of all the message IDs, message formats to be able to interact with...
const uint32_t * boardCfgLowRm
Definition: sciclient.h:485
uint32_t flags
Definition: sciclient.h:444
uint32_t boardCfgLowPmSize
Definition: sciclient.h:497
Sciclient_BoardCfgPrms_t * pBoardCfgPrms
Definition: sciclient.h:418
int32_t Sciclient_loadFirmware(const uint32_t *pSciclient_firmware)
Loads the DMSC firmware. This is typically called by SBL. Load firmware does not require calling the ...
Input parameters for Sciclient_service function.
Definition: sciclient.h:440
Header that prefixes all TISCI messages.
Definition: tisci_protocol.h:89
int32_t Sciclient_configPrmsInit(Sciclient_ConfigPrms_t *pCfgPrms)
Sciclient_ConfigPrms_t structure init function.