blob: 661fd29a2d5736b869dded26d5db7aceea834072 [file] [log] [blame]
Bryan O'Donoghue937bd6f2018-05-24 19:32:52 +01001/*
Jun Nie8cfd4b52019-06-13 11:38:24 +08002 * Copyright (c) Linaro 2018-2019 Limited and Contributors. All rights reserved.
Bryan O'Donoghue937bd6f2018-05-24 19:32:52 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arch.h>
8#include <asm_macros.S>
9#include <assert_macros.S>
10#include <platform_def.h>
Bryan O'Donoghue40c70ae2018-07-04 13:16:35 +010011#include <imx_hab.h>
Bryan O'Donoghue937bd6f2018-05-24 19:32:52 +010012
13 .globl platform_mem_init
14 .globl plat_get_my_entrypoint
15 .globl plat_crash_console_init
16 .globl plat_crash_console_putc
Antonio Nino Diaz1eb64a12018-10-17 15:29:34 +010017 .globl plat_crash_console_flush
Bryan O'Donoghue40c70ae2018-07-04 13:16:35 +010018 .globl plat_panic_handler
Bryan O'Donoghue937bd6f2018-05-24 19:32:52 +010019
20 /* ---------------------------------------------
21 * int plat_mem_init(void)
22 * Function to initialize memory.
23 * The HAB hands off the DDR controller already
24 * setup and ready to use.
25 * Implement the mandatory function as a NOP
26 * ---------------------------------------------
27 */
28func platform_mem_init
29 bx lr
30endfunc platform_mem_init
31
32func plat_get_my_entrypoint
33 mov r0, #0
34 bx lr
35endfunc plat_get_my_entrypoint
36
37func plat_crash_console_init
Jun Nie8cfd4b52019-06-13 11:38:24 +080038 mov_imm r0, PLAT_IMX7_BOOT_UART_BASE
39 mov_imm r1, PLAT_IMX7_BOOT_UART_CLK_IN_HZ
40 mov_imm r2, PLAT_IMX7_CONSOLE_BAUDRATE
Bryan O'Donoghue937bd6f2018-05-24 19:32:52 +010041 b imx_crash_uart_init
42endfunc plat_crash_console_init
43
44func plat_crash_console_putc
Jun Nie8cfd4b52019-06-13 11:38:24 +080045 mov_imm r1, PLAT_IMX7_BOOT_UART_BASE
Bryan O'Donoghue937bd6f2018-05-24 19:32:52 +010046 b imx_crash_uart_putc
47endfunc plat_crash_console_putc
Bryan O'Donoghue40c70ae2018-07-04 13:16:35 +010048
Antonio Nino Diaz1eb64a12018-10-17 15:29:34 +010049func plat_crash_console_flush
50 /* Placeholder */
51 mov r0, #0
52 bx lr
53endfunc plat_crash_console_flush
54
Bryan O'Donoghue40c70ae2018-07-04 13:16:35 +010055func plat_panic_handler
56 mov r3, #HAB_ROM_VECTOR_TABLE_FAILSAFE
57 ldr r3, [r3, #0]
58 blx r3
59endfunc plat_panic_handler