aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-01-15 14:15:41 -0700
committerTom Rini <trini@konsulko.com>2023-02-10 18:18:44 -0500
commite19ab99470b71f6e1d57c3e9037088da588de473 (patch)
tree9cc07096516deced4d43fae2b5f440fbaad8e988
parent0926a4bd5f5da3efcde3a5905f9d79db1e105687 (diff)
downloadu-boot-e19ab99470b71f6e1d57c3e9037088da588de473.zip
u-boot-e19ab99470b71f6e1d57c3e9037088da588de473.tar.gz
u-boot-e19ab99470b71f6e1d57c3e9037088da588de473.tar.bz2
dm: Allow serial output during the relocation process
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@chromium.org>
-rw-r--r--common/board_r.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/board_r.c b/common/board_r.c
index c6c0c1a..e450033 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -797,6 +797,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.
* TODO(sjg@chromium.org): Consider doing this for all archs, or