u-boot/0015-cmd-boot-add-brom-cmd-to-reboot-to-.patch

67 lines
2.0 KiB
Diff

From aa75cb09f8616f4234e71a2abe73f095bf3ee7c0 Mon Sep 17 00:00:00 2001
From: Andy Yan <andy.yan@rock-chips.com>
Date: Tue, 6 Feb 2018 09:51:12 +0800
Subject: [PATCH] cmd: boot: add brom cmd to reboot to brom dnl mode
Change-Id: I797491ebe25af1013732aeee87e61e3ba4bc1689
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
.../arm/include/asm/arch-rockchip/boot_mode.h | 1 +
cmd/boot.c | 20 +++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/arch/arm/include/asm/arch-rockchip/boot_mode.h b/arch/arm/include/asm/arch-rockchip/boot_mode.h
index 6b2a610cf4..bcdf4420cf 100644
--- a/arch/arm/include/asm/arch-rockchip/boot_mode.h
+++ b/arch/arm/include/asm/arch-rockchip/boot_mode.h
@@ -19,6 +19,7 @@
#define BOOT_BROM_DOWNLOAD 0xEF08A53C
#ifndef __ASSEMBLY__
+void set_back_to_bootrom_dnl_flag(void);
int setup_boot_mode(void);
#endif
diff --git a/cmd/boot.c b/cmd/boot.c
index 14839c1ced..d7c7db449c 100644
--- a/cmd/boot.c
+++ b/cmd/boot.c
@@ -44,16 +44,36 @@ static int do_go(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
printf ("## Application terminated, rc = 0x%lX\n", rc);
return rcode;
}
+#endif
+
+#if defined(CONFIG_ROCKCHIP_BOOT_MODE_REG) && CONFIG_ROCKCHIP_BOOT_MODE_REG
+#include <asm/arch-rockchip/boot_mode.h>
+static int do_reboot_brom(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
+{
+ set_back_to_bootrom_dnl_flag();
+ do_reset(NULL, 0, 0, NULL);
+
+ return 0;
+}
+#endif
/* -------------------------------------------------------------------- */
+#ifdef CONFIG_CMD_GO
U_BOOT_CMD(
go, CONFIG_SYS_MAXARGS, 1, do_go,
"start application at address 'addr'",
"addr [arg ...]\n - start application at address 'addr'\n"
" passing 'arg' as arguments"
);
+#endif
+#if defined(CONFIG_ROCKCHIP_BOOT_MODE_REG) && CONFIG_ROCKCHIP_BOOT_MODE_REG
+U_BOOT_CMD(
+ rbrom, 1, 0, do_reboot_brom,
+ "Perform RESET of the CPU and enter boot rom",
+ ""
+);
#endif
U_BOOT_CMD(