mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 17:44:19 +00:00

This patch checks if the Errata 2938996(Cortex-A520) , 2726228(Cortex-X4) applies to cores and if affected applies the errata workaround which disables TRBE. Signed-off-by: Arvind Ram Prakash <arvind.ramprakash@arm.com> Change-Id: I53b037839820c8b3a869f393588302a365d5b97c
30 lines
799 B
C
30 lines
799 B
C
/*
|
|
* Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
/* Runtime C routines for errata workarounds and common routines */
|
|
|
|
#include <arch.h>
|
|
#include <arch_helpers.h>
|
|
#include <cortex_a520.h>
|
|
#include <cortex_x4.h>
|
|
#include <lib/cpus/cpu_ops.h>
|
|
#include <lib/cpus/errata.h>
|
|
|
|
#if ERRATA_A520_2938996 || ERRATA_X4_2726228
|
|
unsigned int check_if_affected_core(void)
|
|
{
|
|
uint32_t midr_val = read_midr();
|
|
long rev_var = cpu_get_rev_var();
|
|
|
|
if (EXTRACT_PARTNUM(midr_val) == EXTRACT_PARTNUM(CORTEX_A520_MIDR)) {
|
|
return check_erratum_cortex_a520_2938996(rev_var);
|
|
} else if (EXTRACT_PARTNUM(midr_val) == EXTRACT_PARTNUM(CORTEX_X4_MIDR)) {
|
|
return check_erratum_cortex_x4_2726228(rev_var);
|
|
}
|
|
|
|
return ERRATA_NOT_APPLIES;
|
|
}
|
|
#endif
|