PDK API Guide for J721E
sciserver.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 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 
48 #ifndef SCISERVER_H_
49 #define SCISERVER_H_
50 
51 /* ========================================================================== */
52 /* Include Files */
53 /* ========================================================================== */
54 
55 #include <stdint.h>
56 #include <stddef.h>
57 #include <stdbool.h>
58 #include <ti/csl/csl_types.h>
60 
61 
62 /* ========================================================================== */
63 /* Macros & Typedefs */
64 /* ========================================================================== */
65 
80 #define SCISERVER_CTRL_CMD_HALT (0xA5)
81 
96 #define SCISERVER_CTRL_CMD_RUN (0x5A)
97 
111 #define SCISERVER_PROCESS_STATE_WAIT (0x5A)
112 
126 #define SCISERVER_PROCESS_STATE_RUN (0xA5U)
127 
132 #define SCISERVER_FORWARD_MSG (0x5AU)
133 
138 #define SCISERVER_NO_FORWARD_MSG (0xA5U)
139 
141 #define SCISERVER_INIT_DONE (0x69U)
142 
144 #define SCISERVER_INIT_NOT_DONE (0x96U)
145 
147 #define SCISERVER_HW_QUEUE_SIZE (52U)
148 
150 #define SCISERVER_HWI_NUM (5U)
151 
153 #define SCISERVER_SECPROXY_INSTANCE_COUNT (0x2U)
154 
163 typedef uint32_t Sciserver_SemaphoreIds;
164 #define SCISERVER_SEMAPHORE_USER_HI (uint32_t)0
165 
166 #define SCISERVER_SEMAPHORE_USER_LO (uint32_t)1
167 
168 #define SCISERVER_SEMAPHORE_USER_DM (uint32_t)2
169 
170 #define SCISERVER_SEMAPHORE_MAX_CNT (uint32_t)3
171 
172 /* @} */
173 
182 typedef uint32_t Sciserver_TaskIds;
183 #define SCISERVER_TASK_USER_HI (uint32_t)0
184 
185 #define SCISERVER_TASK_USER_LO (uint32_t)1
186 
187 #define SCISERVER_TASK_MAX_CNT (uint32_t)2
188 
189 /* @} */
190 
191 /* ========================================================================== */
192 /* Structure Declarations */
193 /* ========================================================================== */
194 
196 typedef struct {
197  void *ptr;
200 
211 typedef struct {
212  uint8_t host;
213  int32_t hwi_id;
216 
221 typedef enum
222 {
230 
239 typedef struct {
244 
259 typedef struct {
260  const uint32_t irq_num;
261  uint32_t *const hw_msg_buffer;
262  const uint16_t hw_msg_queue_id;
263  const uint32_t semaphore_id;
266 
300 typedef struct {
301  const int32_t task_id;
302  uint32_t *const *hw_msg_buffer_list;
303  const uint8_t hw_msg_buffer_count;
304  const uint32_t hw_msg_buffer_sz;
305  const uint32_t semaphore_id;
308  const int32_t priority;
309  uint8_t *const stack;
311 
312 /* ========================================================================== */
313 /* Function Declarations */
314 /* ========================================================================== */
315 
319 char * Sciserver_getVersionStr(void);
320 
324 char * Sciserver_getRmPmHalVersionStr(void);
325 
332 int32_t Sciserver_init(Sciserver_CfgPrms_t *pPrms);
333 
338 int32_t Sciserver_deinit(void);
339 
344 void Sciserver_setCtrlState (uint8_t state);
345 
349 uint8_t Sciserver_getCtrlState (void);
350 
355 void Sciserver_setProcessState (uint8_t state);
356 
360 uint8_t Sciserver_getProcessState (void);
361 
369 int32_t Sciserver_interruptHandler(Sciserver_hwiData *uhd, bool* soft_error);
370 
377 
384 
388 void Sciserver_socInit (void);
389 
390 /* ========================================================================== */
391 /* Static Function Definitions */
392 /* ========================================================================== */
393 /* None */
394 
395 #endif /* #ifndef SCISERVER_H_ */
396 
397 /* @} */
uint32_t *const hw_msg_buffer
Definition: sciserver.h:261
const uint16_t hw_msg_queue_id
Definition: sciserver.h:262
void Sciserver_setCtrlState(uint8_t state)
Sciserver Set the Control Command State.
This file contains prototypes for APIs contained as a part of SCICLIENT as well as the structures of ...
uint8_t current_buffer_idx
Definition: sciserver.h:241
int32_t Sciserver_interruptHandler(Sciserver_hwiData *uhd, bool *soft_error)
Sciserver Interrupt Handler.
uint32_t *const * hw_msg_buffer_list
Definition: sciserver.h:302
Sciserver_taskStateState
Definition: sciserver.h:221
void Sciserver_socInit(void)
Sciserver function to implement SoC specific configuration.
uint8_t host
Definition: sciserver.h:212
uint8_t *const stack
Definition: sciserver.h:309
Contains data needed for Sciserver HWI operation.
Definition: sciserver.h:259
int32_t hwi_id
Definition: sciserver.h:213
States for Sciserver_taskState.
char * Sciserver_getVersionStr(void)
Sciserver Get Version String Function.
const uint32_t semaphore_id
Definition: sciserver.h:263
Sciserver Configuration Parameters.
Definition: sciserver.h:196
void Sciserver_setProcessState(uint8_t state)
Sciserver Set the Process State.
uint32_t Sciserver_SemaphoreIds
Semaphore Ids to be used for the user and DM tasks.
Definition: sciserver.h:163
Sciserver_taskState *const state
Definition: sciserver.h:306
Contains data needed for secure task operation.
Definition: sciserver.h:300
Contains data needed for Sciserver task operation.
Definition: sciserver.h:239
const int32_t priority
Definition: sciserver.h:308
char * Sciserver_getRmPmHalVersionStr(void)
Sciserver Get RM_PM_HAL Version String Function.
Definition: sciserver.h:225
int32_t Sciserver_initPrms_Init(Sciserver_CfgPrms_t *pPrms)
Initialize the init params for SCISERVER.
const uint8_t hw_msg_buffer_count
Definition: sciserver.h:303
uint8_t state
Definition: tisci_pm_clock.h:130
const uint32_t hw_msg_buffer_sz
Definition: sciserver.h:304
uint32_t Sciserver_TaskIds
Task Ids to be used for the user and DM tasks.
Definition: sciserver.h:182
Sciserver_msgData *const * user_msg_data
Definition: sciserver.h:307
int32_t Sciserver_deinit(void)
Sciserver De-Initialization Function.
This file contains the Register Desciptions for CSL types.
uint8_t current_forwarded_buffer_idx
Definition: sciserver.h:242
void * ptr
Definition: sciserver.h:197
Sciserver_msgData *const user_msg_data
Definition: sciserver.h:264
const uint32_t irq_num
Definition: sciserver.h:260
int32_t Sciserver_processtask(Sciserver_taskData *utd)
Sciserver Process Task Function.
uint8_t Sciserver_getProcessState(void)
Sciserver Get the Process State.
uint8_t Sciserver_getCtrlState(void)
Sciserver Get the Control Command State.
const uint32_t semaphore_id
Definition: sciserver.h:305
Definition: sciserver.h:227
int32_t Sciserver_init(Sciserver_CfgPrms_t *pPrms)
Sciserver Initialization Function.
Sciserver_taskStateState state
Definition: sciserver.h:240
Contains data about the message needed to idetify the sender and route the message response back to t...
Definition: sciserver.h:211
bool is_pending
Definition: sciserver.h:214
Definition: sciserver.h:223
const int32_t task_id
Definition: sciserver.h:301