AM263x MCU+ SDK  09.02.00
dthe.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * 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
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
48 #ifndef DTHE_H_
49 #define DTHE_H_
50 
51 /* ========================================================================== */
52 /* Include Files */
53 /* ========================================================================== */
54 
55 #include <stdint.h>
56 #include <kernel/dpl/SystemP.h>
57 #include <security/crypto/dthe/hw_include/cslr_dthe.h>
58 #include <drivers/hw_include/cslr_soc.h>
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
64 /* ========================================================================== */
65 /* Macros & Typedefs */
66 /* ========================================================================== */
67 
68 
77 typedef enum DTHE_Return_e
78 {
79  DTHE_RETURN_SUCCESS = 0xCE50311AU,
80  DTHE_RETURN_FAILURE = 0x924FC5E7U,
82 
84 typedef void *DTHE_Handle;
85 
87 typedef struct
88 {
89  /*
90  * SOC configuration
91  */
92  uint32_t caBaseAddr;
94  uint32_t aesBaseAddr;
96  uint32_t shaBaseAddr;
98  uint32_t isOpen;
100  uint32_t faultStatus;
102 } DTHE_Attrs;
103 
105 typedef struct
106 {
109 } DTHE_Config;
110 
111 /* ========================================================================== */
112 /* Global Variables */
113 /* ========================================================================== */
114 
116 extern DTHE_Config gDtheConfig[];
118 extern uint32_t gDtheConfigNum;
119 
120 /* ========================================================================== */
121 /* Function Definitions */
122 /* ========================================================================== */
126 void DTHE_init(void);
127 
131 void DTHE_deinit(void);
132 
140 DTHE_Handle DTHE_open(uint32_t index);
141 
151 
152 #ifdef __cplusplus
153 }
154 #endif
155 
156 #endif /* DTHE_H_ */
157 
DTHE_close
DTHE_Return_t DTHE_close(DTHE_Handle handle)
Function to close a DTHE module specified by the DTHE handle.
DTHE_Config
DTHE driver context.
Definition: dthe.h:106
DTHE_RETURN_SUCCESS
@ DTHE_RETURN_SUCCESS
Definition: dthe.h:79
gDtheConfigNum
uint32_t gDtheConfigNum
Externally defined driver configuration Num.
SystemP.h
gDtheConfig
DTHE_Config gDtheConfig[]
Externally defined driver configuration array.
DTHE_Return_t
DTHE_Return_t
DTHE Driver Error code.
Definition: dthe.h:78
DTHE_Config::attrs
DTHE_Attrs * attrs
Definition: dthe.h:107
DTHE_Attrs::shaBaseAddr
uint32_t shaBaseAddr
Definition: dthe.h:96
DTHE_RETURN_FAILURE
@ DTHE_RETURN_FAILURE
Definition: dthe.h:80
DTHE_open
DTHE_Handle DTHE_open(uint32_t index)
Function to open DTHE instance, enable DTHE engine.
DTHE_Attrs::aesBaseAddr
uint32_t aesBaseAddr
Definition: dthe.h:94
DTHE_Attrs::caBaseAddr
uint32_t caBaseAddr
Definition: dthe.h:92
DTHE_Attrs
DTHE attributes.
Definition: dthe.h:88
DTHE_Handle
void * DTHE_Handle
Handle to the DTHE driver.
Definition: dthe.h:84
DTHE_init
void DTHE_init(void)
This function initializes the DTHE.
DTHE_Attrs::faultStatus
uint32_t faultStatus
Definition: dthe.h:100
DTHE_Attrs::isOpen
uint32_t isOpen
Definition: dthe.h:98
DTHE_deinit
void DTHE_deinit(void)
This function de-initializes the DTHE.