From patchwork Mon Feb 5 12:50:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 126846 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1941926ljc; Mon, 5 Feb 2018 04:51:27 -0800 (PST) X-Google-Smtp-Source: AH8x224jCcKwA+IliFMtUGNUPFlFSO9L1HE/xZeKEY5kBKBZXW7KVANNXiZ1u4MoG3VdB3oYhX+h X-Received: by 10.99.55.1 with SMTP id e1mr3343773pga.237.1517835087504; Mon, 05 Feb 2018 04:51:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517835087; cv=none; d=google.com; s=arc-20160816; b=kXmGOjWM4Frf/b/iptdPFKLB0P9saJYNCd3aAv3o+qi5xb9R7Ug3u9Kgf//n37JAMC RyiUL4PZCZFHGmiFfELUwT15fCALm0uxawIvu6CsTNQBoEs//6/YDaVI5OJ8zqsNTrJG aBo/BPDl40+I077SXiMfm4nWYCe/nLmq7y9B2oe3cjfakIVjcvXRtMZL0E0+Nre2ge6U KoIvPjqab4HemzkYm7peb0jHaqP018kgZaoxK4p4A5bl0sSV1qztCGkL0b/Zc2MEIGz/ px+2g21vrMHKKwZDDsc4kvSjSw2APz+CrXH2dguQX+t7EKgwu5NJypK1QvKeX9RmjFk8 QzlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=2Pggypr2F7LkEvZ1Gw0smpxXIinUjgE6D8HvxGn/T10=; b=PkqJY45BPdGdHM/MttKXi23PFSvNTIAjc7ocZLe35x8jbH7JDmviC9RL0BqwZO+9vg 990pMpSuTXp5ahg8ITqxPBswrccdYhdOCwHg8PM+gqaUpQKZSC/MYYCzS/ViEQmla2F4 4vnWIRBwJZZeTEvbOw65VYP6iajI2ZQp7q0xrPFbogVeh08a9C9UJPc6ETHHcmnWhfT+ w5rfnH8bb7tMbgF3VxIF5ABUnN5sw6hsY2ILQ45fWSzbhmomXh0qgej9W7v7c08eTfpP 1ZmpuQhVTEV6QkqURHLkWsNyveQmSAEc0njKg8iEaVrj49nPGG7mrbiJrDvIpsTXqtKK zTDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=ohzvNRZe; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5-v6si6870758pls.791.2018.02.05.04.51.27; Mon, 05 Feb 2018 04:51:27 -0800 (PST) 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; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=ohzvNRZe; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752844AbeBEMvZ (ORCPT + 6 others); Mon, 5 Feb 2018 07:51:25 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:29225 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752710AbeBEMvX (ORCPT ); Mon, 5 Feb 2018 07:51:23 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w15CopWq010644; Mon, 5 Feb 2018 06:50:51 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1517835051; bh=rhq1UgDeYXGmwkXgj61euVRB2BeHSvMpe/lz1CD6Si8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=ohzvNRZen3fKaDCzQHKBpZOh8lFjwhOmYVxH9t/WUtqHsWQsgsfWx9zQ3tz3bwQCO NvJxYHDlSr7VdOXN/m/nkxyZzGIo6o6kc+ycKLscE/O1QfmA4GGajqgu33+PBVrEmd cNVFrldyzGP4aXRCYxJ2UhdID9GDfYQZ6ogm0go8= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w15CopTd019716; Mon, 5 Feb 2018 06:50:51 -0600 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Mon, 5 Feb 2018 06:50:51 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Mon, 5 Feb 2018 06:50:51 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w15CoaGY023963; Mon, 5 Feb 2018 06:50:48 -0600 From: Kishon Vijay Abraham I To: Ulf Hansson , Tony Lindgren , Adrian Hunter CC: Rob Herring , Mark Rutland , Russell King , Kishon Vijay Abraham I , , , , , Subject: [PATCH v2 03/16] mmc: sdhci-omap: Add custom set_uhs_signaling sdhci_host ops Date: Mon, 5 Feb 2018 18:20:16 +0530 Message-ID: <20180205125029.21570-4-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180205125029.21570-1-kishon@ti.com> References: <20180205125029.21570-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org UHS-1 DDR50 and MMC DDR52 mode require DDR bit to be set in the configuration register (MMCHS_CON). Add sdhci-omap specific set_uhs_signaling ops to set this bit. Also while setting the UHSMS bit, clock should be disabled. Signed-off-by: Kishon Vijay Abraham I Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-omap.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index df927f3faaf6..86b6cc0a5380 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -31,6 +31,7 @@ #define SDHCI_OMAP_CON 0x12c #define CON_DW8 BIT(5) #define CON_DMA_MASTER BIT(20) +#define CON_DDR BIT(19) #define CON_CLKEXTFREE BIT(16) #define CON_PADEN BIT(15) #define CON_INIT BIT(1) @@ -461,6 +462,26 @@ static void sdhci_omap_init_74_clocks(struct sdhci_host *host, u8 power_mode) enable_irq(host->irq); } +static void sdhci_omap_set_uhs_signaling(struct sdhci_host *host, + unsigned int timing) +{ + u32 reg; + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host); + + sdhci_omap_stop_clock(omap_host); + + reg = sdhci_omap_readl(omap_host, SDHCI_OMAP_CON); + if (timing == MMC_TIMING_UHS_DDR50 || timing == MMC_TIMING_MMC_DDR52) + reg |= CON_DDR; + else + reg &= ~CON_DDR; + sdhci_omap_writel(omap_host, SDHCI_OMAP_CON, reg); + + sdhci_set_uhs_signaling(host, timing); + sdhci_omap_start_clock(omap_host); +} + static struct sdhci_ops sdhci_omap_ops = { .set_clock = sdhci_omap_set_clock, .set_power = sdhci_omap_set_power, @@ -470,7 +491,7 @@ static struct sdhci_ops sdhci_omap_ops = { .set_bus_width = sdhci_omap_set_bus_width, .platform_send_init_74_clocks = sdhci_omap_init_74_clocks, .reset = sdhci_reset, - .set_uhs_signaling = sdhci_set_uhs_signaling, + .set_uhs_signaling = sdhci_omap_set_uhs_signaling, }; static int sdhci_omap_set_capabilities(struct sdhci_omap_host *omap_host)