Skip to content

Commit 2ab5372

Browse files
committed
feat(armv8): add boot data copy routine for non-unified plats
Signed-off-by: Daniel Oliveira <[email protected]>
1 parent e5f0edf commit 2ab5372

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/arch/armv8/aarch32/boot.S

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,19 @@ _set_master_cpu:
154154
/* If this is the cpu master, clear bss */
155155
cmp r9, #0
156156
bne 1f
157+
158+
#ifdef MEM_NON_UNIFIED
159+
/* Copy data from RX to RWX */
160+
ldr r7, =_data_lma_start // LMA start
161+
ldr r11, =_data_vma_start // VMA start
162+
ldr r12, =_image_load_end // LMA end
163+
bl copy_data
164+
165+
ldr r1, =_data_vma_start
166+
ldr r3, =data_addr
167+
str r1, [r3] // store image load address in img_addr
168+
#endif
169+
157170
ldr r11, =_bss_start
158171
ldr r12, =_bss_end
159172
bl boot_clear
@@ -197,6 +210,16 @@ boot_clear:
197210
1:
198211
bx lr
199212

213+
/* Copies data from r7 to r11 up to the r12 limit */
214+
.global copy_data
215+
copy_data:
216+
1:
217+
ldr r8, [r7], #4
218+
str r8, [r11], #4
219+
cmp r7, r12
220+
bne 1b
221+
bx lr
222+
200223
/*
201224
* Code adapted from "Application Note Bare-metal Boot Code for ARMv8-A Processors - Version 1.0"
202225
*

0 commit comments

Comments
 (0)