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-19 09:55:35 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2024-04-04 12:53:53 +0200
commit53d092471f6c791724a89ac3c3a0c6f2b9df0979 (patch)
treef12f87dbcfb7566c928031dabe9ad7359d7570a8 /bsps/arm/xilinx-zynqmp/console/console-config.c
parentdev/serial: Add ZYNQ_UART_[01]_BASE_ADDR (diff)
downloadrtems-53d092471f6c791724a89ac3c3a0c6f2b9df0979.tar.bz2
dev/serial: Add Zynq UART kernel I/O support
Replace the BSP_CONSOLE_MINOR BSP option for the Xilinx Zynq BSPs with the new BSP option ZYNQ_UART_KERNEL_IO_BASE_ADDR. Move the kernel I/O support to a shared file.
Diffstat (limited to '')
-rw-r--r--bsps/arm/xilinx-zynqmp/console/console-config.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/bsps/arm/xilinx-zynqmp/console/console-config.c b/bsps/arm/xilinx-zynqmp/console/console-config.c
index b9fef02154..550e930415 100644
--- a/bsps/arm/xilinx-zynqmp/console/console-config.c
+++ b/bsps/arm/xilinx-zynqmp/console/console-config.c
@@ -32,7 +32,6 @@
#include <rtems/console.h>
#include <rtems/bspIo.h>
-#include <rtems/sysinit.h>
#include <rtems/termiostypes.h>
#include <bsp/irq.h>
@@ -64,6 +63,7 @@ rtems_status_code console_initialize(
rtems_termios_initialize();
for (i = 0; i < RTEMS_ARRAY_SIZE(zynqmp_uart_instances); ++i) {
+ zynq_uart_context *ctx = &zynqmp_uart_instances[i];
char uart[] = "/dev/ttySX";
uart[sizeof(uart) - 2] = (char) ('0' + i);
@@ -71,10 +71,10 @@ rtems_status_code console_initialize(
&uart[0],
&zynq_uart_handler,
NULL,
- &zynqmp_uart_instances[i].base
+ &ctx->base
);
- if (i == BSP_CONSOLE_MINOR) {
+ if (ctx->regs == (zynq_uart *) ZYNQ_UART_KERNEL_IO_BASE_ADDR) {
link(&uart[0], CONSOLE_DEVICE_NAME);
}
}
@@ -84,37 +84,5 @@ rtems_status_code console_initialize(
void zynqmp_debug_console_flush(void)
{
- zynq_uart_reset_tx_flush(zynqmp_uart_instances[BSP_CONSOLE_MINOR].regs);
+ zynq_uart_reset_tx_flush((zynq_uart *) ZYNQ_UART_KERNEL_IO_BASE_ADDR);
}
-
-static void zynqmp_debug_console_out(char c)
-{
- zynq_uart_write_char_polled(zynqmp_uart_instances[BSP_CONSOLE_MINOR].regs, c);
-}
-
-static void zynqmp_debug_console_init(void)
-{
- 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)
-{
- zynq_uart_initialize(zynqmp_uart_instances[BSP_CONSOLE_MINOR].regs);
- zynqmp_debug_console_out(c);
-}
-
-static int zynqmp_debug_console_in(void)
-{
- 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;
-
-BSP_polling_getchar_function_type BSP_poll_char = zynqmp_debug_console_in;
-
-RTEMS_SYSINIT_ITEM(
- zynqmp_debug_console_init,
- RTEMS_SYSINIT_BSP_START,
- RTEMS_SYSINIT_ORDER_LAST_BUT_5
-);