All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de
Subject: IMX8MM SD UHS support
Date: Tue, 19 Jan 2021 09:32:09 -0800	[thread overview]
Message-ID: <CAJ+vNU3dBQOrBKSqyQUxVKZVGM=0C7WU-_cCc_5qG6rSvDWbQg@mail.gmail.com> (raw)
In-Reply-To: <AM6PR06MB4691C592870E022E6672DFE9A6A40@AM6PR06MB4691.eurprd06.prod.outlook.com>

On Mon, Jan 18, 2021 at 11:38 AM ZHIZHIKIN Andrey
<andrey.zhizhikin@leica-geosystems.com> wrote:
>
> Hello Tim,
>
> Sorry it took me quite some time to get this sorted out, but I believe I was able to identify an offending commit that is preventing the USDHC to switch to higher speed modes.
>
> It is in fact b5874b552f ("mmc: fsl_esdhc_imx: add wait_dat0() support"), reverting it makes SD Card to properly report capabilities and switch to high speed modes.
>
> Can you try to revert this on your end to see if the SD Card would start to operate in high speed mode?
>
> I'm still investigating why this addition of wait_dat0() caused this, I believe this is due to the fact that the same wait is already performed while voltage switch to handle the errata, thus this addition wait might erroneously timeout.
>
> ++ Haibo Chen <haibo.chen@nxp.com>
>
> Haibo,
>
> Can you please explain the purpose of adding wait_dat0() Introduced with commit b5874b552f? It is not clear from the commit message what was the purpose of adding it. Have you tested the USDHC switch to higher modes with this change?

Andrey,

Reverting b5874b552f ("mmc: fsl_esdhc_imx: add wait_dat0() support")
does not resolve the issue. That function waits for a specified
timeout for the card to assert DAT[0] either high or low depending on
arg and is used to check for command busy or failure. The patch in
question adds that function so that the common mmc code can utilize
it. If the function does not exist in the host controller driver any
call to mmc_wait_dat0 returns -ENOSYS so it must be there to support
UHS anyway.

What is not clear to me is why the card would hold DAT[0] low on the
voltage switch indicating a failure as it does not in the Linux driver
which appears to me to be doing the same thing. Again, if we ignore
the return code UHS works fine and I'm not at all clear why you
wouldn't run into this issue:
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index a6394bc..5ea3cd2 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -579,10 +579,12 @@ static int mmc_switch_voltage(struct mmc *mmc,
int signal_voltage)
         * dat[0:3] low. Wait for at least 1 ms according to spec
         */
        err = mmc_wait_dat0(mmc, 1, 1000);
+#if 0 // hack: not clear why card always holds DAT[0] high here on
fsl_esdhc_imx
        if (err == -ENOSYS)
                udelay(1000);
        else if (err)
                return -ETIMEDOUT;
+#endif

        return 0;
 }

Honestly I don't have the time to keep delving into this. I don't have
any reason to believe that UHS has ever worked with fsl_esdhc_imx and
because my boards boot from eMMC (and HS200/HS400 works) I'm not
missing out on much by having a slow microSD.

Best regards,

Tim

  reply	other threads:[~2021-01-19 17:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20201229232204epcas1p473b2ffe2ae0b94c91e6a2d99304805fe@epcas1p4.samsung.com>
2020-12-29 23:21 ` IMX8MM SD UHS support Tim Harvey
2020-12-29 23:43   ` Jaehoon Chung
2020-12-29 23:56     ` Tim Harvey
2020-12-30  9:30   ` ZHIZHIKIN Andrey
2020-12-30 16:54     ` Tim Harvey
2020-12-30 17:50       ` Fabio Estevam
2020-12-30 18:21         ` Adam Ford
2020-12-30 18:47           ` Tim Harvey
2020-12-30 20:41             ` Adam Ford
2020-12-30 21:00             ` ZHIZHIKIN Andrey
2021-01-05 23:09               ` Tim Harvey
2021-01-18 19:38                 ` ZHIZHIKIN Andrey
2021-01-19 17:32                   ` Tim Harvey [this message]
2021-01-19 20:47                     ` ZHIZHIKIN Andrey
2021-01-19 20:52                       ` Adam Ford
2021-01-22 12:41                       ` Bough Chen
2021-01-25 10:43                         ` Bough Chen
2022-01-11 23:32                           ` Adam Ford
2022-01-14  3:12                             ` Bough Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ+vNU3dBQOrBKSqyQUxVKZVGM=0C7WU-_cCc_5qG6rSvDWbQg@mail.gmail.com' \
    --to=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.