AM64x MCU+ SDK  08.05.00
FIREWALL

Firewall is a module used to implement overall SoC security by providing a mechanism to assign and restrict device resources to a given main entity or Secure/Non-secure/Priv/User world. The Firewall driver provides API to perform initialization and configuration of regions.

Features Supported

  • Support a multi number of regions, depending on the firewall.
  • Two overlapping regions
  • Lock Mode and Cache Mode
  • Support up to 3 privilege and permission slots

SysConfig Features

Note
It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.

SysConfig can be used to configure below parameters

  • Firewall ID and Region Instances
  • Number of Regions
  • Region Index
  • Lock, Cache, Background mode selection
  • Start Address and End Address
  • Transaction permission like Priv-ID, Read, Write, Debug, Cacheable Configuration
Note
Check enable manual address in SysConfig to enter manual region configuration.

Features NOT supported

  • More than 1 overlap regions not supported.
  • The minimum memory region size is 4KB.
  • DMSC targets regions are not supported.

Important Usage Guidelines

  • There can be only one background region per firewall. Foreground regions can have overlapping addresses only with the background region
  • In case two regions overlap, foreground region takes precedence and its permissions are taken into effect.
  • The regions must be 4KB aligned.

Example Usage

Include the below file to access the APIs

Instance open Example

Firewall_open(CONFIG_FIREWALL0);
DebugP_assert(gFirewallHandle != NULL);

Instance close Example

Firewall_close(gFirewallHandle);

Config Firewall region Example

int32_t status;
Firewall_RegionCfg regionParams;
Firewall_Attrs gFirewallAttrs;
uint32_t regionIndex = 1;
regionParams.regionIndex = 0;
regionParams.control = FWL_CONTROL_ENABLE;
regionParams.permissions[0] = (uint32_t) PRIVID_EVERYONE << 16 | \
regionParams.permissions[1] = 0x0;
regionParams.permissions[2] = 0x0U;
regionParams.startAddr = 0x70000000U;
regionParams.endAddr = 0x7003FFFFU;
gFirewallAttrs.firewallId = 14,
gFirewallAttrs.totalRegions = 4,
gFirewallAttrs.regionInfo = regionParams,
gFirewallAttrs.initRegions = 1,
status = Firewall_configureRegion(gFirewallHandle, gFirewallAttrs);

API

APIs for FIREWALL

Firewall_RegionCfg::endAddr
uint64_t endAddr
Definition: firewall/v0/firewall.h:203
Firewall_Attrs::totalRegions
uint32_t totalRegions
Definition: firewall/v0/firewall.h:218
Firewall_RegionCfg::control
uint32_t control
Definition: firewall/v0/firewall.h:197
Firewall_Attrs
Firewall atributes.
Definition: firewall/v0/firewall.h:214
FWL_CONTROL_ENABLE
#define FWL_CONTROL_ENABLE
Definition: firewall/v0/firewall.h:111
Firewall_RegionCfg
Firewall Region Cfg specifies the MMR configuration for the specified firewall ID.
Definition: firewall/v0/firewall.h:193
Firewall_RegionCfg::startAddr
uint64_t startAddr
Definition: firewall/v0/firewall.h:201
Firewall_Attrs::firewallId
uint32_t firewallId
Definition: firewall/v0/firewall.h:216
Firewall_open
int32_t Firewall_open(Firewall_Handle handle)
This function opens a given Firewall peripheral.
SystemP_SUCCESS
#define SystemP_SUCCESS
Return status when the API execution was successful.
Definition: SystemP.h:56
Firewall_Attrs::regionInfo
Firewall_RegionCfg * regionInfo
Definition: firewall/v0/firewall.h:222
Firewall_configureRegion
int32_t Firewall_configureRegion(Firewall_Handle handle, Firewall_Attrs *attrs)
Intialize a firewall with multiple regions.
PRIVID_EVERYONE
#define PRIVID_EVERYONE
Definition: firewall/v0/firewall.h:83
Firewall_Attrs::initRegions
uint32_t initRegions
Definition: firewall/v0/firewall.h:220
Firewall_close
void Firewall_close(Firewall_Handle handle)
Function to close Firewall peripheral specified by firewall handle.
Firewall_RegionCfg::regionIndex
uint16_t regionIndex
Definition: firewall/v0/firewall.h:195
firewall.h
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:159
Firewall_RegionCfg::permissions
uint32_t permissions[FWL_MAX_PRIVID_SLOTS]
Definition: firewall/v0/firewall.h:199
FWL_PERM_SEC_RW
#define FWL_PERM_SEC_RW
Definition: firewall/v0/firewall.h:158