From patchwork Thu Apr 24 21:44:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Kryger X-Patchwork-Id: 29018 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f71.google.com (mail-yh0-f71.google.com [209.85.213.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D16B3203AC for ; Thu, 24 Apr 2014 21:45:49 +0000 (UTC) Received: by mail-yh0-f71.google.com with SMTP id a41sf11963782yho.2 for ; Thu, 24 Apr 2014 14:45:49 -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=7xCOXjNIcpeKq+SV00MGfhcqTTpKG//9880J5FRed8s=; b=l4CBJAgtG2V7RARxehmeHwdhjZoGrwLVsL7qRo5M9ekmROEWgq9dF1NqPu2mZI+ZlG 4lwAGCyEnW76npaYUGSxcPJBK7D6RBdLwpCMBsznpb5bX4KINZWrSHunypzrkQ7qrXl5 bpN15NFb28lYCOlbmxV+zVyqRYjRjPmHgu+tjC0/ueKjGRxCBK/idZAQpc53LKdS4vBI FkSeD9pYtYVJWAd99SpnpKFlkGZgsuSBmxSB8kfOVjFfioJJy5BMLynrgddEoGGFzVnN NMaSCuWwhsXc3uQlZ1duBpPip0aIwKMOxgZ5cdpNyIyi04KLEz3B9FDwj8AoARqGmdm/ gesw== X-Gm-Message-State: ALoCoQme8E867stPJUKpZ1AiBl8zb2trDoaNT7HW8B8ltoOElWq8TJb0XtEvgDgdREBsbTXL2m9A X-Received: by 10.236.4.201 with SMTP id 49mr1103229yhj.47.1398375949560; Thu, 24 Apr 2014 14:45:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.40 with SMTP id y37ls1479271qgy.10.gmail; Thu, 24 Apr 2014 14:45:49 -0700 (PDT) X-Received: by 10.220.163.3 with SMTP id y3mr3035357vcx.7.1398375949456; Thu, 24 Apr 2014 14:45:49 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id y16si1247172vct.210.2014.04.24.14.45.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 24 Apr 2014 14:45:49 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id pa12so3750178veb.1 for ; Thu, 24 Apr 2014 14:45:49 -0700 (PDT) X-Received: by 10.52.119.178 with SMTP id kv18mr2053033vdb.39.1398375949383; Thu, 24 Apr 2014 14:45:49 -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 ib8csp48365vcb; Thu, 24 Apr 2014 14:45:48 -0700 (PDT) X-Received: by 10.66.148.230 with SMTP id tv6mr2980211pab.155.1398375948645; Thu, 24 Apr 2014 14:45:48 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ci3si3410171pad.373.2014.04.24.14.45.47; Thu, 24 Apr 2014 14:45:47 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754823AbaDXVpe (ORCPT + 27 others); Thu, 24 Apr 2014 17:45:34 -0400 Received: from mail-gw1-out.broadcom.com ([216.31.210.62]:43955 "EHLO mail-gw1-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753217AbaDXVp3 (ORCPT ); Thu, 24 Apr 2014 17:45:29 -0400 X-IronPort-AV: E=Sophos;i="4.97,921,1389772800"; d="scan'208";a="26500481" Received: from irvexchcas07.broadcom.com (HELO IRVEXCHCAS07.corp.ad.broadcom.com) ([10.9.208.55]) by mail-gw1-out.broadcom.com with ESMTP; 24 Apr 2014 15:53:25 -0700 Received: from IRVEXCHSMTP1.corp.ad.broadcom.com (10.9.207.51) by IRVEXCHCAS07.corp.ad.broadcom.com (10.9.208.55) with Microsoft SMTP Server (TLS) id 14.3.174.1; Thu, 24 Apr 2014 14:45:28 -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; Thu, 24 Apr 2014 14:45:28 -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 9C5E727A81; Thu, 24 Apr 2014 14:45:28 -0700 (PDT) Received: by dhcp-sv1-10-19-114-209.sj.broadcom.com (Postfix, from userid 1004) id 315FB2520E80; Thu, 24 Apr 2014 14:45:27 -0700 (PDT) From: Tim Kryger To: Chris Ball , Ulf Hansson CC: Tim Kryger , Linux MMC , Linux Kernel Mailing List Subject: [PATCH v2] mmc: core: Try other signal levels during power up Date: Thu, 24 Apr 2014 14:44:26 -0700 Message-ID: <1398375866-8898-1-git-send-email-tim.kryger@linaro.org> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@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: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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 Acked-by: Ulf Hansson --- Changes since v1: - Eliminated temporary err variable and added debug output drivers/mmc/core/core.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index acbc3f2..72926a9 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1533,8 +1533,13 @@ void mmc_power_up(struct mmc_host *host, u32 ocr) host->ios.timing = MMC_TIMING_LEGACY; mmc_set_ios(host); - /* Set signal voltage to 3.3V */ - __mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330); + /* Try to set signal voltage to 3.3V but fall back to 1.8v or 1.2v */ + if (__mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330) == 0) + dev_dbg(mmc_dev(host), "Initial signal voltage of 3.3v\n"); + else if (__mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_180) == 0) + dev_dbg(mmc_dev(host), "Initial signal voltage of 1.8v\n"); + else if (__mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_120) == 0) + dev_dbg(mmc_dev(host), "Initial signal voltage of 1.2v\n"); /* * This delay should be sufficient to allow the power supply