mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 23:41:23 +01:00
lib: sbi: Simplify console platform operations
Instead of having console_putc() and console_getc() callbacks in platform operations, it will be much simpler for console driver to directly register these operations as device to the sbi_console implementation. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Xiang W <wxjstz@126.com>
This commit is contained in:
@@ -63,23 +63,6 @@ static int platform_console_init(void)
|
||||
PLATFORM_UART_BAUDRATE, 0, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Write a character to the platform console output.
|
||||
*/
|
||||
static void platform_console_putc(char ch)
|
||||
{
|
||||
/* Example if the generic UART8250 driver is used */
|
||||
uart8250_putc(ch);
|
||||
}
|
||||
|
||||
/*
|
||||
* Read a character from the platform console input.
|
||||
*/
|
||||
static int platform_console_getc(void)
|
||||
{
|
||||
return uart8250_getc();
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the platform interrupt controller for current HART.
|
||||
*/
|
||||
@@ -198,8 +181,6 @@ static void platform_system_reset(u32 type, u32 reason)
|
||||
const struct sbi_platform_operations platform_ops = {
|
||||
.early_init = platform_early_init,
|
||||
.final_init = platform_final_init,
|
||||
.console_putc = platform_console_putc,
|
||||
.console_getc = platform_console_getc,
|
||||
.console_init = platform_console_init,
|
||||
.irqchip_init = platform_irqchip_init,
|
||||
.ipi_send = platform_ipi_send,
|
||||
|
Reference in New Issue
Block a user