From patchwork Thu Aug 25 07:04:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 74652 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp690460qga; Thu, 25 Aug 2016 00:03:37 -0700 (PDT) X-Received: by 10.194.123.228 with SMTP id md4mr6012247wjb.91.1472108617330; Thu, 25 Aug 2016 00:03:37 -0700 (PDT) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id q134si30355882wmg.137.2016.08.25.00.03.37; Thu, 25 Aug 2016 00:03:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1CE3DA757A; Thu, 25 Aug 2016 09:03:09 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id s_-8vJESBfux; Thu, 25 Aug 2016 09:03:08 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9C9F5A7580; Thu, 25 Aug 2016 09:02:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4C5414B9CB for ; Thu, 25 Aug 2016 09:02:41 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sI1t7g2ESc-1 for ; Thu, 25 Aug 2016 09:02:41 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-08.nifty.com (conuserg-08.nifty.com [210.131.2.75]) by theia.denx.de (Postfix) with ESMTPS id 3C8FD4B9F9 for ; Thu, 25 Aug 2016 09:02:36 +0200 (CEST) Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id u7P72PXm002611; Thu, 25 Aug 2016 16:02:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com u7P72PXm002611 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1472108547; bh=mVM0AwevLyWG4OdSFaIsV8wxVwKFX0hCZC1fzodIs3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DUuPMclKSFywcCdS+cNdoQ9QuvKaag8XIwr5rAis7Qxz5GtEBQAnWUKhkzaORT4nk T1h4R/gdhJRIKEHp1T/KKSMb6O2/WEstr+LyXBVc/B/jRk9wMop2/aRgeaoqRHHcmh IX8H/3Zfglrr6PVJesZhi7e88QQ5iJzuxSQyWL67gqf8QHfR2oUohGZ9b8bxK2wTAB cPn8Y7eRx5GkrTWDOQbTxxtIe5UdwkR0bcW+vE8mE3Eux14mGMS7NgagiS9ZEH1vbG srt/sSHl/D4i1sRi5TjL+RSq/uxjhjk6Ng3HENphFBHl4rT4jlWG4RmM4Q1Wpr/R4x KprfHEqh92QvA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Thu, 25 Aug 2016 16:04:21 +0900 Message-Id: <1472108663-17156-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472108663-17156-1-git-send-email-yamada.masahiro@socionext.com> References: <1472108663-17156-1-git-send-email-yamada.masahiro@socionext.com> Subject: [U-Boot] [PATCH 4/6] mmc: sdhci: move SDMA capability check to sdhci_setup_cfg() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" If CONFIG_BLK is enabled, add_sdhci() is never called. Move this quirk handling to sdhci_setup_cfg(), which is now the central place for hardware capability checks. Signed-off-by: Masahiro Yamada --- drivers/mmc/sdhci.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index c66151c..da73653 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -519,6 +519,14 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host, u32 caps; caps = sdhci_readl(host, SDHCI_CAPABILITIES); + +#ifdef CONFIG_MMC_SDMA + if (!(caps & SDHCI_CAN_DO_SDMA)) { + printf("%s: Your controller doesn't support SDMA!!\n", + __func__); + return -EINVAL; + } +#endif host->version = sdhci_readw(host, SDHCI_HOST_VERSION); cfg->name = host->name; @@ -585,17 +593,6 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk, u32 min_clk) { int ret; -#ifdef CONFIG_MMC_SDMA - unsigned int caps; - - caps = sdhci_readl(host, SDHCI_CAPABILITIES); - if (!(caps & SDHCI_CAN_DO_SDMA)) { - printf("%s: Your controller doesn't support SDMA!!\n", - __func__); - return -1; - } -#endif - ret = sdhci_setup_cfg(&host->cfg, host, max_clk, min_clk); if (ret) return ret;