mbox series

[v5,0/3] Introduce mtdblock device

Message ID 20240603155702.1840464-1-avromanov@salutedevices.com
Headers show
Series Introduce mtdblock device | expand

Message

Alexey Romanov June 3, 2024, 3:56 p.m. UTC
Hello!

This series adds support for the mtdblock 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 mtd 0 part_name

Tested only on SPI NAND, so bind is made only for
SPI NAND drivers.

---

Changes V1 -> V2 [1]:

  - Drop patch [2].
  - Add warning if bind NAND mtdblock device.
  - Move documentation of mtdblock implementation
    from commit message to the source code.
  - Remove __maybe_unused from mtd partition functions
    description.
  - Use blk_enabled() instead of #ifdefs.

Changes V2 -> V3 [2]:

  - Rebased over [3].
  - Rename mtd_bread/bwrite -> mtd_blk_read/write.
  - Fix GPL-2.0 license short name definiton in headers.
  - Add empty line after MTD_ENTRY_NUMBERS define.

Changes V3 -> V4 [4]:

  - Fix build warnings: use LBAF printf format string for lbaint_t types.

Changes V4 -> V5 [5]:

  - Rebased over u-boot/master.
  - Fix build errors and warnings if CONFIG_BLK isn't enabled.
  - Fix failed tests in cases is mtdblock device isn't binded.

Links:

  - [1] https://lore.kernel.org/all/20240227100441.1811047-1-avromanov@salutedevices.com/
  - [2] https://lore.kernel.org/all/20240227100441.1811047-5-avromanov@salutedevices.com/
  - [3] https://lore.kernel.org/u-boot/20240403114047.84030-1-heinrich.schuchardt@canonical.com/T/#u
  - [4] https://lore.kernel.org/all/20240404105813.1520732-1-avromanov@salutedevices.com/
  - [5] https://lore.kernel.org/all/20240524102920.2631731-1-avromanov@salutedevices.com/

Alexey Romanov (3):
  disk: support MTD partitions
  drivers: introduce mtdblock abstraction
  spinand: bind mtdblock

 disk/part.c                 |   3 +-
 drivers/block/blk-uclass.c  |   1 +
 drivers/mtd/Kconfig         |   1 +
 drivers/mtd/Makefile        |   1 +
 drivers/mtd/mtdblock.c      | 227 ++++++++++++++++++++++++++++++++++++
 drivers/mtd/mtdpart.c       |  76 ++++++++++++
 drivers/mtd/nand/spi/core.c |  20 ++++
 include/linux/mtd/mtd.h     |  21 ++++
 include/part.h              |   3 +
 9 files changed, 352 insertions(+), 1 deletion(-)
 create mode 100644 drivers/mtd/mtdblock.c

Comments

Simon Glass June 5, 2024, 2:13 a.m. UTC | #1
Hi Alexey,

On Mon, Jun 3, 2024, 09:57 Alexey Romanov <avromanov@salutedevices.com>
wrote:

