Merge branch 'master_sh/gen4/mmcfix' of https://source.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / common / board_r.c
index 6026e43..6b4180b 100644 (file)
@@ -452,7 +452,7 @@ static int initr_env(void)
                env_set_hex("fdtcontroladdr",
                            (unsigned long)map_to_sysmem(gd->fdt_blob));
 
-       #if (CONFIG_IS_ENABLED(SAVE_PREV_BL_INITRAMFS_START_ADDR) || \
+       #if (IS_ENABLED(CONFIG_SAVE_PREV_BL_INITRAMFS_START_ADDR) || \
                                                IS_ENABLED(CONFIG_SAVE_PREV_BL_FDT_ADDR))
                save_prev_bl_data();
        #endif
@@ -569,6 +569,13 @@ static int dm_announce(void)
                        printf("Warning: Unexpected devicetree source (not from a prior stage)");
                        printf("Warning: U-Boot may not function properly\n");
                }
+               if (IS_ENABLED(CONFIG_OF_TAG_MIGRATE) &&
+                   (gd->flags & GD_FLG_OF_TAG_MIGRATE))
+                       /*
+                        * U-Boot will silently fail to work after 2023.07 if
+                        * there are old tags present
+                        */
+                       printf("Warning: Device tree includes old 'u-boot,dm-' tags: please fix by 2023.07!\n");
        }
 
        return 0;
@@ -797,6 +804,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