summaryrefslogtreecommitdiffstats
path: root/bsps/aarch64
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/aarch64
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 'bsps/aarch64')
-rw-r--r--bsps/aarch64/xilinx-zynqmp/console/console.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/bsps/aarch64/xilinx-zynqmp/console/console.c b/bsps/aarch64/xilinx-zynqmp/console/console.c
index 9ce0b1da63..1e5df997e8 100644
--- a/bsps/aarch64/xilinx-zynqmp/console/console.c
+++ b/bsps/aarch64/xilinx-zynqmp/console/console.c
@@ -45,6 +45,7 @@
#include <bsp/irq.h>
#include <dev/serial/zynq-uart.h>
+#include <dev/serial/zynq-uart-regs.h>
#include <bspopts.h>
#include <libfdt.h>
@@ -236,42 +237,30 @@ 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);
BSP_output_char = zynqmp_debug_console_out;
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;