[PATCH 04/24] dm: Allow serial output during the relocation process

Simon Glass sjg at chromium.org
Sun Jan 15 22:15:41 CET 2023


Reset the serial flags so that the debug UART can be used (if enabled)
in the small window where there is no serial device. This can avoid a hang
in some cases.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 common/board_r.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/common/board_r.c b/common/board_r.c
index 3618acad437..5f3c3db476d 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -796,6 +796,15 @@ static init_fnc_t init_sequence_r[] = {
 
 void board_init_r(gd_t *new_gd, ulong dest_addr)
 {
+	/*
+	 * The pre-relocation drivers may be using memory that has now gone
+	 * away. Mark serial as unavailable - this will fall back to the debug
+	 * UART if available.
+	 *
+	 * Do the same with log drivers since the memory may not be available.
+	 */
+	gd->flags &= ~(GD_FLG_SERIAL_READY | GD_FLG_LOG_READY);
+
 	/*
 	 * Set up the new global data pointer. So far only x86 does this
 	 * here.
-- 
2.39.0.314.g84b9a713c41-goog



More information about the U-Boot mailing list