From patchwork Wed Mar 6 11:34:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 225485 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CE3752C0308 for ; Wed, 6 Mar 2013 22:35:42 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UDCcG-0007I6-Hb; Wed, 06 Mar 2013 11:34:39 +0000 Received: from mail-ee0-f42.google.com ([74.125.83.42]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UDCc7-0007Cx-DJ for linux-mtd@lists.infradead.org; Wed, 06 Mar 2013 11:34:28 +0000 Received: by mail-ee0-f42.google.com with SMTP id b47so5414037eek.15 for ; Wed, 06 Mar 2013 03:34:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=ascJ32otafVbDHWh/AJipN06R/taQJxWH/fnLsnGXkI=; b=WIZZDLFBbQjevwDeLt78UvlqKChfQma7QEaLa0tB9quj76b7FkIq1dZ7xj8tYja/vf UtfovhbBduWPls781gefZa/tqMaCBGDu5oT1gkSe5SRLaFimBL66/h40jDHM9t2DgCpE uSQzTodNePZ9v5LO8A4HT20LqIFxvjtccsRUhWzEU7zRsA8Ctcu3Bj5fOh9PKpxoMwFS jV/UhkOvxua/Jil1oMBaRz9xYqh+QeVbotXoCUOAEM8QnZmWiMK5eamJKpF/NQxUWtxb lcAtKbImYYUYQpV4b6CBCKBA3XiYTLbRQ92+0B+rpft5ARklNDrUncplB2iutGkMGMwG V5hQ== X-Received: by 10.14.173.67 with SMTP id u43mr81336250eel.22.1362569665876; Wed, 06 Mar 2013 03:34:25 -0800 (PST) Received: from linux-sonyvaio.poz.roche.com (gw.bas.roche.com. [196.3.50.254]) by mx.google.com with ESMTPS id a1sm41961256eep.2.2013.03.06.03.34.23 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 06 Mar 2013 03:34:24 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: linux-mtd@lists.infradead.org, Artem Bityutskiy , David Woodhouse Subject: [PATCH V3 2/3] mtd: bcm47xxsflash: store info about flash type Date: Wed, 6 Mar 2013 12:34:19 +0100 Message-Id: <1362569659-14925-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1362567695-17523-2-git-send-email-zajec5@gmail.com> References: <1362567695-17523-2-git-send-email-zajec5@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130306_063427_879514_A79FCE3A X-CRM114-Status: GOOD ( 10.38 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.83.42 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zajec5[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (zajec5[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Hauke Mehrtens , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org It's going to be needed for erase and write operations, they differ between Atmel and ST flashes. Signed-off-by: Rafał Miłecki --- V3: rebase after change in 0001 --- drivers/mtd/devices/bcm47xxsflash.c | 9 +++++++++ drivers/mtd/devices/bcm47xxsflash.h | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/drivers/mtd/devices/bcm47xxsflash.c b/drivers/mtd/devices/bcm47xxsflash.c index b22df6d..2f9e629 100644 --- a/drivers/mtd/devices/bcm47xxsflash.c +++ b/drivers/mtd/devices/bcm47xxsflash.c @@ -63,6 +63,15 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) b47s->bcma_cc = container_of(sflash, struct bcma_drv_cc, sflash); + switch (b47s->bcma_cc->capabilities & BCMA_CC_CAP_FLASHT) { + case BCMA_CC_FLASHT_STSER: + b47s->type = BCM47XXSFLASH_TYPE_ST; + break; + case BCMA_CC_FLASHT_ATSER: + b47s->type = BCM47XXSFLASH_TYPE_ATMEL; + break; + } + b47s->window = sflash->window; b47s->blocksize = sflash->blocksize; b47s->numblocks = sflash->numblocks; diff --git a/drivers/mtd/devices/bcm47xxsflash.h b/drivers/mtd/devices/bcm47xxsflash.h index e37285e..4498529 100644 --- a/drivers/mtd/devices/bcm47xxsflash.h +++ b/drivers/mtd/devices/bcm47xxsflash.h @@ -5,9 +5,16 @@ struct bcma_drv_cc; +enum bcm47xxsflash_type { + BCM47XXSFLASH_TYPE_ATMEL, + BCM47XXSFLASH_TYPE_ST, +}; + struct bcm47xxsflash { struct bcma_drv_cc *bcma_cc; + enum bcm47xxsflash_type type; + u32 window; u32 blocksize; u16 numblocks;