}
static const struct arm_cpu_capabilities arm_errata[] = {
+ {
+ /* Cortex-A15 r0p4 */
+ .desc = "ARM erratum 766422",
+ .capability = ARM32_WORKAROUND_766422,
+ MIDR_RANGE(MIDR_CORTEX_A15, 0x04, 0x04),
+ },
#if defined(CONFIG_ARM64_ERRATUM_827319) || \
defined(CONFIG_ARM64_ERRATUM_824069)
{
#include "vtimer.h"
#include <asm/gic.h>
#include <asm/vgic.h>
+#include <asm/cpuerrata.h>
/* The base of the stack must always be double-word aligned, which means
* that both the kernel half of struct cpu_user_regs (which is pushed in
* Erratum 766422: Thumb store translation fault to Hypervisor may
* not have correct HSR Rt value.
*/
- if ( cpu_has_erratum_766422() && (regs->cpsr & PSR_THUMB) && dabt.write )
+ if ( check_workaround_766422() && (regs->cpsr & PSR_THUMB) && dabt.write )
{
rc = decode_instruction(regs, &info.dabt);
if ( rc )
#define READ_SYSREG(R...) READ_SYSREG32(R)
#define WRITE_SYSREG(V, R...) WRITE_SYSREG32(V, R)
-/* Erratum 766422: only Cortex A15 r0p4 is affected */
-#define cpu_has_erratum_766422() \
- (unlikely(current_cpu_data.midr.bits == 0x410fc0f4))
-
#endif /* __ASSEMBLY__ */
#endif /* __ASM_ARM_ARM32_PROCESSOR_H */
#define READ_SYSREG(name) READ_SYSREG64(name)
#define WRITE_SYSREG(v, name) WRITE_SYSREG64(v, name)
-#define cpu_has_erratum_766422() 0
-
#endif /* __ASSEMBLY__ */
#endif /* __ASM_ARM_ARM64_PROCESSOR_H */
#endif
+CHECK_WORKAROUND_HELPER(766422, ARM32_WORKAROUND_766422, CONFIG_ARM_32)
+
#undef CHECK_WORKAROUND_HELPER
#endif /* __ARM_CPUERRATA_H__ */
#define ARM64_WORKAROUND_CLEAN_CACHE 0
#define ARM64_WORKAROUND_DEVICE_LOAD_ACQUIRE 1
+#define ARM32_WORKAROUND_766422 2
-#define ARM_NCAPS 2
+#define ARM_NCAPS 3
#ifndef __ASSEMBLY__
#define ARM_CPU_IMP_ARM 0x41
+#define ARM_CPU_PART_CORTEX_A15 0xC0F
#define ARM_CPU_PART_CORTEX_A53 0xD03
#define ARM_CPU_PART_CORTEX_A57 0xD07
+#define MIDR_CORTEX_A15 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A15)
#define MIDR_CORTEX_A53 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A53)
#define MIDR_CORTEX_A57 MIDR_CPU_MODEL(ARM_CPU_IMP_ARM, ARM_CPU_PART_CORTEX_A57)