Fathi Boudra | 422bf77 | 2019-12-02 11:10:16 +0200 | [diff] [blame^] | 1 | --- a/plat/arm/board/fvp/aarch64/fvp_ras.c |
| 2 | +++ b/plat/arm/board/fvp/aarch64/fvp_ras.c |
| 3 | @@ -5,11 +5,46 @@ |
| 4 | */ |
| 5 | |
| 6 | #include <lib/extensions/ras.h> |
| 7 | +#include <services/sdei.h> |
| 8 | + |
| 9 | +static int injected_fault_handler(const struct err_record_info *info, |
| 10 | + int probe_data, const struct err_handler_data *const data) |
| 11 | +{ |
| 12 | + uint64_t status; |
| 13 | + int ret __unused; |
| 14 | + |
| 15 | + /* |
| 16 | + * The faulting error record is already selected by the SER probe |
| 17 | + * function. |
| 18 | + */ |
| 19 | + status = read_erxstatus_el1(); |
| 20 | + |
| 21 | + ERROR("Fault reported by system error record %d on 0x%lx: status=0x%llx\n", |
| 22 | + probe_data, read_mpidr_el1(), status); |
| 23 | + ERROR(" exception reason=%u syndrome=0x%llx\n", data->ea_reason, |
| 24 | + data->flags); |
| 25 | + |
| 26 | + /* Clear error */ |
| 27 | + write_erxstatus_el1(status); |
| 28 | + |
| 29 | + ret = sdei_dispatch_event(5000); |
| 30 | + if (ret < 0) { |
| 31 | + ERROR("Can't dispatch event to SDEI\n"); |
| 32 | + panic(); |
| 33 | + } else { |
| 34 | + INFO("SDEI event dispatched\n"); |
| 35 | + } |
| 36 | + |
| 37 | + return 0; |
| 38 | +} |
| 39 | |
| 40 | struct ras_interrupt fvp_ras_interrupts[] = { |
| 41 | }; |
| 42 | |
| 43 | struct err_record_info fvp_err_records[] = { |
| 44 | + /* Record for injected fault */ |
| 45 | + ERR_RECORD_SYSREG_V1(0, 2, ras_err_ser_probe_sysreg, |
| 46 | + injected_fault_handler, NULL), |
| 47 | }; |
| 48 | |
| 49 | REGISTER_ERR_RECORD_INFO(fvp_err_records); |