mtd: spi-nor: spansion: switch cypress_nor_get_page_size() to use vreg_offset
authorTudor Ambarus <tudor.ambarus@linaro.org>
Wed, 26 Jul 2023 07:52:57 +0000 (10:52 +0300)
committerTudor Ambarus <tudor.ambarus@linaro.org>
Wed, 26 Jul 2023 09:39:11 +0000 (12:39 +0300)
commitaa517a29d6457e8afcbe8e7e9eb8813594c39d1f
tree578034bb7ce559698084aacb988fb2783655d18e
parentfb63bfad1e8f9f893c2bd5fa3eecb92aa632a3e8
mtd: spi-nor: spansion: switch cypress_nor_get_page_size() to use vreg_offset

All users of cypress_nor_get_page_size() but S25FS256T retrieve n_dice
and vreg_offset from SFDP. S25FS256T does not define the SCCR map to
retrive the vreg_offset, but it does support it: SPINOR_REG_CYPRESS_VREG.
Switch cypress_nor_get_page_size() to always use vreg_offset so that we
use the same code base for both single and multi chip package flashes.
cypress_nor_get_page_size() is now called in the post_sfdp() hook instead
of post_bfpt(), as vreg_offset and n_dice are parsed after BFPT.
Consequently the null checks on n_dice and vreg_offset are moved to
the post_sfdp() hook.

Tested-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Link: https://lore.kernel.org/r/20230726075257.12985-12-tudor.ambarus@linaro.org
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
drivers/mtd/spi-nor/spansion.c