From patchwork Sat Apr 24 15:58:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume LECERF X-Patchwork-Id: 50906 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 10B24B7D28 for ; Sun, 25 Apr 2010 02:04:59 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1O5hpD-0006PM-2m; Sat, 24 Apr 2010 16:03:23 +0000 Received: from smtp2-g21.free.fr ([212.27.42.2]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1O5hpA-0006NZ-O8 for linux-mtd@lists.infradead.org; Sat, 24 Apr 2010 16:03:21 +0000 Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by smtp2-g21.free.fr (Postfix) with ESMTP id 5EFE34B011D; Sat, 24 Apr 2010 18:03:14 +0200 (CEST) Received: from shiryu.yomgui.biz (lsd.homeftp.net [82.235.75.105]) by smtp2-g21.free.fr (Postfix) with ESMTP id 3FE464B0158; Sat, 24 Apr 2010 18:03:12 +0200 (CEST) Received: from localhost ([127.0.0.1] helo=shiryu.yomgui.biz) by shiryu.yomgui.biz with esmtp (Exim 4.71) (envelope-from ) id 1O5hkR-0003wF-FJ; Sat, 24 Apr 2010 17:58:27 +0200 Subject: [PATCH v5 8/9] mtd: cfi_cmdset_0002: add CFI detection for SST 39VF{32, 64}xxB chips To: linux-mtd From: Guillaume LECERF Date: Sat, 24 Apr 2010 17:58:27 +0200 Message-ID: <20100424155827.14723.84379.stgit@shiryu.yomgui.biz> In-Reply-To: <20100424155751.14723.46761.stgit@shiryu.yomgui.biz> References: <20100424155751.14723.46761.stgit@shiryu.yomgui.biz> User-Agent: StGit/0.15 MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20100424_120321_328650_1B1B678B X-CRM114-Status: UNSURE ( 8.00 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.2 (+) X-Spam-Report: SpamAssassin version 3.3.1 on bombadil.infradead.org summary: Content analysis details: (1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, low trust [212.27.42.2 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is freemail (glecerf[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 1.2 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list Cc: Wolfram Sang , David Woodhouse , Chris Moore , Artem Bityutskiy 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 This patch adds support for detecting SST 39VF32xxB and 39VF64xxB chips in CFI mode. Signed-off-by: Guillaume LECERF Reviewed-by: Wolfram Sang --- drivers/mtd/chips/cfi_cmdset_0002.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c index c5837d0..ef64080 100644 --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -281,6 +281,17 @@ static void fixup_sst39vf(struct mtd_info *mtd, void *param) cfi->addr_unlock2 = 0x2AAA; } +static void fixup_sst39vf_rev_b(struct mtd_info *mtd, void *param) +{ + struct map_info *map = mtd->priv; + struct cfi_private *cfi = map->fldrv_priv; + + fixup_old_sst_eraseregion(mtd); + + cfi->addr_unlock1 = 0x555; + cfi->addr_unlock2 = 0x2AA; +} + static void fixup_s29gl064n_sectors(struct mtd_info *mtd, void *param) { struct map_info *map = mtd->priv; @@ -309,6 +320,10 @@ static struct cfi_fixup cfi_nopri_fixup_table[] = { { CFI_MFR_SST, 0x234B, fixup_sst39vf, NULL, }, // SST39VF1601 { CFI_MFR_SST, 0x235A, fixup_sst39vf, NULL, }, // SST39VF3202 { CFI_MFR_SST, 0x235B, fixup_sst39vf, NULL, }, // SST39VF3201 + { CFI_MFR_SST, 0x235C, fixup_sst39vf_rev_b, NULL, }, // SST39VF3202B + { CFI_MFR_SST, 0x235D, fixup_sst39vf_rev_b, NULL, }, // SST39VF3201B + { CFI_MFR_SST, 0x236C, fixup_sst39vf_rev_b, NULL, }, // SST39VF6402B + { CFI_MFR_SST, 0x236D, fixup_sst39vf_rev_b, NULL, }, // SST39VF6401B { 0, 0, NULL, NULL } };