AM65x MCU+ SDK  09.01.00
sciclient.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2023, 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 
212 #ifndef SCICLIENT_H_
213 #define SCICLIENT_H_
214 
215 /* ========================================================================== */
216 /* Include Files */
217 /* ========================================================================== */
218 
219 #include <stdint.h>
220 #include <stddef.h>
221 #include <kernel/dpl/SystemP.h>
222 
223 /* Windows Visual Studio build doesn't __attribute__ indentifier, so forcing it be to dummy for getting build working */
224 #ifdef _MSC_VER
225  #ifndef __attribute__
226  #define __attribute__()
227  #endif
228 #endif
229 
230 /* TISCI Include */
231 #define TISCI_BIT(n) (1UL << (n))
232 
237 typedef uint8_t devgrp_t;
238 
243 typedef uint8_t domgrp_t;
244 
245 /* External definitions */
246 
251 #define DEVGRP_ALL (0x00U)
252 
254 #define DEVGRP_00 ((0x01U) << 0U)
255 
256 #define DEVGRP_01 ((0x01U) << 1U)
257 
258 #define DEVGRP_02 ((0x01U) << 2U)
259 
260 #define DEVGRP_03 ((0x01U) << 3U)
261 
262 #define DEVGRP_04 ((0x01U) << 4U)
263 
264 #define DEVGRP_05 ((0x01U) << 5U)
265 
266 #define DEVGRP_06 ((0x01U) << 6U)
267 
271 #define DEVGRP_DMSC ((0x01U) << 7U)
272 
273 #define DEVGRP_DMSC_ALL (0xFFU)
274 
279 #define MAX_NUM_DEVGRPS (8U)
280 
281 #include <drivers/hw_include/cslr_soc.h>
287 #if defined (SOC_AM65X)
292 #endif
293 #if defined (SOC_AM64X) || defined (SOC_AM243X)
294 #include <drivers/sciclient/include/tisci/am64x_am243x/tisci_resasg_types.h>
295 #include <drivers/sciclient/include/tisci/am64x_am243x/tisci_hosts.h>
296 #include <drivers/sciclient/include/tisci/am64x_am243x/tisci_sec_proxy.h>
297 #include <drivers/sciclient/include/tisci/am64x_am243x/tisci_boardcfg_constraints.h>
298 #include <drivers/sciclient/include/tisci/am64x_am243x/tisci_devices.h>
299 #include <drivers/sciclient/include/tisci/am64x_am243x/tisci_clocks.h>
300 #include <drivers/sciclient/include/tisci/am64x_am243x/tisci_hosts.h>
301 #include <drivers/sciclient/include/am64x_am243x/sciclient_fmwMsgParams.h>
302 #endif
303 #if defined (SOC_AM62X)
304 #include <drivers/sciclient/include/tisci/am62x/tisci_resasg_types.h>
305 #include <drivers/sciclient/include/tisci/am62x/tisci_hosts.h>
306 #include <drivers/sciclient/include/tisci/am62x/tisci_sec_proxy.h>
307 #include <drivers/sciclient/include/tisci/am62x/tisci_boardcfg_constraints.h>
308 #include <drivers/sciclient/include/tisci/am62x/tisci_devices.h>
309 #include <drivers/sciclient/include/tisci/am62x/tisci_clocks.h>
310 #include <drivers/sciclient/include/tisci/am62x/tisci_hosts.h>
311 #include <drivers/sciclient/include/am62x/sciclient_fmwMsgParams.h>
312 #endif
336 
337 #ifdef __cplusplus
338 extern "C" {
339 #endif
340 
341 /* ========================================================================== */
342 /* Macros & Typedefs */
343 /* ========================================================================== */
344 
345 /* ========================================================================== */
346 /* Structure Declarations */
347 /* ========================================================================== */
348 
352 typedef struct
353 {
354  uint16_t messageType;
356  uint32_t flags;
360  const uint8_t *pReqPayload;
362  uint32_t reqPayloadSize;
364  uint32_t timeout;
368 
372 typedef struct
373 {
374  uint32_t flags;
376  uint8_t *pRespPayload;
382  uint32_t respPayloadSize;
385 
386 /* ========================================================================== */
387 /* Function Declarations */
388 /* ========================================================================== */
389 
399 int32_t Sciclient_loadFirmware(const uint32_t *pSciclient_firmware);
400 
408 
424 int32_t Sciclient_init(uint32_t coreId);
425 
455 int32_t Sciclient_service(const Sciclient_ReqPrm_t *pReqPrm,
456  Sciclient_RespPrm_t *pRespPrm);
457 
468 int32_t Sciclient_deinit(void);
469 
475 int32_t Sciclient_abiCheck(void);
476 
483 
491 int32_t Sciclient_getVersionCheck(uint32_t doLog);
492 
499 
500 /* ========================================================================== */
501 /* Static Function Definitions */
502 /* ========================================================================== */
503 
504 
505 #ifdef __cplusplus
506 }
507 #endif
508 
509 #endif /* #ifndef SCICLIENT_H_ */
510 
tisci_rm_ra.h
tisci_rm_udmap.h
Sciclient_loadFirmware
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 ...
tisci_pm_clock.h
Sciclient_abiCheck
int32_t Sciclient_abiCheck(void)
API to verify that firmware ABI matches the supported ABI.
tisci_keystore.h
SystemP.h
sciclient_dkek.h
This file contains the definition of all the message IDs, message formats to be able to interact with...
sciclient_fmwMsgParams.h
This file contains the definition of all the parameter IDs for PM, RM, Security.
Sciclient_RespPrm_t
Output parameters for Sciclient_service function.
Definition: sciclient.h:373
tisci_sec_handover.h
tisci_pm_core.h
Sciclient_RespPrm_t::flags
uint32_t flags
Definition: sciclient.h:374
tisci_boardcfg_rm.h
Sciclient_getVersionCheck
int32_t Sciclient_getVersionCheck(uint32_t doLog)
API to send a get version command to SYSFW and optionally log the results to console.
Sciclient_ReqPrm_t::timeout
uint32_t timeout
Definition: sciclient.h:364
domgrp_t
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:243
tisci_rm_shared.h
tisci_rm_proxy.h
Sciclient_triggerSecHandover
int32_t Sciclient_triggerSecHandover(void)
API to trigger security handover.
tisci_boardcfg.h
Sciclient_deinit
int32_t Sciclient_deinit(void)
De-initialization of sciclient. This de-initialization is specific to the application....
Sciclient_RespPrm_t::respPayloadSize
uint32_t respPayloadSize
Definition: sciclient.h:382
devgrp_t
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:237
tisci_sec_proxy.h
tisci_protocol.h
tisci_sec_macros.h
tisci_boardcfg_macros.h
tisci_rm_irq.h
sciclient_boardcfg.h
Wrapper function to send the board configuration message to DMSC.
tisci_dkek.h
tisci_procboot.h
tisci_keywriter.h
tisci_pm_device.h
Sciclient_init
int32_t Sciclient_init(uint32_t coreId)
This API is called once for registering interrupts and creating semaphore handles to be able to talk ...
sciclient_firewall.h
This file contains the definition of all the message IDs, message formats to be able to interact with...
Sciclient_waitForBootNotification
int32_t Sciclient_waitForBootNotification(void)
Waits for boot notification from SYSFW.
Sciclient_service
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_pm.h
This file contains the definition of all the message IDs, message formats to be able to interact with...
Sciclient_ReqPrm_t::flags
uint32_t flags
Definition: sciclient.h:356
tisci_rm_psil.h
Sciclient_ReqPrm_t::reqPayloadSize
uint32_t reqPayloadSize
Definition: sciclient.h:362
Sciclient_getSelfDevIdCore
uint32_t Sciclient_getSelfDevIdCore(void)
Sciclient_ReqPrm_t::messageType
uint16_t messageType
Definition: sciclient.h:354
Sciclient_ReqPrm_t
Input parameters for Sciclient_service function.
Definition: sciclient.h:353
Sciclient_RespPrm_t::pRespPayload
uint8_t * pRespPayload
Definition: sciclient.h:376
sciclient_procboot.h
This file contains the definition of all the message IDs, message formats to be able to interact with...
tisci_hosts.h
tisci_resasg_types.h
tisci_core.h
Sciclient_ReqPrm_t::pReqPayload
const uint8_t * pReqPayload
Definition: sciclient.h:360
tisci_firewall.h
tisci_rm_core.h
sciclient_rm.h
This file contains the definition of all the message IDs, message formats to be able to interact with...