1/* 2 * Copyright (c) 2013-2019, ARM Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7#include <arch.h> 8#include <asm_macros.S> 9#include <drivers/console.h> 10#include <platform_def.h> 11 12 .weak plat_report_exception 13 .weak plat_reset_handler 14 .weak plat_disable_acp 15 .weak bl1_plat_prepare_exit 16 .weak plat_panic_handler 17 .weak bl31_plat_enable_mmu 18 .weak bl32_plat_enable_mmu 19 20 .weak plat_handle_uncontainable_ea 21 .weak plat_handle_double_fault 22 .weak plat_handle_el3_ea 23 24#define MPIDR_RES_BIT_MASK 0xff000000 25 26 /* ----------------------------------------------------- 27 * Placeholder function which should be redefined by 28 * each platform. 29 * ----------------------------------------------------- 30 */ 31func plat_report_exception 32 ret 33endfunc plat_report_exception 34 35 /* ----------------------------------------------------- 36 * Placeholder function which should be redefined by 37 * each platform. This function should preserve x19 - x29. 38 * ----------------------------------------------------- 39 */ 40func plat_reset_handler 41 ret 42endfunc plat_reset_handler 43 44 /* ----------------------------------------------------- 45 * Placeholder function which should be redefined by 46 * each platform. This function is allowed to use 47 * registers x0 - x17. 48 * ----------------------------------------------------- 49 */ 50func plat_disable_acp 51 ret 52endfunc plat_disable_acp 53 54 /* ----------------------------------------------------- 55 * void bl1_plat_prepare_exit(entry_point_info_t *ep_info); 56 * Called before exiting BL1. Default: do nothing 57 * ----------------------------------------------------- 58 */ 59func bl1_plat_prepare_exit 60 ret 61endfunc bl1_plat_prepare_exit 62 63 /* ----------------------------------------------------- 64 * void plat_panic_handler(void) __dead2; 65 * Endless loop by default. 66 * ----------------------------------------------------- 67 */ 68func plat_panic_handler 69 wfi 70 b plat_panic_handler 71endfunc plat_panic_handler 72 73 /* ----------------------------------------------------- 74 * void bl31_plat_enable_mmu(uint32_t flags); 75 * 76 * Enable MMU in BL31. 77 * ----------------------------------------------------- 78 */ 79func bl31_plat_enable_mmu 80 b enable_mmu_direct_el3 81endfunc bl31_plat_enable_mmu 82 83 /* ----------------------------------------------------- 84 * void bl32_plat_enable_mmu(uint32_t flags); 85 * 86 * Enable MMU in BL32. 87 * ----------------------------------------------------- 88 */ 89func bl32_plat_enable_mmu 90 b enable_mmu_direct_el1 91endfunc bl32_plat_enable_mmu 92 93 94 /* ----------------------------------------------------- 95 * Platform handler for Uncontainable External Abort. 96 * 97 * x0: EA reason 98 * x1: EA syndrome 99 * ----------------------------------------------------- 100 */ 101func plat_handle_uncontainable_ea 102 b report_unhandled_exception 103endfunc plat_handle_uncontainable_ea 104 105 /* ----------------------------------------------------- 106 * Platform handler for Double Fault. 107 * 108 * x0: EA reason 109 * x1: EA syndrome 110 * ----------------------------------------------------- 111 */ 112func plat_handle_double_fault 113 b report_unhandled_exception 114endfunc plat_handle_double_fault 115 116 /* ----------------------------------------------------- 117 * Platform handler for EL3 External Abort. 118 * ----------------------------------------------------- 119 */ 120func plat_handle_el3_ea 121 b report_unhandled_exception 122endfunc plat_handle_el3_ea 123