u-boot-brain/drivers/mtd
Thomas Gleixner 6f4e7d3c75 spl: Lightweight UBI and UBI fastmap support
Booting a payload out of NAND FLASH from the SPL is a crux today, as
it requires hard partioned FLASH. Not a brilliant idea with the
reliability of todays NAND FLASH chips.

The upstream UBI + UBI fastmap implementation which is about to
brought to u-boot is too heavy weight for SPLs as it provides way more
functionality than needed for a SPL and does not even fit into the
restricted SPL areas which are loaded from the SoC boot ROM.

So this provides a fast and lightweight implementation of UBI scanning
and UBI fastmap attach. The scan and logical to physical block mapping
code is developed from scratch, while the fastmap implementation is
lifted from the linux kernel source and stripped down to fit the SPL
needs.

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

The code requires quite some storage. The largest and unknown part of
it is the number of fastmap blocks to read. Therefor the data
structure is not put into the BSS. The code requires a pointer to free
memory handed in which is initialized by the UBI attach code itself.

See doc/README.ubispl for further information on how to use it.

This shares the ubi-media.h and crc32 implementation of drivers/mtd/ubi
There is no way to share the fastmap code, as UBISPL only utilizes the
slightly modified functions ubi_attach_fastmap() and ubi_scan_fastmap()
from the original kernel ubi fastmap implementation.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Acked-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
2016-07-22 09:53:00 -04:00
..
nand nand_spl_simple: Add a simple NAND read function 2016-07-22 09:52:59 -04:00
onenand onenand_spl_simple: Add a simple OneNAND read function 2016-07-22 09:53:00 -04:00
spi sunxi: Support booting from SPI flash 2016-07-15 08:34:34 +02:00
ubi mtd, ubi: set free_count to zero before walking through erase list 2016-04-22 11:47:37 +02:00
ubispl spl: Lightweight UBI and UBI fastmap support 2016-07-22 09:53:00 -04:00
altera_qspi.c altera_qspi: allow ctrl-c to abort the erase ops 2015-12-28 09:32:43 +08:00
at45.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
cfi_flash.c mtd: cfi_flash: fix polling for bit XSR.7 on Intel chips 2016-07-20 11:13:26 +02:00
cfi_mtd.c mtd, cfi, ubi: add missing writebufsize initialization 2014-11-19 07:54:04 +01:00
dataflash.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
ftsmc020.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
jedec_flash.c mtd: Handle 29LV800BT 2014-11-19 08:48:41 +01:00
Kconfig drivers: mtd: add Microchip PIC32 internal non-CFI flash driver. 2016-05-21 01:25:50 +02:00
Makefile drivers: mtd: add Microchip PIC32 internal non-CFI flash driver. 2016-05-21 01:25:50 +02:00
mtd_uboot.c mtd: uboot: Add meaningful error message 2015-11-12 13:17:28 -05:00
mtd-uclass.c dm: implement a MTD uclass 2015-11-12 08:26:58 +08:00
mtdconcat.c kbuild: force to define __UBOOT__ in all the C sources 2014-09-16 12:23:56 -04:00
mtdcore.c compat: Remove is_power_of_2() definition 2015-11-05 16:46:59 -05:00
mtdcore.h mtd, ubi, ubifs: resync with Linux-3.14 2014-08-25 19:25:55 -04:00
mtdpart.c mtd: Introduce mtd_block_isreserved() 2015-08-25 22:53:57 -05:00
mw_eeprom.c Update i386 code (sc520_cdp) 2008-09-09 11:48:53 +02:00
pic32_flash.c drivers: mtd: add Microchip PIC32 internal non-CFI flash driver. 2016-05-21 01:25:50 +02:00
st_smi.c Add GPL-2.0+ SPDX-License-Identifier to source files 2013-07-24 09:44:38 -04:00
stm32_flash.c stm32: stm32_flash: add memory barrier during flash write 2016-04-11 20:48:23 -04:00
stm32_flash.h stm32: stm32f4: move flash driver to mtd driver location 2016-03-26 18:49:28 -04:00