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: 7133701 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 915819F314 for ; Mon, 7 Sep 2015 11:23:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A602C20678 for ; Mon, 7 Sep 2015 11:23:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C75E42041B for ; Mon, 7 Sep 2015 11:23:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZYuUv-0003Ns-CO; Mon, 07 Sep 2015 11:22:05 +0000 Received: from mail-pa0-f52.google.com ([209.85.220.52]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZYuUS-00033x-SS for linux-arm-kernel@lists.infradead.org; Mon, 07 Sep 2015 11:21:38 +0000 Received: by padhk3 with SMTP id hk3so10023280pad.3 for ; Mon, 07 Sep 2015 04:21:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ncPiABK2SoHkaRTxpAws9yzhyA2/cmfPePE+RDYvcjY=; b=h2chRSleBwToHd7jXBMKxQ3/OrlgJQhrvT5CxHz/sA9tKB26Frk3MObtGln8zV+/3o dya12cHHwnzXjK0YXGUs4cc4znjPduDUmSmQ1EF7b1vDJ85rzZxAfwCBoVPHmGNj6GFX 7oIQkvKhiskz0NzC3fwO9RUqq0F1PH0cKl8hPtAmaxYZUAGDbyzQ5hFSiwiDKAUTbsxR JFB6KV3cPNnMQgSIj/qCEO26N9V4uVPFjQLjdufbrI4hkn82/fBZ1d+oKb1X6dYgp4Vd j6ignJGPMSQS6oPNSs88w16OZu5vgICVzB7cd5wGQV5Fnuel07Tvb/ItvdYa9FKyYidO VJZQ== X-Gm-Message-State: ALoCoQkI9JU/re7VKS/jf/RIi/Z5wL/hv9fvKJgrdlwr+RzzeBava5pciZKA2L9OnLLWdXx4acI4 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150907_042137_052585_B8ADBC55 X-CRM114-Status: GOOD ( 15.14 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, ulf.hansson@linaro.org, Tim Wang , linux-kernel@vger.kernel.org, Vaibhav Hiremath , robh+dt@kernel.org, linux-arm-kernel@lists.infradead.org, Kevin Liu MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; } /*