diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-21 11:27:55 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-21 13:11:57 +0200 |
commit | 325c40760866f1dc08d800dbc34d49e66da0205c (patch) | |
tree | a46d8b449e70b08372db328ceeae2274f0410498 /arch/arm/cpu | |
parent | 63f612f9e0ea2a9729b874ab45c3d9af45394d0d (diff) | |
download | barebox-325c40760866f1dc08d800dbc34d49e66da0205c.tar.gz barebox-325c40760866f1dc08d800dbc34d49e66da0205c.tar.xz |
ARM: Add relocate_to_adr_full()
relocate_to_adr() currently relocates the PBL code to another address,
but doesn't move the piggy data (compressed barebox image). This patch
adds relocate_to_adr_full() which moves the full image including the
piggy data. This is needed for upcoming Rockchip RK3568 support. Here
we are started at address 0x0, but must move away from that address as
this is where the ATF/OP-Tee binaries are expected to be loaded.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20210615141641.31577-6-s.hauer@pengutronix.de
Link: https://lore.barebox.org/20210621092802.27275-6-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r-- | arch/arm/cpu/setupc_64.S | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/arm/cpu/setupc_64.S b/arch/arm/cpu/setupc_64.S index ee9ea6cfc0..e24acbd0da 100644 --- a/arch/arm/cpu/setupc_64.S +++ b/arch/arm/cpu/setupc_64.S @@ -24,9 +24,18 @@ ENDPROC(setup_c) * executing at new address. */ .section .text.relocate_to_adr -ENTRY(relocate_to_adr) /* x0: target address */ +#ifdef __PBL__ +ENTRY(relocate_to_adr_full) + ldr x2, =__piggydata_end + b 1f +#endif + +ENTRY(relocate_to_adr) + ldr x2, =__bss_start + b 1f +1: stp x19, x20, [sp, #-16]! stp x21, x22, [sp, #-16]! @@ -45,8 +54,6 @@ ENTRY(relocate_to_adr) cmp x1, x21 /* already at correct address? */ beq 1f /* yes, skip copy to new address */ - ldr x2, =__bss_start - sub x2, x2, x0 /* x2: size */ mov x0, x21 /* x0: target */ |