All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
To: Igor Opaniuk <igor.opaniuk@foundries.io>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	Ricardo Salveti <ricardo@foundries.io>,
	 Jorge Ramirez-Ortiz <jorge@foundries.io>,
	Fabio Estevam <festevam@gmail.com>,
	Haibo Chen <haibo.chen@nxp.com>,
	 Jaehoon Chung <jh80.chung@samsung.com>,
	Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH v2 2/2] mmc: sdhci-esdhc-imx: Add HS400 support for iMX7ULP
Date: Wed, 8 Sep 2021 21:56:01 +0300	[thread overview]
Message-ID: <CAOF=9AsRpBHNbVBwGuuLbj6YH18CK4U5KM2=9r-yxuA0WNwqQQ@mail.gmail.com> (raw)
In-Reply-To: <CAL6CDMEX4gYzd4eh6y+s54QfOMs6YK5R8sbeohxQL6EuUb+3CQ@mail.gmail.com>

Hi Igor,

On Wed, Sep 8, 2021 at 5:42 PM Igor Opaniuk <igor.opaniuk@foundries.io> wrote:
>
> Hi Oleksandr,
>
> On Tue, Aug 31, 2021 at 8:49 PM Oleksandr Suvorov
> <oleksandr.suvorov@foundries.io> wrote:
> >
> > Import HS400 support for iMX7ULP B0 from the Linux kernel:
> >
> > 2eaf5a533afd ("mmc: sdhci-esdhc-imx: Add HS400 support for iMX7ULP")
> >
> > According to IC suggest, need to clear the STROBE_DLL_CTRL_RESET
> > before any setting of STROBE_DLL_CTRL register.
> >
> > USDHC has register bits(bit[27~20] of register STROBE_DLL_CTRL)
> > for slave sel value. If this register bits value is 0,  it needs
> > 256 ref_clk cycles to update slave sel value. IC suggest to set
> > bit[27~20] to 0x4, it only need 4 ref_clk cycle to update slave
> > sel value. This will short the lock time of slave.
> >
> > i.MX7ULP B0 will need more time to lock the REF and SLV, so change
> > to add 5us delay.
> >
> > Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
> > Reviewed-by: Fabio Estevam <festevam@gmail.com>
> > ---
> >
> > Changes in v2:
> > - fixed Series-notes record.
> > - added Reviewed-by records.
> >
> >  drivers/mmc/fsl_esdhc_imx.c | 11 ++++++++---
> >  include/fsl_esdhc_imx.h     |  1 +
> >  2 files changed, 9 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c
> > index 6c8f77f9ee..569f099d9b 100644
> > --- a/drivers/mmc/fsl_esdhc_imx.c
> > +++ b/drivers/mmc/fsl_esdhc_imx.c
> > @@ -727,17 +727,21 @@ static void esdhc_set_strobe_dll(struct mmc *mmc)
> >
> >         if (priv->clock > ESDHC_STROBE_DLL_CLK_FREQ) {
> >                 esdhc_write32(&regs->strobe_dllctrl, ESDHC_STROBE_DLL_CTRL_RESET);
> > +               /* clear the reset bit on strobe dll before any setting */
> > +               esdhc_write32(&regs->strobe_dllctrl, 0);
> > +
> minor:
> additional blank line isn't needed.

Thank you, fixed!

> >
> >                 /*
> >                  * enable strobe dll ctrl and adjust the delay target
> >                  * for the uSDHC loopback read clock
> >                  */
> >                 val = ESDHC_STROBE_DLL_CTRL_ENABLE |
> > +                       ESDHC_STROBE_DLL_CTRL_SLV_UPDATE_INT_DEFAULT |
> >                         (priv->strobe_dll_delay_target <<
> >                          ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_SHIFT);
> >                 esdhc_write32(&regs->strobe_dllctrl, val);
> > -               /* wait 1us to make sure strobe dll status register stable */
> > -               mdelay(1);
> > +               /* wait 5us to make sure strobe dll status register stable */
> > +               mdelay(5);
> >                 val = esdhc_read32(&regs->strobe_dllstat);
> >                 if (!(val & ESDHC_STROBE_DLL_STS_REF_LOCK))
> >                         pr_warn("HS400 strobe DLL status REF not lock!\n");
> > @@ -1708,7 +1712,8 @@ static struct esdhc_soc_data usdhc_imx7d_data = {
> >
> >  static struct esdhc_soc_data usdhc_imx7ulp_data = {
> >         .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
> > -                       | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200,
> > +                       | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
> > +                       | ESDHC_FLAG_HS400,
> >  };
> >
> >  static struct esdhc_soc_data usdhc_imx8qm_data = {
> > diff --git a/include/fsl_esdhc_imx.h b/include/fsl_esdhc_imx.h
> > index 45ed635a77..12e9163382 100644
> > --- a/include/fsl_esdhc_imx.h
> > +++ b/include/fsl_esdhc_imx.h
> > @@ -194,6 +194,7 @@
> >  #define ESDHC_STROBE_DLL_CTRL_RESET    BIT(1)
> >  #define ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_DEFAULT   0x7
> >  #define ESDHC_STROBE_DLL_CTRL_SLV_DLY_TARGET_SHIFT     3
> > +#define ESDHC_STROBE_DLL_CTRL_SLV_UPDATE_INT_DEFAULT   (4 << 20)
> >
> >  #define ESDHC_STROBE_DLL_STATUS                0x74
> >  #define ESDHC_STROBE_DLL_STS_REF_LOCK  BIT(1)
> > --
> > 2.31.1
> >
>
> Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
>
> --
> Best regards - Freundliche Grüsse - Meilleures salutations
>
> Igor Opaniuk
> Embedded Software Engineer
> T:  +380 938364067
> E: igor.opaniuk@foundries.io
> W: www.foundries.io



-- 
Best regards,

Oleksandr Suvorov
Software Engineer
W: www.foundries.io

  reply	other threads:[~2021-09-08 18:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210831175004epcas1p357d7c59b2bcf35ad84795620b3383599@epcas1p3.samsung.com>
2021-08-31 17:49 ` [PATCH v2 1/2] mmc: fsl_esdhc_imx: initialize data for imx7ulp Oleksandr Suvorov
2021-08-31 17:49   ` [PATCH v2 2/2] mmc: sdhci-esdhc-imx: Add HS400 support for iMX7ULP Oleksandr Suvorov
2021-09-02 23:12     ` Jaehoon Chung
2021-09-08 14:42     ` Igor Opaniuk
2021-09-08 18:56       ` Oleksandr Suvorov [this message]
2021-09-02 23:11   ` [PATCH v2 1/2] mmc: fsl_esdhc_imx: initialize data for imx7ulp Jaehoon Chung

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='CAOF=9AsRpBHNbVBwGuuLbj6YH18CK4U5KM2=9r-yxuA0WNwqQQ@mail.gmail.com' \
    --to=oleksandr.suvorov@foundries.io \
    --cc=festevam@gmail.com \
    --cc=haibo.chen@nxp.com \
    --cc=igor.opaniuk@foundries.io \
    --cc=jh80.chung@samsung.com \
    --cc=jorge@foundries.io \
    --cc=peng.fan@nxp.com \
    --cc=ricardo@foundries.io \
    --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.