diff mbox series

[RFC,4/4] jumparch64: add go64

Message ID 20200810142652.40669-5-linux@fw-web.de
State New
Delegated to: Tom Rini
Headers show
Series Add 32bit-mode for mt7622 | expand

Commit Message

Frank Wunderlich Aug. 10, 2020, 2:26 p.m. UTC
From: Frank Wunderlich <frank-w@public-files.de>

adding a new uboot command go64 which allows booting 64bit
kernel-image from 32bit uboot using the jumparch64 target in mt7622 ATF

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 cmd/boot.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
diff mbox series

Patch

diff --git a/cmd/boot.c b/cmd/boot.c
index 36aba22b30..1448eb3854 100644
--- a/cmd/boot.c
+++ b/cmd/boot.c
@@ -53,6 +53,32 @@  U_BOOT_CMD(
 	"      passing 'arg' as arguments"
 );
 
+#if defined(CONFIG_ARCH_MEDIATEK_32) && defined(CONFIG_TARGET_MT7622)
+static int do_go64(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
+{
+	ulong	addr;
+
+	if (argc < 2)
+		return CMD_RET_USAGE;
+
+	addr = simple_strtoul(argv[1], NULL, 16);
+
+	printf ("## Starting application at 0x%08lX ...\n", addr);
+
+	extern void jumparch64_smc(ulong addr, ulong arg1, ulong arg2);
+	jumparch64_smc(addr, 0, 0);
+
+	return 0;
+}
+
+U_BOOT_CMD(
+	go64, CONFIG_SYS_MAXARGS, 1,	do_go64,
+	"start 64bit application at address 'addr'",
+	"addr [arg ...]\n    - start 64bit application at address 'addr'\n"
+	"      passing 'arg' as arguments"
+);
+#endif
+
 #endif
 
 U_BOOT_CMD(