From patchwork Thu Nov 22 17:33:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu CASTET X-Patchwork-Id: 201098 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C230D2C00A5 for ; Fri, 23 Nov 2012 04:35:29 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tbafn-000129-N7; Thu, 22 Nov 2012 17:34:48 +0000 Received: from mail-bk0-f49.google.com ([209.85.214.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tbafg-0000xp-Un for linux-mtd@lists.infradead.org; Thu, 22 Nov 2012 17:34:42 +0000 Received: by mail-bk0-f49.google.com with SMTP id jm19so2317494bkc.36 for ; Thu, 22 Nov 2012 09:34:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=1xllEDzHsqyfm8yFeqTvsnsaiF3ZbmyffalQImDlG3E=; b=gv0KzNGacp5uie9Rblr4oM8k6ECqXsxry3Z+/R5WJyKkJ7A7mSg/sBYVNM129cLt2M iibRdGfuAwoHlaSvXEoifNT777xvWulI1OjkTRLwRQT8331it1KxOKCsB+jx0gSqvKW3 yzJ9OeiiTazJyOMoB4z0JqgeFlJDHQDFOlr1z80+9Ft6Zyp4Ve7+wrVzuXZNsuVtW9Im DxOuslPWwYk7jqGxQVOA7v5cAzVtDjl61RVpkmYJCBAeLq19zfl+RHBB7xrfxpGFOtbZ RYq1YFyzXw3NKAfcXqR2WxlK7GX0MbB3u8mQaNiQ0x+XSoqsuNejTKyToJ27lnhwfDMF U2YA== Received: by 10.204.5.69 with SMTP id 5mr565150bku.26.1353605679476; Thu, 22 Nov 2012 09:34:39 -0800 (PST) Received: from perruche.Parrot.Biz ([46.218.109.82]) by mx.google.com with ESMTPS id l17sm3070670bkw.12.2012.11.22.09.34.35 (version=SSLv3 cipher=OTHER); Thu, 22 Nov 2012 09:34:36 -0800 (PST) From: Matthieu CASTET To: linux-mtd@lists.infradead.org Subject: [PATCH V2] mtd nand : print flash size during detection Date: Thu, 22 Nov 2012 18:33:40 +0100 Message-Id: <1353605620-29549-1-git-send-email-matthieu.castet@parrot.com> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121122_123441_300917_6B98409E X-CRM114-Status: GOOD ( 11.11 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.214.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (matthieu.castet[at]gmail.com) -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.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Matthieu CASTET , dedekind1@gmail.com X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This help to detect bad flash identification in case the size is not present on the name (ONFI). Signed-off-by: Matthieu CASTET --- drivers/mtd/nand/nand_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 16e95e7..8eda5db 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -3285,10 +3285,10 @@ ident_done: chip->cmdfunc = nand_command_lp; pr_info("NAND device: Manufacturer ID: 0x%02x, Chip ID: 0x%02x (%s %s)," - " page size: %d, OOB size: %d\n", + " %dMiB, page size: %d, OOB size: %d\n", *maf_id, *dev_id, nand_manuf_ids[maf_idx].name, chip->onfi_version ? chip->onfi_params.model : type->name, - mtd->writesize, mtd->oobsize); + (int)(chip->chipsize >> 20), mtd->writesize, mtd->oobsize); return type; }