mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
41f7be7334
The RISC-V SBI interface v0.1 provides a function for printing a character to the console. Even though SBI v0.1 functions are deprecated, the SBI console is quite useful for early debugging, because it works without any dcache, memory, or MMIO access in S mode. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
16 lines
259 B
C
16 lines
259 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
|
|
#include <debug_uart.h>
|
|
#include <asm/sbi.h>
|
|
|
|
static inline void _debug_uart_init(void)
|
|
{
|
|
}
|
|
|
|
static inline void _debug_uart_putc(int c)
|
|
{
|
|
if (CONFIG_IS_ENABLED(RISCV_SMODE))
|
|
sbi_console_putchar(c);
|
|
}
|
|
|
|
DEBUG_UART_FUNCS
|