From patchwork Sun May 17 11:02:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Ribeiro X-Patchwork-Id: 27314 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 CF943B7079 for ; Sun, 17 May 2009 21:04:48 +1000 (EST) Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1M5e8w-0007k0-Cm; Sun, 17 May 2009 11:02:58 +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 1M5e8n-0007aB-N6 for linux-mtd@lists.infradead.org; Sun, 17 May 2009 11:02:56 +0000 Received: by mail-qy0-f184.google.com with SMTP id 14so6487207qyk.28 for ; Sun, 17 May 2009 04:02:49 -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=gJB0Yc4Mlnde+ycRngSORrYGy2I0qLegS+FwTeyLMuY=; b=aLZQt0Ci6EI8c+3YRsPl2ZFvvp39tGbRhBZTJXV8g7vZv4V/peODlUdCITh0gY9ltK Qp2DDEtdlKVes9Ibe/PyGpG0NIJQShmbuewB9ji6it0dyIm+kZ9SImjAzSJv3jGSC+Pi D9X2N+E8pEBNA3fOE8WTT94lM/GcSNmHHWU5s= 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=G24ILIguCJ1zCtrQ13dVXBoF8ejXRILAr6nd0PI/zuRmljZA1rG7mTnAnax4BbRSfr Bl4hrjJG2POS/ltAl8YbswwKYcinjNfO/XAoYkFtbdgnWL2D0+J7EAM9LtgwEGU0MVbZ ovW2DZCBIQux8lleHay4PDMZavq57Ytua/RWA= Received: by 10.224.19.141 with SMTP id a13mr5519338qab.60.1242558169379; Sun, 17 May 2009 04:02:49 -0700 (PDT) Received: from ?192.168.1.2? (20158140132.user.veloxzone.com.br [201.58.140.132]) by mx.google.com with ESMTPS id 6sm3053289qwk.20.2009.05.17.04.02.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 17 May 2009 04:02:48 -0700 (PDT) Subject: [PATCH] cfi_cmdset_0001.c: quirk for PF38F4476. From: Daniel Ribeiro To: David Woodhouse Date: Sun, 17 May 2009 08:02:17 -0300 Message-Id: <1242558137.26769.7.camel@brutus> Mime-Version: 1.0 X-Mailer: Evolution 2.24.3 X-Spam-Score: 0.0 (/) Cc: Nicolas Pitre , 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") (sent again with CC to Nicolas Pitre) Signed-off-by: Daniel Ribeiro Acked-by: Nicolas Pitre --- 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 "