diff options
author | Madhukar Pappireddy <madhukar.pappireddy@arm.com> | 2021-02-22 21:44:01 +0000 |
---|---|---|
committer | TrustedFirmware Code Review <review@review.trustedfirmware.org> | 2021-02-22 21:44:01 +0000 |
commit | 1272391ee13a5b3428fd7aa2dc88575492a15aec (patch) | |
tree | 3b2de4f1b68dfdb4750ab442a607455fd2f8fcb8 /drivers | |
parent | c36e2d488e940c674a0f442d89f64bd4a57e7616 (diff) | |
parent | d4c61c38783dd8d43ca6a63ce5fbc64c9c812db9 (diff) | |
download | trusted-firmware-a-1272391ee13a5b3428fd7aa2dc88575492a15aec.tar.gz |
Merge changes Ie5c48303,I5d363c46 into integration
* changes:
tzc400: adjust filter flag if it is set to FILTER_BIT_ALL
tzc400: fix logical error in FILTER_BIT definitions
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/arm/tzc/tzc400.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/arm/tzc/tzc400.c b/drivers/arm/tzc/tzc400.c index 95a5e7f77f..9798ed4e5f 100644 --- a/drivers/arm/tzc/tzc400.c +++ b/drivers/arm/tzc/tzc400.c @@ -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 */ @@ -162,7 +162,9 @@ void tzc400_configure_region0(unsigned int sec_attr, /* * `tzc400_configure_region` is used to program regions into the TrustZone * controller. A region can be associated with more than one filter. The - * associated filters are passed in as a bitmap (bit0 = filter0). + * associated filters are passed in as a bitmap (bit0 = filter0), except that + * the value TZC_400_REGION_ATTR_FILTER_BIT_ALL selects all filters, based on + * the value of tzc400.num_filters. * NOTE: * Region 0 is special; it is preferable to use tzc400_configure_region0 * for this region (see comment for that function). @@ -176,6 +178,11 @@ void tzc400_configure_region(unsigned int filters, { assert(tzc400.base != 0U); + /* Adjust filter mask by real filter number */ + if (filters == TZC_400_REGION_ATTR_FILTER_BIT_ALL) { + filters = (1U << tzc400.num_filters) - 1U; + } + /* Do range checks on filters and regions. */ assert(((filters >> tzc400.num_filters) == 0U) && (region < tzc400.num_regions)); |