[U-Boot] [patch 0/2] SPL: Lightweight UBI and UBI fastmap support
Thomas Gleixner
tglx at linutronix.de
Sat Jul 5 11:48:12 CEST 2014
Utilizing NAND FLASH requires proper wear leveling and bitflip
management. Linux choice for this is UBI. The upstream UBI
implementation is far too big for a SPL, but it is desired to load
arbitrary payload including u-boot itself from a UBI managed NAND
FLASH. That restricts the non-UBI managed part of the NAND flash to
the first few eraseblocks which are reserved for the SoC boot ROM to
load the SPL.
The following patches provide a lightweight and fast UBI attach and
load code, which supports fastmap and full scan mode.
The text foot print on the board which I used for development is:
6854 0 0 6854 1abd drivers/mtd/ubispl/built-in.o
Attaching a NAND chip with 4096 physical eraseblocks (4 blocks are
reserved for the SPL) takes:
In full scan mode: 1172ms
In fastmap mode: 95ms
With that and a moderate sized kernel image, I'm able to hand off to
the kernel within less than 500ms.
The scan and logical to physical block mapping code is developed from
scratch, while the fastmap functions are lifted from the linux kernel
source and adjusted to fit the SPL needs.
The implementation is paranoid and carefully preserves the UBI
robustness.
For now I keep a private copy of ubi-media.h which should be shared
with the drivers/mtd/ubi/ one once Heiko has synced it to the 3.14
source.
There is room for more boot time optimizations:
- Implement sub page reads for nand_spl_simple
- Hand the UBI data from SPL to kernel to avoid rescan of the
fastmap/flash
Thanks,
tglx
More information about the U-Boot
mailing list