From mboxrd@z Thu Jan 1 00:00:00 1970 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 963ECC433F5 for ; Sat, 19 Feb 2022 13:08:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2AC3583C39; Sat, 19 Feb 2022 14:08:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1645276102; bh=UGS8Z7lnsXoDTOpau0fl5f6wtmb6hVORVgr1VLbIEFU=; h=From:To:Subject:In-reply-to:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From; b=r1BZK1msVGpZM0LHJxCLwzTQPc4aR2uKtcpwvY+pEhdB3ZM4sfesHlW8+cHW1YWjt cpG5egLrM5Sr4M5+zxcQ0XprYYZ6zeL4RWazJOCpyZ7tqKYlTzPs4ecgBzSknk4eT7 Biyv8yzJHP365YPN+vUDoHkn3VT72G+C+Ohh2MNGAaunJppMKhMQhopBgU0CWUQxMS NlbpSjE32wmODeYlZ4/gmYgwITnnQupjBaWzePmkaZ6v1jQAtqyZTphFH7gNDlGECi WxUcleCa0Wh8KSmthQ7w9z29xBF/72d+kffSyz2hfHT6K+G5l4Y3CyVwB4LiElbl2z ukTfRabW/mIMA== Received: by phobos.denx.de (Postfix, from userid 109) id E3DC183C16; Sat, 19 Feb 2022 14:08:06 +0100 (CET) Received: from mail-out.m-online.net (mail-out.m-online.net [IPv6:2001:a60:0:28:0:1:25:1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 962CA83C17 for ; Sat, 19 Feb 2022 14:08:01 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sbabic@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4K184d2G1Cz1s754; Sat, 19 Feb 2022 14:08:01 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4K184d207sz1r98m; Sat, 19 Feb 2022 14:08:01 +0100 (CET) X-Amavis-Alert: BAD HEADER SECTION, Missing required header field: "Date" Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id fT7y_BiIgSnJ; Sat, 19 Feb 2022 14:08:00 +0100 (CET) Received: from papero (host-88-217-136-221.customer.m-online.net [88.217.136.221]) by mail.mnet-online.de (Postfix) with ESMTP; Sat, 19 Feb 2022 14:08:00 +0100 (CET) From: sbabic@denx.de X-Patchwork-Submitter: Adam Ford X-Patchwork-Id: 1579150 X-Patchwork-Delegate: sbabic@denx.de To: Adam Ford ,u-boot@lists.denx.de Subject: [PATCH 1/2] mmc: fsl_esdhc_imx: Fix fsl_esdhc_wait_dat0 In-reply-to: <20220112135356.322069-2-aford173@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Message-Id: <20220219130806.E3DC183C16@phobos.denx.de> Date: Sat, 19 Feb 2022 14:08:02 +0100 (CET) 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.5 at phobos.denx.de X-Virus-Status: Clean > According to Haibo Chen [1] - the current implementation mmc_wait_dat0, > the second mmc_wait_dat0() in mmc_switch_voltage() always return timeout. > This causes UHS cards to not properly initialize to their highest rate, > and default back for high-speed mode. > When reviewing [1] and comparing it to the linux driver, it appears > that this function can be accomplished by turning off the clock, > and waiting for the clock-standby bit to become active. > [1] - https://lists.denx.de/pipermail/u-boot/2021-January/438644.html > Reported-by: Tim Harvey > Signed-off-by: Adam Ford > diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c > index 4c06361bee..e5814232a2 100644 > --- a/drivers/mmc/fsl_esdhc_imx.c > +++ b/drivers/mmc/fsl_esdhc_imx.c > @@ -1684,9 +1684,15 @@ static int fsl_esdhc_wait_dat0(struct udevice *dev, = int state, > struct fsl_esdhc_priv *priv =3D dev_get_priv(dev); > struct fsl_esdhc *regs =3D priv->esdhc_regs; > =20 > + /* > + * Clear the clock-enable and wait for the bit indicating it > + * is in standby. > + */ > + esdhc_clrbits32(®s->vendorspec, VENDORSPEC_CKEN); > ret =3D readx_poll_timeout(esdhc_read32, ®s->prsstat, tmp, > - !!(tmp & PRSSTAT_DAT0) =3D=3D !!state, > + (tmp & PRSSTAT_SDSTB), > timeout_us); > + > return ret; > } > =20 Applied to u-boot-imx, master, thanks ! Best regards, Stefano Babic --=20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic@denx.de =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D