aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@amd.com>2022-06-24 14:15:00 +0200
committerMichal Simek <michal.simek@amd.com>2022-06-24 14:15:00 +0200
commit3041b512ebed13e29144cf5b9524e714c4aa458e (patch)
treea905c245a7fe3c51070b51c0032bc46f06ccf52e /arch
parent532ad5f84163cdf010e0181e2f9c3fbb1eac88d6 (diff)
downloadu-boot-3041b512ebed13e29144cf5b9524e714c4aa458e.zip
u-boot-3041b512ebed13e29144cf5b9524e714c4aa458e.tar.gz
u-boot-3041b512ebed13e29144cf5b9524e714c4aa458e.tar.bz2
microblaze: Optimize register usage in relocate_code
There are additional operations which can be done simpler that's why improve logic around relocation address r7 handling and _start symbol. Signed-off-by: Michal Simek <michal.simek@amd.com> Link: https://lore.kernel.org/r/c8b60f72f1605c2ba6b4b7be1893d7e6ec3d8597.1655299267.git.michal.simek@amd.com
Diffstat (limited to 'arch')
-rw-r--r--arch/microblaze/cpu/start.S7
1 files changed, 2 insertions, 5 deletions
diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S
index 2aae4a0..f2d6d12 100644
--- a/arch/microblaze/cpu/start.S
+++ b/arch/microblaze/cpu/start.S
@@ -271,7 +271,6 @@ relocate_code:
mts rshr, r1
addi r31, r6, 0 /* Start to use new GD */
- add r23, r0, r7 /* Move reloc addr to r23 */
/* Relocate text and data - r12 temp value */
addi r21, r0, _start
addi r22, r0, _end /* Include BSS too */
@@ -280,15 +279,13 @@ relocate_code:
rsub r6, r21, r22
or r5, r0, r0
1: lw r12, r21, r5 /* Load u-boot data */
- sw r12, r23, r5 /* Write zero to loc */
+ sw r12, r7, r5 /* Write zero to loc */
cmp r12, r5, r6 /* Check if we have reach the end */
bneid r12, 1b
addi r5, r5, 4 /* Increment to next loc - relocate code */
/* R23 points to the base address. */
- add r23, r0, r7 /* Move reloc addr to r23 */
- addi r24, r0, _start /* Get reloc offset */
- rsub r23, r24, r23 /* keep - this is already here gd->reloc_off */
+ rsub r23, r21, r7 /* keep - this is already here gd->reloc_off */
/* Setup vectors with post-relocation symbols */
add r5, r0, r23 /* load gd->reloc_off to r5 */