From: Quanyang Wang <[email protected]> The zcu102 and zc706 boards support qspi dual mode, and in the dual mode, the erasesize for mtd device should be twice as much as the erasesize for each nor flash chip.
Signed-off-by: Quanyang Wang <[email protected]> --- drivers/mtd/spi-nor/spi-nor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index c6fca2a81c44..79f6a6f4445d 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -5446,7 +5446,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, struct device_node *np_spi; int ret; int i; - u32 is_dual; + u32 is_dual = 0; ret = spi_nor_check(nor); if (ret) @@ -5666,6 +5666,10 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, if (info->flags & SPI_NOR_4B_OPCODES) nor->flags |= SNOR_F_4B_OPCODES; + /* If in dual mode, erasesize should be doubled */ + if (is_dual) + mtd->erasesize = mtd->erasesize * 2; + ret = spi_nor_set_addr_width(nor); if (ret) return ret; -- 2.17.1
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#8245): https://lists.yoctoproject.org/g/linux-yocto/message/8245 Mute This Topic: https://lists.yoctoproject.org/mt/68786088/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
