[U-Boot] [PATCH] 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.
Signed-off-by: Alison Wang alison.wang@nxp.com --- include/image.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/image.h b/include/image.h index 8d380e0..fcfe730 100644 --- a/include/image.h +++ b/include/image.h @@ -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) {

On Tue, Jun 06, 2017 at 03:32:40PM +0800, Alison Wang wrote:
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 alison.wang@nxp.com
Reviewed-by: Tom Rini trini@konsulko.com
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!

Hi, Tom,
On Tue, Jun 06, 2017 at 03:32:40PM +0800, Alison Wang wrote:
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 alison.wang@nxp.com
Reviewed-by: Tom Rini trini@konsulko.com
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

On Tue, Jun 06, 2017 at 03:32:40PM +0800, Alison Wang wrote:
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 alison.wang@nxp.com Reviewed-by: Tom Rini trini@konsulko.com
Applied to u-boot/master, thanks!
participants (3)
-
Alison Wang
-
Alison Wang
-
Tom Rini