From patchwork Fri May 19 08:15:16 2017 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: 100177 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp204359qge; Fri, 19 May 2017 01:28:03 -0700 (PDT) X-Received: by 10.98.138.150 with SMTP id o22mr9098779pfk.120.1495182483824; Fri, 19 May 2017 01:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1495182483; cv=none; d=google.com; s=arc-20160816; b=lE4xUU+RRG0IBWwH8SeT+cNM8dK0zySzTQjvOpuuS3gxJ3oEUZ3s0rc0Klvu8y+WiE zUo2ecwUBDMIpku1/76pQN9IoOw0lKaSBjD5L9h3OT2Z+6RkrKdxeLoLeD1Bnuwurdo6 vpdjn2LeDlUxbjcO2QxAiJulEf5leX012HYDRA2Q2sUyBNlxm9GGu10+Wea3D56cDnOn k5hIl4QRgVINgLFtpMXihtpJfgO+Fx032ofrRg/DFsK8MpMFSeK0AxcWYlynRL2ZeVqZ hHPr1TCiXkpzkFjpyyTntkf/WvQkkP+8q7t4ktC1Ix+vDumLp+Pz8HcQJCxr7ehLKesR 5HUA== 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=hHhbxm2XkgNU1b2KmD0jlYQDaEqATMD11yMt+rl4nqE=; b=UVv7z22XFtABFuL4CFHhOrB23iGF2T9e+gdFxCDxPss9ykySgcEiABZOww3V9RR1r6 4UllYe5eO+0yHVU4e3cBPEB1wOVeWptMyGVC+syF9N81m3eqfdxAYuh/guCerLiRCjIt BwAwa4lHPEWUn5+52CZWqQbnFDozcadXDQDDd6BjDBEuSWp52pJGhlfwAY9M0okUZDqs eM04zelzXrwMzGF2xOFKLKvesOkl94F+CW5N8AArOFFWSG7j7Ym4eT0SA3az5fiK8QdJ c4QlqI5KZsg5B2GO52JjYrHgjfP+RSmCDs7gEn0Adfr02HVhg8iDdZcxyluMtuCwwxMB KwSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) 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 o19si7871912pfj.126.2017.05.19.01.28.03; Fri, 19 May 2017 01:28:03 -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; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755690AbdESI1p (ORCPT + 25 others); Fri, 19 May 2017 04:27:45 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:10396 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753452AbdESIS0 (ORCPT ); Fri, 19 May 2017 04:18:26 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id v4J8Gwha018163; Fri, 19 May 2017 03:16:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1495181818; bh=hOcchWHNdS9cbiQIXglSXOjzBwmisiLI9OOnhYlBtv0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=OV4ue7cayoFEgoGBrlHHFqKatRc1Ihy40WCYk21qdMZicBGhktV6vTFVZJhxpWPbq 153WVVWaS2VkVMw/b8xZWCWx8LYrnBnwEtXHevz1oaYbQe91otgEmGrktLsEihsjfN 3aeXU4DC2HpxcEvbGW0hm6yVycQ+NmYTz7GCaYjw= Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4J8Gwt2027315; Fri, 19 May 2017 03:16:58 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Fri, 19 May 2017 03:16:58 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v4J8FfQN009185; Fri, 19 May 2017 03:16:54 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Rob Herring , Tony Lindgren CC: , , , , , , Jonathan Corbet , Mark Rutland , Russell King , , Subject: [PATCH 16/41] mmc: omap_hsmmc: Support non-1.8V IO controllers Date: Fri, 19 May 2017 13:45:16 +0530 Message-ID: <20170519081541.26753-17-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170519081541.26753-1-kishon@ti.com> References: <20170519081541.26753-1-kishon@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sekhar Nori OMAP HSMMC driver assumes that if the controller does not support dual-volt, then it supports only 1.8V IO. This assumption can be incorrect. For example, on K2G MMC0 supports 3.3V IO only. AM57x Beagle-x15 and IDK boards support only 3.3V IO on eMMC interface. Support device-tree property "no-1-8-v" to for controllers which are not dual-voltage and do not support 1.8V IO. Note that lack of support for this property has not led to any known regression in affected platforms so far. But it will be nice to be in sync with hardware configuration. Signed-off-by: Sekhar Nori Signed-off-by: Kishon Vijay Abraham I --- drivers/mmc/host/omap_hsmmc.c | 15 ++++++++++++--- include/linux/platform_data/hsmmc-omap.h | 5 +++++ 2 files changed, 17 insertions(+), 3 deletions(-) -- 2.11.0 diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index c6e3efb0f8fb..7c555e3ecce8 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -865,6 +865,9 @@ static int omap_hsmmc_context_restore(struct omap_hsmmc_host *host) else hctl = SDVS30; capa = VS30 | VS18; + } else if (host->pdata->controller_flags & OMAP_HSMMC_NO_1_8_V) { + hctl = SDVS30; + capa = VS30; } else { hctl = SDVS18; capa = VS18; @@ -2121,11 +2124,14 @@ static void omap_hsmmc_set_capabilities(struct omap_hsmmc_host *host) val = OMAP_HSMMC_READ(host->base, CAPA); - /* Only MMC1 supports 3.0V */ - if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT) + if (host->pdata->controller_flags & OMAP_HSMMC_SUPPORTS_DUAL_VOLT) { val |= (VS30 | VS18); - else + } else if (host->pdata->controller_flags & OMAP_HSMMC_NO_1_8_V) { + val |= VS30; + val &= ~VS18; + } else { val |= VS18; + } OMAP_HSMMC_WRITE(host->base, CAPA, val); } @@ -2567,6 +2573,9 @@ static struct omap_hsmmc_platform_data *of_get_hsmmc_pdata(struct device *dev) if (of_find_property(np, "ti,dual-volt", NULL)) pdata->controller_flags |= OMAP_HSMMC_SUPPORTS_DUAL_VOLT; + if (of_find_property(np, "no-1-8-v", NULL)) + pdata->controller_flags |= OMAP_HSMMC_NO_1_8_V; + pdata->gpio_cd = -EINVAL; pdata->gpio_cod = -EINVAL; pdata->gpio_wp = -EINVAL; diff --git a/include/linux/platform_data/hsmmc-omap.h b/include/linux/platform_data/hsmmc-omap.h index c3f2a34db97a..d7be21dc9ffd 100644 --- a/include/linux/platform_data/hsmmc-omap.h +++ b/include/linux/platform_data/hsmmc-omap.h @@ -23,12 +23,17 @@ * for example Advisory 2.1.1.128 "MMC: Multiple Block Read * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_ * Revision F (October 2010) (SPRZ278F). + * + * OMAP_HSMMC_NO_1_8_V: The controller does not support 1.8V IO voltage + * irrespective of what the capability states. + * */ #define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0) #define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1) #define OMAP_HSMMC_SWAKEUP_MISSING BIT(2) #define OMAP_HSMMC_REQUIRE_IODELAY BIT(3) #define OMAP_HSMMC_HAS_HWPARAM BIT(4) +#define OMAP_HSMMC_NO_1_8_V BIT(5) struct omap_hsmmc_dev_attr { u8 flags;