> Hello!
>
> This series adds support for the mtdblock 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 mtd 0 part_name
>
> Tested only on SPI NAND, so bind is made only for
> SPI NAND drivers.
>
> ---
>
> Changes V1 -> V2 [1]:
>
>   - Drop patch [2].
>   - Add warning if bind NAND mtdblock device.
>   - Move documentation of mtdblock implementation
>     from commit message to the source code.
>   - Remove __maybe_unused from mtd partition functions
>     description.
>   - Use blk_enabled() instead of #ifdefs.
>
> Changes V2 -> V3 [2]:
>
>   - Rebased over [3].
>   - Rename mtd_bread/bwrite -> mtd_blk_read/write.
>   - Fix GPL-2.0 license short name definiton in headers.
>   - Add empty line after MTD_ENTRY_NUMBERS define.
>
> Changes V3 -> V4 [4]:
>
>   - Fix build warnings: use LBAF printf format string for lbaint_t types.
>
> Changes V4 -> V5 [5]:
>
>   - Rebased over u-boot/master.
>   - Fix build errors and warnings if CONFIG_BLK isn't enabled.
>   - Fix failed tests in cases is mtdblock device isn't binded.
>
> Links:
>
>   - [1]
> https://lore.kernel.org/all/20240227100441.1811047-1-avromanov@salutedevices.com/
>   - [2]
> https://lore.kernel.org/all/20240227100441.1811047-5-avromanov@salutedevices.com/
>   - [3]
> https://lore.kernel.org/u-boot/20240403114047.84030-1-heinrich.schuchardt@canonical.com/T/#u
>   - [4]
> https://lore.kernel.org/all/20240404105813.1520732-1-avromanov@salutedevices.com/
>   - [5]
> https://lore.kernel.org/all/20240524102920.2631731-1-avromanov@salutedevices.com/
>
> Alexey Romanov (3):
>   disk: support MTD partitions
>   drivers: introduce mtdblock abstraction
>   spinand: bind mtdblock
>
>  disk/part.c                 |   3 +-
>  drivers/block/blk-uclass.c  |   1 +
>  drivers/mtd/Kconfig         |   1 +
>  drivers/mtd/Makefile        |   1 +
>  drivers/mtd/mtdblock.c      | 227 ++++++++++++++++++++++++++++++++++++
>  drivers/mtd/mtdpart.c       |  76 ++++++++++++
>  drivers/mtd/nand/spi/core.c |  20 ++++
>  include/linux/mtd/mtd.h     |  21 ++++
>  include/part.h              |   3 +
>  9 files changed, 352 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/mtd/mtdblock.c
>
> --
> 2.34.1
>
>
Alexey Romanov June 5, 2024, 10:09 a.m. UTC | #2
Hi Simon,
your message is empty.

On Tue, Jun 04, 2024 at 08:13:34PM -0600, Simon Glass wrote:
> Hi Alexey,
> 
> On Mon, Jun 3, 2024, 09:57 Alexey Romanov <avromanov@salutedevices.com>
> wrote:
> 
> > Hello!
> >
> > This series adds support for the mtdblock 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 mtd 0 part_name
> >
> > Tested only on SPI NAND, so bind is made only for
> > SPI NAND drivers.
> >
> > ---
> >
> > Changes V1 -> V2 [1]:
> >
> >   - Drop patch [2].
> >   - Add warning if bind NAND mtdblock device.
> >   - Move documentation of mtdblock implementation
> >     from commit message to the source code.
> >   - Remove __maybe_unused from mtd partition functions
> >     description.
> >   - Use blk_enabled() instead of #ifdefs.
> >
> > Changes V2 -> V3 [2]:
> >
> >   - Rebased over [3].
> >   - Rename mtd_bread/bwrite -> mtd_blk_read/write.
> >   - Fix GPL-2.0 license short name definiton in headers.
> >   - Add empty line after MTD_ENTRY_NUMBERS define.
> >
> > Changes V3 -> V4 [4]:
> >
> >   - Fix build warnings: use LBAF printf format string for lbaint_t types.
> >
> > Changes V4 -> V5 [5]:
> >
> >   - Rebased over u-boot/master.
> >   - Fix build errors and warnings if CONFIG_BLK isn't enabled.
> >   - Fix failed tests in cases is mtdblock device isn't binded.
> >
> > Links:
> >
> >   - [1]
> > https://lore.kernel.org/all/20240227100441.1811047-1-avromanov@salutedevices.com/
> >   - [2]
> > https://lore.kernel.org/all/20240227100441.1811047-5-avromanov@salutedevices.com/
> >   - [3]
> > https://lore.kernel.org/u-boot/20240403114047.84030-1-heinrich.schuchardt@canonical.com/T/#u
> >   - [4]
> > https://lore.kernel.org/all/20240404105813.1520732-1-avromanov@salutedevices.com/
> >   - [5]
> > https://lore.kernel.org/all/20240524102920.2631731-1-avromanov@salutedevices.com/
> >
> > Alexey Romanov (3):
> >   disk: support MTD partitions
> >   drivers: introduce mtdblock abstraction
> >   spinand: bind mtdblock
> >
> >  disk/part.c                 |   3 +-
> >  drivers/block/blk-uclass.c  |   1 +
> >  drivers/mtd/Kconfig         |   1 +
> >  drivers/mtd/Makefile        |   1 +
> >  drivers/mtd/mtdblock.c      | 227 ++++++++++++++++++++++++++++++++++++
> >  drivers/mtd/mtdpart.c       |  76 ++++++++++++
> >  drivers/mtd/nand/spi/core.c |  20 ++++
> >  include/linux/mtd/mtd.h     |  21 ++++
> >  include/part.h              |   3 +
> >  9 files changed, 352 insertions(+), 1 deletion(-)
> >  create mode 100644 drivers/mtd/mtdblock.c
> >
> > --
> > 2.34.1
> >
> >
Simon Glass June 5, 2024, 1:17 p.m. UTC | #3
Hi Alexey,

