From patchwork Sat Apr 24 15:58:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume LECERF X-Patchwork-Id: 50909 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 32483B7D25 for ; Sun, 25 Apr 2010 02:05:19 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1O5hon-0006Eo-Dp; Sat, 24 Apr 2010 16:02:57 +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 1O5hol-0006DY-5C for linux-mtd@lists.infradead.org; Sat, 24 Apr 2010 16:02:56 +0000 Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by smtp2-g21.free.fr (Postfix) with ESMTP id CD75E4B0140; Sat, 24 Apr 2010 18:02:49 +0200 (CEST) Received: from shiryu.yomgui.biz (lsd.homeftp.net [82.235.75.105]) by smtp2-g21.free.fr (Postfix) with ESMTP id E930A4B0105; Sat, 24 Apr 2010 18:02:46 +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 1O5hk2-0003qe-5I; Sat, 24 Apr 2010 17:58:02 +0200 Subject: [PATCH v5 3/9] mtd: cfi_probe: add support for SST 0x0701 vendorname To: linux-mtd From: Guillaume LECERF Date: Sat, 24 Apr 2010 17:58:02 +0200 Message-ID: <20100424155802.14723.83366.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_120255_739408_87FC4753 X-CRM114-Status: UNSURE ( 7.87 ) 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 SST 39VF160x and 39VF320x chips use vendorname id 0x0701 and alternative unlock addresses. Add support for them in cfi_probe.c. Signed-off-by: Guillaume LECERF Reviewed-by: Wolfram Sang --- drivers/mtd/chips/cfi_probe.c | 8 ++++++++ include/linux/mtd/cfi.h | 1 + 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c index 045dc10..b2acd32 100644 --- a/drivers/mtd/chips/cfi_probe.c +++ b/drivers/mtd/chips/cfi_probe.c @@ -206,6 +206,11 @@ static int __xipram cfi_chip_setup(struct map_info *map, #endif } + if (cfi->cfiq->P_ID == P_ID_SST_OLD) { + addr_unlock1 = 0x5555; + addr_unlock2 = 0x2AAA; + } + /* * Note we put the device back into Read Mode BEFORE going into Auto * Select Mode, as some devices support nesting of modes, others @@ -271,6 +276,9 @@ static char *vendorname(__u16 vendor) case P_ID_SST_PAGE: return "SST Page Write"; + case P_ID_SST_OLD: + return "SST 39VF160x/39VF320x"; + case P_ID_INTEL_PERFORMANCE: return "Intel Performance Code"; diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index cee05b1..5716fc7 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h @@ -253,6 +253,7 @@ struct cfi_bri_query { #define P_ID_MITSUBISHI_STD 0x0100 #define P_ID_MITSUBISHI_EXT 0x0101 #define P_ID_SST_PAGE 0x0102 +#define P_ID_SST_OLD 0x0701 #define P_ID_INTEL_PERFORMANCE 0x0200 #define P_ID_INTEL_DATA 0x0210 #define P_ID_RESERVED 0xffff