devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zach Brown <zach.brown@ni.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Shawn Lin <shawn.lin@rock-chips.com>,
	Julia Cartwright <julia@ni.com>, Rob Herring <robh+dt@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed
Date: Fri, 7 Oct 2016 13:56:04 -0500	[thread overview]
Message-ID: <20161007185603.GA8388@zach-desktop> (raw)
In-Reply-To: <7acb34a9-d323-b112-f796-92c2a962743c@intel.com>

On Thu, Oct 06, 2016 at 09:13:24AM +0300, Adrian Hunter wrote:
> On 06/10/16 04:34, Shawn Lin wrote:
> > On 2016/10/6 5:22, Julia Cartwright wrote:
> >> On Wed, Oct 05, 2016 at 03:03:44PM -0500, Rob Herring wrote:
> >>> On Wed, Oct 5, 2016 at 1:33 PM, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> >>>> On 23 September 2016 at 22:01, Zach Brown <zach.brown@ni.com> wrote:
> >>>>> Certain board configurations can make highspeed malfunction due to
> >>>>> timing issues. In these cases a way is needed to force the controller
> >>>>> and card into standard speed even if they otherwise appear to be capable
> >>>>> of highspeed.
> >>>>>
> >>>>> The sd-broken-highspeed property will let the sdhci driver know that
> >>>>> highspeed will not work.
> >>>>>
> >>>>> Signed-off-by: Zach Brown <zach.brown@ni.com>
> >>>>> ---
> >>>>>  Documentation/devicetree/bindings/mmc/mmc.txt | 2 ++
> >>>>>  1 file changed, 2 insertions(+)
> >>>>>
> >>>>> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt
> >>>>> b/Documentation/devicetree/bindings/mmc/mmc.txt
> >>>>> index 8a37782..59332ea 100644
> >>>>> --- a/Documentation/devicetree/bindings/mmc/mmc.txt
> >>>>> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt
> >>>>> @@ -52,6 +52,8 @@ Optional properties:
> >>>>>  - no-sdio: controller is limited to send sdio cmd during initialization
> >>>>>  - no-sd: controller is limited to send sd cmd during initialization
> >>>>>  - no-mmc: controller is limited to send mmc cmd during initialization
> >>>>> +- sd-broken-highspeed: Highspeed is broken, even if the controller and
> >>>>> card
> >>>>> +  themselves claim they support highspeed.
> >>>>
> >>>> Regarding a broken card, that is managed via the card quirks and not in DT.
> >>>>
> >>>> If this is about a controller limitation, we already have the option
> >>>> to describe what it supports, so we don't need an option to tell what
> >>>> it *not* supports.
> >>>>
> >>>> For example "cap-sd-highspeed" tells whether the controller supports
> >>>> SD high-speed, please use that instead.
> >>>
> >>> If a controller has a capability register and it lies (perhaps the
> >>> board has limitations that the SoC does not), then you may need to
> >>> disable a feature.
> >>
> >> That's precisely the case here.  This is a board-level problem, not a
> >> card or controller problem.  As Zach mentioned in the cover letter, the
> >> trace length between controller and card on some of our boards is too
> >> long to meet high-speed timings, even though both card and controller
> >> advertise it.
> >
> > IIRC, I saw the same problem while using sdhci to bring up a
> > industrial board for vehicle. The trace length is so long that
> > I have to limit the max-frequency to make it works properly when
> > running at hishspeed.
> >
> > So could you try to limit the max-frequency in your DT to see
> > if it could work for you? I guess it should work as once reducing
> > the frequency, the timing per cycle will be large enough to meet
> > the spec. At least that helped me solve my problem.
> >
> > For further consideration, I deployed a mechanism called "tuning for
> > non UHS or non-hs200/400" for my donwstream tree at that time. The basic
> > concept is to ask devices to send ext_csd(or send status for SD case)
> > *repeatedly*. Some hosts, i.e. sdhci-of-arasan or dw_mmc-rockchip, can
> > manually set rx delay via some clock unit registers to capture the
> > working sample window and select the middle point of the longest good
> > phase region. The same for retune. But it is a little complicated, and
> > could only be applicable to the hosts who could adjust the rx delay
> > manually when claiming the caps of MMC_CAPS_CAN_TUNING_FOR_HS, whatever
> > the name is...
> >
> > I don't know if it is worth to add this, and I don't know if it's
> > a legit way. Anyway, I just share my thought(experience) for you and
> > linux-mmc to think more about how to deal with the case you meet rather
> > than sacrificing the performence by removing highspeed or reducing
> > frequency..
> >
>
> As Shawn points out, using max-frequency is a possibility. Did you consider
> that?
>

I hadn't. So I looked into it and, as I stated the issue using max-frequency
would work, but I forgot to add that, because we pass the signal through an
fpga it has to be standard speed. If the card and controller are not in
standard speed then it won't pass hold time. Specifically we need the data to
change on the falling edge of the clock.

I'll add this justification to the commit message.

> There are 2 high speed caps:
> 	cap-sd-highspeed
> 	cap-mmc-highspeed
>
> Yet patch in 2, the effect of sd-broken-highspeed is to suppress highspeed
> for both SD and MMC.  Should it then be called just broken-highspeed?
>

I agree, broken-highspeed makes more sense. Will change in the next version.

  reply	other threads:[~2016-10-07 18:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23 20:01 [RFC 0/2] Add device tree property and quirk for supporting sdhci Zach Brown
2016-09-23 20:01 ` [RFC 1/2] sdhci: Add device tree property sd-broken-highspeed Zach Brown
     [not found]   ` <1474660869-15532-2-git-send-email-zach.brown-acOepvfBmUk@public.gmane.org>
2016-10-03 17:37     ` Rob Herring
2016-10-05 18:33   ` Ulf Hansson
2016-10-05 20:03     ` Rob Herring
     [not found]       ` <CAL_JsqLjtn2-FaO_h9JWOsZqttQ35yV6KOnQz2Z-cMr=0GHJCg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-05 21:22         ` Julia Cartwright
2016-10-06  1:34           ` Shawn Lin
     [not found]             ` <5972c8f4-23b5-7dbb-b87c-7be7ec5b1a17-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-10-06  6:13               ` Adrian Hunter
2016-10-07 18:56                 ` Zach Brown [this message]
2016-10-06  8:03         ` Ulf Hansson
2016-10-17 21:49           ` Zach Brown
2016-09-23 20:01 ` [RFC 2/2] sdhci: Prevent SD from doing highspeed timing when sd-broken-highspeed property is set Zach Brown
     [not found]   ` <1474660869-15532-3-git-send-email-zach.brown-acOepvfBmUk@public.gmane.org>
2016-10-06  6:39     ` Adrian Hunter

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=20161007185603.GA8388@zach-desktop \
    --to=zach.brown@ni.com \
    --cc=adrian.hunter@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=julia@ni.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=ulf.hansson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).