From patchwork Thu Dec 4 10:21:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 41923 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E8BF425E8C for ; Thu, 4 Dec 2014 10:23:51 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hs14sf7296346lab.9 for ; Thu, 04 Dec 2014 02:23:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=QsOV+NqFg7Z8C8BDlk+0JDZkBt+XfrBOfYmF/FF2wPE=; b=VeujUxCqq2U931xBzUiRTFxXnG533qa+F9Zh8gRn+RN67fu2ZAqHLQREuJfn3KjFdl JSl8MVZQ2LEVYgTThHJUq9D5IwhDvBWT/1CtYoOw1yWkXvQKoEk3Q2kO3AYpcLUXi+2x Fdbpxbw7edmv8bhpcZ5xmydFJ+Smt4Oxly8gVyji4GBz6O2ttdYJSvGAQNmgE6kFdoHS bsmTvliJXMeHWv0eW1TxN96+38GrUmL7BR0z0otIUGg9B8W/3d6m193rbjU9STRwg9dM fZC2UE2BMEbAfcx+5zM49s7GVwI9mVlAYEy442GyfeTVrjxuxXELqL9Ld1CwIWf6/xuG FYOw== X-Gm-Message-State: ALoCoQlkTiR5bPD8BRkPrU2kR5lIe4ulQKn+FLA6zYDacP+ylKvN5lHViyod0pMwNPcoW1nj6QAu X-Received: by 10.112.14.2 with SMTP id l2mr2076436lbc.5.1417688630856; Thu, 04 Dec 2014 02:23:50 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.5 with SMTP id r5ls205057lae.47.gmail; Thu, 04 Dec 2014 02:23:50 -0800 (PST) X-Received: by 10.112.171.136 with SMTP id au8mr8754355lbc.71.1417688630588; Thu, 04 Dec 2014 02:23:50 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id u6si25471655lag.20.2014.12.04.02.23.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Dec 2014 02:23:50 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id l4so4402869lbv.12 for ; Thu, 04 Dec 2014 02:23:50 -0800 (PST) X-Received: by 10.153.7.170 with SMTP id dd10mr8571526lad.44.1417688630509; Thu, 04 Dec 2014 02:23:50 -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.112.184.201 with SMTP id ew9csp10297lbc; Thu, 4 Dec 2014 02:23:49 -0800 (PST) X-Received: by 10.68.230.231 with SMTP id tb7mr24441959pbc.42.1417688628890; Thu, 04 Dec 2014 02:23:48 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l11si42468808pdj.98.2014.12.04.02.23.48 for ; Thu, 04 Dec 2014 02:23:48 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754057AbaLDKXn (ORCPT + 26 others); Thu, 4 Dec 2014 05:23:43 -0500 Received: from mail-yh0-f42.google.com ([209.85.213.42]:42725 "EHLO mail-yh0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753401AbaLDKW3 (ORCPT ); Thu, 4 Dec 2014 05:22:29 -0500 Received: by mail-yh0-f42.google.com with SMTP id v1so8086514yhn.1 for ; Thu, 04 Dec 2014 02:22:28 -0800 (PST) X-Received: by 10.170.121.142 with SMTP id n136mr13109201ykb.123.1417688548797; Thu, 04 Dec 2014 02:22:28 -0800 (PST) Received: from localhost.localdomain (host109-148-232-11.range109-148.btcentralplus.com. [109.148.232.11]) by mx.google.com with ESMTPSA id y67sm16089929yhc.11.2014.12.04.02.22.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Dec 2014 02:22:28 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: lee.jones@linaro.org, kernel@stlinux.com, computersforpeace@gmail.com, linux-mtd@lists.infradead.org, Christophe Kerello Subject: [PATCH v2 RESEND 10/11] mtd: st_spi_fsm: Provide mask to obtain correct boot device pins Date: Thu, 4 Dec 2014 10:21:51 +0000 Message-Id: <1417688512-7644-11-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417688512-7644-1-git-send-email-lee.jones@linaro.org> References: <1417688512-7644-1-git-send-email-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Christophe Kerello This patch adds a mask to be able to get the right boot device selection. For example: for STiH415, value = SYSTEM_STATUS398[4:0] for STiH416, value = SYSTEM_STATUS2598[4:0] for STiH407, value = SYSTEM_STATUS5561[6:2] Signed-off-by: Christophe Kerello Signed-off-by: Lee Jones --- drivers/mtd/devices/st_spi_fsm.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/mtd/devices/st_spi_fsm.c b/drivers/mtd/devices/st_spi_fsm.c index 18f6f0b..f992f00 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -2123,6 +2123,7 @@ static void stfsm_fetch_platform_configs(struct platform_device *pdev) struct regmap *regmap; uint32_t boot_device_reg; uint32_t boot_device_spi; + uint32_t boot_device_msk; uint32_t boot_device; /* Value we read from *boot_device_reg */ int ret; @@ -2147,10 +2148,17 @@ static void stfsm_fetch_platform_configs(struct platform_device *pdev) if (ret) goto boot_device_fail; + /* Mask to apply on boot_device_reg */ + ret = of_property_read_u32(np, "st,boot-device-msk", &boot_device_msk); + if (ret) + goto boot_device_fail; + ret = regmap_read(regmap, boot_device_reg, &boot_device); if (ret) goto boot_device_fail; + boot_device &= boot_device_msk; + if (boot_device != boot_device_spi) fsm->booted_from_spi = false;