From patchwork Wed Mar 26 16:39:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 27148 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BE19920369 for ; Wed, 26 Mar 2014 16:41:52 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id i17sf4982221qcy.11 for ; Wed, 26 Mar 2014 09:41:52 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=i70XKCCA2FNbbM2vbiNoA6ysdXy9+SHfPAjEPPOJb0Y=; b=HpxAc7a3ErC3koo+3tbm39QkoeOtg6NvA8CysVM3qT2adkT/j55VEnsGjo2gsBuFWN xqX3QC/4ggE0m/DOTdUFXJse8+HNEh9x1DP6cX/QtoAfR3Z82GifPgJGj+kEyZo8NyrK sjW4wPjboxeotyk2WOz6eMdJrNX2m0Wqy31NKG1TOEsxkgOCkLOI8guxFEjsJnPP/A1L Rjm+HAvtNT8JU3jZOB5Bls4mKtfsxqq8SzHBX66gvCpUnPhdYir1s1zUpdiS5kZouPXs mlRWHlOOde5ww+pGsFlpdo6oRCRZ8lBND/l5EuAZOlP68tmk0yTbj2WufGV55lWGplx+ nHJw== X-Gm-Message-State: ALoCoQlF4CZjZh9TqNUK6f+D80yYvBeLA2wTGFOuuzJFW6Obv/R+Iv12NCrxc1td1x4+WThmIVyi X-Received: by 10.236.179.66 with SMTP id g42mr29064186yhm.17.1395852112459; Wed, 26 Mar 2014 09:41:52 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.97.166 with SMTP id m35ls738506qge.87.gmail; Wed, 26 Mar 2014 09:41:52 -0700 (PDT) X-Received: by 10.221.22.71 with SMTP id qv7mr685531vcb.34.1395852112287; Wed, 26 Mar 2014 09:41:52 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id cb3si4759437vdc.131.2014.03.26.09.41.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 09:41:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 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.177; Received: by mail-ve0-f177.google.com with SMTP id sa20so2606022veb.8 for ; Wed, 26 Mar 2014 09:41:52 -0700 (PDT) X-Received: by 10.52.161.130 with SMTP id xs2mr575265vdb.49.1395852112193; Wed, 26 Mar 2014 09:41:52 -0700 (PDT) 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.78.9 with SMTP id i9csp61235vck; Wed, 26 Mar 2014 09:41:51 -0700 (PDT) X-Received: by 10.69.31.43 with SMTP id kj11mr85882162pbd.67.1395852111022; Wed, 26 Mar 2014 09:41:51 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yf9si6534019pab.296.2014.03.26.09.41.50; Wed, 26 Mar 2014 09:41:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756002AbaCZQln (ORCPT + 26 others); Wed, 26 Mar 2014 12:41:43 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:43095 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932129AbaCZQkT (ORCPT ); Wed, 26 Mar 2014 12:40:19 -0400 Received: by mail-wi0-f178.google.com with SMTP id bs8so2036645wib.5 for ; Wed, 26 Mar 2014 09:40:18 -0700 (PDT) X-Received: by 10.180.77.49 with SMTP id p17mr33576896wiw.4.1395852018754; Wed, 26 Mar 2014 09:40:18 -0700 (PDT) Received: from lee--X1.home (host109-148-113-193.range109-148.btcentralplus.com. [109.148.113.193]) by mx.google.com with ESMTPSA id gp10sm3913806wib.13.2014.03.26.09.40.16 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Mar 2014 09:40:17 -0700 (PDT) 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, angus.clark@st.com, Christophe Kerello Subject: [PATCH 14/15] mtd: st_spi_fsm: Provide mask to obtain correct boot device pins Date: Wed, 26 Mar 2014 16:39:28 +0000 Message-Id: <1395851969-13520-15-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1395851969-13520-1-git-send-email-lee.jones@linaro.org> References: <1395851969-13520-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=neutral (google.com: 209.85.128.177 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 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 9e00173..3ab27c8 100644 --- a/drivers/mtd/devices/st_spi_fsm.c +++ b/drivers/mtd/devices/st_spi_fsm.c @@ -2159,6 +2159,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; @@ -2183,10 +2184,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;