mtd: spi-nor: spansion: Rework cypress_nor_get_page_size() for multi-chip device...
authorTakahiro Kuwano <Takahiro.Kuwano@infineon.com>
Fri, 7 Apr 2023 06:41:01 +0000 (15:41 +0900)
committerTudor Ambarus <tudor.ambarus@linaro.org>
Sat, 8 Apr 2023 06:30:17 +0000 (09:30 +0300)
commit6c01ae11130ccb5f16e90ab0605198d25b7c1efa
treedbb6b20269244f4a80edbc0faa70356aec19ccdf
parent7ab8b810757a32b083c75a61b5638bca82e17a4c
mtd: spi-nor: spansion: Rework cypress_nor_get_page_size() for multi-chip device support

For multi-chip devices, we can use 512B page only when the all dice are
configured as 512B page size. The volatile register address is calculated
by using the volatile register addresses retrieved from the SCCR tables
and the (configuration) register offset.

The location of cypress_nor_set_page_size() call is moved from
post_bfpt_fixup() to post_sfdp_fixup(), because the number of dice and
volatile register offset are parsed in the optional SCCR tables.

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