simple ubi reader

Artem Bityutskiy dedekind1 at gmail.com
Sun Nov 28 13:13:39 EST 2010


On Sun, 2010-11-28 at 11:27 +0200, Vladimir Khmelnitsky wrote:
> Hi,
> 
> I need to write bootloader which should read its second stage binary
> from ubi volume.
> I wonder if there is some simple open source code I can use to implement
> ubi volume reader?

I know people doing small bootloader code (closed source) with 4KiB
constraint for whole code, and it supported UBI R/O. That was clever
code made by clever people though. But here are some points:

1. You do not have to read EC headers when scanning
2. You do not really need to read the volume table
3. If you can assume you need only one volume, say, with vol ID 0, this
simplifies things further.

Also, AFAIR, some people found that placing VID header at the very end
of the NAND page made ECC calculations easier and faster. This is
actually why UBI has 'vid_hdr_offs' option which is not widely used,
though.

Anyway, this is the original old design document, which may contain some
hints, but I'm not sure:

http://linux-mtd.infradead.org/doc/ubidesign/ubidesign.pdf

The doc is not up-to-date, but all the design principles are valid.

-- 
Best Regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list