Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756164AbdIGVXH (ORCPT ); Thu, 7 Sep 2017 17:23:07 -0400 Received: from 9.mo5.mail-out.ovh.net ([178.32.96.204]:39304 "EHLO 9.mo5.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751456AbdIGVXF (ORCPT ); Thu, 7 Sep 2017 17:23:05 -0400 X-Greylist: delayed 8878 seconds by postgrey-1.27 at vger.kernel.org; Thu, 07 Sep 2017 17:23:05 EDT From: Cyrille Pitchen To: marek.vasut@gmail.com, linux-mtd@lists.infradead.org, geert@linux-m68k.org Cc: computersforpeace@gmail.com, dwmw2@infradead.org, boris.brezillon@free-electrons.com, richard@nod.at, linux-kernel@vger.kernel.org, Cyrille Pitchen Subject: [DEBUG] mtd: spi-nor: dump DWORDs of the Basic Flash Parameter Table Date: Thu, 7 Sep 2017 20:54:56 +0200 Message-Id: <20170907185456.4631-1-cyrille.pitchen@wedev4u.fr> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-Ovh-Tracer-Id: 10811453856571938696 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeelledrfedvgdduvdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenuc Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2462 Lines: 63 debug purpose only, should not be merged! Signed-off-by: Cyrille Pitchen --- Hi Geert, Can you apply this patch on your tree then report me what was printed, please? I have an idea of the root cause of your issue then a potential work-around but I first need to validate my assumption to confirm that the work-around would actually work. For instance, here is what I get with a Macronix MX25L25673G (same JEDEC ID as MX25L25635E): [ 0.700000] atmel_qspi f0020000.spi: DWORD1 = 0xfffb20e5 [ 0.710000] atmel_qspi f0020000.spi: DWORD2 = 0x0fffffff [ 0.710000] atmel_qspi f0020000.spi: DWORD3 = 0x6b08eb44 [ 0.720000] atmel_qspi f0020000.spi: DWORD4 = 0xbb043b08 [ 0.720000] atmel_qspi f0020000.spi: DWORD5 = 0xfffffffe [ 0.720000] atmel_qspi f0020000.spi: DWORD6 = 0xff00ffff [ 0.730000] atmel_qspi f0020000.spi: DWORD7 = 0xeb44ffff [ 0.730000] atmel_qspi f0020000.spi: DWORD8 = 0x520f200c [ 0.740000] atmel_qspi f0020000.spi: DWORD9 = 0xff00d810 [ 0.740000] atmel_qspi f0020000.spi: DWORD10 = 0x00dd59d6 [ 0.740000] atmel_qspi f0020000.spi: DWORD11 = 0xdb039f82 [ 0.750000] atmel_qspi f0020000.spi: DWORD12 = 0x38670344 [ 0.750000] atmel_qspi f0020000.spi: DWORD13 = 0xb030b030 [ 0.760000] atmel_qspi f0020000.spi: DWORD14 = 0x5cd5bdf7 [ 0.760000] atmel_qspi f0020000.spi: DWORD15 = 0xff299e4a [ 0.760000] atmel_qspi f0020000.spi: DWORD16 = 0x85f950f0 [ 0.770000] atmel_qspi f0020000.spi: BFPT version 1.6 (length = 16) [ 0.770000] atmel_qspi f0020000.spi: mx25l25635e (32768 Kbytes) Best regards, Cyrille drivers/mtd/spi-nor/spi-nor.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 05254dd6a4a0..5066d99b9f50 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -2136,8 +2136,14 @@ static int spi_nor_parse_bfpt(struct spi_nor *nor, return err; /* Fix endianness of the BFPT DWORDs. */ - for (i = 0; i < BFPT_DWORD_MAX; i++) + for (i = 0; i < BFPT_DWORD_MAX; i++) { bfpt.dwords[i] = le32_to_cpu(bfpt.dwords[i]); + dev_info(nor->dev, "DWORD%d = 0x%08x\n", i + 1, bfpt.dwords[i]); + } + dev_info(nor->dev, "BFPT version %d.%d (length = %u)\n", + bfpt_header->major, + bfpt_header->minor, + bfpt_header->length); /* Number of address bytes. */ switch (bfpt.dwords[BFPT_DWORD(1)] & BFPT_DWORD1_ADDRESS_BYTES_MASK) { -- 2.11.0