dev/serial: Simplify some Zynq UART functions

Make the initialization and polled functions independent of the Termios
context.  This helps to implement the kernel I/O support without a dependency
on the Termios framework.
This commit is contained in:
Sebastian Huber
2024-03-18 14:47:59 +01:00
parent 5b0e355ed7
commit 4c2da2c343
8 changed files with 62 additions and 111 deletions

View File

@@ -44,24 +44,18 @@
static void zynq_debug_console_out(char c)
{
rtems_termios_device_context *base =
&zynq_uart_instances[BSP_CONSOLE_MINOR].base;
zynq_uart_write_polled(base, c);
zynq_uart_write_char_polled(zynq_uart_instances[BSP_CONSOLE_MINOR].regs, c);
}
static void zynq_debug_console_early_init(char c);
static void zynq_debug_console_init(void)
{
rtems_termios_device_context *base =
&zynq_uart_instances[BSP_CONSOLE_MINOR].base;
if (BSP_output_char != zynq_debug_console_early_init) {
return;
}
zynq_uart_initialize(base);
zynq_uart_initialize(zynq_uart_instances[BSP_CONSOLE_MINOR].regs);
BSP_output_char = zynq_debug_console_out;
}
@@ -73,10 +67,7 @@ static void zynq_debug_console_early_init(char c)
static int zynq_debug_console_in(void)
{
rtems_termios_device_context *base =
&zynq_uart_instances[BSP_CONSOLE_MINOR].base;
return zynq_uart_read_polled(base);
return zynq_uart_read_char_polled(zynq_uart_instances[BSP_CONSOLE_MINOR].regs);
}
BSP_output_char_function_type BSP_output_char = zynq_debug_console_early_init;