On Wed, 5 Jun 2024 at 04:09, Alexey Romanov <avromanov@salutedevices.com> wrote:
>
> Hi Simon,
> your message is empty.
>
> On Tue, Jun 04, 2024 at 08:13:34PM -0600, Simon Glass wrote:
> > Hi Alexey,
> >
> > On Mon, Jun 3, 2024, 09:57 Alexey Romanov <avromanov@salutedevices.com>
> > wrote:
> >
> > > Hello!
> > >
> > > This series adds support for the mtdblock 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 mtd 0 part_name
> > >
> > > Tested only on SPI NAND, so bind is made only for
> > > SPI NAND drivers.
> > >
> > > ---
> > >
> > > Changes V1 -> V2 [1]:
> > >
> > >   - Drop patch [2].
> > >   - Add warning if bind NAND mtdblock device.
> > >   - Move documentation of mtdblock implementation
> > >     from commit message to the source code.
> > >   - Remove __maybe_unused from mtd partition functions
> > >     description.
> > >   - Use blk_enabled() instead of #ifdefs.
> > >
> > > Changes V2 -> V3 [2]:
> > >
> > >   - Rebased over [3].
> > >   - Rename mtd_bread/bwrite -> mtd_blk_read/write.
> > >   - Fix GPL-2.0 license short name definiton in headers.
> > >   - Add empty line after MTD_ENTRY_NUMBERS define.
> > >
> > > Changes V3 -> V4 [4]:
> > >
> > >   - Fix build warnings: use LBAF printf format string for lbaint_t types.
> > >
> > > Changes V4 -> V5 [5]:
> > >
> > >   - Rebased over u-boot/master.
> > >   - Fix build errors and warnings if CONFIG_BLK isn't enabled.
> > >   - Fix failed tests in cases is mtdblock device isn't binded.
> > >
> > > Links:
> > >
> > >   - [1]
> > > https://lore.kernel.org/all/20240227100441.1811047-1-avromanov@salutedevices.com/
> > >   - [2]
> > > https://lore.kernel.org/all/20240227100441.1811047-5-avromanov@salutedevices.com/
> > >   - [3]
> > > https://lore.kernel.org/u-boot/20240403114047.84030-1-heinrich.schuchardt@canonical.com/T/#u
> > >   - [4]
> > > https://lore.kernel.org/all/20240404105813.1520732-1-avromanov@salutedevices.com/
> > >   - [5]
> > > https://lore.kernel.org/all/20240524102920.2631731-1-avromanov@salutedevices.com/
> > >
> > > Alexey Romanov (3):
> > >   disk: support MTD partitions
> > >   drivers: introduce mtdblock abstraction
> > >   spinand: bind mtdblock
> > >
> > >  disk/part.c                 |   3 +-
> > >  drivers/block/blk-uclass.c  |   1 +
> > >  drivers/mtd/Kconfig         |   1 +
> > >  drivers/mtd/Makefile        |   1 +
> > >  drivers/mtd/mtdblock.c      | 227 ++++++++++++++++++++++++++++++++++++
> > >  drivers/mtd/mtdpart.c       |  76 ++++++++++++
> > >  drivers/mtd/nand/spi/core.c |  20 ++++
> > >  include/linux/mtd/mtd.h     |  21 ++++
> > >  include/part.h              |   3 +
> > >  9 files changed, 352 insertions(+), 1 deletion(-)
> > >  create mode 100644 drivers/mtd/mtdblock.c
> > >
> > > --
> > > 2.34.1
> > >
> > >
>

