Home | History | Annotate | Download | only in aarch64
      1 /*
      2  * Copyright (c) 2013-2017, 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 <platform_def.h>
     10 
     11 	.weak	plat_report_exception
     12 	.weak	plat_crash_console_init
     13 	.weak	plat_crash_console_putc
     14 	.weak	plat_crash_console_flush
     15 	.weak	plat_reset_handler
     16 	.weak	plat_disable_acp
     17 	.weak	bl1_plat_prepare_exit
     18 	.weak	plat_error_handler
     19 	.weak	plat_panic_handler
     20 	.weak	bl2_plat_preload_setup
     21 	.weak	plat_try_next_boot_source
     22 
     23 #if !ENABLE_PLAT_COMPAT
     24 	.globl	platform_get_core_pos
     25 
     26 #define MPIDR_RES_BIT_MASK	0xff000000
     27 
     28 	/* ------------------------------------------------------------------
     29 	 *  int platform_get_core_pos(int mpidr)
     30 	 *  Returns the CPU index of the CPU specified by mpidr. This is
     31 	 *  defined when platform compatibility is disabled to enable Trusted
     32 	 *  Firmware components like SPD using the old  platform API to work.
     33 	 *  This API is deprecated and it assumes that the mpidr specified is
     34 	 *  that of a valid and present CPU. Instead, plat_my_core_pos()
     35 	 *  should be used for CPU index of the current CPU and
     36 	 *  plat_core_pos_by_mpidr() should be used for CPU index of a
     37 	 *  CPU specified by its mpidr.
     38 	 * ------------------------------------------------------------------
     39 	 */
     40 func_deprecated platform_get_core_pos
     41 	bic	x0, x0, #MPIDR_RES_BIT_MASK
     42 	mrs	x1, mpidr_el1
     43 	bic	x1, x1, #MPIDR_RES_BIT_MASK
     44 	cmp	x0, x1
     45 	beq	plat_my_core_pos
     46 	b	platform_core_pos_helper
     47 endfunc_deprecated platform_get_core_pos
     48 #endif
     49 
     50 	/* -----------------------------------------------------
     51 	 * Placeholder function which should be redefined by
     52 	 * each platform.
     53 	 * -----------------------------------------------------
     54 	 */
     55 func plat_report_exception
     56 	ret
     57 endfunc plat_report_exception
     58 
     59 	/* -----------------------------------------------------
     60 	 * Placeholder function which should be redefined by
     61 	 * each platform.
     62 	 * -----------------------------------------------------
     63 	 */
     64 func plat_crash_console_init
     65 	mov	x0, #0
     66 	ret
     67 endfunc plat_crash_console_init
     68 
     69 	/* -----------------------------------------------------
     70 	 * Placeholder function which should be redefined by
     71 	 * each platform.
     72 	 * -----------------------------------------------------
     73 	 */
     74 func plat_crash_console_putc
     75 	ret
     76 endfunc plat_crash_console_putc
     77 
     78 	/* -----------------------------------------------------
     79 	 * Placeholder function which should be redefined by
     80 	 * each platform.
     81 	 * -----------------------------------------------------
     82 	 */
     83 func plat_crash_console_flush
     84 	ret
     85 endfunc plat_crash_console_flush
     86 
     87 	/* -----------------------------------------------------
     88 	 * Placeholder function which should be redefined by
     89 	 * each platform. This function should preserve x19 - x29.
     90 	 * -----------------------------------------------------
     91 	 */
     92 func plat_reset_handler
     93 	ret
     94 endfunc plat_reset_handler
     95 
     96 	/* -----------------------------------------------------
     97 	 * Placeholder function which should be redefined by
     98 	 * each platform. This function is allowed to use
     99 	 * registers x0 - x17.
    100 	 * -----------------------------------------------------
    101 	 */
    102 func plat_disable_acp
    103 	ret
    104 endfunc plat_disable_acp
    105 
    106 	/* -----------------------------------------------------
    107 	 * void bl1_plat_prepare_exit(entry_point_info_t *ep_info);
    108 	 * Called before exiting BL1. Default: do nothing
    109 	 * -----------------------------------------------------
    110 	 */
    111 func bl1_plat_prepare_exit
    112 	ret
    113 endfunc bl1_plat_prepare_exit
    114 
    115 	/* -----------------------------------------------------
    116 	 * void plat_error_handler(int err) __dead2;
    117 	 * Endless loop by default.
    118 	 * -----------------------------------------------------
    119 	 */
    120 func plat_error_handler
    121 	wfi
    122 	b	plat_error_handler
    123 endfunc plat_error_handler
    124 
    125 	/* -----------------------------------------------------
    126 	 * void plat_panic_handler(void) __dead2;
    127 	 * Endless loop by default.
    128 	 * -----------------------------------------------------
    129 	 */
    130 func plat_panic_handler
    131 	wfi
    132 	b	plat_panic_handler
    133 endfunc plat_panic_handler
    134 
    135 	/* -----------------------------------------------------
    136 	 * Placeholder function which should be redefined by
    137 	 * each platfrom.
    138 	 * -----------------------------------------------------
    139 	 */
    140 func bl2_plat_preload_setup
    141 	ret
    142 endfunc bl2_plat_preload_setup
    143 
    144 	/* -----------------------------------------------------
    145 	 * Placeholder function which should be redefined by
    146 	 * each platfrom.
    147 	 * -----------------------------------------------------
    148 	 */
    149 func plat_try_next_boot_source
    150 	mov	x0, #0
    151 	ret
    152 endfunc plat_try_next_boot_source
    153