Remove _tzc_get_max_top_addr() function

This function was needed at the time where we didn't have the
compiler_rt lib. An AArch32-specific variant was provided to handle
the 64-bit shift operation in 32-bit. This is no longer needed.

Change-Id: Ibab709a95e3a723ae2eeaddf873dba70ff2012b3
Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
This commit is contained in:
Sandrine Bailleux 2018-10-31 13:41:47 +01:00
parent 638d2b5141
commit b56ec68080
3 changed files with 3 additions and 38 deletions

View File

@ -182,8 +182,8 @@ void tzc400_configure_region(unsigned int filters,
* Do address range check based on TZC configuration. A 64bit address is
* the max and expected case.
*/
assert(((region_top <= _tzc_get_max_top_addr(tzc400.addr_width)) &&
(region_base < region_top)));
assert((region_top <= (UINT64_MAX >> (64U - tzc400.addr_width))) &&
(region_base < region_top));
/* region_base and (region_top + 1) must be 4KB aligned */
assert(((region_base | (region_top + 1U)) & (4096U - 1U)) == 0U);

View File

@ -180,39 +180,4 @@ static inline unsigned int _tzc_read_peripheral_id(uintptr_t base)
return id;
}
#if ENABLE_ASSERTIONS
#ifdef AARCH32
static inline unsigned long long _tzc_get_max_top_addr(unsigned int addr_width)
{
/*
* Assume at least 32 bit wide address and initialize the max.
* This function doesn't use 64-bit integer arithmetic to avoid
* having to implement additional compiler library functions.
*/
unsigned long long addr_mask = 0xFFFFFFFFU;
uint32_t *addr_ptr = (uint32_t *)&addr_mask;
assert(addr_width >= 32U);
/* This logic works only on little - endian platforms */
assert((read_sctlr() & SCTLR_EE_BIT) == 0U);
/*
* If required address width is greater than 32, populate the higher
* 32 bits of the 64 bit field with the max address.
*/
if (addr_width > 32U)
*(addr_ptr + 1U) = ((1U << (addr_width - 32U)) - 1U);
return addr_mask;
}
#else
static inline unsigned long long _tzc_get_max_top_addr(unsigned int addr_width)
{
return UINT64_MAX >> (64U - addr_width);
}
#endif /* AARCH32 */
#endif /* ENABLE_ASSERTIONS */
#endif /* TZC_COMMON_PRIVATE_H */

View File

@ -188,7 +188,7 @@ void tzc_dmc500_configure_region(unsigned int region_no,
* Do address range check based on DMC-TZ configuration. A 43bit address
* is the max and expected case.
*/
assert(((region_top <= _tzc_get_max_top_addr(43)) &&
assert(((region_top <= (UINT64_MAX >> (64U - 43U))) &&
(region_base < region_top)));
/* region_base and (region_top + 1) must be 4KB aligned */