File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff 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:
1972101 :
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 *
You can’t perform that action at this time.
0 commit comments