In past there must be a flash_header.S file provided by NXP.
u-boot.imx6/flash_header.S at master · rabeeh/u-boot.imx6 · GitHub
I am trying to customize newer android BSP with flash_header.S . my uboot.bin have the IVT header, but it is hardcoded. In newer versions its dynamically generated.
flash_header.S have one extra thing that is
b _start
that instruction only changes the offset and then uboot.bin can't be used in place of android bsp's uboot.
I am currently changing flash_header.S file so that it can be used to generate uboot.imx. But I don't know much of assembly
Can you tell me in the newer mx6_plugin.S file, after ROM code finish working with it, where the control goes?
Does it go to start.S or Vector.S?
Also in newer code why this is done
push {r0-r4, lr}
and not
push {r0-r6, lr}
I am asking it because I am trying to use the later as those are needed in my case.
pop {r0-r6, lr} /* pop r0,..., lr from stack*/
push {r5}
ldr r5, boot_data2
str r5, [r0]
ldr r5, image_len2
str r5, [r1]
ldr r5, second_ivt_offset
str r5, [r2]
mov r0, #1
pop {r5}
/* return back to ROM code */
bx lr
Does ROM code decides in this code where the uboot code will start? I can't decide whether my changes are effective or not because I don't see any
b _start or b _reset happening to uboot code. So how does mx6_plugin.S file work successfully? In my case I have kept this file as it is but changes some code for my use case like this
adr r0, boot_data2 /*load boot_data2 address in r0*/
adr r1, image_len2
adr r2, boot_data2
this,
pop {r0-r6, lr} /* pop r0,..., lr from stack*/
push {r5}
ldr r5, boot_data2
str r5, [r0]
ldr r5, image_len2
str r5, [r1]
ldr r5, second_ivt_offset
str r5, [r2]
mov r0, #1
pop {r5}
/* return back to ROM code */
bx lr
and this
second_ivt_offset: .long (ivt2_header + 0x2C + FLASH_OFFSET)
/*
* The following is the second IVT header plus the second boot data
*/
ivt2_header: .long 0x0
app2_code_jump_v: .long 0x0
reserv3: .long 0x0
dcd2_ptr: .long 0x0
boot_data2_ptr: .long 0x0
self_ptr2: .long 0x0
app_code_csf2: .long 0x0
reserv4: .long 0x0
boot_data2: .long 0x0
image_len2: .long 0x0
plugin2: .long 0x0
All of this code is inside my changes mx6_plugin.S.
So can I be sure that my u-boot.imx will get to the starting point of uboot after plugin finishes its work? Aren there any size limitation to plugin image or any register usage restriction like r4 to r6 can't be used?