aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/board_f.c3
-rw-r--r--common/board_r.c9
2 files changed, 12 insertions, 0 deletions
diff --git a/common/board_f.c b/common/board_f.c
index 2b4edf30c9..f3c1ab53b1 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -290,7 +290,10 @@ static int setup_mon_len(void)
{
#if defined(__ARM__) || defined(__MICROBLAZE__)
gd->mon_len = (ulong)&__bss_end - (ulong)_start;
+#elif defined(CONFIG_SANDBOX) && !defined(__riscv)
+ gd->mon_len = (ulong)&_end - (ulong)_init;
#elif defined(CONFIG_SANDBOX)
+ /* gcc does not provide _init in crti.o on RISC-V */
gd->mon_len = 0;
#elif defined(CONFIG_EFI_APP)
gd->mon_len = (ulong)&_end - (ulong)_init;
diff --git a/common/board_r.c b/common/board_r.c
index c6c0c1ab1d..e45003353f 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