imx: fix partition reboot fail when debug console is enabled

With partition reboot enabled, console_list variable which is
located in data section is NOT reset, system will be busy looping
in early console operation of flush_loop() if console_list is
NOT 0 while HW console is NOT initialized, so we have to clear
this variable to make partition reboot work.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
(cherry picked from commit 8328fcf83527b2258c1a1b290efa737be7a63171)
diff --git a/plat/imx/imx8qm/imx8qm_bl31_setup.c b/plat/imx/imx8qm/imx8qm_bl31_setup.c
index 4bc8c78..0b1ba3d 100644
--- a/plat/imx/imx8qm/imx8qm_bl31_setup.c
+++ b/plat/imx/imx8qm/imx8qm_bl31_setup.c
@@ -34,6 +34,10 @@
 IMPORT_SYM(unsigned long, __RW_START__, BL31_RW_START);
 IMPORT_SYM(unsigned long, __RW_END__, BL31_RW_END);
 
+#if DEBUG_CONSOLE
+extern unsigned long console_list;
+#endif
+
 static entry_point_info_t bl32_image_ep_info;
 static entry_point_info_t bl33_image_ep_info;
 
@@ -399,6 +403,8 @@
 {
 #if DEBUG_CONSOLE
 	static console_lpuart_t console;
+
+	console_list = 0;
 #endif
 	if (sc_ipc_open(&ipc_handle, SC_IPC_BASE) != SC_ERR_NONE)
 		panic();
diff --git a/plat/imx/imx8qx/imx8qx_bl31_setup.c b/plat/imx/imx8qx/imx8qx_bl31_setup.c
index b7cb7a5..11d33c1 100644
--- a/plat/imx/imx8qx/imx8qx_bl31_setup.c
+++ b/plat/imx/imx8qx/imx8qx_bl31_setup.c
@@ -34,6 +34,10 @@
 IMPORT_SYM(unsigned long, __RW_START__, BL31_RW_START);
 IMPORT_SYM(unsigned long, __RW_END__, BL31_RW_END);
 
+#if DEBUG_CONSOLE
+extern unsigned long console_list;
+#endif
+
 static entry_point_info_t bl32_image_ep_info;
 static entry_point_info_t bl33_image_ep_info;
 
@@ -377,6 +381,8 @@
 {
 #if DEBUG_CONSOLE
 	static console_lpuart_t console;
+
+	console_list = 0;
 #endif
 	if (sc_ipc_open(&ipc_handle, SC_IPC_BASE) != SC_ERR_NONE)
 		panic();