From patchwork Thu Sep 7 18:54:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyrille Pitchen X-Patchwork-Id: 811118 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EaSjzCs/"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xp8mh3j8Bz9sBW for ; Fri, 8 Sep 2017 04:56:04 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=1axOVeFZcfg27JapGlOU16FTXgGp8EshaMR7k/wQnOU=; b=EaSjzCs/Cv8Z97S00txEGuI5G5 c1qlsm/K6wdWaVGxi1t6gxxo84PN+qDemlyTx7luVTWRm3sSKgHge7A9O0XG39lLZcQgMt2fykjw/ uSZs3CC4pBXviDb7PdUd2IYuBMwnymlMRIOgg+xoMyF2uGM6QyZpo4QWM7EYGaFypGw6UT+2dyi1S GY47XSLPaT8WuYA13rC4fOViNz8K9Z15XgnYyzbd6V+2O/4YaIJWnnCUPoIbIww+tOmJs60fQiFYE N8PKwtj5bFLWtnJcKbqaDj5bkJnu0m7YybMj94n612Zr/7smi2dB0bNX83JE7BCqNS0f6BDNuExHT JLt7OFwQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dq1y1-0006SV-3a; Thu, 07 Sep 2017 18:55:57 +0000 Received: from 11.mo5.mail-out.ovh.net ([46.105.47.167]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dq1xb-000682-Ne for linux-mtd@lists.infradead.org; Thu, 07 Sep 2017 18:55:34 +0000 Received: from player786.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id D7BDA1258DB for ; Thu, 7 Sep 2017 20:55:07 +0200 (CEST) Received: from mountainer.wedev4u.int (cor13-1-82-232-94-13.fbx.proxad.net [82.232.94.13]) (Authenticated sender: cyrille.pitchen@wedev4u.fr) by player786.ha.ovh.net (Postfix) with ESMTPSA id 703FA80080; Thu, 7 Sep 2017 20:54:57 +0200 (CEST) From: Cyrille Pitchen To: marek.vasut@gmail.com, linux-mtd@lists.infradead.org, geert@linux-m68k.org 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: gggruggvucftvghtrhhoucdtuddrfeelledrfedvgdduvdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecufedttdenuc X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170907_115531_928219_A7252FF8 X-CRM114-Status: GOOD ( 11.07 ) X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [46.105.47.167 listed in list.dnswl.org] 1.7 URIBL_BLACK Contains an URL listed in the URIBL blacklist [URIs: wedev4u.fr] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [46.105.47.167 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: boris.brezillon@free-electrons.com, richard@nod.at, linux-kernel@vger.kernel.org, Cyrille Pitchen , computersforpeace@gmail.com, dwmw2@infradead.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org debug purpose only, should not be merged! Signed-off-by: Cyrille Pitchen Signed-off-by: Boris Brezillon Acked-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) {