From: Simon Horman <horms@verge.net.au>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Magnus Damm <magnus.damm@gmail.com>,
linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Ai Kyuse <ai.kyuse.uw@renesas.com>
Subject: Re: [PATCH/RFC v2 2/3] mmc: sh_mobile_sdhi: Add tuning support
Date: Mon, 23 May 2016 10:34:27 +0900 [thread overview]
Message-ID: <20160523013427.GG25562@verge.net.au> (raw)
In-Reply-To: <87eg8tsijz.wl%kuninori.morimoto.gx@renesas.com>
On Mon, May 23, 2016 at 12:57:41AM +0000, Kuninori Morimoto wrote:
>
> Hi Simon
>
> > From: Ai Kyuse <ai.kyuse.uw@renesas.com>
> >
> > Add tuning support for use with SDR104 mode
> > This includes adding support for the sampling clock controller (SCC).
> >
> > Signed-off-by: Ai Kyuse <ai.kyuse.uw@renesas.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> (snip)
> > +static int sh_mobile_sdhi_select_tuning(struct tmio_mmc_host *host, bool *tap)
> > +{
> > + unsigned long tap_num, i;
> > + int ok_count;
> > +
> > + /* Clear SCC_RVSREQ */
> > + sd_scc_write32(host, SH_MOBILE_SDHI_SCC_RVSREQ, 0);
> > +
> > + /* Select SCC */
> > + tap_num = (sd_scc_read32(host, SH_MOBILE_SDHI_SCC_DTCNTL) >>
> > + SH_MOBILE_SDHI_SCC_DTCNTL_TAPNUM_SHIFT) &
> > + SH_MOBILE_SDHI_SCC_DTCNTL_TAPNUM_MASK;
> > +
> > + /*
> > + * Select clock where three consecutive bock reads succeeded.
> > + *
> > + * There may be multiple occurrences of three successive reads
> > + * and selecting any of them is correct. Here the first one is
> > + * selected.
> > + */
> > + ok_count = 0;
> > + for (i = 0; i < 2 * tap_num; i++) {
> > + if (tap[i])
> > + ok_count++;
> > + else
> > + ok_count = 0;
> > + if (ok_count == 3)
> > + break;
> > + }
>
> As I pointed on [1/3] patch, having "tap_array_size" on this function,
> and check tap_num <-> tap_array_size is nice idea IMO.
We could also provide the array parameter and
not read tap_num using sd_scc_read32() here at all.
Which do you feel is best?
next prev parent reply other threads:[~2016-05-23 1:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-20 7:02 [PATCH/RFC v2 0/3] UHS-I SDR-104 support for sh_mobile_sdhi Simon Horman
2016-05-20 7:02 ` [PATCH/RFC v2 1/3] mmc: tmio: Add tuning support Simon Horman
2016-05-23 0:53 ` Kuninori Morimoto
2016-05-23 1:33 ` Simon Horman
2016-05-20 7:02 ` [PATCH/RFC v2 2/3] mmc: sh_mobile_sdhi: " Simon Horman
2016-05-23 0:57 ` Kuninori Morimoto
2016-05-23 1:34 ` Simon Horman [this message]
2016-05-23 2:14 ` Kuninori Morimoto
2016-05-20 7:02 ` [PATCH/RFC v2 3/3] ARM: dts: r8a7790: lager: Enable UHS-I SDR-104 Simon Horman
2016-05-24 0:41 ` [PATCH/RFC v2 0/3] UHS-I SDR-104 support for sh_mobile_sdhi Simon Horman
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=20160523013427.GG25562@verge.net.au \
--to=horms@verge.net.au \
--cc=ai.kyuse.uw@renesas.com \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=wsa+renesas@sang-engineering.com \
/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