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 731133 14696 0 745829 b6165 u-boot
AFTER 732301 14696 0 746997 b65f5 u-boot
DELTA +1168 0 0
TINY:
text data bss dec hex filename
BEFORE 80492 3744 248 84484 14a04 spl/u-boot-spl
AFTER 80748 3744 248 84740 14b04 spl/u-boot-spl
DELTA +256
---
Changes in v2:
- Rebase on top of next
- Link to v1:
https://lore.kernel.org/u-boot/20260612-split-id-table-into-vendor-files-v1-0-dfaaa82cc...@infineon.com/
To: [email protected]
Cc: Tom Rini <[email protected]>
Cc: Vignesh R <[email protected]>
Cc: Michael Walle <[email protected]>
Cc: Miquel Raynal <[email protected]>
Cc: Tudor Ambarus <[email protected]>
Cc: Pratyush Yadav <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Tanmay Kathpalia <[email protected]>
Cc: Raymond Mao <[email protected]>
Cc: Ssunk <[email protected]>
Cc: Flaviu Nistor <[email protected]>
Cc: Eugen Hristev <[email protected]>
Cc: Jeffrey Yu <[email protected]>
Signed-off-by: Takahiro Kuwano <[email protected]>
---
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 | 18 +
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 | 140 ++
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 | 752 +----------
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 | 27 +
drivers/mtd/spi/xtx.c | 54 +
drivers/mtd/spi/zbit.c | 19 +
include/linux/mtd/spi-nor.h | 2 +
24 files changed, 3378 insertions(+), 2971 deletions(-)
---
base-commit: 6b78e91c4d4e9c47fe825bd2d31c0496d15f03d9
change-id: 20260924-split-sfdp-id-560cb00d1405
Best regards,
--
Takahiro Kuwano <[email protected]>