]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ARM: global_data: make set_gd() work for armv5 and armv6
authorMarek Behún <marek.behun@nic.cz>
Thu, 20 May 2021 11:24:09 +0000 (13:24 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 24 May 2021 18:21:30 +0000 (14:21 -0400)
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 <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/arm/include/asm/global_data.h

index fba655f3b934bee68057a8db7438afbb3b579c07..bb82efafa61e194f6d293cd0a0768c4c3e29ef3f 100644 (file)
@@ -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
 }