mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-05-07 12:19:26 +00:00
Merge "feat(tzc400): update filters by region" into integration
This commit is contained in:
commit
d3f91e242a
3 changed files with 33 additions and 1 deletions
|
@ -68,6 +68,7 @@ DEFINE_TZC_COMMON_WRITE_REGION_BASE(400, 400)
|
||||||
DEFINE_TZC_COMMON_WRITE_REGION_TOP(400, 400)
|
DEFINE_TZC_COMMON_WRITE_REGION_TOP(400, 400)
|
||||||
DEFINE_TZC_COMMON_WRITE_REGION_ATTRIBUTES(400, 400)
|
DEFINE_TZC_COMMON_WRITE_REGION_ATTRIBUTES(400, 400)
|
||||||
DEFINE_TZC_COMMON_WRITE_REGION_ID_ACCESS(400, 400)
|
DEFINE_TZC_COMMON_WRITE_REGION_ID_ACCESS(400, 400)
|
||||||
|
DEFINE_TZC_COMMON_UPDATE_FILTERS(400, 400)
|
||||||
DEFINE_TZC_COMMON_CONFIGURE_REGION0(400)
|
DEFINE_TZC_COMMON_CONFIGURE_REGION0(400)
|
||||||
DEFINE_TZC_COMMON_CONFIGURE_REGION(400)
|
DEFINE_TZC_COMMON_CONFIGURE_REGION(400)
|
||||||
|
|
||||||
|
@ -271,6 +272,15 @@ void tzc400_configure_region(unsigned int filters,
|
||||||
sec_attr, nsaid_permissions);
|
sec_attr, nsaid_permissions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tzc400_update_filters(unsigned int region, unsigned int filters)
|
||||||
|
{
|
||||||
|
/* Do range checks on filters and regions. */
|
||||||
|
assert(((filters >> tzc400.num_filters) == 0U) &&
|
||||||
|
(region < tzc400.num_regions));
|
||||||
|
|
||||||
|
_tzc400_update_filters(tzc400.base, region, tzc400.num_filters, filters);
|
||||||
|
}
|
||||||
|
|
||||||
void tzc400_enable_filters(void)
|
void tzc400_enable_filters(void)
|
||||||
{
|
{
|
||||||
unsigned int state;
|
unsigned int state;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2016-2020, ARM Limited and Contributors. All rights reserved.
|
* Copyright (c) 2016-2021, ARM Limited and Contributors. All rights reserved.
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-3-Clause
|
* SPDX-License-Identifier: BSD-3-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -89,6 +89,27 @@
|
||||||
val); \
|
val); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* It is used to modify the filters status for a defined region.
|
||||||
|
*/
|
||||||
|
#define DEFINE_TZC_COMMON_UPDATE_FILTERS(fn_name, macro_name) \
|
||||||
|
static inline void _tzc##fn_name##_update_filters( \
|
||||||
|
uintptr_t base, \
|
||||||
|
unsigned int region_no, \
|
||||||
|
unsigned int nbfilters, \
|
||||||
|
unsigned int filters) \
|
||||||
|
{ \
|
||||||
|
uint32_t filters_mask = GENMASK(nbfilters - 1U, 0); \
|
||||||
|
\
|
||||||
|
mmio_clrsetbits_32(base + \
|
||||||
|
TZC_REGION_OFFSET( \
|
||||||
|
TZC_##macro_name##_REGION_SIZE, \
|
||||||
|
region_no) + \
|
||||||
|
TZC_##macro_name##_REGION_ATTR_0_OFFSET, \
|
||||||
|
filters_mask << TZC_REGION_ATTR_F_EN_SHIFT, \
|
||||||
|
filters << TZC_REGION_ATTR_F_EN_SHIFT); \
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* It is used to program region 0 ATTRIBUTES and ACCESS register.
|
* It is used to program region 0 ATTRIBUTES and ACCESS register.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -109,6 +109,7 @@ void tzc400_configure_region(unsigned int filters,
|
||||||
unsigned long long region_top,
|
unsigned long long region_top,
|
||||||
unsigned int sec_attr,
|
unsigned int sec_attr,
|
||||||
unsigned int nsaid_permissions);
|
unsigned int nsaid_permissions);
|
||||||
|
void tzc400_update_filters(unsigned int region, unsigned int filters);
|
||||||
void tzc400_set_action(unsigned int action);
|
void tzc400_set_action(unsigned int action);
|
||||||
void tzc400_enable_filters(void);
|
void tzc400_enable_filters(void);
|
||||||
void tzc400_disable_filters(void);
|
void tzc400_disable_filters(void);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue