From patchwork Tue Feb 18 14:55:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 24875 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A4037202B2 for ; Tue, 18 Feb 2014 15:00:03 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id m1sf70036441oag.5 for ; Tue, 18 Feb 2014 07:00:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=5GLuvFPNI/N7vCTzQTHbHuWJxuWuaV4WpLHLy9kyNlE=; b=FO0/l6kWFcFkWhh1WYK3ZoUmWvUnuHLVGHrwJI3HH4X+eHBNiNNV+5PZVJsiQiQYGZ 1xedSnJKncsAJQ1HqSfqqZvJ87Bcz+Ul0pWDfuuTD5gkhJjzguCGPa90OLJ6JaK1gQww tEWGZBOKKrigQcugpbL8A32MgfPABL+4haWsye7n8/W+I1t/dSVTbY0/BgV5c4UwOHS6 3FviQ6MGD7N7cJtVAfCjjf3W+wOnfxd1ok9NloL/2bPRCb6+j2S2e3yxtWAMp8aB3GJe qfAq15wFh8jsd7uLZ3MVLL4EZ5SNVOmP+gVmh63btOLPwiUAs75k39zu0tJ/Kk9Kqo8u qb8w== X-Gm-Message-State: ALoCoQkjU/3jLM2kmFO5hm4G8iFK+NUXC6mc33R2gjfHZ+r6gFvtC682s/x2IaS55NtqPWjOnJcv X-Received: by 10.182.81.7 with SMTP id v7mr13344110obx.28.1392735603093; Tue, 18 Feb 2014 07:00:03 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.83.73 with SMTP id i67ls1335127qgd.97.gmail; Tue, 18 Feb 2014 07:00:03 -0800 (PST) X-Received: by 10.53.9.107 with SMTP id dr11mr7979690vdd.1.1392735603005; Tue, 18 Feb 2014 07:00:03 -0800 (PST) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id uw4si5557280vdc.92.2014.02.18.07.00.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 07:00:02 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so13806531veb.30 for ; Tue, 18 Feb 2014 07:00:02 -0800 (PST) X-Received: by 10.220.106.84 with SMTP id w20mr21568013vco.18.1392735602893; Tue, 18 Feb 2014 07:00:02 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp222729vcz; Tue, 18 Feb 2014 07:00:02 -0800 (PST) X-Received: by 10.194.90.144 with SMTP id bw16mr22855727wjb.1.1392735601936; Tue, 18 Feb 2014 07:00:01 -0800 (PST) Received: from casper.infradead.org (casper.infradead.org. [2001:770:15f::2]) by mx.google.com with ESMTPS id iy12si12289779wic.81.2014.02.18.07.00.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Feb 2014 07:00:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2001:770:15f::2 as permitted sender) client-ip=2001:770:15f::2; Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFm8K-0006ta-J5; Tue, 18 Feb 2014 14:58:53 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFm7r-0007Y9-4Q; Tue, 18 Feb 2014 14:58:23 +0000 Received: from mail-wg0-f42.google.com ([74.125.82.42]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WFm6o-0007F1-0r for linux-mtd@lists.infradead.org; Tue, 18 Feb 2014 14:57:21 +0000 Received: by mail-wg0-f42.google.com with SMTP id k14so3145035wgh.1 for ; Tue, 18 Feb 2014 06:56:56 -0800 (PST) X-Received: by 10.180.185.232 with SMTP id ff8mr960074wic.25.1392735416120; Tue, 18 Feb 2014 06:56:56 -0800 (PST) Received: from localhost.localdomain ([80.76.198.141]) by mx.google.com with ESMTPSA id h13sm46039687wjr.22.2014.02.18.06.56.53 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 18 Feb 2014 06:56:55 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 11/35] mtd: st_spi_fsm: Use device size to determine address width Date: Tue, 18 Feb 2014 14:55:38 +0000 Message-Id: <1392735362-1245-12-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392735362-1245-1-git-send-email-lee.jones@linaro.org> References: <1392735362-1245-1-git-send-email-lee.jones@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140218_095718_214395_1D41652E X-CRM114-Status: GOOD ( 11.00 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.42 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Angus.Clark@st.com, lee.jones@linaro.org, DCG_UPD_stlinux_kernel@list.st.com, linux-mtd@lists.infradead.org, computersforpeace@gmail.com, dwmw2@infradead.org X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Take some known parameters, namely size and number of sectors and use them to determine weather a device can support 32bit addressing or not. If it can, set the associated flash capability flag for latter use. Acked-by Angus Clark Signed-off-by: Lee Jones --- drivers/mtd/devices/st_spi_fsm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index 68fa12e..1d7a13a0 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -670,6 +670,10 @@ static int stfsm_probe(struct platform_device *pdev) return -ENODEV; fsm->info = info; + /* Use device size to determine address width */ + if (info->sector_size * info->n_sectors > 0xFFFFFF) + info->flags |= FLASH_FLAG_32BIT_ADDR; + platform_set_drvdata(pdev, fsm); fsm->mtd.dev.parent = &pdev->dev;