boot: arm: riscv: sandbox: Add a format for the booti file

Arm invented a new format for arm64 and something similar is also used
with RISC-V. Add this to the list of supported formats and provide a way
for the format to be detected on both architectures.

Update the genimg_get_format() function to support this.

Fix up switch() statements which don't currently mention this format.
Booti does not support a ramdisk, so this can be ignored.

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/riscv/lib/image.c b/arch/riscv/lib/image.c
index a82f48e..859326c 100644
--- a/arch/riscv/lib/image.c
+++ b/arch/riscv/lib/image.c
@@ -32,6 +32,13 @@
 	uint32_t	res4;		/* reserved */
 };
 
+bool booti_is_valid(const void *img)
+{
+	const struct linux_image_h *lhdr = img;
+
+	return lhdr->magic == LINUX_RISCV_IMAGE_MAGIC;
+}
+
 int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
 		bool force_reloc)
 {
@@ -39,7 +46,7 @@
 
 	lhdr = (struct linux_image_h *)map_sysmem(image, 0);
 
-	if (lhdr->magic != LINUX_RISCV_IMAGE_MAGIC) {
+	if (!booti_is_valid(lhdr)) {
 		puts("Bad Linux RISCV Image magic!\n");
 		return -EINVAL;
 	}