AM263x MCU+ SDK  08.03.00
mpu_firewall/v0/mpu_firewall.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 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 
55 #include <drivers/hw_include/cslr_soc.h>
56 #include <drivers/mpu_firewall/v0/cslr_mpu.h>
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 /* ========================================================================== */
63 /* Structure Declarations */
64 /* ========================================================================== */
65 
72 typedef struct
73 {
75  uint32_t id ;
77  uint32_t regionNumber ;
79  uint32_t startAddress ;
81  uint32_t endAddress ;
84  uint32_t aidConfig ;
86  uint8_t aidxConfig ;
94  uint8_t userReadConfig ;
96  uint8_t userWriteConfig ;
98  uint8_t userExecConfig ;
100  uint8_t nonSecureConfig ;
102  uint8_t debugConfig ;
103 
105 
111 typedef struct
112 {
114  uint32_t baseAddr ;
116  uint32_t numRegions ;
117 
119 
120 /* ========================================================================== */
121 /* Function Declarations */
122 /* ========================================================================== */
123 
128 
137 
146 int32_t MPU_FIREWALL_getFirewallConfig(uint32_t firewallId, MPU_FIREWALL_Config** firewallConfig);
147 
154 
163 uint32_t MPU_FIREWALL_readFaultAddress (uint32_t baseAddr);
164 
173 uint32_t MPU_FIREWALL_readFaultStatus (uint32_t baseAddr);
174 
181 void MPU_FIREWALL_clearFault (uint32_t baseAddr);
182 
190 void MPU_FIREWALL_interruptEnable (uint32_t baseAddr, uint32_t flag);
191 
199 void MPU_FIREWALL_clearInterruptEnable (uint32_t baseAddr, uint32_t flag);
200 
208 void MPU_FIREWALL_setInterruptStatus (uint32_t baseAddr, uint32_t flag);
209 
217 uint32_t MPU_FIREWALL_getInterruptStatus (uint32_t baseAddr);
218 
226 void MPU_FIREWALL_clearInterruptStatus (uint32_t baseAddr, uint32_t flag);
227 
228 #ifdef __cplusplus
229 }
230 #endif
231 
232 #endif /* #ifndef MPU_FIREWALL_H_ */
233 
MPU_FIREWALL_RegionParams::userReadConfig
uint8_t userReadConfig
Definition: mpu_firewall/v0/mpu_firewall.h:94
MPU_FIREWALL_clearInterruptEnable
void MPU_FIREWALL_clearInterruptEnable(uint32_t baseAddr, uint32_t flag)
Function to disable MPU Firewall interrupt.
MPU_FIREWALL_setRegion
int32_t MPU_FIREWALL_setRegion(MPU_FIREWALL_RegionParams *mpuParams)
Function to configure a Firewall region.
MPU_FIREWALL_init
void MPU_FIREWALL_init()
This function initializes the MPU Firewall module.
MPU_FIREWALL_RegionParams::supervisorReadConfig
uint8_t supervisorReadConfig
Definition: mpu_firewall/v0/mpu_firewall.h:88
MPU_FIREWALL_RegionParams::endAddress
uint32_t endAddress
Definition: mpu_firewall/v0/mpu_firewall.h:81
MPU_FIREWALL_RegionParams::startAddress
uint32_t startAddress
Definition: mpu_firewall/v0/mpu_firewall.h:79
MPU_FIREWALL_Config
MPU Firewall Parameters.
Definition: mpu_firewall/v0/mpu_firewall.h:112
MPU_FIREWALL_RegionParams::userExecConfig
uint8_t userExecConfig
Definition: mpu_firewall/v0/mpu_firewall.h:98
MPU_FIREWALL_clearInterruptStatus
void MPU_FIREWALL_clearInterruptStatus(uint32_t baseAddr, uint32_t flag)
Function to clear interrupt status.
MPU_FIREWALL_readFaultStatus
uint32_t MPU_FIREWALL_readFaultStatus(uint32_t baseAddr)
Function to read the fault status register. It contains information on the kind of firewall violation...
MPU_FIREWALL_readFaultAddress
uint32_t MPU_FIREWALL_readFaultAddress(uint32_t baseAddr)
Function to read the fault address that created the firewall violation.
MPU_FIREWALL_setInterruptStatus
void MPU_FIREWALL_setInterruptStatus(uint32_t baseAddr, uint32_t flag)
Function to set interrupt. This can be used for testing interrupts.
MPU_FIREWALL_Config::numRegions
uint32_t numRegions
Definition: mpu_firewall/v0/mpu_firewall.h:116
MPU_FIREWALL_RegionParams::aidConfig
uint32_t aidConfig
Definition: mpu_firewall/v0/mpu_firewall.h:84
MPU_FIREWALL_RegionParams_init
void MPU_FIREWALL_RegionParams_init(MPU_FIREWALL_RegionParams *mpuParams)
Function to initialize the parameters of a region.
MPU_FIREWALL_clearFault
void MPU_FIREWALL_clearFault(uint32_t baseAddr)
Function to clear MPU Firewall fault address and fault status register .
MPU_FIREWALL_RegionParams::userWriteConfig
uint8_t userWriteConfig
Definition: mpu_firewall/v0/mpu_firewall.h:96
MPU_FIREWALL_RegionParams::id
uint32_t id
Definition: mpu_firewall/v0/mpu_firewall.h:75
MPU_FIREWALL_RegionParams::supervisorExecConfig
uint8_t supervisorExecConfig
Definition: mpu_firewall/v0/mpu_firewall.h:92
MPU_FIREWALL_getFirewallConfig
int32_t MPU_FIREWALL_getFirewallConfig(uint32_t firewallId, MPU_FIREWALL_Config **firewallConfig)
Function to get parameters of a firewall.
MPU_FIREWALL_getInterruptStatus
uint32_t MPU_FIREWALL_getInterruptStatus(uint32_t baseAddr)
Function to read interrupt status.
MPU_FIREWALL_Config::baseAddr
uint32_t baseAddr
Definition: mpu_firewall/v0/mpu_firewall.h:114
MPU_FIREWALL_RegionParams::debugConfig
uint8_t debugConfig
Definition: mpu_firewall/v0/mpu_firewall.h:102
MPU_FIREWALL_RegionParams::aidxConfig
uint8_t aidxConfig
Definition: mpu_firewall/v0/mpu_firewall.h:86
MPU_FIREWALL_RegionParams::supervisorWriteConfig
uint8_t supervisorWriteConfig
Definition: mpu_firewall/v0/mpu_firewall.h:90
MPU_FIREWALL_RegionParams
MPU Region Parameters.
Definition: mpu_firewall/v0/mpu_firewall.h:73
MPU_FIREWALL_interruptEnable
void MPU_FIREWALL_interruptEnable(uint32_t baseAddr, uint32_t flag)
Function to enable MPU Firewall interrupt.
MPU_FIREWALL_RegionParams::regionNumber
uint32_t regionNumber
Definition: mpu_firewall/v0/mpu_firewall.h:77
MPU_FIREWALL_RegionParams::nonSecureConfig
uint8_t nonSecureConfig
Definition: mpu_firewall/v0/mpu_firewall.h:100