I am trying to understand the U-boot source(2014.07). I could see the following code in arch/arm/cpu/armv7/lowlevel_init.S file.
#ifdef CONFIG_SPL_BUILD
ldr r9, =gdata
#else
sub sp, sp, #GD_SIZE
bic sp, sp, #7
mov r9, sp
#endif
push {ip, lr}
bl s_init
pop {ip, pc}
Can you please tell why sp is moved to r9 register - "mov r9, sp"(for SPL build gdata is loaded to r9 register- "ldr r9, =gdata"). Is there any specific use of r9 register, so that we are storing sp value to r9.