Are you able to add a sandbox test for this code?

Regards,
Simon
Dario Binacchi June 14, 2024, 8:09 a.m. UTC | #4
Hi Alexey,

I'm still encountering errors raised by the CI:

$ tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
--board ${TEST_PY_BD} ${OVERRIDE}
34Building current source for 1 boards (1 thread, 32 jobs per thread)
35 arm: + evb-ast2500
36+In file included from include/nand.h:19,
37+ from cmd/bootm.c:17:
38+include/linux/mtd/mtd.h:430:55: error: 'struct blk_desc' declared
inside parameter list will not be visible outside of this definition
or declaration [-Werror]
39+ 430 | static inline struct mtd_info *blk_desc_to_mtd(struct blk_desc *bdesc)

Thanks and regards,
Dario

On Wed, Jun 5, 2024 at 3:17 PM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Alexey,
>
> On Wed, 5 Jun 2024 at 04:09, Alexey Romanov <avromanov@salutedevices.com> wrote:
> >
> > Hi Simon,
> > your message is empty.
> >
> > On Tue, Jun 04, 2024 at 08:13:34PM -0600, Simon Glass wrote:
> > > Hi Alexey,
> > >
> > > On Mon, Jun 3, 2024, 09:57 Alexey Romanov <avromanov@salutedevices.com>
> > > wrote:
> > >
> > > > Hello!
> > > >
> > > > This series adds support for the mtdblock 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 mtd 0 part_name
> > > >
> > > > Tested only on SPI NAND, so bind is made only for
> > > > SPI NAND drivers.
> > > >
> > > > ---
> > > >
> > > > Changes V1 -> V2 [1]:
> > > >
> > > >   - Drop patch [2].
> > > >   - Add warning if bind NAND mtdblock device.
> > > >   - Move documentation of mtdblock implementation
> > > >     from commit message to the source code.
> > > >   - Remove __maybe_unused from mtd partition functions
> > > >     description.
> > > >   - Use blk_enabled() instead of #ifdefs.
> > > >
> > > > Changes V2 -> V3 [2]:
> > > >
> > > >   - Rebased over [3].
> > > >   - Rename mtd_bread/bwrite -> mtd_blk_read/write.
> > > >   - Fix GPL-2.0 license short name definiton in headers.
> > > >   - Add empty line after MTD_ENTRY_NUMBERS define.
> > > >
> > > > Changes V3 -> V4 [4]:
> > > >
> > > >   - Fix build warnings: use LBAF printf format string for lbaint_t types.
> > > >
> > > > Changes V4 -> V5 [5]:
> > > >
> > > >   - Rebased over u-boot/master.
> > > >   - Fix build errors and warnings if CONFIG_BLK isn't enabled.
> > > >   - Fix failed tests in cases is mtdblock device isn't binded.
> > > >
> > > > Links:
> > > >
> > > >   - [1]
> > > > https://lore.kernel.org/all/20240227100441.1811047-1-avromanov@salutedevices.com/
> > > >   - [2]
> > > > https://lore.kernel.org/all/20240227100441.1811047-5-avromanov@salutedevices.com/
> > > >   - [3]
> > > > https://lore.kernel.org/u-boot/20240403114047.84030-1-heinrich.schuchardt@canonical.com/T/#u
> > > >   - [4]
> > > > https://lore.kernel.org/all/20240404105813.1520732-1-avromanov@salutedevices.com/
> > > >   - [5]
> > > > https://lore.kernel.org/all/20240524102920.2631731-1-avromanov@salutedevices.com/
> > > >
> > > > Alexey Romanov (3):
> > > >   disk: support MTD partitions
> > > >   drivers: introduce mtdblock abstraction
> > > >   spinand: bind mtdblock
> > > >
> > > >  disk/part.c                 |   3 +-
> > > >  drivers/block/blk-uclass.c  |   1 +
> > > >  drivers/mtd/Kconfig         |   1 +
> > > >  drivers/mtd/Makefile        |   1 +
> > > >  drivers/mtd/mtdblock.c      | 227 ++++++++++++++++++++++++++++++++++++
> > > >  drivers/mtd/mtdpart.c       |  76 ++++++++++++
> > > >  drivers/mtd/nand/spi/core.c |  20 ++++
> > > >  include/linux/mtd/mtd.h     |  21 ++++
> > > >  include/part.h              |   3 +
> > > >  9 files changed, 352 insertions(+), 1 deletion(-)
> > > >  create mode 100644 drivers/mtd/mtdblock.c
> > > >
> > > > --
> > > > 2.34.1
> > > >
> > > >
> >
>
> Are you able to add a sandbox test for this code?
>
> Regards,
> Simon
Alexey Romanov June 17, 2024, 11:14 a.m. UTC | #5
Hello,

