From patchwork Thu May 15 09:37:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 30234 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2D82C20446 for ; Thu, 15 May 2014 09:37:35 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id db11sf3239922veb.0 for ; Thu, 15 May 2014 02:37:34 -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=YwqKS2nwV6f7fy5STSh9rtxlaaNgtSFg+0tc7AcZtAg=; b=a3je+Zs0aHZHYHjpsc8f6R0RT8Sdw7kMimTdNWp5Bx4gITSjGaKU9n+2bGuE97HSO0 ymIePAMhBPKFMncFyZHlzSch0Qx94ywUYM8Z2QDT1hvm3Tc2hRYkyx8g3MsDoEaBGaoa qOwV95HN/0wGo3Zb9zA6XO4SL1s0k/snBEObND5fBg/Frl/mUhkqmnFy2En4e6YtzW7c CxUU8Mu1TF8noEaBrI2pLIlocCnukX3DL1WnTz/ZaRlwD3yoOtXiGW74rodiMHDk8d46 xxY4JZCJI0GhWf/YgvhkjyGbJzWSDRLom2jVMajeJg+9WtDefc2ixvte6xE9FAcvHa5m aWrg== X-Gm-Message-State: ALoCoQkqxsX0Y47LiFaaAu4OlvTrmBQHjq9hexPdE280YmIhyBUWiZi7fhGRvkDOKpJaKbwIby4o X-Received: by 10.236.84.141 with SMTP id s13mr4226263yhe.5.1400146654877; Thu, 15 May 2014 02:37:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.52 with SMTP id n49ls152715qge.29.gmail; Thu, 15 May 2014 02:37:34 -0700 (PDT) X-Received: by 10.52.182.227 with SMTP id eh3mr539047vdc.40.1400146654782; Thu, 15 May 2014 02:37:34 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id c8si44022veh.193.2014.05.15.02.37.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 May 2014 02:37:34 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id lh14so3972028vcb.19 for ; Thu, 15 May 2014 02:37:34 -0700 (PDT) X-Received: by 10.58.211.229 with SMTP id nf5mr7491852vec.19.1400146654632; Thu, 15 May 2014 02:37:34 -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.221.72 with SMTP id ib8csp307859vcb; Thu, 15 May 2014 02:37:34 -0700 (PDT) X-Received: by 10.68.132.68 with SMTP id os4mr10873755pbb.129.1400146653832; Thu, 15 May 2014 02:37:33 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id hu10si2389445pbc.358.2014.05.15.02.37.33; Thu, 15 May 2014 02:37:33 -0700 (PDT) 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 S1754556AbaEOJhW (ORCPT + 27 others); Thu, 15 May 2014 05:37:22 -0400 Received: from mail-we0-f179.google.com ([74.125.82.179]:62488 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754391AbaEOJhN (ORCPT ); Thu, 15 May 2014 05:37:13 -0400 Received: by mail-we0-f179.google.com with SMTP id q59so795065wes.10 for ; Thu, 15 May 2014 02:37:12 -0700 (PDT) X-Received: by 10.180.109.69 with SMTP id hq5mr7792695wib.30.1400146632021; Thu, 15 May 2014 02:37:12 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-78-145-240-98.as13285.net. [78.145.240.98]) by mx.google.com with ESMTPSA id kp5sm6057065wjb.30.2014.05.15.02.37.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 May 2014 02:37:11 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Russell King , Ulf Hansson , linux-mmc@vger.kernel.org Cc: Chris Ball , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linus.walleij@linaro.org, Srinivas Kandagatla Subject: [PATCH v2 07/14] mmc: mmci: add ddrmode mask to variant data Date: Thu, 15 May 2014 10:37:08 +0100 Message-Id: <1400146628-30097-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400146447-29803-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1400146447-29803-1-git-send-email-srinivas.kandagatla@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: srinivas.kandagatla@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.220.174 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: Srinivas Kandagatla This patch adds ddrmode mask to variant structure giving more flexibility to the driver to support more SOCs which have different datactrl register layout. Without this patch datactrl register is updated with wrong ddrmode mask on non ST SOCs, resulting in card detection failures. Signed-off-by: Srinivas Kandagatla Reviewed-by: Linus Walleij --- drivers/mmc/host/mmci.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 1385554..dec70d2 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -59,6 +59,7 @@ static unsigned int fmax = 515633; * is asserted (likewise for RX) * @sdio: variant supports SDIO * @st_clkdiv: true if using a ST-specific clock divider algorithm + * @datactrl_mask_ddrmode: ddr mode mask in datactrl register. * @blksz_datactrl16: true if Block size is at b16..b30 position in datactrl register * @blksz_datactrl4: true if Block size is at b4..b16 position in datactrl * register @@ -76,6 +77,7 @@ struct variant_data { unsigned int datalength_bits; unsigned int fifosize; unsigned int fifohalfsize; + unsigned int datactrl_mask_ddrmode; bool sdio; bool st_clkdiv; bool blksz_datactrl16; @@ -114,6 +116,7 @@ static struct variant_data variant_u300 = { .fifosize = 16 * 4, .fifohalfsize = 8 * 4, .clkreg_enable = MCI_ST_U300_HWFCEN, + .datactrl_mask_ddrmode = MCI_ST_DPSM_DDRMODE, .datalength_bits = 16, .sdio = true, .pwrreg_powerup = MCI_PWR_ON, @@ -126,6 +129,7 @@ static struct variant_data variant_nomadik = { .fifosize = 16 * 4, .fifohalfsize = 8 * 4, .clkreg = MCI_CLK_ENABLE, + .datactrl_mask_ddrmode = MCI_ST_DPSM_DDRMODE, .datalength_bits = 24, .sdio = true, .st_clkdiv = true, @@ -140,6 +144,7 @@ static struct variant_data variant_ux500 = { .fifohalfsize = 8 * 4, .clkreg = MCI_CLK_ENABLE, .clkreg_enable = MCI_ST_UX500_HWFCEN, + .datactrl_mask_ddrmode = MCI_ST_DPSM_DDRMODE, .datalength_bits = 24, .sdio = true, .st_clkdiv = true, @@ -155,6 +160,7 @@ static struct variant_data variant_ux500v2 = { .fifohalfsize = 8 * 4, .clkreg = MCI_CLK_ENABLE, .clkreg_enable = MCI_ST_UX500_HWFCEN, + .datactrl_mask_ddrmode = MCI_ST_DPSM_DDRMODE, .datalength_bits = 24, .sdio = true, .st_clkdiv = true, @@ -800,7 +806,7 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) } if (host->mmc->ios.timing == MMC_TIMING_UHS_DDR50) - datactrl |= MCI_ST_DPSM_DDRMODE; + datactrl |= variant->datactrl_mask_ddrmode; /* * Attempt to use DMA operation mode, if this