fix(xilinx): runtime console to handle dt failure
If the Device Tree is missing or parsing fails in the runtime
console, the console still gets registered with zeroed DT values,
leading to a panic due to the absence of a console type.
Added fallback option and check for zero base address.
Change-Id: I5f5e0222685ba015ab7db2ecbd46d906f5ab9116
Signed-off-by: Maheedhar Bollapalli <maheedharsai.bollapalli@amd.com>
diff --git a/plat/xilinx/common/plat_console.c b/plat/xilinx/common/plat_console.c
index 2d478cd..617a345 100644
--- a/plat/xilinx/common/plat_console.c
+++ b/plat/xilinx/common/plat_console.c
@@ -274,14 +274,16 @@
INFO("BL31: Early console setup\n");
#ifdef CONSOLE_RUNTIME
-#if (RT_CONSOLE_IS(dtb) && (XLNX_DT_CFG == 1))
- rt_hd_console.base = dt_uart_info.base;
- rt_hd_console.baud_rate = dt_uart_info.baud_rate;
- rt_hd_console.console_type = dt_uart_info.console_type;
-#else
rt_hd_console.base = (uintptr_t)RT_UART_BASE;
rt_hd_console.baud_rate = (uint32_t)UART_BAUDRATE;
rt_hd_console.console_type = RT_UART_TYPE;
+
+#if (RT_CONSOLE_IS(dtb) && (XLNX_DT_CFG == 1))
+ if (dt_uart_info.base != 0U) {
+ rt_hd_console.base = dt_uart_info.base;
+ rt_hd_console.baud_rate = dt_uart_info.baud_rate;
+ rt_hd_console.console_type = dt_uart_info.console_type;
+ }
#endif
if ((rt_hd_console.console_type == boot_hd_console.console_type) &&