From patchwork Sat May 16 11:41:12 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Ribeiro X-Patchwork-Id: 27301 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 91A2FB6F34 for ; Sat, 16 May 2009 21:46:10 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1M5IGl-0003ZY-CT; Sat, 16 May 2009 11:41:35 +0000 Received: from mail-qy0-f184.google.com ([209.85.221.184]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1M5IGc-0003YD-Li for linux-mtd@lists.infradead.org; Sat, 16 May 2009 11:41:33 +0000 Received: by qyk14 with SMTP id 14so5873594qyk.28 for ; Sat, 16 May 2009 04:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:cc :content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=2jxb/YE5NI2zjyVoCzE/9wVbxyi+mtQcX5laTnsSgKk=; b=pdN2ucWyBcX8ZDB5bBG8+SGWEJ9QettexY/dwfmP2cmoWVzj278uszjgik/Icv7OkE mFC1tQFCEs4pkHe5GSHcZTzin2Pp4t9XYFTYr1lf5DhOlhZ4bfS/6U0GWnlCH7P1LWaP z/xPMWivaEBllPQiAP+eVVFdUUjwACokKNQY8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; b=Emjjo1saMJXO/F/uV+JWIxaqj5QYOi2nKXCSNuOGxqLA1srDSfey/6sAjrWWjIdFSs e+yzaZjebxqOIgILLT3f29z6sMF3WXb5zkFZrRnoio0slCNaAMwI0IqEhwPqH4X0v0v2 5C08nnenqpPuikCl4u0x84zTk58ombDijfNO0= Received: by 10.224.32.146 with SMTP id c18mr4898645qad.58.1242474086042; Sat, 16 May 2009 04:41:26 -0700 (PDT) Received: from ?192.168.1.2? (20158157201.user.veloxzone.com.br [201.58.157.201]) by mx.google.com with ESMTPS id 26sm3435374qwa.28.2009.05.16.04.41.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 16 May 2009 04:41:25 -0700 (PDT) Subject: [PATCH] cfi_cmdset_0001.c: quirk for PF38F4476. From: Daniel Ribeiro To: David Woodhouse Date: Sat, 16 May 2009 08:41:12 -0300 Message-Id: <1242474072.30413.32.camel@brutus> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 X-Spam-Score: 0.0 (/) Cc: openezx-devel , linux-mtd@lists.infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.11 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 chip reports CFI 1.3, but the CFI PRI is like CFI 1.1. Add a quirk to pass probe on this chip. (This patch depends on "cfi_cmdset_0001.c: CFI 1.0 and CFI 1.1") Signed-off-by: Daniel Ribeiro --- drivers/mtd/chips/cfi_cmdset_0001.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index bf07d14..0e01ab9 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c @@ -46,6 +46,7 @@ #define MANUFACTURER_INTEL 0x0089 #define I82802AB 0x00ad #define I82802AC 0x00ac +#define PF38F4476 0x881c #define MANUFACTURER_ST 0x0020 #define M50LPW080 0x002F #define M50FLW080A 0x0080 @@ -315,9 +316,18 @@ static struct cfi_fixup fixup_table[] = { { 0, 0, NULL, NULL } }; +static void cfi_fixup_major_minor(struct cfi_private *cfi, + struct cfi_pri_intelext *extp) +{ + if (cfi->mfr == MANUFACTURER_INTEL && + cfi->id == PF38F4476 && extp->MinorVersion == '3') + extp->MinorVersion = '1'; +} + static inline struct cfi_pri_intelext * read_pri_intelext(struct map_info *map, __u16 adr) { + struct cfi_private *cfi = map->fldrv_priv; struct cfi_pri_intelext *extp; unsigned int extra_size = 0; unsigned int extp_size = sizeof(*extp); @@ -327,6 +337,8 @@ read_pri_intelext(struct map_info *map, __u16 adr) if (!extp) return NULL; + cfi_fixup_major_minor(cfi, extp); + if (extp->MajorVersion != '1' || (extp->MinorVersion < '0' || extp->MinorVersion > '5')) { printk(KERN_ERR " Unknown Intel/Sharp Extended Query "