Skip to contentSkip to conversation

RISCV: image: Add booti support

PATCH New Atish Patra 3 participants 3 messages May 7, 2019 – May 9, 2019 1 message not in the archive RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 RISCV: image: Add booti support

This patch adds booti support for RISC-V Linux kernel. The existing bootm method will also continue to work as it is.

It depends on the following kernel patch which adds the header to the flat Image. Gzip compressed Image (Image.gz) support is not enabled with this patch.

https://patchwork.kernel.org/patch/10925543/

Tested on HiFive Unleashed and QEMU.

---
Changes from v4->v5
1. Update help text for booti.

Changes from v3->v4
1. Rebased on top of master to avoid git am errors.

Changes from v2->v3
1. Updated the image header structure as per kernel patch.
2. Removed Image.gz support as it will be added as separate RFC patch.

---
 arch/riscv/lib/Makefile |  1 +
 arch/riscv/lib/image.c  | 55 +++++++++++++++++++++++++++++++++++++++++
 cmd/Kconfig             |  2 +-
 cmd/booti.c             |  8 ++++--
 4 files changed, 63 insertions(+), 3 deletions(-)
 create mode 100644 arch/riscv/lib/image.c
arch/riscv/lib/Makefile +1 -0
index 1c332db436a9..6ae6ebbeafda 100644
@@ -7,6 +7,7 @@
 # Rick Chen, Andes Technology Corporation <[email protected]>
 
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
+obj-$(CONFIG_CMD_BOOTI) += bootm.o image.o
 obj-$(CONFIG_CMD_GO) += boot.o
 obj-y	+= cache.o
 obj-$(CONFIG_RISCV_RDTIME) += rdtime.o
arch/riscv/lib/image.c new file +55 -0

55 lines not on this page · raw message

cmd/Kconfig +1 -1
index 069e0ea7300b..4e11e0f404c8 100644
@@ -223,7 +223,7 @@ config CMD_BOOTZ
 
 config CMD_BOOTI
 	bool "booti"
-	depends on ARM64
+	depends on ARM64 || RISCV
 	default y
 	help
 	  Boot an AArch64 Linux Kernel image from memory.
cmd/booti.c +6 -2
index 04353b68eccc..c36b0235df8c 100644
@@ -77,7 +77,11 @@ int do_booti(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	bootm_disable_interrupts();
 
 	images.os.os = IH_OS_LINUX;
+#ifdef CONFIG_RISCV_SMODE
+	images.os.arch = IH_ARCH_RISCV;
+#elif CONFIG_ARM64
 	images.os.arch = IH_ARCH_ARM64;
+#endif
 	ret = do_bootm_states(cmdtp, flag, argc, argv,
 #ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
 			      BOOTM_STATE_RAMDISK |
@@ -92,7 +96,7 @@ int do_booti(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #ifdef CONFIG_SYS_LONGHELP
 static char booti_help_text[] =
 	"[addr [initrd[:size]] [fdt]]\n"
-	"    - boot arm64 Linux Image stored in memory\n"
+	"    - boot Linux 'Image' stored at 'addr'\n"
 	"\tThe argument 'initrd' is optional and specifies the address\n"
 	"\tof an initrd in memory. The optional parameter ':size' allows\n"
 	"\tspecifying the size of a RAW initrd.\n"
@@ -107,5 +111,5 @@ static char booti_help_text[] =
 
 U_BOOT_CMD(
 	booti,	CONFIG_SYS_MAXARGS,	1,	do_booti,
-	"boot arm64 Linux Image image from memory", booti_help_text
+	"boot Linux kernel 'Image' format from memory", booti_help_text
 );
Signature · 1 line
2.21.0
#1 lore raw

PATCH v5 1/1 RISCV: image: Add booti support

Quoted 7 lines · Atish Patra

This patch adds booti support for RISC-V Linux kernel. The existing bootm method will also continue to work as it is.

It depends on the following kernel patch which adds the header to the flat Image. Gzip compressed Image (Image.gz) support is not enabled with this patch.

Quoted 7 lines

https://patchwork.kernel.org/patch/10925543/

Tested on HiFive Unleashed and QEMU.

Signature · 2 lines
Best regards,
Marek Vasut

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH v5 1/1 RISCV: image: Add booti support

Quoted 18 lines

From: Marek Vasut [mailto:marek.vasut at gmail.com]
Sent: Tuesday, May 07, 2019 9:11 AM
To: Atish Patra; u-boot at lists.denx.de
Cc: Tom Rini; Karsten Merker; Alexander Graf; Alex Kiernan; Anup Patel; Bin Meng; Heinrich Schuchardt; Joe Hershberger; Lukas Auer; Michal Simek; Rick Jian-Zhi Chen(陳建志); Simon Glass
Subject: Re: [U-Boot] [v5 PATCH] RISCV: image: Add booti support

Quoted 9 lines · Atish Patra

This patch adds booti support for RISC-V Linux kernel. The existing bootm method will also continue to work as it is.

It depends on the following kernel patch which adds the header to the flat Image. Gzip compressed Image (Image.gz) support is not enabled with this patch.

https://patchwork.kernel.org/patch/10925543/

Quoted 8 lines
Quoted 5 lines

Tested on HiFive Unleashed and QEMU.

Applied to u-boot-riscv/master, thanks!