[PATCH 5/5] arm/xilinx-zynq: Initialize debug console once

Sebastian Huber sebastian.huber at embedded-brains.de
Wed May 24 13:05:50 UTC 2023


---
 bsps/arm/xilinx-zynq/console/debug-console.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bsps/arm/xilinx-zynq/console/debug-console.c b/bsps/arm/xilinx-zynq/console/debug-console.c
index 6e89ad0323..d398ca7988 100644
--- a/bsps/arm/xilinx-zynq/console/debug-console.c
+++ b/bsps/arm/xilinx-zynq/console/debug-console.c
@@ -50,11 +50,17 @@ static void zynq_debug_console_out(char c)
   zynq_uart_write_polled(base, 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);
   BSP_output_char = zynq_debug_console_out;
 }
-- 
2.35.3



More information about the devel mailing list