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: 28649 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 53BC620548 for ; Fri, 18 Apr 2014 18:58:48 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id vb8sf4713794obc.7 for ; Fri, 18 Apr 2014 11:58:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=pxLbIJVMo727rTpG75Xs6a9vTTM0/Uue6SIixdFvQi8=; b=ZoBbRhROFROUNnW8qijtkI3Ro/ZINaZggW36LRSNIg81asgW6EzZGRsLXF36xI660m eRgGaZ1BadcpyyS8DxB4ygGGW2xyDY7K/LWeRS0kfA71IcweUBPJifxAvp1IgjTbciit Yet8tZeBUDrcksSIr8pFgkFyrkK+6XIJljxihg1C0g90S70Y4VSmboL1G66z8EKuxk+A 05SVuPcPiOgwr8nKpmH6nocMhR+IAatEbYXo/M+RpxOroI3LvXUxJi7mYG00usWfawZ2 8+t1ttVjHysnngIBpY6TcF51GDD1K9xdjBoLDRjW0pXL2xA0Z3Z3fqSpeiXm2egCBNuN PWbQ== X-Gm-Message-State: ALoCoQl1NABC+1bRqn6GAxq46BatOXKhEuxTQDuJtjBHthBb7yMPubmo5cm8zYVVNjmnemRwVbmD X-Received: by 10.43.92.68 with SMTP id bp4mr8889206icc.26.1397847527626; Fri, 18 Apr 2014 11:58:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.88.229 with SMTP id t92ls1680461qgd.9.gmail; Fri, 18 Apr 2014 11:58:47 -0700 (PDT) X-Received: by 10.220.250.203 with SMTP id mp11mr15818403vcb.2.1397847527483; Fri, 18 Apr 2014 11:58:47 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id ls10si5097572vec.10.2014.04.18.11.58.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Apr 2014 11:58:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.177; Received: by mail-ve0-f177.google.com with SMTP id sa20so3445785veb.22 for ; Fri, 18 Apr 2014 11:58:47 -0700 (PDT) X-Received: by 10.220.162.6 with SMTP id t6mr16033015vcx.12.1397847527394; Fri, 18 Apr 2014 11:58:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp131943vcb; Fri, 18 Apr 2014 11:58:46 -0700 (PDT) X-Received: by 10.69.19.161 with SMTP id gv1mr23358473pbd.143.1397847526529; Fri, 18 Apr 2014 11:58:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tc10si13848338pbc.504.2014.04.18.11.58.45; Fri, 18 Apr 2014 11:58:45 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751984AbaDRS6n (ORCPT + 7 others); 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: list List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: tim.kryger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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