1
0
Fork 0

mtd: spi-nor: Fix selection of 4-byte addressing opcodes on Spansion

commit 440b6d5025 upstream.

mtd->size is still unassigned when running spansion_post_sfdp_fixups()
hook, therefore use nor->params.size to determine the size of flash device.

This makes sure that 4-byte addressing opcodes are used on Spansion
flashes that are larger than 16MiB and don't have SFDP 4BAIT table
populated.

Fixes: 92094ebc38 ("mtd: spi-nor: Add spansion_post_sfdp_fixups()")
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5.4-rM2-2.2.x-imx-squashed
Vignesh Raghavendra 2020-01-08 10:43:43 +05:30 committed by Greg Kroah-Hartman
parent f6e4244f8b
commit 144573be26
1 changed files with 1 additions and 3 deletions

View File

@ -4544,9 +4544,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor)
static void spansion_post_sfdp_fixups(struct spi_nor *nor)
{
struct mtd_info *mtd = &nor->mtd;
if (mtd->size <= SZ_16M)
if (nor->params.size <= SZ_16M)
return;
nor->flags |= SNOR_F_4B_OPCODES;