Jorge Ramirez-Ortiz | f1751c0 | 2018-09-23 09:41:00 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, Renesas Electronics Corporation. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <arch.h> |
| 8 | #include <asm_macros.S> |
| 9 | |
| 10 | .globl console_init |
| 11 | .globl console_putc |
| 12 | .globl console_uninit |
| 13 | .globl console_core_init |
| 14 | .globl console_core_putc |
| 15 | .globl console_core_getc |
| 16 | .globl console_flush |
| 17 | |
| 18 | .extern rcar_log_init |
| 19 | .extern rcar_set_log_data |
| 20 | |
| 21 | /* ----------------------------------------------- |
| 22 | * int console_core_init(unsigned long base_addr, |
| 23 | * unsigned int uart_clk, unsigned int baud_rate) |
| 24 | * Function to initialize the log area. This |
| 25 | * function will be accessed by console_init and |
| 26 | * crash reporting. |
| 27 | * Return 1 on SUCCESS, 0 on error |
| 28 | * In: x0 - Not used |
| 29 | * w1 - Not used |
| 30 | * w2 - Not used |
| 31 | * ----------------------------------------------- |
| 32 | */ |
| 33 | func console_core_init |
| 34 | b rcar_log_init |
| 35 | endfunc console_core_init |
| 36 | func console_init |
| 37 | b console_core_init |
| 38 | endfunc console_init |
| 39 | |
| 40 | /* -------------------------------------------------------- |
| 41 | * int console_core_putc(int c, unsigned long base_addr) |
| 42 | * Function to output a character over the log area. |
| 43 | * Return 1 on SUCCESS, 0 on error |
| 44 | * In : w0 - Not used |
| 45 | * x1 - Not used |
| 46 | * -------------------------------------------------------- |
| 47 | */ |
| 48 | func console_core_putc |
| 49 | b rcar_set_log_data |
| 50 | endfunc console_core_putc |
| 51 | func console_putc |
| 52 | b console_core_putc |
| 53 | endfunc console_putc |
| 54 | |
| 55 | /* --------------------------------------------- |
| 56 | * int console_core_getc(unsigned long base_addr) |
| 57 | * Function to get a character from the console. |
| 58 | * It returns the character grabbed on success |
| 59 | * or -1 on error. |
| 60 | * In : x0 - console base address |
| 61 | * Clobber list : x0, x1 |
| 62 | * --------------------------------------------- |
| 63 | */ |
| 64 | func console_core_getc |
| 65 | ret |
| 66 | endfunc console_core_getc |
| 67 | |
| 68 | /* ----------------------------------------------- |
| 69 | * void console_uninit(void) |
| 70 | * Function to finish the use of console driver. |
| 71 | * ----------------------------------------------- |
| 72 | */ |
| 73 | func console_uninit |
| 74 | ret |
| 75 | endfunc console_uninit |
| 76 | |
| 77 | /* --------------------------------------------- |
| 78 | * int console_flush(void) |
| 79 | * Function to force a write of all buffered |
| 80 | * data that hasn't been output. It returns 0 |
| 81 | * upon successful completion, otherwise it |
| 82 | * returns -1. |
| 83 | * Clobber list : x0, x1 |
| 84 | * --------------------------------------------- |
| 85 | */ |
| 86 | func console_flush |
| 87 | mov w0, #0 |
| 88 | ret |
| 89 | endfunc console_flush |