From patchwork Fri Apr 18 18:58:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Kryger X-Patchwork-Id: 4018241 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4588C9F2BA for ; Fri, 18 Apr 2014 18:58:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D990203B7 for ; Fri, 18 Apr 2014 18:58:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C5B3203B5 for ; Fri, 18 Apr 2014 18:58:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751984AbaDRS6n (ORCPT ); Fri, 18 Apr 2014 14:58:43 -0400 Received: from mail-gw2-out.broadcom.com ([216.31.210.63]:30693 "EHLO mail-gw2-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751885AbaDRS6m (ORCPT ); Fri, 18 Apr 2014 14:58:42 -0400 X-IronPort-AV: E=Sophos;i="4.97,885,1389772800"; d="scan'208";a="25191924" Received: from irvexchcas08.broadcom.com (HELO IRVEXCHCAS08.corp.ad.broadcom.com) ([10.9.208.57]) by mail-gw2-out.broadcom.com with ESMTP; 18 Apr 2014 12:22:15 -0700 Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.3.174.1; Fri, 18 Apr 2014 11:58:41 -0700 Received: from mail-sj1-12.sj.broadcom.com (10.10.10.20) by IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) with Microsoft SMTP Server id 14.3.174.1; Fri, 18 Apr 2014 11:58:42 -0700 Received: from dhcp-sv1-10-19-114-209.sj.broadcom.com (mps-infra-lab3.sj.broadcom.com [10.19.114.109]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id ADF2527A81; Fri, 18 Apr 2014 11:58:41 -0700 (PDT) Received: by dhcp-sv1-10-19-114-209.sj.broadcom.com (Postfix, from userid 1004) id 86AB32520E7E; Fri, 18 Apr 2014 11:58:41 -0700 (PDT) From: Tim Kryger To: Chris Ball , Ulf Hansson CC: Tim Kryger , Linux MMC , Linux Kernel Mailing List Subject: [PATCH] mmc: core: Try other signal levels during power up Date: Fri, 18 Apr 2014 11:58:30 -0700 Message-ID: <1397847510-17199-1-git-send-email-tim.kryger@linaro.org> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 The eMMC signalling voltage is determined by VCCQ which is provided to the card by the host. Signalling is not required to begin at 3.3v and, if the host and card both support a particular VCC/VCCQ combination, it can be used immediately. In contrast, SD Cards must begin with 3.3v signalling and may switch to a lower voltage signalling if instructed to do so in CMD11. A message is required to coordinate this operation because the card only receives a 3.3v VDD and must know when to use the 1.8v produced by its internal regulator. It makes sense for the core to begin with 3.3v signalling but when that can't be set, 1.8v and 1.2v signalling also should be attempted. This is especially important when an external regulator with a limited range is used to supply VCCQ to an eMMC part. Signed-off-by: Tim Kryger --- drivers/mmc/core/core.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index acbc3f2..ecdbeae 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1517,6 +1517,8 @@ void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type) */ void mmc_power_up(struct mmc_host *host, u32 ocr) { + int err; + if (host->ios.power_mode == MMC_POWER_ON) return; @@ -1534,7 +1536,13 @@ void mmc_power_up(struct mmc_host *host, u32 ocr) mmc_set_ios(host); /* Set signal voltage to 3.3V */ - __mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330); + err = __mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330); + + /* Since eMMC parts can start at 1.8v or 1.2v try those too */ + if (err) + err = __mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180); + if (err) + __mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_120); /* * This delay should be sufficient to allow the power supply