xref: /rk3399_ARM-atf/drivers/st/uart/aarch32/stm32_console.S (revision 4353bb20cc8937a5d540a06c4a8fe7ee880fc3ca)
1/*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6#include <asm_macros.S>
7
8	.globl	console_core_init
9	.globl	console_core_putc
10	.globl	console_core_getc
11	.globl	console_core_flush
12
13	/* -----------------------------------------------------------------
14	 * int console_core_init(uintptr_t base_addr,
15	 *			 unsigned int uart_clk,
16	 *			 unsigned int baud_rate)
17	 *
18	 * Function to initialize the console without a C Runtime to print
19	 * debug information. This function will be accessed by console_init
20	 * and crash reporting.
21	 *
22	 * In: r0 - console base address
23	 *     r1 - Uart clock in Hz
24	 *     r2 - Baud rate
25	 * Out: return 1 on success else 0 on error
26	 * Clobber list : r1, r2, r3
27	 * -----------------------------------------------------------------
28	 */
29func console_core_init
30	bx	lr
31endfunc console_core_init
32
33	/* ---------------------------------------------------------------
34	 * int console_core_putc(int c, uintptr_t base_addr)
35	 *
36	 * Function to output a character over the console. It returns the
37	 * character printed on success or -1 on error.
38	 *
39	 * In : r0 - character to be printed
40	 *      r1 - console base address
41	 * Out : return -1 on error else return character.
42	 * Clobber list : r2
43	 * ---------------------------------------------------------------
44	 */
45func console_core_putc
46	bx	lr
47endfunc console_core_putc
48
49	/* -----------------------------------------------------------
50	 * int console_core_getc(uintptr_t base_addr)
51	 *
52	 * Function to get a character from the console.
53	 * It returns the character grabbed on success or -1 on error.
54	 *
55	 * In : r0 - console base address
56	 * Out : return -1.
57	 * Clobber list : r0, r1
58	 * -----------------------------------------------------------
59	 */
60func console_core_getc
61	/* Not supported */
62	mov	r0, #-1
63	bx	lr
64endfunc console_core_getc
65
66	/* ---------------------------------------------------------------
67	 * int console_core_flush(uintptr_t base_addr)
68	 *
69	 * Function to force a write of all buffered data that hasn't been
70	 * output.
71	 *
72	 * In : r0 - console base address
73	 * Out : return -1 on error else return 0.
74	 * Clobber list : r0, r1
75	 * ---------------------------------------------------------------
76	 */
77func console_core_flush
78	bx	lr
79endfunc console_core_flush
80