From patchwork Mon Sep 7 11:18:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 53222 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id 6018B22B05 for ; Mon, 7 Sep 2015 11:21:34 +0000 (UTC) Received: by lamp12 with SMTP id p12sf25496795lam.2 for ; Mon, 07 Sep 2015 04:21:33 -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=pjf3LG6Ulm/YF15XoHLWZEQuDYWvHqqVRuJSgeVbycM=; b=RNJiwr7uID8OYsoDz9bXwO4Q2uGpOtcYYyKbVu+rABHqmXuqUQmc/T/6p1LhxhdHtd Tg2x5f9Lh9+r24LEPMMt5UZOVymwCS0ISZqhm+sDxA5mJPW1kt4uqwkwVNP2OPRvcrbA 4hIRzqfVVT8cN6q6IltI0aHzKYnj8TWMdfuuWbATf717XpeN7u9DuYnD7taE9a7U+kD9 Dh+dFsRaZzhzLRbrcY0nMxCxOwdkSuyzbsmbasCC6VhQO0PhDpd3Hds17g6AEuI0LT59 l0gUXDh6CxwAwLW/DcRTu4OhHRUrsvBR0UScmWYjrIMhsVr10wrqhunpd29t7/FUkPHJ FDBw== X-Gm-Message-State: ALoCoQnrMpTOT2FzeFnuLLqj8U/JA4Z7X7U3uh90Zx6n60HZnwuL2vRBQhgw/kCDeYGwuIkD2+4h X-Received: by 10.180.90.106 with SMTP id bv10mr4905699wib.6.1441624893305; Mon, 07 Sep 2015 04:21:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.169 with SMTP id f9ls580687lam.93.gmail; Mon, 07 Sep 2015 04:21:33 -0700 (PDT) X-Received: by 10.112.199.5 with SMTP id jg5mr16520111lbc.57.1441624893113; Mon, 07 Sep 2015 04:21:33 -0700 (PDT) Received: from mail-la0-f44.google.com (mail-la0-f44.google.com. [209.85.215.44]) by mx.google.com with ESMTPS id r3si10152455laa.97.2015.09.07.04.21.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Sep 2015 04:21:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.44 as permitted sender) client-ip=209.85.215.44; Received: by lagj9 with SMTP id j9so50595257lag.2 for ; Mon, 07 Sep 2015 04:21:33 -0700 (PDT) X-Received: by 10.112.209.106 with SMTP id ml10mr16607789lbc.112.1441624893006; Mon, 07 Sep 2015 04:21:33 -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.112.59.35 with SMTP id w3csp316219lbq; Mon, 7 Sep 2015 04:21:32 -0700 (PDT) X-Received: by 10.68.103.132 with SMTP id fw4mr45184617pbb.62.1441624891921; Mon, 07 Sep 2015 04:21:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vy5si10600385pac.2.2015.09.07.04.21.30; Mon, 07 Sep 2015 04:21:31 -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 S1751676AbbIGLV0 (ORCPT + 28 others); Mon, 7 Sep 2015 07:21:26 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:33089 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751574AbbIGLVU (ORCPT ); Mon, 7 Sep 2015 07:21:20 -0400 Received: by pacex6 with SMTP id ex6so94900812pac.0 for ; Mon, 07 Sep 2015 04:21:19 -0700 (PDT) X-Received: by 10.66.219.227 with SMTP id pr3mr41082930pac.33.1441624879877; Mon, 07 Sep 2015 04:21:19 -0700 (PDT) Received: from localhost.localdomain ([202.62.93.139]) by smtp.gmail.com with ESMTPSA id fm5sm11654737pbb.60.2015.09.07.04.21.16 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Sep 2015 04:21:18 -0700 (PDT) From: Vaibhav Hiremath To: linux-mmc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, robh+dt@kernel.org, ulf.hansson@linaro.org, Kevin Liu , Tim Wang , Vaibhav Hiremath Subject: [PATCH-v2 5/7] mmc: sdhci-pxav3: Fix HS200 mode support Date: Mon, 7 Sep 2015 16:48:39 +0530 Message-Id: <1441624721-15612-6-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1441624721-15612-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1441624721-15612-1-git-send-email-vaibhav.hiremath@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: vaibhav.hiremath@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.215.44 as permitted sender) smtp.mailfrom=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: Kevin Liu IN case of MMC HS200 mode, current code does not enable SD_CE_ATA_2.MMC_HS200 & SD_CE_ATA_2.MMC_CARD bit configurations. So this patch updates the above bit fields correctly. Signed-off-by: Tim Wang Signed-off-by: Kevin Liu Signed-off-by: Vaibhav Hiremath --- Note: Unfortunately I do not have access to any other datasheets which uses sdhci-pxav3 driver, so quite not sure whether this would break any existing platform, probably NOT, as I do not see any references for this change. If anyone can confirm that would be really great. drivers/mmc/host/sdhci-pxav3.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c index d933f75..6978810 100644 --- a/drivers/mmc/host/sdhci-pxav3.c +++ b/drivers/mmc/host/sdhci-pxav3.c @@ -57,6 +57,8 @@ #define SD_CE_ATA_1 0x10C #define SD_CE_ATA_2 0x10E +#define SD_CE_ATA2_HS200_EN BIT(10) +#define SD_CE_ATA2_MMC_MODE BIT(12) #define SDCE_MISC_INT BIT(2) #define SDCE_MISC_INT_EN BIT(1) @@ -330,6 +332,17 @@ static int pxav3_select_pinstate(struct sdhci_host *host, unsigned int uhs) return pinctrl_select_state(pxa->pinctrl, pinctrl); } +static int pxav3_select_hs200(struct sdhci_host *host) +{ + u16 reg = 0; + + reg = sdhci_readw(host, SD_CE_ATA_2); + reg |= SD_CE_ATA2_HS200_EN | SD_CE_ATA2_MMC_MODE; + sdhci_writew(host, reg, SD_CE_ATA_2); + + return 0; +} + static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs) { struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); @@ -361,6 +374,10 @@ static void pxav3_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs) case MMC_TIMING_UHS_DDR50: ctrl_2 |= SDHCI_CTRL_UHS_DDR50 | SDHCI_CTRL_VDD_180; break; + case MMC_TIMING_MMC_HS200: + ctrl_2 |= SDHCI_CTRL_UHS_SDR104 | SDHCI_CTRL_VDD_180; + pxav3_select_hs200(host); + break; } /*