Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 1 | /* |
Sona Mathew | 595a31d | 2023-09-26 09:20:35 -0500 | [diff] [blame] | 2 | * Copyright (c) 2023-2024, Arm Limited and Contributors. All rights reserved. |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 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__ |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 14 | #include <cortex_a710.h> |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 15 | #include <cortex_a78.h> |
| 16 | #include <cortex_a78_ae.h> |
| 17 | #include <cortex_a78c.h> |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 18 | #include <cortex_x2.h> |
Sona Mathew | d8b91ac | 2024-02-21 15:07:30 -0600 | [diff] [blame] | 19 | #include <cortex_x3.h> |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 20 | #include <neoverse_n2.h> |
| 21 | #include <neoverse_v1.h> |
| 22 | #include <neoverse_v2.h> |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 23 | #endif |
| 24 | |
Sona Mathew | 595a31d | 2023-09-26 09:20:35 -0500 | [diff] [blame] | 25 | /* Max number of platform based errata with no workaround in EL3 */ |
| 26 | #define MAX_PLAT_CPU_ERRATA_ENTRIES 2 |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 27 | |
Sona Mathew | 595a31d | 2023-09-26 09:20:35 -0500 | [diff] [blame] | 28 | #define ERRATA_LIST_END (MAX_PLAT_CPU_ERRATA_ENTRIES - 1) |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 29 | |
Sona Mathew | c5b386d | 2023-03-14 16:50:36 -0500 | [diff] [blame] | 30 | /* Default values for unused memory in the array */ |
Sona Mathew | 8d1a153 | 2023-09-26 17:49:51 -0500 | [diff] [blame] | 31 | #define UNDEF_ERRATA {UINT_MAX, UCHAR_MAX, UCHAR_MAX} |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 32 | |
| 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 Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 40 | struct 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 Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | struct em_cpu_list{ |
Sona Mathew | 595a31d | 2023-09-26 09:20:35 -0500 | [diff] [blame] | 47 | 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 Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | int32_t verify_errata_implemented(uint32_t errata_id, uint32_t forward_flag); |
| 52 | #endif /* ERRATA_CPUSPEC_H */ |