imx_uart_console.S 1.04 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * Copyright (c) 2018-2019, ARM Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <arch.h>
#include <asm_macros.S>
#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
23
	str	r0, [r4, #CONSOLE_T_BASE]
24
25
26
27
28
29
30
31
32
33
34
35
36
37

	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
38
	ldr	r1, [r1, #CONSOLE_T_BASE]
39
40
41
42
	b console_imx_uart_core_putc
endfunc console_imx_uart_putc

func console_imx_uart_getc
43
	ldr	r0, [r0, #CONSOLE_T_BASE]
44
45
46
47
	b console_imx_uart_core_getc
endfunc console_imx_uart_getc

func console_imx_uart_flush
48
	ldr	r0, [r0, #CONSOLE_T_BASE]
49
50
	b console_imx_uart_core_flush
endfunc console_imx_uart_flush