AM62x MCU+ SDK  10.01.00
safety_checkers_tifs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 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  */
33 
34 
58 #ifndef SAFETY_CHECKERS_TIFS_H_
59 #define SAFETY_CHECKERS_TIFS_H_
60 
61 /* ========================================================================== */
62 /* Include Files */
63 /* ========================================================================== */
64 
65 /* None */
66 
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70 
78 /* ========================================================================== */
79 /* Macros & Typedefs */
80 /* ========================================================================== */
81 
82 #define SAFETY_CHECKERS_TIFS_FWL_OPEN 0x902CU
83 #define SAFETY_CHECKERS_TIFS_FWL_CLOSE 0x902DU
84 
85 #define SAFETY_CHECKERS_TIFS_FWL_BASE 0x45000000U
86 #define SAFETY_CHECKERS_TIFS_CONTROL_REG 0x0U
87 #define SAFETY_CHECKERS_TIFS_PRIV_ID0 0x4U
88 #define SAFETY_CHECKERS_TIFS_PRIV_ID1 0x8U
89 #define SAFETY_CHECKERS_TIFS_PRIV_ID2 0xCU
90 #define SAFETY_CHECKERS_TIFS_START_ADDRL 0x10U
91 #define SAFETY_CHECKERS_TIFS_START_ADDRH 0x14U
92 #define SAFETY_CHECKERS_TIFS_END_ADDRL 0x18U
93 #define SAFETY_CHECKERS_TIFS_END_ADDRH 0x1CU
94 #define SAFETY_CHECKERS_TIFS_MAX_REGIONS 36U
95 
96 #define SAFETY_CHECKERS_TIFS_ISC_BASE 0x45800000U
97 #define SAFETY_CHECKERS_TIFS_CC_ISC_BASE 0x45828000U
98 #define SAFETY_CHECKERS_TIFS_ISC_CONTROL0_REG 0x0U
99 #define SAFETY_CHECKERS_TIFS_ISC_CONTROL1_REG 0x4U
100 #define SAFETY_CHECKERS_TIFS_ISC_PRIVID_REG 0x0U
101 #define SAFETY_CHECKERS_TIFS_ISC_PRIVID_LOCK_REG 0x4U
102 #define SAFETY_CHECKERS_TIFS_ISC_CBASS_MAX_REGIONS 32U
103 #define SAFETY_CHECKERS_TIFS_ISC_CCPRIV_MAX_REGION 255U
104 #define SAFETY_CHECKERS_TIFS_ISC_RA_MAX_ID 1024U
105 
106 
116 /* ========================================================================== */
117 /* Structure Declarations */
118 /* ========================================================================== */
119 
126 typedef struct
127 {
128  uint32_t controlReg; /* Region Control Register */
129  uint32_t privId0; /* Region Priv-ID 0 slot permission */
130  uint32_t privId1; /* Region Priv-ID 1 slot permission */
131  uint32_t privId2; /* Region Priv-ID 2 slot permission */
132  uint32_t startAddrLow; /* Region Start address Low */
133  uint32_t startAddrHigh; /* Region Start address High */
134  uint32_t endAddrLow; /* Region End address Low */
135  uint32_t endAddrHigh; /* Region End address High */
137 
144 typedef struct
145 {
146  uint32_t fwlId; /* Firewall id */
147  uint32_t numRegions; /* Number of regions stored in the firewall config for an id */
148  uint32_t maxNumRegions; /* Maximum number of regions present in an id */
149  SafetyCheckers_TifsFwlRegList fwlCfgPerRegion[SAFETY_CHECKERS_TIFS_MAX_REGIONS]; /* Firewall registers for a given region */
151 
158 typedef struct
159 {
160  uint32_t controlReg0; /* Region Control Register 0 */
161  uint32_t controlReg1; /* Region Control Register 1 */
162  uint32_t startAddrLow; /* Region Start address Low */
163  uint32_t startAddrHigh; /* Region Start address High */
164  uint32_t endAddrLow; /* Region End address Low */
165  uint32_t endAddrHigh; /* Region End address High */
166  uint32_t rcr; /* Default Region Control Register */
168 
175 typedef struct {
176  uint32_t privId; /* Region contains privid to set */
177  uint32_t lock; /* Region contains lock privid setting */
179 
186 typedef struct {
187  uint32_t controlReg1; /* Control Region 1 */
188  uint32_t controlReg2; /* Control Region 2 */
190 
197 typedef struct
198 {
199  uint32_t iscId; /* ISC id */
200  uint32_t numRegions; /* Number of regions stored in the ISC config for an id */
201  uint32_t maxNumRegions; /* Maximum number of regions present in an id */
202  SafetyCheckers_TifsIscCbassRegList iscCfgPerRegionCbass[SAFETY_CHECKERS_TIFS_ISC_CBASS_MAX_REGIONS]; /* ISC registers for a given region */
204 
211 typedef struct
212 {
213  uint32_t iscIdOffset; /* ISC id offset */
214  uint32_t numRegions; /* Number of regions stored in the ISC config for an id */
215  uint32_t maxNumRegions; /* Maximum number of regions present in an id */
216  SafetyCheckers_TifsIscCcRegList iscCfgPerRegionCc[SAFETY_CHECKERS_TIFS_ISC_CCPRIV_MAX_REGION]; /* ISC registers for a given region */
218 
225 typedef struct
226 {
227  uint32_t iscId; /* ISC id */
228  uint32_t numRegions; /* Number of regions stored in the ISC config for an id */
229  uint32_t maxNumRegions; /* Maximum number of regions present in an id */
230  SafetyCheckers_TifsIscRaRegList iscCfgPerRegionRa[SAFETY_CHECKERS_TIFS_ISC_RA_MAX_ID]; /* ISC registers for a given region */
232 
242 /* ========================================================================== */
243 /* Function Declarations */
244 /* ========================================================================== */
245 
253 
267 
281 
295 
309 
323 
337 
351 
365 
374 
375 #ifdef __cplusplus
376 }
377 #endif
378 
379 #endif /* #ifndef SAFETY_CHECKERS_TIFS_H_ */
380 
SafetyCheckers_TifsIscRaConfig
Structure for RA ISC configuration register info for a given ISC id.
Definition: safety_checkers_tifs.h:226
SAFETY_CHECKERS_TIFS_ISC_CBASS_MAX_REGIONS
#define SAFETY_CHECKERS_TIFS_ISC_CBASS_MAX_REGIONS
Definition: safety_checkers_tifs.h:102
SafetyCheckers_TifsIscRaConfig::maxNumRegions
uint32_t maxNumRegions
Definition: safety_checkers_tifs.h:229
SafetyCheckers_tifsGetFwlCfg
int32_t SafetyCheckers_tifsGetFwlCfg(SafetyCheckers_TifsFwlConfig *fwlConfig, uint32_t size)
API uses the pointer to firewall configuration fwlConfig as input and updates fwlConfig with the regi...
SafetyCheckers_TifsFwlConfig::maxNumRegions
uint32_t maxNumRegions
Definition: safety_checkers_tifs.h:148
SafetyCheckers_TifsFwlConfig::numRegions
uint32_t numRegions
Definition: safety_checkers_tifs.h:147
SafetyCheckers_tifsGetIscCcCfg
int32_t SafetyCheckers_tifsGetIscCcCfg(SafetyCheckers_TifsIscCcConfig *iscConfig, uint32_t size)
API uses the pointer to cc isc configuration iscConfig as input and updates iscConfig with the regist...
size
uint16_t size
Definition: tisci_boardcfg.h:1
SafetyCheckers_tifsVerifyFwlCfg
int32_t SafetyCheckers_tifsVerifyFwlCfg(const SafetyCheckers_TifsFwlConfig *fwlConfig, uint32_t size)
API compares the fwlConfig (golden reference) with runtime firewall register values and return succes...
SafetyCheckers_TifsIscCcRegList::lock
uint32_t lock
Definition: safety_checkers_tifs.h:177
SafetyCheckers_TifsIscCbassRegList::endAddrLow
uint32_t endAddrLow
Definition: safety_checkers_tifs.h:164
SafetyCheckers_TifsFwlRegList::privId2
uint32_t privId2
Definition: safety_checkers_tifs.h:131
SafetyCheckers_tifsGetIscRaCfg
int32_t SafetyCheckers_tifsGetIscRaCfg(SafetyCheckers_TifsIscRaConfig *iscConfig, uint32_t size)
API uses the pointer to ra isc configuration iscConfig as input and updates iscConfig with the regist...
SafetyCheckers_TifsIscCcConfig::maxNumRegions
uint32_t maxNumRegions
Definition: safety_checkers_tifs.h:215
SafetyCheckers_TifsIscCbassConfig::numRegions
uint32_t numRegions
Definition: safety_checkers_tifs.h:200
SafetyCheckers_tifsReqFwlOpen
int32_t SafetyCheckers_tifsReqFwlOpen(void)
API to request TIFS to open firewall.
SafetyCheckers_TifsIscRaConfig::iscId
uint32_t iscId
Definition: safety_checkers_tifs.h:227
SafetyCheckers_TifsFwlRegList::privId0
uint32_t privId0
Definition: safety_checkers_tifs.h:129
SafetyCheckers_TifsIscCcRegList::privId
uint32_t privId
Definition: safety_checkers_tifs.h:176
SAFETY_CHECKERS_TIFS_ISC_CCPRIV_MAX_REGION
#define SAFETY_CHECKERS_TIFS_ISC_CCPRIV_MAX_REGION
Definition: safety_checkers_tifs.h:103
SAFETY_CHECKERS_TIFS_MAX_REGIONS
#define SAFETY_CHECKERS_TIFS_MAX_REGIONS
Definition: safety_checkers_tifs.h:94
SafetyCheckers_TifsIscCbassRegList::startAddrHigh
uint32_t startAddrHigh
Definition: safety_checkers_tifs.h:163
SafetyCheckers_tifsReqFwlClose
int32_t SafetyCheckers_tifsReqFwlClose(void)
API to request TIFS to close firewall.
SafetyCheckers_TifsIscRaRegList
Structure for CC ISC configuration registers for a given ISC region.
Definition: safety_checkers_tifs.h:186
SafetyCheckers_TifsIscCbassRegList::controlReg1
uint32_t controlReg1
Definition: safety_checkers_tifs.h:161
SafetyCheckers_TifsIscCbassConfig::maxNumRegions
uint32_t maxNumRegions
Definition: safety_checkers_tifs.h:201
SafetyCheckers_TifsIscCbassRegList
Structure for CBASS ISC configuration registers for a given ISC region.
Definition: safety_checkers_tifs.h:159
SafetyCheckers_tifsGetIscCbassCfg
int32_t SafetyCheckers_tifsGetIscCbassCfg(SafetyCheckers_TifsIscCbassConfig *iscConfig, uint32_t size)
API uses the pointer to cbass isc configuration iscConfig as input and updates iscConfig with the reg...
SafetyCheckers_TifsIscCbassConfig
Structure for CBASS ISC configuration register info for a given ISC id.
Definition: safety_checkers_tifs.h:198
SafetyCheckers_TifsFwlRegList::privId1
uint32_t privId1
Definition: safety_checkers_tifs.h:130
SafetyCheckers_TifsIscRaConfig::numRegions
uint32_t numRegions
Definition: safety_checkers_tifs.h:228
SafetyCheckers_TifsFwlConfig
Structure for firewall configuration register info for a given firewall id.
Definition: safety_checkers_tifs.h:145
SafetyCheckers_TifsIscCcRegList
Structure for CC ISC configuration registers for a given ISC region.
Definition: safety_checkers_tifs.h:175
SafetyCheckers_TifsIscCbassRegList::rcr
uint32_t rcr
Definition: safety_checkers_tifs.h:166
SafetyCheckers_TifsFwlRegList::startAddrLow
uint32_t startAddrLow
Definition: safety_checkers_tifs.h:132
SafetyCheckers_TifsIscCbassRegList::startAddrLow
uint32_t startAddrLow
Definition: safety_checkers_tifs.h:162
SAFETY_CHECKERS_TIFS_ISC_RA_MAX_ID
#define SAFETY_CHECKERS_TIFS_ISC_RA_MAX_ID
Definition: safety_checkers_tifs.h:104
SafetyCheckers_TifsFwlRegList::endAddrHigh
uint32_t endAddrHigh
Definition: safety_checkers_tifs.h:135
SafetyCheckers_TifsIscCbassRegList::endAddrHigh
uint32_t endAddrHigh
Definition: safety_checkers_tifs.h:165
SafetyCheckers_TifsFwlRegList::startAddrHigh
uint32_t startAddrHigh
Definition: safety_checkers_tifs.h:133
SafetyCheckers_tifsVerifyIscCcCfg
int32_t SafetyCheckers_tifsVerifyIscCcCfg(const SafetyCheckers_TifsIscCcConfig *iscConfig, uint32_t size)
API compares the cc iscConfig (golden reference) with runtime isc register values and return success ...
SafetyCheckers_TifsIscCcConfig::numRegions
uint32_t numRegions
Definition: safety_checkers_tifs.h:214
SafetyCheckers_TifsIscRaRegList::controlReg2
uint32_t controlReg2
Definition: safety_checkers_tifs.h:188
SafetyCheckers_TifsIscCbassConfig::iscId
uint32_t iscId
Definition: safety_checkers_tifs.h:199
SafetyCheckers_TifsFwlRegList::endAddrLow
uint32_t endAddrLow
Definition: safety_checkers_tifs.h:134
SafetyCheckers_TifsIscRaRegList::controlReg1
uint32_t controlReg1
Definition: safety_checkers_tifs.h:187
SafetyCheckers_TifsFwlConfig::fwlId
uint32_t fwlId
Definition: safety_checkers_tifs.h:146
SafetyCheckers_tifsVerifyIscCbassCfg
int32_t SafetyCheckers_tifsVerifyIscCbassCfg(const SafetyCheckers_TifsIscCbassConfig *iscConfig, uint32_t size)
API compares the cbass iscConfig (golden reference) with runtime isc register values and return succe...
SafetyCheckers_TifsFwlRegList
Structure for firewall configuration registers for a given firewall region.
Definition: safety_checkers_tifs.h:127
SafetyCheckers_tifsVerifyIscRaCfg
int32_t SafetyCheckers_tifsVerifyIscRaCfg(const SafetyCheckers_TifsIscRaConfig *iscConfig, uint32_t size)
API compares the ra iscConfig (golden reference) with runtime isc register values and return success ...
SafetyCheckers_TifsIscCbassRegList::controlReg0
uint32_t controlReg0
Definition: safety_checkers_tifs.h:160
SafetyCheckers_TifsIscCcConfig
Structure for CC ISC configuration register info for a given ISC id.
Definition: safety_checkers_tifs.h:212
SafetyCheckers_TifsFwlRegList::controlReg
uint32_t controlReg
Definition: safety_checkers_tifs.h:128
SafetyCheckers_TifsIscCcConfig::iscIdOffset
uint32_t iscIdOffset
Definition: safety_checkers_tifs.h:213