[U-Boot] Relocation confusion
Drasko DRASKOVIC
drasko.draskovic at gmail.com
Wed Apr 22 17:59:58 CEST 2009
Hi all,
I have some questions regarding start.S code for arm926ejs. Looking at the
relocation code of u-boot:
relocate: /* relocate U-Boot to RAM */
adr r0, _start /* r0 <- current position of code */
ldr r1, _TEXT_BASE /* test if we run from flash or RAM */
cmp r0, r1 /* don't reloc during debug */
beq stack_setup
ldr r2, _armboot_start
ldr r3, _bss_start
sub r2, r3, r2 /* r2 <- size of armboot */
add r2, r0, r2 /* r2 <- source end address */
1) What is exactly difference between _start and _armboot_start ? I can see
in the same file definition of _armboot_start :
.globl _armboot_start
_armboot_start:
.word _start
So, I am confused there - it looks like they are the same thing.
2) Line:
sub r2, r3, r2
is logical, but after we do :
add r2, r0, r2 /* r2 <- source end address */
to find source end address. But if _start and _armboot_start are the same,
we already have this source end address : it is _bss_start.
3) Based on this, if _armboot_start and _start are not the same thing, I
could guess that _start is pointing at 0x0 of the flash (or SDRAM), i.e. it
is uP entry point after reset, and _armboot_start is the place where we
start to put u-boot instructions (TEXT section). That would mean that we
either have
a) some program uP will execute before u-boot. What could that ever be?
b) some section of u-boot that goes before TEXT section, and will never be
relocated to RAM _TEXT_BASE. What could that ever be?
Thanks for your answers.
Best regards,
Drasko DRASKOVIC
More information about the U-Boot
mailing list