Bryan O'Donoghue | 937bd6f | 2018-05-24 19:32:52 +0100 | [diff] [blame] | 1 | /* |
Jun Nie | 8cfd4b5 | 2019-06-13 11:38:24 +0800 | [diff] [blame] | 2 | * Copyright (c) Linaro 2018-2019 Limited and Contributors. All rights reserved. |
Bryan O'Donoghue | 937bd6f | 2018-05-24 19:32:52 +0100 | [diff] [blame] | 3 | * |
| 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'Donoghue | 40c70ae | 2018-07-04 13:16:35 +0100 | [diff] [blame] | 11 | #include <imx_hab.h> |
Bryan O'Donoghue | 937bd6f | 2018-05-24 19:32:52 +0100 | [diff] [blame] | 12 | |
| 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 Diaz | 1eb64a1 | 2018-10-17 15:29:34 +0100 | [diff] [blame] | 17 | .globl plat_crash_console_flush |
Bryan O'Donoghue | 40c70ae | 2018-07-04 13:16:35 +0100 | [diff] [blame] | 18 | .globl plat_panic_handler |
Bryan O'Donoghue | 937bd6f | 2018-05-24 19:32:52 +0100 | [diff] [blame] | 19 | |
| 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 | */ |
| 28 | func platform_mem_init |
| 29 | bx lr |
| 30 | endfunc platform_mem_init |
| 31 | |
| 32 | func plat_get_my_entrypoint |
| 33 | mov r0, #0 |
| 34 | bx lr |
| 35 | endfunc plat_get_my_entrypoint |
| 36 | |
| 37 | func plat_crash_console_init |
Jun Nie | 8cfd4b5 | 2019-06-13 11:38:24 +0800 | [diff] [blame] | 38 | 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'Donoghue | 937bd6f | 2018-05-24 19:32:52 +0100 | [diff] [blame] | 41 | b imx_crash_uart_init |
| 42 | endfunc plat_crash_console_init |
| 43 | |
| 44 | func plat_crash_console_putc |
Jun Nie | 8cfd4b5 | 2019-06-13 11:38:24 +0800 | [diff] [blame] | 45 | mov_imm r1, PLAT_IMX7_BOOT_UART_BASE |
Bryan O'Donoghue | 937bd6f | 2018-05-24 19:32:52 +0100 | [diff] [blame] | 46 | b imx_crash_uart_putc |
| 47 | endfunc plat_crash_console_putc |
Bryan O'Donoghue | 40c70ae | 2018-07-04 13:16:35 +0100 | [diff] [blame] | 48 | |
Antonio Nino Diaz | 1eb64a1 | 2018-10-17 15:29:34 +0100 | [diff] [blame] | 49 | func plat_crash_console_flush |
| 50 | /* Placeholder */ |
| 51 | mov r0, #0 |
| 52 | bx lr |
| 53 | endfunc plat_crash_console_flush |
| 54 | |
Bryan O'Donoghue | 40c70ae | 2018-07-04 13:16:35 +0100 | [diff] [blame] | 55 | func plat_panic_handler |
| 56 | mov r3, #HAB_ROM_VECTOR_TABLE_FAILSAFE |
| 57 | ldr r3, [r3, #0] |
| 58 | blx r3 |
| 59 | endfunc plat_panic_handler |