u-boot/drivers/serial/serial_sbi.c
Samuel Holland 41f7be7334 serial: Add a debug console using the RISC-V SBI interface
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>
2021-10-07 16:08:23 +08:00

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