armv8: Support loading 32-bit OS which is not in the form of FIT
PATCH 1/1 armv8: Support loading 32-bit OS which is not in the form of FIT
As only FIT image is supported now, this patch is to support loading 32-bit uImage, dtb and rootfs separately.
--- include/image.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/image.h +2 -1
@@ -785,7 +785,8 @@ static inline int image_check_type(const image_header_t *hdr, uint8_t type) }static inline int image_check_arch (const image_header_t *hdr,uint8_t arch) { -return (image_get_arch (hdr) == arch); +return (image_get_arch (hdr) == arch) || + (image_get_arch (hdr) ==IH_ARCH_ARM && arch ==IH_ARCH_ARM64 ); }static inline int image_check_os (const image_header_t *hdr,uint8_t os) {
Signature · 1 line
2.1.0.27.g96db324
PATCH 1/1 armv8: Support loading 32-bit OS which is not in the form of FIT
Quoted 4 lines · Alison Wang
As only FIT image is supported now, this patch is to support loading 32-bit uImage, dtb and rootfs separately.
Signed-off-by Alison Wang <[email protected]>
However, entirely unrelated, I found this while reviewing the patch:
$ grep IH_ARCH_ arch/arm/include/asm/arch-fsl-layerscape/mp.h #define IH_ARCH_ARM 2 /* ARM */ #define IH_ARCH_ARM64 22 /* ARM64 */
And that's dangerous and whatever needs those defines needs to be using <image.h> instead where we have the canonical enum of those values. Please correct this, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170606/1fcab44c/attachment.sig>
PATCH 1/1 armv8: Support loading 32-bit OS which is not in the form of FIT
Hi, Tom,
Quoted 9 lines · Alison Wang
Quoted 5 lines
As only FIT image is supported now, this patch is to support loading 32-bit uImage, dtb and rootfs separately.
Signed-off-by Alison Wang <[email protected]>Reviewed-by Tom Rini <[email protected]>
Quoted 9 lines
However, entirely unrelated, I found this while reviewing the patch:
$ grep IH_ARCH_ arch/arm/include/asm/arch-fsl-layerscape/mp.h #define IH_ARCH_ARM 2 /* ARM */ #define IH_ARCH_ARM64 22 /* ARM64 */And that's dangerous and whatever needs those defines needs to be using <
image.h> instead where we have the canonical enum of those values. Please correct this, thanks!
[Alison Wang] Thanks for your suggestion. Yes, it's dangerous and <image.h> should be used.
In <image.h>, IH_ARCH_ARM and IH_ARCH_ARM64 are defined in an enumeration type. In the assembly file arch/arm/cpu/armv8/fsl-layerscape/lowlevel.S, IH_ARCH_DEFAULT is used.
#ifndef CONFIG_ARM64
#define IH_ARCH_DEFAULT IH_ARCH_ARM
#else
#define IH_ARCH_DEFAULT IH_ARCH_ARM64
#endif
So IH_ARCH_ARM or IH_ARCH_ARM64 need to be used in the assembly code. The way to include <image.h> in the assembly file will cause more problems.
I will send a patch to use IH_ARCH_ARM and IH_ARCH_ARM64 in the C programming, and remove the duplicate definition in mp.h.
Best Regards,
Alison Wang
Quoted 5 lines · Alison Wang
As only FIT image is supported now, this patch is to support loading 32-bit uImage, dtb and rootfs separately.
Signed-off-by Alison Wang <[email protected]>Reviewed-by Tom Rini <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170610/966c12bf/attachment.sig>