]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mtd: spi-nor: sfdp: introduce smpt_read_dummy fixup hook
authorTakahiro Kuwano <Takahiro.Kuwano@infineon.com>
Wed, 5 Nov 2025 07:47:58 +0000 (16:47 +0900)
committerPratyush Yadav <pratyush@kernel.org>
Mon, 10 Nov 2025 10:11:02 +0000 (11:11 +0100)
commit653f6def567c81f37302f9591ffd54df3e2a11eb
treef5a201c7e67690c55dba70311d0b4710b757c650
parent604cf6a40157abba4677dea9834de8df9047d798
mtd: spi-nor: sfdp: introduce smpt_read_dummy fixup hook

SMPT contains config detection info that describes opcode, address, and
dummy cycles to read sector map config. The dummy cycles parameter can
be SMPT_CMD_READ_DUMMY_IS_VARIABLE and in that case nor->read_dummy
(initialized as 0) is used. In Infineon flash chips, Read Any Register
command with variable dummy cycle is defined in SMPT. S25Hx/S28Hx flash
has 0 dummy cycle by default to read volatile regiters and
nor->read_dummy can work. S25FS-S flash has 8 dummy cycles so we need a
hook that can fix dummy cycles with actually used value.

Inroduce smpt_read_dummy() in struct spi_nor_fixups. It is called when
the dummy cycle field in SMPT config detection is 'varialble'.

Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Tested-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # S25FS512S
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Signed-off-by: Pratyush Yadav <pratyush@kernel.org>
drivers/mtd/spi-nor/core.h
drivers/mtd/spi-nor/sfdp.c