[PATCH 05/11] ARM: Add relocate_to_adr_full()
Sascha Hauer
s.hauer at pengutronix.de
Tue Jun 15 07:16:35 PDT 2021
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 at pengutronix.de>
---
arch/arm/cpu/setupc_64.S | 13 ++++++++++---
arch/arm/include/asm/barebox-arm.h | 1 +
2 files changed, 11 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 */
diff --git a/arch/arm/include/asm/barebox-arm.h b/arch/arm/include/asm/barebox-arm.h
index 348a55e804..24f9bce2ef 100644
--- a/arch/arm/include/asm/barebox-arm.h
+++ b/arch/arm/include/asm/barebox-arm.h
@@ -53,6 +53,7 @@ void setup_c(void);
void pbl_barebox_break(void);
void relocate_to_current_adr(void);
void relocate_to_adr(unsigned long target);
+void relocate_to_adr_full(unsigned long target);
void __noreturn barebox_arm_entry(unsigned long membase, unsigned long memsize, void *boarddata);
struct barebox_arm_boarddata {
--
2.29.2
More information about the barebox
mailing list