The introduction of the SPI-NAND framework and, more widely, the support of non parallel-NOR, parallel-NAND and SPI-NOR has shown that extending U-Boot MTD devices/partitions handling was not straightforward at all. While this first series [1] is a great step forward, it is not actually usable due to purely software limitations.
This series intends to: * Do some cleanup in the MTD layer * Add a new 'mtd' command that should replace in the future all the MTD-specific commands like 'nand' and 'sf'. * Make deep changes in the partition handling by introducing a new way of managing MTD partitions (that soon will be also sent to the Linux kernel), and adding a generic 'mtdparts' environment variable parser in prevision of the 'mtdparts' command removal. * The UBI command is also updated to stop messing with partitions that should just be declared in the 'mtdparts' variable. People can now do the following without 'mtdids': # setenv mtdparts "nor0=1m(some),-(more);spi-nand0=-(all)" Partitions are visible with: # mtd list And UBI support is available with (for the above example): # ubi part all At least these two missing features will be added with further changes: * 'mtd write' on NANDs should use by default the trimffs option (to avoid writing empty pages). * 'nand bad' is a great way to know the list of detected bad-blocks and could be implemented in 'mtd'. Of course, this series only applies on top of [1]. [1] https://lists.denx.de/pipermail/u-boot/2018-August/336780.html Thanks, Miquèl Miquel Raynal (13): lib: strto: parse all lowercase metric prefixes in ustrtoul[l] lib: strto: fix metric suffix parsing in strtoul[l] mtd: Kconfig: remove MTD_PARTITIONS duplicated symbol cmd: mtdparts: accept spi-nand devices cmd: mtdparts: remove mandatory 'mtdparts=' prefix mtd: uclass: add probe function mtd: uclass: add a generic 'mtdparts' parser mtd: uclass: search for an equivalent MTD name with the mtdids mtd: mtdpart: implement proper partition handling cmd: mtd: add 'mtd' command cmd: mtdparts: try to probe the MTD devices as a fallback cmd: ubi: clean the partition handling cmd: mtdparts: describe as legacy cmd/Kconfig | 22 +- cmd/Makefile | 1 + cmd/mtd.c | 517 ++++++++++++++++++++++++++ cmd/mtdparts.c | 46 ++- cmd/ubi.c | 100 ++--- drivers/mtd/Kconfig | 3 - drivers/mtd/Makefile | 2 +- drivers/mtd/mtd-uclass.c | 16 + drivers/mtd/mtdcore.c | 2 + drivers/mtd/mtdpart.c | 661 +++++++++++++++++++++------------ include/jffs2/load_kernel.h | 7 +- include/linux/mtd/mtd.h | 31 ++ include/linux/mtd/partitions.h | 5 +- include/mtd.h | 3 + lib/strto.c | 26 +- 15 files changed, 1093 insertions(+), 349 deletions(-) create mode 100644 cmd/mtd.c -- 2.17.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot