AM62Px MCU+ SDK  09.02.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 
51 /* @} */
52 
53 #ifndef SAFETY_CHECKERS_TIFS_H_
54 #define SAFETY_CHECKERS_TIFS_H_
55 
56 /* ========================================================================== */
57 /* Include Files */
58 /* ========================================================================== */
59 
60 /* None */
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
73 /* ========================================================================== */
74 /* Macros & Typedefs */
75 /* ========================================================================== */
76 
77 #define SAFETY_CHECKERS_TIFS_FWL_OPEN 0x902CU
78 #define SAFETY_CHECKERS_TIFS_FWL_CLOSE 0x902DU
79 
80 #define SAFETY_CHECKERS_TIFS_FWL_BASE 0x45000000U
81 #define SAFETY_CHECKERS_TIFS_CONTROL_REG 0x0U
82 #define SAFETY_CHECKERS_TIFS_PRIV_ID0 0x4U
83 #define SAFETY_CHECKERS_TIFS_PRIV_ID1 0x8U
84 #define SAFETY_CHECKERS_TIFS_PRIV_ID2 0xCU
85 #define SAFETY_CHECKERS_TIFS_START_ADDRL 0x10U
86 #define SAFETY_CHECKERS_TIFS_START_ADDRH 0x14U
87 #define SAFETY_CHECKERS_TIFS_END_ADDRL 0x18U
88 #define SAFETY_CHECKERS_TIFS_END_ADDRH 0x1CU
89 #define SAFETY_CHECKERS_TIFS_MAX_REGIONS 36U
90 
100 /* ========================================================================== */
101 /* Structure Declarations */
102 /* ========================================================================== */
103 
110 typedef struct
111 {
112  uint32_t controlReg; /* Region Control Register */
113  uint32_t privId0; /* Region Priv-ID 0 slot permission */
114  uint32_t privId1; /* Region Priv-ID 1 slot permission */
115  uint32_t privId2; /* Region Priv-ID 2 slot permission */
116  uint32_t startAddrLow; /* Region Start address Low */
117  uint32_t startAddrHigh; /* Region Start address High */
118  uint32_t endAddrLow; /* Region End address Low */
119  uint32_t endAddrHigh; /* Region End address High */
121 
128 typedef struct
129 {
130  uint32_t fwlId; /* Firewall id */
131  uint32_t numRegions; /* Number of regions stored in the firewall config for an id */
132  uint32_t maxNumRegions; /* Maximum number of regions present in an id */
133  SafetyCheckers_TifsFwlRegList fwlCfgPerRegion[SAFETY_CHECKERS_TIFS_MAX_REGIONS]; /* Firewall registers for a given region */
135 
145 /* ========================================================================== */
146 /* Function Declarations */
147 /* ========================================================================== */
148 
156 
170 
184 
193 
194 #ifdef __cplusplus
195 }
196 #endif
197 
198 #endif /* #ifndef SAFETY_CHECKERS_TIFS_H_ */
199 
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:132
SafetyCheckers_TifsFwlConfig::numRegions
uint32_t numRegions
Definition: safety_checkers_tifs.h:131
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_TifsFwlRegList::privId2
uint32_t privId2
Definition: safety_checkers_tifs.h:115
SafetyCheckers_tifsReqFwlOpen
int32_t SafetyCheckers_tifsReqFwlOpen(void)
API to request TIFS to open firewall.
SafetyCheckers_TifsFwlRegList::privId0
uint32_t privId0
Definition: safety_checkers_tifs.h:113
SAFETY_CHECKERS_TIFS_MAX_REGIONS
#define SAFETY_CHECKERS_TIFS_MAX_REGIONS
Definition: safety_checkers_tifs.h:89
SafetyCheckers_tifsReqFwlClose
int32_t SafetyCheckers_tifsReqFwlClose(void)
API to request TIFS to close firewall.
SafetyCheckers_TifsFwlRegList::privId1
uint32_t privId1
Definition: safety_checkers_tifs.h:114
SafetyCheckers_TifsFwlConfig
Structure for firewall configuration register info for a given firewall id.
Definition: safety_checkers_tifs.h:129
SafetyCheckers_TifsFwlRegList::startAddrLow
uint32_t startAddrLow
Definition: safety_checkers_tifs.h:116
SafetyCheckers_TifsFwlRegList::endAddrHigh
uint32_t endAddrHigh
Definition: safety_checkers_tifs.h:119
SafetyCheckers_TifsFwlRegList::startAddrHigh
uint32_t startAddrHigh
Definition: safety_checkers_tifs.h:117
SafetyCheckers_TifsFwlRegList::endAddrLow
uint32_t endAddrLow
Definition: safety_checkers_tifs.h:118
SafetyCheckers_TifsFwlConfig::fwlId
uint32_t fwlId
Definition: safety_checkers_tifs.h:130
SafetyCheckers_TifsFwlRegList
Structure for firewall configuration registers for a given firewall region.
Definition: safety_checkers_tifs.h:111
SafetyCheckers_TifsFwlRegList::controlReg
uint32_t controlReg
Definition: safety_checkers_tifs.h:112