From: Marek BehĂșn Date: Thu, 20 May 2021 11:24:09 +0000 (+0200) Subject: ARM: global_data: make set_gd() work for armv5 and armv6 X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=82b63e95410ebca0bbfd343ce163299a44a2d932;p=u-boot.git ARM: global_data: make set_gd() work for armv5 and armv6 The Thumb instruction `ldr` is able to move high registers only from armv7. For armv5 and armv6 we have to use `mov`. Signed-off-by: Marek BehĂșn Reviewed-by: Simon Glass --- diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index fba655f3b9..bb82efafa6 100644 --- a/arch/arm/include/asm/global_data.h +++ b/arch/arm/include/asm/global_data.h @@ -122,8 +122,10 @@ static inline void set_gd(volatile gd_t *gd_ptr) { #ifdef CONFIG_ARM64 __asm__ volatile("ldr x18, %0\n" : : "m"(gd_ptr)); -#else +#elif __ARM_ARCH >= 7 __asm__ volatile("ldr r9, %0\n" : : "m"(gd_ptr)); +#else + __asm__ volatile("mov r9, %0\n" : : "r"(gd_ptr)); #endif }