blob: 49bac23e3b67d157437881dfd56360a3e881e6ca [file] [log] [blame]
Sona Mathew7fe03522022-11-18 18:05:38 -06001/*
Sona Mathew595a31d2023-09-26 09:20:35 -05002 * Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved.
Sona Mathew7fe03522022-11-18 18:05:38 -06003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef ERRATA_CPUSPEC_H
8#define ERRATA_CPUSPEC_H
9
10#include <stdint.h>
11#include <arch_helpers.h>
12
13#if __aarch64__
Sona Mathew7fe03522022-11-18 18:05:38 -060014#include <cortex_a710.h>
Sona Mathew7fe03522022-11-18 18:05:38 -060015#include <cortex_a78.h>
16#include <cortex_a78_ae.h>
17#include <cortex_a78c.h>
Sona Mathew7fe03522022-11-18 18:05:38 -060018#include <cortex_x2.h>
Sona Mathewd8b91ac2024-02-21 15:07:30 -060019#include <cortex_x3.h>
Sona Mathew7fe03522022-11-18 18:05:38 -060020#include <neoverse_n2.h>
21#include <neoverse_v1.h>
22#include <neoverse_v2.h>
Sona Mathew7fe03522022-11-18 18:05:38 -060023#endif
24
Sona Mathew595a31d2023-09-26 09:20:35 -050025/* Max number of platform based errata with no workaround in EL3 */
26#define MAX_PLAT_CPU_ERRATA_ENTRIES 2
Sona Mathew7fe03522022-11-18 18:05:38 -060027
Sona Mathew595a31d2023-09-26 09:20:35 -050028#define ERRATA_LIST_END (MAX_PLAT_CPU_ERRATA_ENTRIES - 1)
Sona Mathew7fe03522022-11-18 18:05:38 -060029
Sona Mathewc5b386d2023-03-14 16:50:36 -050030/* Default values for unused memory in the array */
Sona Mathew8d1a1532023-09-26 17:49:51 -050031#define UNDEF_ERRATA {UINT_MAX, UCHAR_MAX, UCHAR_MAX}
Sona Mathew7fe03522022-11-18 18:05:38 -060032
33#define EXTRACT_PARTNUM(x) ((x >> MIDR_PN_SHIFT) & MIDR_PN_MASK)
34
35#define RXPX_RANGE(x, y, z) (((x >= y) && (x <= z)) ? true : false)
36
37/*
38 * CPU specific values for errata handling
39 */
Sona Mathew7fe03522022-11-18 18:05:38 -060040struct em_cpu{
41 unsigned int em_errata_id;
42 unsigned char em_rxpx_lo; /* lowest revision of errata applicable for the cpu */
43 unsigned char em_rxpx_hi; /* highest revision of errata applicable for the cpu */
Sona Mathew7fe03522022-11-18 18:05:38 -060044};
45
46struct em_cpu_list{
Sona Mathew595a31d2023-09-26 09:20:35 -050047 unsigned long cpu_partnumber; /* cpu specific part number defined in midr reg */
48 struct em_cpu cpu_errata_list[MAX_PLAT_CPU_ERRATA_ENTRIES];
Sona Mathew7fe03522022-11-18 18:05:38 -060049};
50
51int32_t verify_errata_implemented(uint32_t errata_id, uint32_t forward_flag);
52#endif /* ERRATA_CPUSPEC_H */