rockchip: spl: only allow do reset after dm setup

Without this, there is a dead loop path:

hang() => spl_hang_reset() => do_reset() => failed to reset => hang()!

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8553bde97bd45ca63e5a12aca1acfc939301b04f
This commit is contained in:
Joseph Chen 2020-12-25 11:28:07 +08:00 committed by Jianhong Chen
parent 658285c1fb
commit 5ead1aa09a
1 changed files with 5 additions and 2 deletions

View File

@ -381,8 +381,11 @@ void spl_hang_reset(void)
{ {
printf("# Reset the board to bootrom #\n"); printf("# Reset the board to bootrom #\n");
#if defined(CONFIG_SPL_SYSRESET) && defined(CONFIG_SPL_DRIVERS_MISC_SUPPORT) #if defined(CONFIG_SPL_SYSRESET) && defined(CONFIG_SPL_DRIVERS_MISC_SUPPORT)
/* reset is available after dm setup */
if (gd->flags & GD_FLG_SPL_EARLY_INIT) {
writel(BOOT_BROM_DOWNLOAD, CONFIG_ROCKCHIP_BOOT_MODE_REG); writel(BOOT_BROM_DOWNLOAD, CONFIG_ROCKCHIP_BOOT_MODE_REG);
do_reset(NULL, 0, 0, NULL); do_reset(NULL, 0, 0, NULL);
}
#endif #endif
} }