On secondary CPUs, zero_bss() will be a NOP because BSS only need to be
zeroed once at boot. So the call in the secondary CPUs path can be
removed.
Lastly, document the behavior and the main registers usage within the
function.
Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
PRINT(" booting -\r\n")
#endif
bl check_cpu_mode
- bl zero_bss
bl cpu_init
bl create_page_tables
bl enable_mmu
b fail
ENDPROC(check_cpu_mode)
+/*
+ * Zero BSS
+ *
+ * Inputs:
+ * r10: Physical offset
+ *
+ * Clobbers r0 - r3
+ */
zero_bss:
- /* Zero BSS On the boot CPU to avoid nasty surprises */
- teq r12, #0
- bne skip_bss
-
PRINT("- Zero BSS -\r\n")
ldr r0, =__bss_start /* Load start & end of bss */
ldr r1, =__bss_end
cmp r0, r1
blo 1b
-skip_bss:
mov pc, lr
ENDPROC(zero_bss)