From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= Date: Sun, 7 Mar 2021 05:25:22 +0100 Subject: [PATCH u-boot 23/39] ARM: global_data: make set_gd() work for armv5 and armv6 In-Reply-To: <20210307042538.21229-1-marek.behun@nic.cz> References: <20210307042538.21229-1-marek.behun@nic.cz> Message-ID: <20210307042538.21229-24-marek.behun@nic.cz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- arch/arm/include/asm/global_data.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 } -- 2.26.2