[PATCH 0/4] mtd: spi-nor: split SFDP, ID database, and fixups

Takahiro Kuwano via B4 Relay devnull+takahiro.kuwano.infineon.com at kernel.org
Fri Jun 12 07:40:48 CEST 2026


The spi-nor-core.c contains optional logics like SFDP and manufcaturer
specific fixups. The spi-nor-ids.c has single large ID database. There
are many #ifdef directives in those files and that negatively affects
readability and maintainability.

This series, as the first step of cleanup, move SFDP logic, IDs, and
fixups to newly source files. Reworking, renaming, and reformating
existing code is not a scope of this series and further cleanup will be
taken place in follow-up patches.

Here is the code size impact when applying this series.
Measured by my AMD Zynq-7000 (ARM32) environment with SFDP and all
manufcaturers are enabled.

SPI-NOR:
            text    data     bss     dec     hex filename
BEFORE    726289   14084       0  740373   b4c15 u-boot
AFTER     727465   14084       0  741549   b50ad u-boot
DELTA      +1176       0       0

TINY:
            text    data     bss     dec     hex filename
BEFORE     77286    3160     248   80694   13b36 spl/u-boot-spl
AFTER      77542    3160     248   81086   13cbe spl/u-boot-spl
DELTA       +256

Signed-off-by: Takahiro Kuwano <takahiro.kuwano at infineon.com>
---
Takahiro Kuwano (4):
      mtd: spi-nor: move SFDP logic out of the core
      mtd: spi-nor: import manufacturer driver concept from Linux
      mtd: spi-nor: move flash info entries to manufacturer drivers
      mtd: spi-nor: move fixups to manufacturer drivers

 drivers/mtd/spi/Makefile        |   19 +
 drivers/mtd/spi/atmel.c         |   28 +
 drivers/mtd/spi/dosilicon.c     |   25 +
 drivers/mtd/spi/eon.c           |   23 +
 drivers/mtd/spi/fujitsu.c       |   27 +
 drivers/mtd/spi/gigadevice.c    |  136 ++
 drivers/mtd/spi/issi.c          |   84 ++
 drivers/mtd/spi/macronix.c      |  154 +++
 drivers/mtd/spi/micron-st.c     |  169 +++
 drivers/mtd/spi/puya.c          |   56 +
 drivers/mtd/spi/sf_internal.h   |  135 +-
 drivers/mtd/spi/sfdp.c          |  720 ++++++++++
 drivers/mtd/spi/sfdp.h          |  152 +++
 drivers/mtd/spi/siliconkaiser.c |   18 +
 drivers/mtd/spi/spansion.c      |  700 ++++++++++
 drivers/mtd/spi/spi-nor-core.c  | 2751 +++++++--------------------------------
 drivers/mtd/spi/spi-nor-ids.c   |  747 +----------
 drivers/mtd/spi/spi-nor-tiny.c  |   11 +-
 drivers/mtd/spi/sst.c           |   34 +
 drivers/mtd/spi/winbond.c       |  250 ++++
 drivers/mtd/spi/xmc.c           |   26 +
 drivers/mtd/spi/xtx.c           |   54 +
 drivers/mtd/spi/zbit.c          |   19 +
 include/linux/mtd/spi-nor.h     |    2 +
 24 files changed, 3374 insertions(+), 2966 deletions(-)
---
base-commit: 2d64a16d2558276fc8095ef2fae131829892d0f3
change-id: 20260602-split-id-table-into-vendor-files-7f6305cc3e2a

Best regards,
--  
Takahiro Kuwano <takahiro.kuwano at infineon.com>




More information about the U-Boot mailing list