Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E690C7618D for ; Thu, 6 Apr 2023 12:14:18 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6A1ED86020; Thu, 6 Apr 2023 14:14:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bzT48a33"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 03E5C86010; Thu, 6 Apr 2023 14:14:15 +0200 (CEST) Received: from mail-ot1-x32b.google.com (mail-ot1-x32b.google.com [IPv6:2607:f8b0:4864:20::32b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2455E86026 for ; Thu, 6 Apr 2023 14:14:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=festevam@gmail.com Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-6978a930502so4489a34.1 for ; Thu, 06 Apr 2023 05:14:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680783250; x=1683375250; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=lUPdwL22naCtY42bQTGkDdrfIfHjh7eZn5wru3xDvdk=; b=bzT48a33XS/dOBcefKZpe1DnZVNsAdF9R9+ObhEzlLGWyoUaM4+lUn2icpi1/g0042 7UC0w3IgkqO4pKigguiU0apc9tvBR7bhocghwT4TBYYEsrxL95RPKvR5cuyqhLE/xiiq 2jJ8R8wxOiDR9/637tuRQeII/AINfIAIXxePjQ+SQ/eTUWa38VqyxaftMKk96zV5XhbM cqvCdZKLubrKC/JBUHVPX2ZNkdTMkrUuK+ymQc8Mi0zz/50fKPnDs+PksvlxOIUy8yig 7u16UYgH87kh6KIBqLL2vdCEL0BOdlqx/8OSoRkcrmhg26UBiFa3AYAf3IdZTWKzWdq2 yIWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680783250; x=1683375250; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lUPdwL22naCtY42bQTGkDdrfIfHjh7eZn5wru3xDvdk=; b=F5cZql/NP9o38bwOx5YLaAokiPLYEeBwh8q+jqCDdEokgtKpl9/2mBF4EFlULRO6NM +Unqji/6tUylM03cl1vWPvtZN6xX7FFE7nC1t9vcAXd3jNd0dvYXfbznqgF7dokZJLky VE96P+agNgI+4p7DK6rju2dOBFYtA+4HDRi36nUsdkwyTbMzVLBCLMSzwCnXez3K/MFf tQrPVI1+UxUQSQNg+glGF8KfCa/gbg4eDHh9emQVECia1xrbslrLp1LYaZY/A4E4mChn Z+jvBdvUcLxGYx/G8qQo/vDpHWPNE2CRtNkdZZYIxX07vTHwCFKveGlN2yZrYcuY/KFV I3rQ== X-Gm-Message-State: AAQBX9dquTooNTbeGZ4xRIZmNLvJWJOk+sHb0CY/w1Ltx6jzU85hGziP uDac2QPWG6JRxyNtNZ5iA+c= X-Google-Smtp-Source: AKy350Zuu+sChPfxlV6zmDqS8ym+FFDcRXP4isOOFip5ZhM8KhXd1LrggmM0h0VSe6grdPE8Y+GoVw== X-Received: by 2002:a9d:12ae:0:b0:686:5bd2:6006 with SMTP id g43-20020a9d12ae000000b006865bd26006mr2567050otg.2.1680783250734; Thu, 06 Apr 2023 05:14:10 -0700 (PDT) Received: from fabio-Precision-3551.. ([2804:14c:485:4b69:c4b0:ddac:a031:82c4]) by smtp.gmail.com with ESMTPSA id j7-20020a9d7d87000000b0069f8ff38bcbsm621362otn.16.2023.04.06.05.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Apr 2023 05:14:10 -0700 (PDT) From: Fabio Estevam To: peng.fan@nxp.com Cc: jh80.chung@samsung.com, u-boot@lists.denx.de, aford173@gmail.com, ye.li@nxp.com, marex@denx.de, Fabio Estevam Subject: [PATCH] mmc: fsl_esdhc: Fix enablement of UHS mode Date: Thu, 6 Apr 2023 09:14:04 -0300 Message-Id: <20230406121404.1547186-1-festevam@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Fabio Estevam Since commit 1a7904fdfa7d ("mmc: fsl_esdhc_imx: Use esdhc_soc_data flags to set host caps") the following SD card error is observed on an imx7d-sdb board: U-Boot 2023.04-00652-g487e42f7bc5e (Apr 05 2023 - 22:14:21 -0300) CPU: Freescale i.MX7D rev1.0 1000 MHz (running at 792 MHz) CPU: Commercial temperature grade (0C to 95C) at 35C Reset cause: POR Model: Freescale i.MX7 SabreSD Board Board: i.MX7D SABRESD in non-secure mode DRAM: 1 GiB Core: 100 devices, 19 uclasses, devicetree: separate PMIC: PFUZE3000 DEV_ID=0x30 REV_ID=0x10 MMC: FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2 Loading Environment from MMC... Card did not respond to voltage select! : -110 *** Warning - No block device, using default environment Fix the problem by only asserting the UHS_CAPS when supports_uhs() is true instead of doing it unconditionally, only based on the defconfig option. Signed-off-by: Fabio Estevam --- drivers/mmc/fsl_esdhc_imx.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c index 66caf683f741..bfc94d2a5326 100644 --- a/drivers/mmc/fsl_esdhc_imx.c +++ b/drivers/mmc/fsl_esdhc_imx.c @@ -1258,11 +1258,7 @@ static int fsl_esdhc_init(struct fsl_esdhc_priv *priv, esdhc_write32(®s->tuning_ctrl, val); } - /* - * UHS doesn't have explicit ESDHC flags, so if it's - * not supported, disable it in config. - */ - if (CONFIG_IS_ENABLED(MMC_UHS_SUPPORT)) + if (CONFIG_IS_ENABLED(MMC_UHS_SUPPORT) && supports_uhs(cfg->host_caps)) cfg->host_caps |= UHS_CAPS; if (CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)) { -- 2.34.1