mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-17 18:14:24 +00:00

Commite74afb652
(Deprecate weak crash console functions) deprecated the default inclusion of weak definitions for plat_crash_console functions in plat/common/aarch64/platform_helpers.S. The code was later copied out to plat/common/aarch64/crash_console_helpers.S so platforms can link it explicitly if they want to. However, since deprecation does not mean removal, the same code is also still duplicated in platform_helpers.S. The duplicated code contains both empty stubs for the !MULTI_CONSOLE_API case, and a real implementation that used to work but was broken by commitd35cc34
(Console: Use callee-saved registers) for MULTI_CONSOLE_API. It's not great to have both of these duplicated in two files, so this patch splits them up: in platform_helpers.S we'll only keep the empty stubs (guarded by !ERROR_DEPRECATED), which should not regress functionality since the MULTI_CONSOLE_API implementation was already broken anyway. In crash_console_helpers.S, we'll only keep the MULTI_CONSOLE_API version, which is enough both as an implementation in itself and as a sample for how to reimplement these functions in a platform-specific file. Change-Id: I83d95a90ab6aac597dc2ea2f2797ac2c8ed075d4 Signed-off-by: Julius Werner <jwerner@chromium.org>
144 lines
3.7 KiB
ArmAsm
144 lines
3.7 KiB
ArmAsm
/*
|
|
* Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <arch.h>
|
|
#include <asm_macros.S>
|
|
#include <console.h>
|
|
#include <platform_def.h>
|
|
|
|
.weak plat_report_exception
|
|
#if !ERROR_DEPRECATED
|
|
.weak plat_crash_console_init
|
|
.weak plat_crash_console_putc
|
|
.weak plat_crash_console_flush
|
|
#endif
|
|
.weak plat_reset_handler
|
|
.weak plat_disable_acp
|
|
.weak bl1_plat_prepare_exit
|
|
.weak plat_panic_handler
|
|
.weak bl31_plat_enable_mmu
|
|
.weak bl32_plat_enable_mmu
|
|
|
|
.weak plat_handle_uncontainable_ea
|
|
.weak plat_handle_double_fault
|
|
.weak plat_handle_el3_ea
|
|
|
|
.globl platform_get_core_pos
|
|
|
|
#define MPIDR_RES_BIT_MASK 0xff000000
|
|
|
|
/* -----------------------------------------------------
|
|
* Placeholder function which should be redefined by
|
|
* each platform.
|
|
* -----------------------------------------------------
|
|
*/
|
|
func plat_report_exception
|
|
ret
|
|
endfunc plat_report_exception
|
|
|
|
#if !ERROR_DEPRECATED
|
|
func plat_crash_console_init
|
|
mov x0, #0
|
|
ret
|
|
endfunc plat_crash_console_init
|
|
|
|
func plat_crash_console_putc
|
|
ret
|
|
endfunc plat_crash_console_putc
|
|
|
|
func plat_crash_console_flush
|
|
ret
|
|
endfunc plat_crash_console_flush
|
|
#endif /* ERROR_DEPRECATED */
|
|
|
|
/* -----------------------------------------------------
|
|
* Placeholder function which should be redefined by
|
|
* each platform. This function should preserve x19 - x29.
|
|
* -----------------------------------------------------
|
|
*/
|
|
func plat_reset_handler
|
|
ret
|
|
endfunc plat_reset_handler
|
|
|
|
/* -----------------------------------------------------
|
|
* Placeholder function which should be redefined by
|
|
* each platform. This function is allowed to use
|
|
* registers x0 - x17.
|
|
* -----------------------------------------------------
|
|
*/
|
|
func plat_disable_acp
|
|
ret
|
|
endfunc plat_disable_acp
|
|
|
|
/* -----------------------------------------------------
|
|
* void bl1_plat_prepare_exit(entry_point_info_t *ep_info);
|
|
* Called before exiting BL1. Default: do nothing
|
|
* -----------------------------------------------------
|
|
*/
|
|
func bl1_plat_prepare_exit
|
|
ret
|
|
endfunc bl1_plat_prepare_exit
|
|
|
|
/* -----------------------------------------------------
|
|
* void plat_panic_handler(void) __dead2;
|
|
* Endless loop by default.
|
|
* -----------------------------------------------------
|
|
*/
|
|
func plat_panic_handler
|
|
wfi
|
|
b plat_panic_handler
|
|
endfunc plat_panic_handler
|
|
|
|
/* -----------------------------------------------------
|
|
* void bl31_plat_enable_mmu(uint32_t flags);
|
|
*
|
|
* Enable MMU in BL31.
|
|
* -----------------------------------------------------
|
|
*/
|
|
func bl31_plat_enable_mmu
|
|
b enable_mmu_direct_el3
|
|
endfunc bl31_plat_enable_mmu
|
|
|
|
/* -----------------------------------------------------
|
|
* void bl32_plat_enable_mmu(uint32_t flags);
|
|
*
|
|
* Enable MMU in BL32.
|
|
* -----------------------------------------------------
|
|
*/
|
|
func bl32_plat_enable_mmu
|
|
b enable_mmu_direct_el1
|
|
endfunc bl32_plat_enable_mmu
|
|
|
|
|
|
/* -----------------------------------------------------
|
|
* Platform handler for Uncontainable External Abort.
|
|
*
|
|
* x0: EA reason
|
|
* x1: EA syndrome
|
|
* -----------------------------------------------------
|
|
*/
|
|
func plat_handle_uncontainable_ea
|
|
b report_unhandled_exception
|
|
endfunc plat_handle_uncontainable_ea
|
|
|
|
/* -----------------------------------------------------
|
|
* Platform handler for Double Fault.
|
|
*
|
|
* x0: EA reason
|
|
* x1: EA syndrome
|
|
* -----------------------------------------------------
|
|
*/
|
|
func plat_handle_double_fault
|
|
b report_unhandled_exception
|
|
endfunc plat_handle_double_fault
|
|
|
|
/* -----------------------------------------------------
|
|
* Platform handler for EL3 External Abort.
|
|
* -----------------------------------------------------
|
|
*/
|
|
func plat_handle_el3_ea
|
|
b report_unhandled_exception
|
|
endfunc plat_handle_el3_ea
|