From patchwork Thu May 22 11:24:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 30606 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2EA5820369 for ; Thu, 22 May 2014 11:24:42 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf10382364pab.3 for ; Thu, 22 May 2014 04:24:41 -0700 (PDT) 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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=vGg9WoHfVDj5yqvom61Wvw3Wy3Drf+vmBBCOdIfl4vE=; b=KLgluOY4m9Ly8ouLIoHyIB+bippULJWvuD0XJK/Se4sUh6UZrmRB9Q2usoXiKdaP4J G8pL2siJ2am4E4XEWOpZf9JJXnZM7AqRuj1QhVcrFuhShQd8XmDt0jHkBHJFrHWNylkM Ex57GmYbay4La8jjwkuNL/MYFCTkEZmaX5xCo0DRE8U7leIpGOn8vgANLs3wiewfdHiR U5f69Y1rOzAfMyPruNJS3mLcNPXJlS6V/LMCmE2PND87jkpVd1NODU8ymaMS2bX0LZvw MqZg3nqF13QwYcWCJrQ0KxEJ4DscDh8K8dpGLX00/roE1fi3BeEN6r4cELEf8Esy6e0X d8cw== X-Gm-Message-State: ALoCoQntVhmCFdeeG2sIdiwxHCROCndKXO7jSsz+bIPuazWwn5Gi9OZAYKb1clOI3I09sRe2Y8mm X-Received: by 10.66.189.234 with SMTP id gl10mr14993503pac.20.1400757881489; Thu, 22 May 2014 04:24:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.145 with SMTP id f17ls1003205qgd.95.gmail; Thu, 22 May 2014 04:24:41 -0700 (PDT) X-Received: by 10.220.98.143 with SMTP id q15mr624799vcn.38.1400757881367; Thu, 22 May 2014 04:24:41 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id so6si2939812vdb.76.2014.05.22.04.24.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 May 2014 04:24:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.178 as permitted sender) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id sa20so4161331veb.23 for ; Thu, 22 May 2014 04:24:41 -0700 (PDT) X-Received: by 10.220.106.7 with SMTP id v7mr295808vco.46.1400757881307; Thu, 22 May 2014 04:24:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp189975vcb; Thu, 22 May 2014 04:24:40 -0700 (PDT) X-Received: by 10.43.160.4 with SMTP id ma4mr1970493icc.83.1400757878673; Thu, 22 May 2014 04:24:38 -0700 (PDT) Received: from mail-ig0-f177.google.com (mail-ig0-f177.google.com [209.85.213.177]) by mx.google.com with ESMTPS id ly7si32079817icc.65.2014.05.22.04.24.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 May 2014 04:24:38 -0700 (PDT) Received-SPF: pass (google.com: domain of lee.jones@linaro.org designates 209.85.213.177 as permitted sender) client-ip=209.85.213.177; Received: by mail-ig0-f177.google.com with SMTP id l13so3362377iga.16 for ; Thu, 22 May 2014 04:24:38 -0700 (PDT) X-Received: by 10.42.106.80 with SMTP id y16mr1520364ico.94.1400757878455; Thu, 22 May 2014 04:24:38 -0700 (PDT) Received: from localhost.localdomain (host109-148-113-200.range109-148.btcentralplus.com. [109.148.113.200]) by mx.google.com with ESMTPSA id z4sm12643314igl.13.2014.05.22.04.24.36 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 22 May 2014 04:24:38 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: computersforpeace@gmail.com, linux-mtd@lists.infradead.org, Christophe Kerello , Lee Jones Subject: [PATCH 09/10] mtd: st_spi_fsm: Provide mask to obtain correct boot device pins Date: Thu, 22 May 2014 12:24:07 +0100 Message-Id: <1400757848-18075-10-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1400757848-18075-1-git-send-email-lee.jones@linaro.org> References: <1400757848-18075-1-git-send-email-lee.jones@linaro.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.128.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: 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 3f74e125..6d535d9 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -2125,6 +2125,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; @@ -2149,10 +2150,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;