summaryrefslogtreecommitdiff
path: root/arch/nds32/cpu/n1213/ag101
diff options
context:
space:
mode:
authorrick <rick@andestech.com>2016-04-14 14:32:27 +0800
committerAndes <uboot@andestech.com>2016-09-29 15:38:10 +0800
commitd607f6fa99a67dd1b40c08ba21ca6f3aaff933ce (patch)
treed1cc2d0cf5a1003e19b08d05f9ae390af3f770d7 /arch/nds32/cpu/n1213/ag101
parent06572f0301c18e63b887efc91803bb9467e55dbe (diff)
nds32: Support relocation.
Enable pie option for relocation. Signed-off-by: rick <rick@andestech.com> Cc: Andes <uboot@andestech.com>
Diffstat (limited to 'arch/nds32/cpu/n1213/ag101')
-rw-r--r--arch/nds32/cpu/n1213/ag101/lowlevel_init.S13
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/nds32/cpu/n1213/ag101/lowlevel_init.S b/arch/nds32/cpu/n1213/ag101/lowlevel_init.S
index 1a94868734..abdd340479 100644
--- a/arch/nds32/cpu/n1213/ag101/lowlevel_init.S
+++ b/arch/nds32/cpu/n1213/ag101/lowlevel_init.S
@@ -6,6 +6,8 @@
* SPDX-License-Identifier: GPL-2.0+
*/
+.pic
+
.text
#include <common.h>
@@ -248,16 +250,11 @@ relo_base:
*/
li $r5, AHBC_BSR6_A
lwi $r8, [$r5]
- li $r4, 0xfff00000
+ li $r4, 0xfff00000 /* r4 = bank6 base */
and $r4, $r4, $r8
-
- li $r5, 0x0
- la $r1, relo_base /* get $pc or $lp */
- sub $r2, $r0, $r1
- sethi $r6, hi20(_end)
- ori $r6, $r6, lo12(_end)
- add $r6, $r6, $r2
+ la $r5, _start@GOTOFF
+ la $r6, _end@GOTOFF
1:
lwi.p $r7, [$r5], #4
swi.p $r7, [$r4], #4