blob: ad05724f821e0d9ac9edfb31c5eb4433f3058761 [file] [log] [blame]
Sona Mathew7fe03522022-11-18 18:05:38 -06001/*
2 * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved.
3 *
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__
14#include <cortex_a35.h>
15#include <cortex_a510.h>
16#include <cortex_a53.h>
17#include <cortex_a57.h>
18#include <cortex_a55.h>
19#include <cortex_a710.h>
20#include <cortex_a72.h>
21#include <cortex_a73.h>
22#include <cortex_a75.h>
23#include <cortex_a76.h>
24#include <cortex_a77.h>
25#include <cortex_a78.h>
26#include <cortex_a78_ae.h>
27#include <cortex_a78c.h>
28#include <cortex_makalu.h>
29#include <cortex_x1.h>
30#include <cortex_x2.h>
31#include <neoverse_n1.h>
32#include <neoverse_n2.h>
33#include <neoverse_v1.h>
34#include <neoverse_v2.h>
35#else
36#include <cortex_a15.h>
37#include <cortex_a17.h>
38#include <cortex_a57.h>
39#include <cortex_a9.h>
40#endif
41
42#define MAX_ERRATA_ENTRIES 15
43
44#define ERRATA_LIST_END (MAX_ERRATA_ENTRIES - 1)
45
46#define UNDEF_ERRATA {UINT_MAX, UCHAR_MAX, UCHAR_MAX, false}
47
48#define EXTRACT_PARTNUM(x) ((x >> MIDR_PN_SHIFT) & MIDR_PN_MASK)
49
50#define RXPX_RANGE(x, y, z) (((x >= y) && (x <= z)) ? true : false)
51
52/*
53 * CPU specific values for errata handling
54 */
55
56struct em_cpu{
57 unsigned int em_errata_id;
58 unsigned char em_rxpx_lo; /* lowest revision of errata applicable for the cpu */
59 unsigned char em_rxpx_hi; /* highest revision of errata applicable for the cpu */
60 bool errata_enabled; /* indicate if errata enabled */
Sona Mathew5a4c9fc2023-03-14 14:02:03 -050061 /* flag to indicate if errata query is based out of non-arm interconnect */
62 bool non_arm_interconnect;
Sona Mathew7fe03522022-11-18 18:05:38 -060063};
64
65struct em_cpu_list{
66 /* field to hold cpu specific part number defined in midr reg */
67 unsigned long cpu_partnumber;
68 struct em_cpu cpu_errata_list[MAX_ERRATA_ENTRIES];
69};
70
71int32_t verify_errata_implemented(uint32_t errata_id, uint32_t forward_flag);
72#endif /* ERRATA_CPUSPEC_H */