blob: f9b96341aa6c5936af2f0e1b8bd74729eb1a0451 [file] [log] [blame]
Jeenu Viswambharana490fe02018-06-08 08:44:36 +01001/*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Manish Pandeyc25ab022023-04-24 14:58:55 +01007#include <inttypes.h>
8#include <stdint.h>
9
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <lib/extensions/ras.h>
Manish Pandeyc25ab022023-04-24 14:58:55 +010011#include <services/sdei.h>
12
13#ifdef PLATFORM_TEST_RAS_FFH
14static int injected_fault_handler(const struct err_record_info *info,
15 int probe_data, const struct err_handler_data *const data)
16{
17 uint64_t status;
18 int ret;
19
20 /*
21 * The faulting error record is already selected by the SER probe
22 * function.
23 */
24 status = read_erxstatus_el1();
25
26 ERROR("Fault reported by system error record %d on 0x%lx: status=0x%" PRIx64 "\n",
27 probe_data, read_mpidr_el1(), status);
28 ERROR(" exception reason=%u syndrome=0x%" PRIx64 "\n", data->ea_reason,
29 data->flags);
30
31 /* Clear error */
32 write_erxstatus_el1(status);
33
34 ret = sdei_dispatch_event(5000);
35 if (ret < 0) {
36 ERROR("Can't dispatch event to SDEI\n");
37 panic();
38 } else {
39 INFO("SDEI event dispatched\n");
40 }
41
42 return 0;
43}
44
45void plat_handle_uncontainable_ea(void)
46{
47 /* Do not change the string, CI expects it. Wait forever */
48 INFO("Injected Uncontainable Error\n");
49 while (true) {
50 wfe();
51 }
52}
53#endif
Jeenu Viswambharana490fe02018-06-08 08:44:36 +010054
55struct ras_interrupt fvp_ras_interrupts[] = {
56};
57
58struct err_record_info fvp_err_records[] = {
Manish Pandeyc25ab022023-04-24 14:58:55 +010059#ifdef PLATFORM_TEST_RAS_FFH
60 /* Record for injected fault */
61 ERR_RECORD_SYSREG_V1(0, 2, ras_err_ser_probe_sysreg,
62 injected_fault_handler, NULL),
63#endif
Jeenu Viswambharana490fe02018-06-08 08:44:36 +010064};
65
66REGISTER_ERR_RECORD_INFO(fvp_err_records);
67REGISTER_RAS_INTERRUPTS(fvp_ras_interrupts);