Skip to contentSkip to conversation

image: fit: Allow booting Aarch64 from arm

PATCH New Ramon Fried 3 participants 3 messages May 14, 2018 – May 15, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image: fit: Allow booting Aarch64 from arm

Snapdragon bootloader needs to jump from 32bit to 64bit
Allow booting in these cases when CONFIG_AARCH32_SUPPORT_ARM64 is defined.

---
 common/image-fit.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
common/image-fit.c +8 -1
index 5b93dceae1..62dbfbdd3d 100644
@@ -1253,17 +1253,24 @@ int fit_image_check_arch(const void *fit, int noffset, uint8_t arch)
 {
 	uint8_t image_arch;
 	int aarch32_support = 0;
+	int aarch64_support = 0;
 
 #ifdef CONFIG_ARM64_SUPPORT_AARCH32
 	aarch32_support = 1;
 #endif
 
+#ifdef CONFIG_AARCH32_SUPPORT_ARM64
+	aarch64_support = 1;
+#endif
+
 	if (fit_image_get_arch(fit, noffset, &image_arch))
 		return 0;
 	return (arch == image_arch) ||
 		(arch == IH_ARCH_I386 && image_arch == IH_ARCH_X86_64) ||
 		(arch == IH_ARCH_ARM64 && image_arch == IH_ARCH_ARM &&
-		 aarch32_support);
+		 aarch32_support) ||
+		(arch == IH_ARCH_ARM && image_arch == IH_ARCH_ARM64 &&
+		 aarch64_support);
 }
 
 /**
Signature · 1 line
2.17.0
#1 lore raw

PATCH 1/1 image: fit: Allow booting Aarch64 from arm

Quoted 39 lines · Ramon Fried

Snapdragon bootloader needs to jump from 32bit to 64bit
Allow booting in these cases when CONFIG_AARCH32_SUPPORT_ARM64 is defined.

---
 common/image-fit.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
common/image-fit.c +8 -2
index 5b93dceae1..62dbfbdd3d 100644
@@ -1253,17 +1253,24 @@ int fit_image_check_arch(const void *fit, int noffset, uint8_t arch)
 {
        uint8_t image_arch;
        int aarch32_support = 0;
+       int aarch64_support = 0;
 
 #ifdef CONFIG_ARM64_SUPPORT_AARCH32
        aarch32_support = 1;
 #endif
 
+#ifdef CONFIG_AARCH32_SUPPORT_ARM64
+       aarch64_support = 1;
+#endif
+
        if (fit_image_get_arch(fit, noffset, &image_arch))
                return 0;
        return (arch == image_arch) ||
                (arch == IH_ARCH_I386 && image_arch == IH_ARCH_X86_64) ||
                (arch == IH_ARCH_ARM64 && image_arch == IH_ARCH_ARM &&
-                aarch32_support);
+                aarch32_support) ||
+               (arch == IH_ARCH_ARM && image_arch == IH_ARCH_ARM64 &&
+                aarch64_support);
 }
 
 /**
--
Quoted 2 lines

2.17.0

Code above is aligned with previous support but I can't see that macro in Kconfig.
Also it is kind of weird that on arm you can run i386 image. It could be stopped later but that changes just suggest that this should be changed.

Thanks,
Michal

#2 lore raw

PATCH 1/1 image: fit: Allow booting Aarch64 from arm

Quoted 38 lines · Michal Simek
Quoted 37 lines · Ramon Fried

Snapdragon bootloader needs to jump from 32bit to 64bit
Allow booting in these cases when CONFIG_AARCH32_SUPPORT_ARM64 is defined.

---
 common/image-fit.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
common/image-fit.c +8 -1
index 5b93dceae1..62dbfbdd3d 100644
@@ -1253,17 +1253,24 @@ int fit_image_check_arch(const void *fit, int noffset, uint8_t arch)
 {
        uint8_t image_arch;
        int aarch32_support = 0;
+       int aarch64_support = 0;
 
 #ifdef CONFIG_ARM64_SUPPORT_AARCH32
        aarch32_support = 1;
 #endif
 
+#ifdef CONFIG_AARCH32_SUPPORT_ARM64
+       aarch64_support = 1;
+#endif
+
        if (fit_image_get_arch(fit, noffset, &image_arch))
                return 0;
        return (arch == image_arch) ||
                (arch == IH_ARCH_I386 && image_arch == IH_ARCH_X86_64) ||
                (arch == IH_ARCH_ARM64 && image_arch == IH_ARCH_ARM &&
-                aarch32_support);
+                aarch32_support) ||
+               (arch == IH_ARCH_ARM && image_arch == IH_ARCH_ARM64 &&
+                aarch64_support);
 }
 
Quoted 9 lines
Quoted 4 lines
common/image-fit.c +0 -1
 /**
--

2.17.0

Code above is aligned with previous support but I can't see that macro in Kconfig.
Also it is kind of weird that on arm you can run i386 image. It could be stopped later but that changes just suggest that this should be changed.

It's the generic area where we make sure either the image is for what we're running on, or the special cases, ie aarch64 runs arm or x8664 runs i386 :)

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180515/b1f5bd3a/attachment.sig>