Hi,
Some time ago I hit an issue regarding alignment requirements of the IVT header when booting from NAND. It seems that Vybrid requires the IVT header to be 8-byte alignment in RAM in order to boot successfully. This requirement however, is not documented anywhere, hence I'm not sure if I miss something here. To illustrate the issue better, I attached a PNG which draws the picture better.
Current U-Boot versions generate an IVT header which are likely odd regarding this 8-byte alignment. I tested the drawn variants using U-Boot and manually altered the headers. In all variants I stripped the DCD completely, hence the header only consisted of the IVT header and the boot data header. All images with the headers worked fine when using the serial loader, however, the non-8-byte aligned IVT header failed to boot from NAND flash.
00000000 d1 00 20 40 00 80 40 3f 00 00 00 00 00 00 00 00 |.. @..@?........|
00000010 f4 7f 40 3f d4 7f 40 3f 00 00 00 00 00 00 00 00 |..@?..@?........|
00000020 d4 7b 40 3f 00 c0 05 00 00 00 00 00 be 00 00 ea |.{@?............|
00000030 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 14 f0 9f e5 |................|
Verified this behavior on a Toradex Colibri VF61 as well as on a Vybrid Tower Module Rev. G. I guess it requires knowledge of the internal boot ROM to understand if this is really an alignment requirement. Note that the U-Boot version which Timesys provides generates an IVT header which aligns on a 8-byte boundary, hence the problem does not appear with that U-Boot version.
There has been a discussion on the U-Boot mailing list about this: [U-Boot] [PATCH] tools: make imxheader size align on page size
--
Stefan
Solved! Go to Solution.
Hi, could you post some code example to help me getting into this?
Hi Rene,
This is upstream U-Boot code. The U-Boot makefiles build an utility called "mkimage" which creates the IVT headers around the U-Boot binary. The utility requires a config file. For the Tower board, the command looks like this (the command is executed automatically by the build system, make V=1 shows the command with arguments):
./tools/mkimage -n board/freescale/vf610twr/imximage.cfg.cfgtmp -T imximage -e 0x3f408000 -d u-boot.bin u-boot.imx
This utility currently creates a IVT header according to specifications, which works on i.MX6 and Vybrid (booting using serial downloader or SD card). However, from Vybrid NAND it doesn't work...
The relevant source code for the IVT header is in
http://git.denx.de/?p=u-boot.git;a=blob;f=tools/imximage.c;hb=HEAD
Probably more interesting are the data structures:
http://git.denx.de/?p=u-boot.git;a=blob;f=tools/imximage.h;hb=HEAD
So, when changing the data structures to align the headers to a 8-byte boundary, e.g. using my proposed change, the boot ROM is able to boot the image even from NAND:
[U-Boot] [PATCH] tools: make imxheader size align on page size
--
Stefan
Hi Stefan,
Now I'm able to boot from NAND with mainline U-boot, but if I need to update U-Boot, how can I do, it seems missing something to write FCB.
Is there any way to do it or I'm stuck with U-boot TimeSys?
Emmanuel
Hi Emmanuel,
A forward ported version to write the BCB (boot configuration block), which the FCB is the relevant part of to boot U-Boot. You might to alter the ECC mode (ecc_block_0_ecc_type) to match the mode you are using (the branch also contains some changes to the NAND driver for Vybrid which are not yet part of U-Boot 2015.04. However, those changes have been submitted and will land in 2015.07).
u-boot-toradex.git - U-Boot bootloader for Apalis and Colibri modules
--
Stefan
Hello karinavalencia and falstaff,
Freescale wrote the support for booting from NAND, we integrated as such, but are not able to provide any further insight beyond what's documented; the internal boot ROM process is not described in any documentation on-hand. Could someone from Freescale's Vybrid team comment on this Karina?
Thank you,
Timesys Support
rendy can you comment please?
timesyssupport can you help with this case?
Timesys Support do you have an update?