summaryrefslogtreecommitdiff
path: root/arch/riscv/lib
diff options
context:
space:
mode:
authorMayuresh Chitale <mchitale@ventanamicro.com>2025-04-04 14:48:57 +0000
committerLeo Yu-Chi Liang <ycliang@andestech.com>2025-05-21 16:45:56 +0800
commit37b0b22d8b7bbed6aa95b6daed06dcbf4a66f211 (patch)
treec86ce56dafebd4bd4cba2624945c6d6ee5baf491 /arch/riscv/lib
parent027a316828528da95a77d20632370b1bc2823f0b (diff)
booti/bootm: riscv: Verify image arch type
Unlike ARM and X86, booting 32-bit images on 64-bit CPUs is currently not supported for Risc-V. Hence, for bootm, disallow booting a FIT or a legacy image that was built for an arch type which is different than the current arch and for booti, set the arch type to be the same as the current arch. Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'arch/riscv/lib')
-rw-r--r--arch/riscv/lib/bootm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c
index 9544907ab1e..c98c5e76633 100644
--- a/arch/riscv/lib/bootm.c
+++ b/arch/riscv/lib/bootm.c
@@ -90,6 +90,10 @@ static void boot_jump_linux(struct bootm_headers *images, int flag)
announce_and_cleanup(fake);
if (!fake) {
+ if (images->os.arch != IH_ARCH_DEFAULT) {
+ printf("Image arch not compatible with host arch.\n");
+ hang();
+ }
if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
#ifdef CONFIG_SMP
ret = smp_call_function(images->ep,