diff options
| author | Marek BehĂșn <[email protected]> | 2021-05-20 13:24:09 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2021-05-24 14:21:30 -0400 |
| commit | 82b63e95410ebca0bbfd343ce163299a44a2d932 (patch) | |
| tree | 8d42fbd943049890b5033729da4015014a43d2c4 | |
| parent | 1b457e753ec8a7bc1e8280e6bc58dcd727e95f47 (diff) | |
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
| -rw-r--r-- | arch/arm/include/asm/global_data.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h index fba655f3b93..bb82efafa61 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 } |
