Merge "fix(gic): wrap cache enabled assert under plat_can_cmo" into integration

This commit is contained in:
Manish Pandey 2022-12-19 11:44:45 +01:00 committed by TrustedFirmware Code Review
commit 01617e0bee
2 changed files with 18 additions and 2 deletions

View file

@ -12,6 +12,7 @@
#include <common/interrupt_props.h>
#include <drivers/arm/gicv3.h>
#include <lib/spinlock.h>
#include <plat/common/platform.h>
#include "gicv3_private.h"
@ -1287,12 +1288,14 @@ int gicv3_rdistif_probe(const uintptr_t gicr_frame)
assert(gicv3_driver_data->gicr_base == 0U);
if (plat_can_cmo()) {
/* Ensure this function is called with Data Cache enabled */
#ifndef __aarch64__
assert((read_sctlr() & SCTLR_C_BIT) != 0U);
assert((read_sctlr() & SCTLR_C_BIT) != 0U);
#else
assert((read_sctlr_el3() & SCTLR_C_BIT) != 0U);
assert((read_sctlr_el3() & SCTLR_C_BIT) != 0U);
#endif /* !__aarch64__ */
}
mpidr_self = read_mpidr_el1() & MPIDR_AFFINITY_MASK;
rdistif_base = gicr_frame;

View file

@ -421,4 +421,17 @@ int plat_fwu_set_metadata_image_source(unsigned int image_id,
void plat_fwu_set_images_source(const struct fwu_metadata *metadata);
uint32_t plat_fwu_get_boot_idx(void);
/*
* Optional function to indicate if cache management operations can be
* performed.
*/
#if CONDITIONAL_CMO
uint64_t plat_can_cmo(void);
#else
static inline uint64_t plat_can_cmo(void)
{
return 1;
}
#endif /* CONDITIONAL_CMO */
#endif /* PLATFORM_H */