From a5a42eec8ed64cbc72d2e59199819e48f904e38f Mon Sep 17 00:00:00 2001 From: Jeroen Hofstee Date: Thu, 21 Nov 2013 22:32:51 +0100 Subject: ARM: fix the standalone programs The standalone programs do not use the api calls, but rely directly on u-boot variable gd->jt for the jump table. Commit fe1378a - "ARM: use r9 for gd" changed the register holding the address of gd, but the assembly code in the standalone examples was not updated accordingly. This broke the programs on ARM relying on the jumptable in the v2013.10 release. This patch unbricks them by using the correct register. Cc: Michal Simek Cc: Albert ARIBAUD Signed-off-by: Jeroen Hofstee --- examples/standalone/stubs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/standalone') diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index 8fb17653b0..5d2ab56995 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -40,14 +40,14 @@ gd_t *global_data; : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r11"); #elif defined(CONFIG_ARM) /* - * r8 holds the pointer to the global_data, ip is a call-clobbered + * r9 holds the pointer to the global_data, ip is a call-clobbered * register */ #define EXPORT_FUNC(x) \ asm volatile ( \ " .globl " #x "\n" \ #x ":\n" \ -" ldr ip, [r8, %0]\n" \ +" ldr ip, [r9, %0]\n" \ " ldr pc, [ip, %1]\n" \ : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "ip"); #elif defined(CONFIG_MIPS) -- cgit v1.2.1 From 0ae7653128c80a4f2920cbe9b124792c2fd9d9e0 Mon Sep 17 00:00:00 2001 From: David Feng Date: Sat, 14 Dec 2013 11:47:35 +0800 Subject: arm64: core support Relocation code based on a patch by Scott Wood, which is: Signed-off-by: Scott Wood Signed-off-by: David Feng --- examples/standalone/stubs.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'examples/standalone') diff --git a/examples/standalone/stubs.c b/examples/standalone/stubs.c index 5d2ab56995..32a19ce354 100644 --- a/examples/standalone/stubs.c +++ b/examples/standalone/stubs.c @@ -39,6 +39,20 @@ gd_t *global_data; " bctr\n" \ : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r11"); #elif defined(CONFIG_ARM) +#ifdef CONFIG_ARM64 +/* + * x18 holds the pointer to the global_data, x9 is a call-clobbered + * register + */ +#define EXPORT_FUNC(x) \ + asm volatile ( \ +" .globl " #x "\n" \ +#x ":\n" \ +" ldr x9, [x18, %0]\n" \ +" ldr x9, [x9, %1]\n" \ +" br x9\n" \ + : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "x9"); +#else /* * r9 holds the pointer to the global_data, ip is a call-clobbered * register @@ -50,6 +64,7 @@ gd_t *global_data; " ldr ip, [r9, %0]\n" \ " ldr pc, [ip, %1]\n" \ : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "ip"); +#endif #elif defined(CONFIG_MIPS) /* * k0 ($26) holds the pointer to the global_data; t9 ($25) is a call- -- cgit v1.2.1