Skip to content

mtd: Implement MTD UCLASS (use SPINOR)

Jagan Teki u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5mtd: spi: Drop redundent SPI flash driverarch/x86/cpu/apollolake/spl.c drivers/mtd/spi/sf-uclass.c include/spi_flash.h+28 -731 reply
2/5mtd: Add dm-mtd core opsdrivers/mtd/mtd-uclass.c include/mtd.h+79 -00 replies
3/5mtd: Add SPL_DM_MTD optiondrivers/mtd/Kconfig drivers/mtd/Makefile+9 -10 replies
4/5mtd: Build mtd-uclass as objdrivers/mtd/Makefile+3 -10 replies
5/5mtd: spi: Switch to MTD uclass (absolute UCLASS_SPI_FLASH)arch/arm/mach-rockchip/spl-boot-order.c arch/x86/cpu/apollolake/spl.c arch/x86/lib/fsp2/fsp_init.c +10 more+71 -1631 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] mtd: Implement MTD UCLASS (use SPINOR)

This was few years backlog work of mine, and it's been blocked to various reasons of having a priority to sync Linux MTD spinor code and most of the community developers are interested in feature-based Linux MTD sync/copy than full functional MTD driver model.

As years passing on to the driver model support the actual migration still seems a myth. So, let us not wait for too long to implement the basic driver model structure to MTD.

So, this series implement the MTD driver model in a fully functional way with all possible dm_mtd ops and necessary API to use SPINOR.

absolute spinor flow:
sf.c => sf uclass => sf driver => spi-nor-core
- flash operations via dm_spi_flash_ops

updated spinor flow:
sf.c => mtd uclass => mtd driver => spi-nor-core
- flash operations via mtd_ops (dm variant)

Future work:
- cleanup of spi_flash with spinor
- renaming of CONFIG option changes
- implement common mtd probe
- implement mtd flash interface types so that the respective ? commands like sf, mtd can make use of dm-mtd in the proper way.

Tested on real target with SPINOR test, and Boot.

Repo available at:
https://gitlab.denx.de/u-boot/custodians/u-boot-spi/-/tree/mtd

Any inputs?
Jagan.

Jagan Teki (5):
mtd: spi: Drop redundent SPI flash driver
mtd: Add dm-mtd core ops
mtd: Add SPL_DM_MTD option
mtd: Build mtd-uclass as obj
mtd: spi: Switch to MTD uclass (absolute UCLASS_SPI_FLASH)

 arch/arm/mach-rockchip/spl-boot-order.c |   4 +-
 arch/x86/cpu/apollolake/spl.c           |  68 +-----------
 arch/x86/lib/fsp2/fsp_init.c            |   2 +-
 arch/x86/lib/fsp2/fsp_support.c         |   7 +-
 arch/x86/lib/mrccache.c                 |   8 +-
 board/atmel/common/mac-spi-nor.c        |   4 +-
 drivers/mtd/Kconfig                     |   8 ++
 drivers/mtd/Makefile                    |   4 +-
 drivers/mtd/mtd-uclass.c                |  38 +++++++
 drivers/mtd/spi/Kconfig                 |   2 +
 drivers/mtd/spi/sandbox.c               |   2 +-
 drivers/mtd/spi/sf-uclass.c             | 135 ++++++++++--------------
 drivers/mtd/spi/sf_dataflash.c          |  25 +++--
 include/dm/uclass-id.h                  |   1 -
 include/mtd.h                           |  41 +++++++
 include/spi_flash.h                     |  65 +-----------
 test/dm/sf.c                            |  12 +--
 17 files changed, 189 insertions(+), 237 deletions(-)
Signature · 1 line
2.25.1