2 * Copyright (c) 2014-2018, ARM Limited and Contributors. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
9 #include <arch_helpers.h>
10 #include <drivers/console.h>
12 #include <lib/extensions/ras.h>
14 #include <lib/xlat_tables/xlat_mmu_helpers.h>
15 #include <plat/common/platform.h>
18 * The following platform setup functions are weakly defined. They
19 * provide typical implementations that may be re-used by multiple
20 * platforms but may also be overridden by a platform if required.
22 #pragma weak bl31_plat_runtime_setup
25 #pragma weak plat_sdei_handle_masked_trigger
26 #pragma weak plat_sdei_validate_entry_point
29 #pragma weak plat_ea_handler
31 void bl31_plat_runtime_setup(void)
34 console_switch_state(CONSOLE_FLAG_RUNTIME
);
41 * Helper function for platform_get_pos() when platform compatibility is
42 * disabled. This is to enable SPDs using the older platform API to continue
45 unsigned int platform_core_pos_helper(unsigned long mpidr
)
47 int idx
= plat_core_pos_by_mpidr(mpidr
);
54 * Function that handles spurious SDEI interrupts while events are masked.
56 void plat_sdei_handle_masked_trigger(uint64_t mpidr
, unsigned int intr
)
58 WARN("Spurious SDEI interrupt %u on masked PE %llx\n", intr
, mpidr
);
62 * Default Function to validate SDEI entry point, which returns success.
63 * Platforms may override this with their own validation mechanism.
65 int plat_sdei_validate_entry_point(uintptr_t ep
, unsigned int client_mode
)
71 /* RAS functions common to AArch64 ARM platforms */
72 void plat_ea_handler(unsigned int ea_reason
, uint64_t syndrome
, void *cookie
,
73 void *handle
, uint64_t flags
)
76 /* Call RAS EA handler */
77 int handled
= ras_ea_handler(ea_reason
, syndrome
, cookie
, handle
, flags
);
82 ERROR("Unhandled External Abort received on 0x%lx at EL3!\n",
84 ERROR(" exception reason=%u syndrome=0x%llx\n", ea_reason
, syndrome
);