summaryrefslogtreecommitdiffstats
path: root/bsps/arm/xilinx-zynqmp/console/console-config.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2024-03-18 14:47:59 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2024-03-27 20:22:53 +0100
commit4c2da2c3435ddeaa394b2351aa441c3bb1f3a7c9 (patch)
tree6b5a61acf3ad95c28fc6435c84845e6d8b7118c8 /bsps/arm/xilinx-zynqmp/console/console-config.c
parentbsps: Move declarations to <bsp/irq-generic.h> (diff)
downloadrtems-4c2da2c3435ddeaa394b2351aa441c3bb1f3a7c9.tar.bz2
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.
Diffstat (limited to '')
-rw-r--r--bsps/arm/xilinx-zynqmp/console/console-config.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/bsps/arm/xilinx-zynqmp/console/console-config.c b/bsps/arm/xilinx-zynqmp/console/console-config.c
index eadd7f11a2..ea148836a5 100644
--- a/bsps/arm/xilinx-zynqmp/console/console-config.c
+++ b/bsps/arm/xilinx-zynqmp/console/console-config.c
@@ -37,6 +37,7 @@
#include <bsp/irq.h>
#include <dev/serial/zynq-uart.h>
+#include <dev/serial/zynq-uart-regs.h>
#include <bspopts.h>
@@ -83,41 +84,29 @@ rtems_status_code console_initialize(
void zynqmp_debug_console_flush(void)
{
- zynq_uart_reset_tx_flush(&zynqmp_uart_instances[BSP_CONSOLE_MINOR]);
+ zynq_uart_reset_tx_flush(zynqmp_uart_instances[BSP_CONSOLE_MINOR].regs);
}
static void zynqmp_debug_console_out(char c)
{
- rtems_termios_device_context *base =
- &zynqmp_uart_instances[BSP_CONSOLE_MINOR].base;
-
- zynq_uart_write_polled(base, c);
+ zynq_uart_write_char_polled(zynqmp_uart_instances[BSP_CONSOLE_MINOR].regs, c);
}
static void zynqmp_debug_console_init(void)
{
- rtems_termios_device_context *base =
- &zynqmp_uart_instances[BSP_CONSOLE_MINOR].base;
-
- zynq_uart_initialize(base);
+ zynq_uart_initialize(zynqmp_uart_instances[BSP_CONSOLE_MINOR].regs);
BSP_output_char = zynqmp_debug_console_out;
}
static void zynqmp_debug_console_early_init(char c)
{
- rtems_termios_device_context *base =
- &zynqmp_uart_instances[BSP_CONSOLE_MINOR].base;
-
- zynq_uart_initialize(base);
+ zynq_uart_initialize(zynqmp_uart_instances[BSP_CONSOLE_MINOR].regs);
zynqmp_debug_console_out(c);
}
static int zynqmp_debug_console_in(void)
{
- rtems_termios_device_context *base =
- &zynqmp_uart_instances[BSP_CONSOLE_MINOR].base;
-
- return zynq_uart_read_polled(base);
+ return zynq_uart_read_char_polled(zynqmp_uart_instances[BSP_CONSOLE_MINOR].regs);
}
BSP_output_char_function_type BSP_output_char = zynqmp_debug_console_early_init;