On Fri, Jun 14, 2024 at 10:09:27AM +0200, Dario Binacchi wrote:
> Hi Alexey,
> 
> I'm still encountering errors raised by the CI:

I'm sorry. I tested my patches with GitHub + Azure Pipelines and 
didn't get any errors like that. I thought testing there uses buildman.
I'll try to run it locally.

> 
> $ tools/buildman/buildman -o ${UBOOT_TRAVIS_BUILD_DIR} -w -E -W -e
> --board ${TEST_PY_BD} ${OVERRIDE}
> 34Building current source for 1 boards (1 thread, 32 jobs per thread)
> 35 arm: + evb-ast2500
> 36+In file included from include/nand.h:19,
> 37+ from cmd/bootm.c:17:
> 38+include/linux/mtd/mtd.h:430:55: error: 'struct blk_desc' declared
> inside parameter list will not be visible outside of this definition
> or declaration [-Werror]
> 39+ 430 | static inline struct mtd_info *blk_desc_to_mtd(struct blk_desc *bdesc)
> 
> Thanks and regards,
> Dario
> 
> On Wed, Jun 5, 2024 at 3:17 PM Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Alexey,
> >
> > On Wed, 5 Jun 2024 at 04:09, Alexey Romanov <avromanov@salutedevices.com> wrote:
> > >
> > > Hi Simon,
> > > your message is empty.
> > >
> > > On Tue, Jun 04, 2024 at 08:13:34PM -0600, Simon Glass wrote:
> > > > Hi Alexey,
> > > >
> > > > On Mon, Jun 3, 2024, 09:57 Alexey Romanov <avromanov@salutedevices.com>
> > > > wrote:
> > > >
> > > > > Hello!
> > > > >
> > > > > This series adds support for the mtdblock 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 mtd 0 part_name
> > > > >
> > > > > Tested only on SPI NAND, so bind is made only for
> > > > > SPI NAND drivers.
> > > > >
> > > > > ---
> > > > >
> > > > > Changes V1 -> V2 [1]:
> > > > >
> > > > >   - Drop patch [2].
> > > > >   - Add warning if bind NAND mtdblock device.
> > > > >   - Move documentation of mtdblock implementation
> > > > >     from commit message to the source code.
> > > > >   - Remove __maybe_unused from mtd partition functions
> > > > >     description.
> > > > >   - Use blk_enabled() instead of #ifdefs.
> > > > >
> > > > > Changes V2 -> V3 [2]:
> > > > >
> > > > >   - Rebased over [3].
> > > > >   - Rename mtd_bread/bwrite -> mtd_blk_read/write.
> > > > >   - Fix GPL-2.0 license short name definiton in headers.
> > > > >   - Add empty line after MTD_ENTRY_NUMBERS define.
> > > > >
> > > > > Changes V3 -> V4 [4]:
> > > > >
> > > > >   - Fix build warnings: use LBAF printf format string for lbaint_t types.
> > > > >
> > > > > Changes V4 -> V5 [5]:
> > > > >
> > > > >   - Rebased over u-boot/master.
> > > > >   - Fix build errors and warnings if CONFIG_BLK isn't enabled.
> > > > >   - Fix failed tests in cases is mtdblock device isn't binded.
> > > > >
> > > > > Links:
> > > > >
> > > > >   - [1]
> > > > > https://lore.kernel.org/all/20240227100441.1811047-1-avromanov@salutedevices.com/
> > > > >   - [2]
> > > > > https://lore.kernel.org/all/20240227100441.1811047-5-avromanov@salutedevices.com/
> > > > >   - [3]
> > > > > https://lore.kernel.org/u-boot/20240403114047.84030-1-heinrich.schuchardt@canonical.com/T/#u
> > > > >   - [4]
> > > > > https://lore.kernel.org/all/20240404105813.1520732-1-avromanov@salutedevices.com/
> > > > >   - [5]
> > > > > https://lore.kernel.org/all/20240524102920.2631731-1-avromanov@salutedevices.com/
> > > > >
> > > > > Alexey Romanov (3):
> > > > >   disk: support MTD partitions
> > > > >   drivers: introduce mtdblock abstraction
> > > > >   spinand: bind mtdblock
> > > > >
> > > > >  disk/part.c                 |   3 +-
> > > > >  drivers/block/blk-uclass.c  |   1 +
> > > > >  drivers/mtd/Kconfig         |   1 +
> > > > >  drivers/mtd/Makefile        |   1 +
> > > > >  drivers/mtd/mtdblock.c      | 227 ++++++++++++++++++++++++++++++++++++
> > > > >  drivers/mtd/mtdpart.c       |  76 ++++++++++++
> > > > >  drivers/mtd/nand/spi/core.c |  20 ++++
> > > > >  include/linux/mtd/mtd.h     |  21 ++++
> > > > >  include/part.h              |   3 +
> > > > >  9 files changed, 352 insertions(+), 1 deletion(-)
> > > > >  create mode 100644 drivers/mtd/mtdblock.c
> > > > >
> > > > > --
> > > > > 2.34.1
> > > > >
> > > > >
> > >
> >
> > Are you able to add a sandbox test for this code?
> >
> > Regards,
> > Simon
> 
> 
> 
> -- 
> 
> Dario Binacchi
> 
> Senior Embedded Linux Developer
> 
> dario.binacchi@amarulasolutions.com
> 
> __________________________________
> 
> 
> Amarula Solutions SRL
> 
> Via Le Canevare 30, 31100 Treviso, Veneto, IT
> 
> T. +39 042 243 5310
> info@amarulasolutions.com
> 
> www.amarulasolutions.com
Alexey Romanov June 25, 2024, 12:48 p.m. UTC | #6
Hi Simon,

