AM263x MCU+ SDK  09.02.00
mpu_firewall/v0/mpu_firewall.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 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 MPU_FIREWALL_H_
49 #define MPU_FIREWALL_H_
50 
51 /* ========================================================================== */
52 /* Include Files */
53 /* ========================================================================== */
54 #include <drivers/hw_include/cslr_soc.h>
55 #include <drivers/mpu_firewall/v0/cslr_mpu.h>
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 /* ========================================================================== */
62 /* Macros & Typedefs */
63 /* ========================================================================== */
64 
73 typedef enum Fwl_Return_e
74 {
75  FWL_DRV_RETURN_SUCCESS = 0xBA14D51BU,
76  FWL_DRV_RETURN_FAILURE = 0xAADF4AFAU,
78 
84 typedef struct
85 {
87  uint32_t startAddr ;
89  uint32_t regionSize ;
90 
92 
98 typedef struct
99 {
101  uint32_t baseAddr ;
103  uint32_t numRegions ;
105  uint32_t targetCount ;
108 
110 
111 /* ========================================================================== */
112 /* Structure Declarations */
113 /* ========================================================================== */
114 
121 typedef struct
122 {
124  uint32_t id ;
126  uint32_t regionNumber ;
128  uint32_t startAddress ;
130  uint32_t endAddress ;
133  uint32_t aidConfig ;
135  uint8_t aidxConfig ;
143  uint8_t userReadConfig ;
145  uint8_t userWriteConfig ;
147  uint8_t userExecConfig ;
149  uint8_t nonSecureConfig ;
151  uint8_t debugConfig ;
152 
154 
155 /* ========================================================================== */
156 /* Function Declarations */
157 /* ========================================================================== */
158 
167 
176 Fwl_Return_t MPU_FIREWALL_getFirewallConfig(uint32_t firewallId, MPU_FIREWALL_Config** firewallConfig);
177 
187 Fwl_Return_t MPU_FIREWALL_readFaultAddress (uint32_t firewallId, uint32_t* faultAddress);
188 
198 Fwl_Return_t MPU_FIREWALL_readFaultStatus (uint32_t firewallId, uint32_t* faultStatus);
199 
208 Fwl_Return_t MPU_FIREWALL_getInterruptStatus (uint32_t firewallId, uint32_t* interruptStatus);
209 
210 #ifdef __cplusplus
211 }
212 #endif
213 
214 #endif /* #ifndef MPU_FIREWALL_H_ */
215 
MPU_FIREWALL_RegionParams::userReadConfig
uint8_t userReadConfig
Definition: mpu_firewall/v0/mpu_firewall.h:143
Firewall_Target
MPU Firewall Target.
Definition: mpu_firewall/v0/mpu_firewall.h:85
Firewall_Target::regionSize
uint32_t regionSize
Definition: mpu_firewall/v0/mpu_firewall.h:89
MPU_FIREWALL_RegionParams::supervisorReadConfig
uint8_t supervisorReadConfig
Definition: mpu_firewall/v0/mpu_firewall.h:137
MPU_FIREWALL_RegionParams::endAddress
uint32_t endAddress
Definition: mpu_firewall/v0/mpu_firewall.h:130
MPU_FIREWALL_RegionParams::startAddress
uint32_t startAddress
Definition: mpu_firewall/v0/mpu_firewall.h:128
MPU_FIREWALL_Config
MPU Firewall Parameters.
Definition: mpu_firewall/v0/mpu_firewall.h:99
MPU_FIREWALL_RegionParams::userExecConfig
uint8_t userExecConfig
Definition: mpu_firewall/v0/mpu_firewall.h:147
Firewall_Target::startAddr
uint32_t startAddr
Definition: mpu_firewall/v0/mpu_firewall.h:87
FWL_DRV_RETURN_FAILURE
@ FWL_DRV_RETURN_FAILURE
Definition: mpu_firewall/v0/mpu_firewall.h:76
MPU_FIREWALL_Config::targetCount
uint32_t targetCount
Definition: mpu_firewall/v0/mpu_firewall.h:105
MPU_FIREWALL_getInterruptStatus
Fwl_Return_t MPU_FIREWALL_getInterruptStatus(uint32_t firewallId, uint32_t *interruptStatus)
Function to read interrupt status.
MPU_FIREWALL_Config::numRegions
uint32_t numRegions
Definition: mpu_firewall/v0/mpu_firewall.h:103
MPU_FIREWALL_RegionParams::aidConfig
uint32_t aidConfig
Definition: mpu_firewall/v0/mpu_firewall.h:133
MPU_FIREWALL_getRegion
Fwl_Return_t MPU_FIREWALL_getRegion(MPU_FIREWALL_RegionParams *mpuParams)
Retrieves the start and end addresses and the permission attributes of a given region in a given fire...
MPU_FIREWALL_RegionParams::userWriteConfig
uint8_t userWriteConfig
Definition: mpu_firewall/v0/mpu_firewall.h:145
MPU_FIREWALL_RegionParams::id
uint32_t id
Definition: mpu_firewall/v0/mpu_firewall.h:124
MPU_FIREWALL_RegionParams::supervisorExecConfig
uint8_t supervisorExecConfig
Definition: mpu_firewall/v0/mpu_firewall.h:141
MPU_FIREWALL_getFirewallConfig
Fwl_Return_t MPU_FIREWALL_getFirewallConfig(uint32_t firewallId, MPU_FIREWALL_Config **firewallConfig)
Function to get parameters associated to a MPU firewall.
MPU_FIREWALL_Config::baseAddr
uint32_t baseAddr
Definition: mpu_firewall/v0/mpu_firewall.h:101
FWL_DRV_RETURN_SUCCESS
@ FWL_DRV_RETURN_SUCCESS
Definition: mpu_firewall/v0/mpu_firewall.h:75
Fwl_Return_t
Fwl_Return_t
Firewall Driver Error code.
Definition: mpu_firewall/v0/mpu_firewall.h:74
MPU_FIREWALL_RegionParams::debugConfig
uint8_t debugConfig
Definition: mpu_firewall/v0/mpu_firewall.h:151
MPU_FIREWALL_RegionParams::aidxConfig
uint8_t aidxConfig
Definition: mpu_firewall/v0/mpu_firewall.h:135
MPU_FIREWALL_RegionParams::supervisorWriteConfig
uint8_t supervisorWriteConfig
Definition: mpu_firewall/v0/mpu_firewall.h:139
MPU_FIREWALL_RegionParams
MPU Region Parameters.
Definition: mpu_firewall/v0/mpu_firewall.h:122
MPU_FIREWALL_readFaultAddress
Fwl_Return_t MPU_FIREWALL_readFaultAddress(uint32_t firewallId, uint32_t *faultAddress)
Function to read the fault address that created the firewall violation.
MPU_FIREWALL_Config::target
Firewall_Target * target
Definition: mpu_firewall/v0/mpu_firewall.h:107
MPU_FIREWALL_readFaultStatus
Fwl_Return_t MPU_FIREWALL_readFaultStatus(uint32_t firewallId, uint32_t *faultStatus)
Function to read the fault status register. It contains information on the kind of firewall violation...
MPU_FIREWALL_RegionParams::regionNumber
uint32_t regionNumber
Definition: mpu_firewall/v0/mpu_firewall.h:126
MPU_FIREWALL_RegionParams::nonSecureConfig
uint8_t nonSecureConfig
Definition: mpu_firewall/v0/mpu_firewall.h:149