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/arm/lib/image.c b/arch/arm/lib/image.c
index 1f672ee..d78d704 100644
--- a/arch/arm/lib/image.c
+++ b/arch/arm/lib/image.c
@@ -28,6 +28,13 @@
 	uint32_t	res5;
 };
 
+bool booti_is_valid(const void *img)
+{
+	const struct Image_header *ih = img;
+
+	return ih->magic == le32_to_cpu(LINUX_ARM64_IMAGE_MAGIC);
+}
+
 int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
 		bool force_reloc)
 {
@@ -39,7 +46,7 @@
 
 	ih = (struct Image_header *)map_sysmem(image, 0);
 
-	if (ih->magic != le32_to_cpu(LINUX_ARM64_IMAGE_MAGIC)) {
+	if (!booti_is_valid(ih)) {
 		puts("Bad Linux ARM64 Image magic!\n");
 		return 1;
 	}