On Wed, Jun 05, 2024 at 07:17:34AM -0600, Simon Glass wrote:
> Hi Alexey,
> 
> On Wed, 5 Jun 2024 at 04:09, Alexey Romanov <avromanov@salutedevices.com> wrote:
> >
> > Hi Simon,
> > your message is empty.
> >
> > On Tue, Jun 04, 2024 at 08:13:34PM -0600, Simon Glass wrote:
> > > Hi Alexey,
> > >
> > > On Mon, Jun 3, 2024, 09:57 Alexey Romanov <avromanov@salutedevices.com>
> > > wrote:
> > >
> > > > Hello!
> > > >
> > > > This series adds support for the mtdblock 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 mtd 0 part_name
> > > >
> > > > Tested only on SPI NAND, so bind is made only for
> > > > SPI NAND drivers.
> > > >
> > > > ---
> > > >
> > > > Changes V1 -> V2 [1]:
> > > >
> > > >   - Drop patch [2].
> > > >   - Add warning if bind NAND mtdblock device.
> > > >   - Move documentation of mtdblock implementation
> > > >     from commit message to the source code.
> > > >   - Remove __maybe_unused from mtd partition functions
> > > >     description.
> > > >   - Use blk_enabled() instead of #ifdefs.
> > > >
> > > > Changes V2 -> V3 [2]:
> > > >
> > > >   - Rebased over [3].
> > > >   - Rename mtd_bread/bwrite -> mtd_blk_read/write.
> > > >   - Fix GPL-2.0 license short name definiton in headers.
> > > >   - Add empty line after MTD_ENTRY_NUMBERS define.
> > > >
> > > > Changes V3 -> V4 [4]:
> > > >
> > > >   - Fix build warnings: use LBAF printf format string for lbaint_t types.
> > > >
> > > > Changes V4 -> V5 [5]:
> > > >
> > > >   - Rebased over u-boot/master.
> > > >   - Fix build errors and warnings if CONFIG_BLK isn't enabled.
> > > >   - Fix failed tests in cases is mtdblock device isn't binded.
> > > >
> > > > Links:
> > > >
> > > >   - [1]
> > > > https://lore.kernel.org/all/20240227100441.1811047-1-avromanov@salutedevices.com/
> > > >   - [2]
> > > > https://lore.kernel.org/all/20240227100441.1811047-5-avromanov@salutedevices.com/
> > > >   - [3]
> > > > https://lore.kernel.org/u-boot/20240403114047.84030-1-heinrich.schuchardt@canonical.com/T/#u
> > > >   - [4]
> > > > https://lore.kernel.org/all/20240404105813.1520732-1-avromanov@salutedevices.com/
> > > >   - [5]
> > > > https://lore.kernel.org/all/20240524102920.2631731-1-avromanov@salutedevices.com/
> > > >
> > > > Alexey Romanov (3):
> > > >   disk: support MTD partitions
> > > >   drivers: introduce mtdblock abstraction
> > > >   spinand: bind mtdblock
> > > >
> > > >  disk/part.c                 |   3 +-
> > > >  drivers/block/blk-uclass.c  |   1 +
> > > >  drivers/mtd/Kconfig         |   1 +
> > > >  drivers/mtd/Makefile        |   1 +
> > > >  drivers/mtd/mtdblock.c      | 227 ++++++++++++++++++++++++++++++++++++
> > > >  drivers/mtd/mtdpart.c       |  76 ++++++++++++
> > > >  drivers/mtd/nand/spi/core.c |  20 ++++
> > > >  include/linux/mtd/mtd.h     |  21 ++++
> > > >  include/part.h              |   3 +
> > > >  9 files changed, 352 insertions(+), 1 deletion(-)
> > > >  create mode 100644 drivers/mtd/mtdblock.c
> > > >
> > > > --
> > > > 2.34.1
> > > >
> > > >
> >
> 
> Are you able to add a sandbox test for this code?

I think no. mtd/ubi block devices at the moment binds
to real SPI NAND devices, which makes it impossible and useless 
to test it with sandbox.

> 
> Regards,
> Simon