diff options
author | Ying-Chun Liu (PaulLiu) <paulliu@debian.org> | 2019-02-12 18:33:04 +0800 |
---|---|---|
committer | Ying-Chun Liu (PaulLiu) <paulliu@debian.org> | 2019-02-12 18:56:29 +0800 |
commit | 70086dc466d980248dfb6416fa6c2adae5aafe8a (patch) | |
tree | e69c4d75063e77a9dce20c3b819e0d8c192ae374 /plat/imx/common | |
parent | 873e394b3bf93214a441f9f98237b58fbbea55aa (diff) |
imx: warp7: Migrate to MULTI_CONSOLE_API
This commit migrates to MULTI_CONSOLE_API for IMX Warp7 board.
We also rename the functions in imx_uart driver to more specific one.
Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Diffstat (limited to 'plat/imx/common')
-rw-r--r-- | plat/imx/common/aarch32/imx_uart_console.S | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/plat/imx/common/aarch32/imx_uart_console.S b/plat/imx/common/aarch32/imx_uart_console.S new file mode 100644 index 00000000..e526d9cb --- /dev/null +++ b/plat/imx/common/aarch32/imx_uart_console.S @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <arch.h> +#include <asm_macros.S> +#define USE_FINISH_CONSOLE_REG_2 +#include <console_macros.S> +#include <assert_macros.S> +#include "imx_uart.h" + + .globl console_imx_uart_register + .globl console_imx_uart_putc + .globl console_imx_uart_getc + .globl console_imx_uart_flush + +func console_imx_uart_register + push {r4, lr} + mov r4, r3 + cmp r4, #0 + beq register_fail + str r0, [r4, #CONSOLE_T_DRVDATA] + + bl console_imx_uart_core_init + cmp r0, #0 + bne register_fail + + mov r0, r4 + pop {r4, lr} + finish_console_register imx_uart putc=1, getc=1, flush=1 + +register_fail: + pop {r4, pc} +endfunc console_imx_uart_register + +func console_imx_uart_putc + ldr r1, [r1, #CONSOLE_T_DRVDATA] + b console_imx_uart_core_putc +endfunc console_imx_uart_putc + +func console_imx_uart_getc + ldr r0, [r0, #CONSOLE_T_DRVDATA] + b console_imx_uart_core_getc +endfunc console_imx_uart_getc + +func console_imx_uart_flush + ldr r0, [r0, #CONSOLE_T_DRVDATA] + b console_imx_uart_core_flush +endfunc console_imx_uart_flush |