From patchwork Mon Apr 21 21:47:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 28734 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E45502032B for ; Mon, 21 Apr 2014 21:47:52 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id kq14sf21397060pab.10 for ; Mon, 21 Apr 2014 14:47:51 -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=fMCxLHobGT7zrHWK9BH5EffEXVfanDvQFz0JVgQRrSs=; b=EGiFNXK16FZc68xvqr9OzA78A1Uos2tK7cCFbWUym+1F+dnBsWwkDzy9BBwkdGpzaT M6OP2zcOxn5qwnMvCj5pjIazT7IG/zVWaDygDD6aoWnt3tsQNWftcvj7Wy4d9eBMfG0Z 6xP0EMjwVYh5gQn2gzjoUV9qE8rL1rUs4IVDYzly62J7jTuK7qcCercktYCPwteF64PJ hqdr76JKHAfwsK4hmUNcRFlFxXVkk5YyuEjV1T5DhPcDG5Fjc2vRziYoTsxmHnHIyrm7 8lwG5UKzQ5obV/DjV8Sid4B8NwJHO8wFdP2NUBIypI8s7/ZOP0PljPMDaAoB6LSIIqOO Oilg== X-Gm-Message-State: ALoCoQm4WLMnqFqVEM9Poj4w29C7l/zZLWw+Zd8I3Ah+7L4BgHZmF69MbVFAV6VrEwgzXh2RmsyN X-Received: by 10.66.232.38 with SMTP id tl6mr21086030pac.33.1398116871665; Mon, 21 Apr 2014 14:47:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.28.137 with SMTP id 9ls2488247qgz.14.gmail; Mon, 21 Apr 2014 14:47:51 -0700 (PDT) X-Received: by 10.58.186.71 with SMTP id fi7mr2015462vec.32.1398116871519; Mon, 21 Apr 2014 14:47:51 -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 dh4si6459957veb.211.2014.04.21.14.47.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 14:47:51 -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 sa20so8379165veb.8 for ; Mon, 21 Apr 2014 14:47:51 -0700 (PDT) X-Received: by 10.52.116.101 with SMTP id jv5mr13347985vdb.11.1398116871425; Mon, 21 Apr 2014 14:47:51 -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 ib8csp320746vcb; Mon, 21 Apr 2014 14:47:51 -0700 (PDT) X-Received: by 10.66.221.4 with SMTP id qa4mr5535562pac.138.1398116870599; Mon, 21 Apr 2014 14:47:50 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si21510945paw.127.2014.04.21.14.47.49; Mon, 21 Apr 2014 14:47:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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 S1754775AbaDUVrq (ORCPT + 7 others); Mon, 21 Apr 2014 17:47:46 -0400 Received: from mail-wg0-f46.google.com ([74.125.82.46]:34479 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754743AbaDUVrn (ORCPT ); Mon, 21 Apr 2014 17:47:43 -0400 Received: by mail-wg0-f46.google.com with SMTP id b13so3100617wgh.17 for ; Mon, 21 Apr 2014 14:47:41 -0700 (PDT) X-Received: by 10.180.76.166 with SMTP id l6mr15649546wiw.17.1398116861856; Mon, 21 Apr 2014 14:47:41 -0700 (PDT) Received: from srinivas-Inspiron-N5050.dlink.com (host-78-149-8-254.as13285.net. [78.149.8.254]) by mx.google.com with ESMTPSA id mw3sm18421782wic.7.2014.04.21.14.47.40 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 21 Apr 2014 14:47:41 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: linux-mmc@vger.kernel.org Cc: Russell King , Chris Ball , Ulf Hansson , linux-kernel@vger.kernel.org, agross@quicinc.com, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH RFC 03/12] mmc: mmci: Add Qcom datactrl register variant Date: Mon, 21 Apr 2014 22:47:35 +0100 Message-Id: <1398116855-31316-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398116624-31052-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1398116624-31052-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-mmc@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=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: Srinivas Kandagatla Instance of this IP on Qualcomm's SOCs has bit different layout for datactrl register. Bit postion datactrl[16:4] hold the true block size instead of power of 2. Signed-off-by: Srinivas Kandagatla --- drivers/mmc/host/mmci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 391e8d4..19d6b6f 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -58,6 +58,8 @@ static unsigned int fmax = 515633; * @sdio: variant supports SDIO * @st_clkdiv: true if using a ST-specific clock divider algorithm * @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 * @pwrreg_powerup: power up value for MMCIPOWER register * @signal_direction: input/out direction of bus signals can be indicated * @pwrreg_clkgate: MMCIPOWER register must be used to gate the clock @@ -73,6 +75,7 @@ struct variant_data { bool sdio; bool st_clkdiv; bool blksz_datactrl16; + bool blksz_datactrl4; u32 pwrreg_powerup; bool signal_direction; bool pwrreg_clkgate; @@ -162,6 +165,7 @@ static struct variant_data variant_qcom = { .fifosize = 16 * 4, .fifohalfsize = 8 * 4, .clkreg = MCI_CLK_ENABLE, + .blksz_datactrl4 = true, .datalength_bits = 24, .blksz_datactrl4 = true, .pwrreg_powerup = MCI_PWR_UP, @@ -760,6 +764,8 @@ static void mmci_start_data(struct mmci_host *host, struct mmc_data *data) if (variant->blksz_datactrl16) datactrl = MCI_DPSM_ENABLE | (data->blksz << 16); + else if (variant->blksz_datactrl4) + datactrl = MCI_DPSM_ENABLE | (data->blksz << 4); else datactrl = MCI_DPSM_ENABLE | blksz_bits << 4;