From patchwork Mon May 17 09:52:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 52772 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 90860B7D86 for ; Mon, 17 May 2010 19:54:30 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1ODx0G-0007nI-Sw; Mon, 17 May 2010 09:52:52 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1ODx0E-0007kV-IN for linux-mtd@bombadil.infradead.org; Mon, 17 May 2010 09:52:50 +0000 Received: from macbook.infradead.org ([2001:8b0:10b:1:216:eaff:fe05:bbb8]) by casper.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1ODx0C-0001OX-Ny; Mon, 17 May 2010 09:52:49 +0000 Subject: Re: [PATCH] mtd: gen_probe: use AMD standard command-set with Winbond flash chips From: David Woodhouse To: Guillaume LECERF In-Reply-To: <20100517093942.12147.98889.stgit@dev.siriade.com> References: <20100517093942.12147.98889.stgit@dev.siriade.com> Date: Mon, 17 May 2010 10:52:47 +0100 Message-ID: <1274089967.6930.6909.camel@macbook.infradead.org> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html Cc: linux-mtd@lists.infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org On Mon, 2010-05-17 at 11:39 +0200, Guillaume LECERF wrote: > Tested with W19L320SBT9C [1]. > > [1] http://www.datasheetarchive.com/pdf-datasheets/Datasheets-40/DSA-795343.pdf > > Signed-off-by: Obinou > Signed-off-by: Guillaume LECERF > --- > drivers/mtd/chips/gen_probe.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c > index 75a8f9d..3b9a284 100644 > --- a/drivers/mtd/chips/gen_probe.c > +++ b/drivers/mtd/chips/gen_probe.c > @@ -249,6 +249,7 @@ static struct mtd_info *check_cmd_set(struct map_info *map, int primary) > #ifdef CONFIG_MTD_CFI_AMDSTD > case P_ID_AMD_STD: > case P_ID_SST_OLD: > + case P_ID_WINBOND: > return cfi_cmdset_0002(map, primary); > #endif > #ifdef CONFIG_MTD_CFI_STAA Looks like this won't automatically load the cfi_cmdset_0002 module on demand, from cfi_cmdset_unknown(). See how the cfi_cmdset_0001 module does it with aliases for 0003 and 0200. Your recent addition of P_ID_SST_OLD suffers the same problem. You want something like this... please test (with CONFIG_MTD_CFI_AMDSTD=m): diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index 87e86e9..d81079e 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -489,7 +489,11 @@ struct mtd_info *cfi_cmdset_0002(struct map_info *map, int primary) return cfi_amdstd_setup(mtd); } +struct mtd_info *cfi_cmdset_0006(struct map_info *map, int primary) __attribute__((alias("cfi_cmdset_0002"))); +struct mtd_info *cfi_cmdset_0701(struct map_info *map, int primary) __attribute__((alias("cfi_cmdset_0002"))); EXPORT_SYMBOL_GPL(cfi_cmdset_0002); +EXPORT_SYMBOL_GPL(cfi_cmdset_0006); +EXPORT_SYMBOL_GPL(cfi_cmdset_0701); static struct mtd_info *cfi_amdstd_setup(struct mtd_info *mtd) { @@ -2040,3 +2044,5 @@ static void cfi_amdstd_destroy(struct mtd_info *mtd) MODULE_LICENSE("GPL"); MODULE_AUTHOR("Crossnet Co. et al."); MODULE_DESCRIPTION("MTD chip driver for AMD/Fujitsu flash chips"); +MODULE_ALIAS("cfi_cmdset_0006"); +MODULE_ALIAS("cfi_cmdset_0701");