From patchwork Thu Jun 26 06:23:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Yang X-Patchwork-Id: 364264 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 054311400F0 for ; Thu, 26 Jun 2014 16:25:45 +1000 (EST) Received: from ozlabs.org (ozlabs.org [103.22.144.67]) by lists.ozlabs.org (Postfix) with ESMTP id DB7D31A0945 for ; Thu, 26 Jun 2014 16:25:44 +1000 (EST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pd0-x22d.google.com (mail-pd0-x22d.google.com [IPv6:2607:f8b0:400e:c02::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id F385E1A00C1 for ; Thu, 26 Jun 2014 16:23:47 +1000 (EST) Received: by mail-pd0-f173.google.com with SMTP id r10so2624207pdi.32 for ; Wed, 25 Jun 2014 23:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pjlmXvJq2JaHKJW+CNd22cME6Zg+DNctBRsx6Dp0Fbc=; b=J6YHWVRBPloxnT4aZsZyrnv41e1luXVuSqtBIKLr8UehkAHkAJyoe8R0MbXBi/Jmsa guq/lbH0+WKyXCAQOQoDi14cOkzrfuk16PXrStD6ZjsHRZJ+NhNgCpUhdUVWfjdczPwL 4zAU3UTWa2Gm2ys0Xw9+u4updBKnSMXV9baUlcTfy5CiDRWbGcZ/5A30JRrniKab6K8d EYTu21F2XwQNO4ySHk80HUgg+t97K4LhdVxot00YStU/YPh+zuqJ2Af6EajX5XpOMuGV poWiQUomse2i5xTcO+7/4sXFvQGygkNuiGgRaiJiCKSVpRG8ELS7Rq2YVL6H2agXLxWS FYMw== X-Received: by 10.66.131.39 with SMTP id oj7mr18421252pab.20.1403763825860; Wed, 25 Jun 2014 23:23:45 -0700 (PDT) Received: from localhost.localdomain ([124.219.7.128]) by mx.google.com with ESMTPSA id gi1sm8217238pbd.15.2014.06.25.23.23.43 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 25 Jun 2014 23:23:45 -0700 (PDT) From: Vincent Yang X-Google-Original-From: Vincent Yang To: chris@printf.net, linux-mmc@vger.kernel.org Subject: [RFC PATCH v2 2/6] mmc: sdhci: add quirk for tuning work around Date: Thu, 26 Jun 2014 14:23:28 +0800 Message-Id: <1403763812-5495-3-git-send-email-Vincent.Yang@tw.fujitsu.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1403763812-5495-1-git-send-email-Vincent.Yang@tw.fujitsu.com> References: <1403763812-5495-1-git-send-email-Vincent.Yang@tw.fujitsu.com> Cc: devicetree@vger.kernel.org, andy.green@linaro.org, patches@linaro.org, anton@enomsg.org, Vincent.Yang@tw.fujitsu.com, jaswinder.singh@linaro.org, linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This patch defines a quirk for tuning work around for some sdhci host controller. It sets both SDHCI_CTRL_EXEC_TUNING and SDHCI_CTRL_TUNED_CLK for tuning. It is a preparation and will be used by Fujitsu SDHCI controller f_sdh30 driver. Signed-off-by: Vincent Yang --- drivers/mmc/host/sdhci.c | 2 ++ include/linux/mmc/sdhci.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index d62262b..900b4e4 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1867,6 +1867,8 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); ctrl |= SDHCI_CTRL_EXEC_TUNING; + if (host->quirks2 & SDHCI_QUIRK2_TUNING_WORK_AROUND) + ctrl |= SDHCI_CTRL_TUNED_CLK; sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2); /* diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 5433f04..bcbad45 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -100,6 +100,8 @@ struct sdhci_host { #define SDHCI_QUIRK2_BROKEN_DDR50 (1<<7) /* Do a callback when switching voltages so do controller-specific actions */ #define SDHCI_QUIRK2_VOLTAGE_SWITCH (1<<8) +/* forced tuned clock */ +#define SDHCI_QUIRK2_TUNING_WORK_AROUND (1<<9) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */