From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHrkg-0000qz-4T for linux-mtd@lists.infradead.org; Wed, 31 Oct 2018 14:45:48 +0000 From: Boris Brezillon To: David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , linux-mtd@lists.infradead.org Cc: Alexandre Belloni , Tudor Ambarus , Cyrille Pitchen Subject: [PATCH v3 2/2] mtd: spi-nor: Use 4B opcodes when the NOR advertises both 3B and 4B Date: Wed, 31 Oct 2018 15:45:04 +0100 Message-Id: <20181031144504.19405-2-boris.brezillon@bootlin.com> In-Reply-To: <20181031144504.19405-1-boris.brezillon@bootlin.com> References: <20181031144504.19405-1-boris.brezillon@bootlin.com> List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , When the NOR supports 4 bytes opcodes we should use those instead of switching the flash in 4-bytes mode. This way, we don't have to restore the addressing mode when resetting the board. Reported-by: Alexandre Belloni Signed-off-by: Boris Brezillon Tested-by: Alexandre Belloni Reviewed-by: Cyrille Pitchen --- Changes in v3: - Add Alexandre R-b+T-b - Add Cyrille R-b Changes in v2 - None --- drivers/mtd/spi-nor/spi-nor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 798915b5c2b0..b20bc4b36f0f 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -2643,6 +2643,7 @@ static int spi_nor_parse_bfpt(struct spi_nor *nor, break; case BFPT_DWORD1_ADDRESS_BYTES_4_ONLY: + case BFPT_DWORD1_ADDRESS_BYTES_3_OR_4: nor->flags |= SNOR_F_4B_OPCODES; nor->addr_width = 4; break; -- 2.17.1