AM62x MCU+ SDK  08.03.00
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 
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_AM64X) || defined (SOC_AM243X)
296 #endif
297 #if defined (SOC_AM62X)
298 #include <drivers/sciclient/include/tisci/am62x/tisci_resasg_types.h>
299 #include <drivers/sciclient/include/tisci/am62x/tisci_hosts.h>
300 #include <drivers/sciclient/include/tisci/am62x/tisci_sec_proxy.h>
301 #include <drivers/sciclient/include/tisci/am62x/tisci_boardcfg_constraints.h>
302 #include <drivers/sciclient/include/tisci/am62x/tisci_devices.h>
303 #include <drivers/sciclient/include/tisci/am62x/tisci_clocks.h>
304 #include <drivers/sciclient/include/tisci/am62x/tisci_hosts.h>
305 #include <drivers/sciclient/include/am62x/sciclient_fmwMsgParams.h>
306 #endif
330 
331 #ifdef __cplusplus
332 extern "C" {
333 #endif
334 
335 /* ========================================================================== */
336 /* Macros & Typedefs */
337 /* ========================================================================== */
338 
339 /* ========================================================================== */
340 /* Structure Declarations */
341 /* ========================================================================== */
342 
346 typedef struct
347 {
348  uint16_t messageType;
350  uint32_t flags;
354  const uint8_t *pReqPayload;
356  uint32_t reqPayloadSize;
358  uint32_t timeout;
362 
366 typedef struct
367 {
368  uint32_t flags;
370  uint8_t *pRespPayload;
376  uint32_t respPayloadSize;
379 
380 /* ========================================================================== */
381 /* Function Declarations */
382 /* ========================================================================== */
383 
393 int32_t Sciclient_loadFirmware(const uint32_t *pSciclient_firmware);
394 
402 
418 int32_t Sciclient_init(uint32_t coreId);
419 
449 int32_t Sciclient_service(const Sciclient_ReqPrm_t *pReqPrm,
450  Sciclient_RespPrm_t *pRespPrm);
451 
462 int32_t Sciclient_deinit(void);
463 
469 int32_t Sciclient_abiCheck(void);
470 
477 
485 int32_t Sciclient_getVersionCheck(uint32_t doLog);
486 
493 
494 /* ========================================================================== */
495 /* Static Function Definitions */
496 /* ========================================================================== */
497 
498 
499 #ifdef __cplusplus
500 }
501 #endif
502 
503 #endif /* #ifndef SCICLIENT_H_ */
504 
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:367
tisci_sec_handover.h
tisci_pm_core.h
Sciclient_RespPrm_t::flags
uint32_t flags
Definition: sciclient.h:368
tisci_clocks.h
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:358
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:376
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_boardcfg_constraints.h
tisci_devices.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:350
tisci_rm_psil.h
Sciclient_ReqPrm_t::reqPayloadSize
uint32_t reqPayloadSize
Definition: sciclient.h:356
Sciclient_getSelfDevIdCore
uint32_t Sciclient_getSelfDevIdCore(void)
Sciclient_ReqPrm_t::messageType
uint16_t messageType
Definition: sciclient.h:348
Sciclient_ReqPrm_t
Input parameters for Sciclient_service function.
Definition: sciclient.h:347
Sciclient_RespPrm_t::pRespPayload
uint8_t * pRespPayload
Definition: sciclient.h:370
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:354
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...