Hello! This series adds support for the UBI block device, which allows to read/write data block by block. For example, it can now be used for BCB or Android AB command:
$ bcb load ubi 0 part_name Tested only on SPI NAND, so bind is made only for SPI NAND drivers. Can be used with mtdblock device [1]. --- Changes V1 -> V2 [2]: - Rebased over mtdblock v2 patchset [3]. - Compile UBI partitions support only if CONFIG_BLK option is enabled. Changes V2 -> V3 [4]: - Fix build warnings: use LBAF printf format string for lbaint_t types. Changes V3 -> V4 [5]: - Rebased over u-boot/master. - Fix build errors and warnings if CONFIG_BLK isn't enabled. - Fix failed tests in cases is ubiblock device isn't binded. Changes V4 -> V5 [6]: - Rebased over u-boot/master. - Fix build errors when CONFIG_MTD and CONFIG_MTD_UBI isn't enabled. - Use auto blk device devnum generation when call blk_create_devicef (pass -1 parameter instead of dev_seq(dev)). Changes V5 -> V6 [7]: - Rebased over u-boot/master. - Introduce CONFIG_UBI_BLOCK which is disabled by default. - Fix undefined reference to `__aeabi_ldivmod' compiler error for 32-bit ARM targets. Links: [1] https://lore.kernel.org/all/20240227100441.1811047-1-avroma...@salutedevices.com/ [2] https://lore.kernel.org/all/20240306134906.1179285-1-avroma...@salutedevices.com/ [3] https://lore.kernel.org/all/20240307130726.1582487-1-avroma...@salutedevices.com/ [4] https://lore.kernel.org/all/20240325144148.3738195-1-avroma...@salutedevices.com/ [5] https://lore.kernel.org/all/20240524111319.3512009-1-avroma...@salutedevices.com/ [6] https://lore.kernel.org/all/20240603155740.1840571-1-avroma...@salutedevices.com/ [7] https://lore.kernel.org/all/20240626104527.2811828-1-avroma...@salutedevices.com/ Alexey Romanov (6): ubi: allow to read from volume with offset ubi: allow to write to volume with offset drivers: introduce UBI block abstraction disk: don't try search for partition type if already set disk: support UBI partitions spinand: bind UBI block cmd/ubi.c | 78 ++++++++++++++++++++-- disk/part.c | 7 ++ drivers/block/blk-uclass.c | 1 + drivers/mtd/nand/spi/core.c | 12 +++- drivers/mtd/ubi/Kconfig | 7 ++ drivers/mtd/ubi/Makefile | 1 + drivers/mtd/ubi/block.c | 130 ++++++++++++++++++++++++++++++++++++ drivers/mtd/ubi/part.c | 99 +++++++++++++++++++++++++++ env/ubi.c | 16 ++--- include/part.h | 2 + include/ubi_uboot.h | 13 +++- 11 files changed, 348 insertions(+), 18 deletions(-) create mode 100644 drivers/mtd/ubi/block.c create mode 100644 drivers/mtd/ubi/part.c -- 2.34.1