All of lore.kernel.org
 help / color / mirror / Atom feed
From: zhangfei gao <zhangfei.gao@gmail.com>
To: linux-mmc@vger.kernel.org
Cc: Adrian Hunter <adrian.hunter@nokia.com>,
	Hanumath Prasad <hanumath.prasad@stericsson.com>,
	Chris Ball <cjb@laptop.org>,
	Matt Fleming <matt@console-pimps.org>,
	eric.y.miao@gmail.com, Haojian Zhuang <haojian.zhuang@gmail.com>
Subject: Re: [Patch 1/1]sdhci: verify ddr50 mode
Date: Wed, 3 Nov 2010 23:26:50 -0400	[thread overview]
Message-ID: <AANLkTi=iNe+Fg8tqTSj7H+UKOB-J=xb5gGp4x3ZNnEiH@mail.gmail.com> (raw)
In-Reply-To: <AANLkTin5S_xKj_H5tFUE+RHa-T_z0USvhdzap3fpSaa8@mail.gmail.com>

Hi All,

The regulator voltage change need some time to keep stable, how could
we put in set_ios, which inside spin_lock, can not use msleep.

>From spec 3.0.
1.8V Signaling Enable Setting
Setting this bit from 1 to 1 starts changing signal voltage from 3.3v
to 1.8v. 1.8v voltage output shall be stable within 5ms. Host
Contrller clears this bit if switching to 1.8v fails.
Clearing this bit from 1 to 0 starts changing signal voltage from 1.8v
to 3.3v . 3.3V regulatro output shall be stable within 5ms.

According to spec, we should wait 5ms to check SDHCI_CTRL2_1_8V
whether it is set or not.
However, here is spin_lock, and we can not put msleep inside.
Our controller does not switch to 1.8v in fact, so the ddr50 mode work
at 3.3v in fact.
Currently our controller count on external pmic to provide 1.8v when
support SBR mode, however, how to consider wait 5ms or so to wait
regulator to be stable.

Thanks

+       if (ddr & MMC_1_8V_DDR_MODE) {
+               con = sdhci_readw(host, SDHCI_HOST_CONTROL2);
+               con |= SDHCI_CTRL2_1_8V;
+               sdhci_writew(host, con, SDHCI_HOST_CONTROL2);
+
+               /* Wait 5 ms to check 1.8v regulator swithing success or not */
+               msleep(5);
+               if (!(sdhci_readw(host, SDHCI_HOST_CONTROL2)
+                                       & SDHCI_CTRL2_1_8V)) {
+                       printk(KERN_ERR "%s: HOST CONTROL fail switch
to 1.8v\n",
+                                       mmc_hostname(host->mmc));
+                       sdhci_dumpregs(host);
+                       return;
+               }
+               con = sdhci_readw(host, SDHCI_HOST_CONTROL2);
+               con &= ~SDHCI_CTRL2_UHS_MASK;
+               if (ddr & MMC_1_8V_DDR_MODE)
+                       con |= SDHCI_CTRL2_DDR50;
+               sdhci_writew(host, con, SDHCI_HOST_CONTROL2);
+       }

  reply	other threads:[~2010-11-04  3:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-01 14:21 [Patch 1/1]sdhci: verify ddr50 mode zhangfei gao
2010-11-04  3:26 ` zhangfei gao [this message]
2010-11-02  1:00 Philip Rakity
2010-11-02 11:54 ` Philip Rakity
2010-11-02 13:01   ` zhangfei gao
2010-11-02 13:46     ` Philip Rakity

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='AANLkTi=iNe+Fg8tqTSj7H+UKOB-J=xb5gGp4x3ZNnEiH@mail.gmail.com' \
    --to=zhangfei.gao@gmail.com \
    --cc=adrian.hunter@nokia.com \
    --cc=cjb@laptop.org \
    --cc=eric.y.miao@gmail.com \
    --cc=hanumath.prasad@stericsson.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=matt@console-pimps.org \
    /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.