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>
This commit is contained in:
@@ -28,6 +28,13 @@ struct Image_header {
|
||||
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 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size,
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user