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

Jagan Teki jagan at amarulasolutions.com
Thu Jul 9 13:17:04 CEST 2020


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(-)

-- 
2.25.1



More information about the U-Boot mailing list