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 | 9421e52 | 2024-03-01 13:36:21 -0600 | [diff] [blame^] | 20 | #include <cortex_x4.h> |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 21 | #include <neoverse_n2.h> |
| 22 | #include <neoverse_v1.h> |
| 23 | #include <neoverse_v2.h> |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 24 | #endif |
| 25 | |
Sona Mathew | 595a31d | 2023-09-26 09:20:35 -0500 | [diff] [blame] | 26 | /* Max number of platform based errata with no workaround in EL3 */ |
| 27 | #define MAX_PLAT_CPU_ERRATA_ENTRIES 2 |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 28 | |
Sona Mathew | 595a31d | 2023-09-26 09:20:35 -0500 | [diff] [blame] | 29 | #define ERRATA_LIST_END (MAX_PLAT_CPU_ERRATA_ENTRIES - 1) |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 30 | |
Sona Mathew | c5b386d | 2023-03-14 16:50:36 -0500 | [diff] [blame] | 31 | /* Default values for unused memory in the array */ |
Sona Mathew | 8d1a153 | 2023-09-26 17:49:51 -0500 | [diff] [blame] | 32 | #define UNDEF_ERRATA {UINT_MAX, UCHAR_MAX, UCHAR_MAX} |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 33 | |
| 34 | #define EXTRACT_PARTNUM(x) ((x >> MIDR_PN_SHIFT) & MIDR_PN_MASK) |
| 35 | |
| 36 | #define RXPX_RANGE(x, y, z) (((x >= y) && (x <= z)) ? true : false) |
| 37 | |
| 38 | /* |
| 39 | * CPU specific values for errata handling |
| 40 | */ |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 41 | struct em_cpu{ |
| 42 | unsigned int em_errata_id; |
| 43 | unsigned char em_rxpx_lo; /* lowest revision of errata applicable for the cpu */ |
| 44 | 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] | 45 | }; |
| 46 | |
| 47 | struct em_cpu_list{ |
Sona Mathew | 595a31d | 2023-09-26 09:20:35 -0500 | [diff] [blame] | 48 | unsigned long cpu_partnumber; /* cpu specific part number defined in midr reg */ |
| 49 | struct em_cpu cpu_errata_list[MAX_PLAT_CPU_ERRATA_ENTRIES]; |
Sona Mathew | 7fe0352 | 2022-11-18 18:05:38 -0600 | [diff] [blame] | 50 | }; |
| 51 | |
| 52 | int32_t verify_errata_implemented(uint32_t errata_id, uint32_t forward_flag); |
| 53 | #endif /* ERRATA_CPUSPEC_H */ |