All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Cc: "linux-renesas-soc@vger.kernel.org" 
	<linux-renesas-soc@vger.kernel.org>,
	Takeshi Saito <takeshi.saito.xv@renesas.com>
Subject: RE: [PATCH 2/2] mmc: renesas_sdhi: support manual calibration
Date: Mon, 31 Aug 2020 06:22:55 +0000	[thread overview]
Message-ID: <TY2PR01MB369224E06BAE72C1711B681AD8510@TY2PR01MB3692.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <20200605101222.10783-3-wsa+renesas@sang-engineering.com>

Hi Wolfram-san,

Thank you for the patch!
 (And, I'm sorry for the delayed response.)

> From: Wolfram Sang, Sent: Friday, June 5, 2020 7:12 PM
> 
> Some R-Car Gen3 SoCs need some manual correction of timing parameters
> after the automatic tuning has finished but before next CMD13 is
> completed. This patch implements that by this state machine:
> 
> - introducing a per-SoC correction table if needed
> - iff such a table exists, the 'fixup_request' callback is populated
>   during probe
> - iff such a table exists, a runtime flag ('needs_adjust_hs400')
>   is set when HS400 tuning gets prepared

We should set the needs_adjust_hs400 when HS400EN=1 is set.
In other words, we should set it in renesas_sdhi_hs400_complete(),
not renesas_sdhi_prepare_hs400_tuning().
	
> - if tuning HS400 fails, the runtime flag is cleared again
> - the callback will check the runtime flag and enable the corrected
>   manual mode if the flag is set and CMD13 is encountered
> - at the end of the enablement the runtime flag is cleared
> - iff the configuration flag is set, the manual mode will be disabled
>   when HS400 gets downgraded
> 
> There also some helper functions added to access the TMPPORT registers.
> The actual correction table is SoC and instance(!) specific and is
> added to the quirks struct.
> 
> Signed-off-by: Takeshi Saito <takeshi.saito.xv@renesas.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
<snip>
> +static void renesas_sdhi_adjust_hs400_mode_enable(struct tmio_mmc_host *host)
> +{
> +	struct renesas_sdhi *priv = host_to_priv(host);
> +	u32 calib_code;
> +
> +	/* disable write protect */
> +	sd_scc_tmpport_write32(host, priv, 0x00,
> +			       SH_MOBILE_SDHI_SCC_TMPPORT_DISABLE_WP_CODE);
> +	/* read calibration code and adjust */
> +	calib_code = sd_scc_tmpport_read32(host, priv, 0x26);

When we read the calib_code at room temperature, the value will be around 0x10.
However, we will get 0x00 here. So, we need to fix it.

Best regards,
Yoshihiro Shimoda


  reply	other threads:[~2020-08-31  6:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05 10:12 [PATCH 0/2] mmc: renesas_sdhi: support manual calibration Wolfram Sang
2020-06-05 10:12 ` [PATCH 1/2] mmc: tmio: add generic hook to fixup after a completed request Wolfram Sang
2020-06-05 10:12 ` [PATCH 2/2] mmc: renesas_sdhi: support manual calibration Wolfram Sang
2020-08-31  6:22   ` Yoshihiro Shimoda [this message]
2020-08-31 11:41     ` Wolfram Sang
2020-06-16 11:32 ` [PATCH 0/2] " Ulf Hansson
2020-06-18  5:39   ` Wolfram Sang

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=TY2PR01MB369224E06BAE72C1711B681AD8510@TY2PR01MB3692.jpnprd01.prod.outlook.com \
    --to=yoshihiro.shimoda.uh@renesas.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=takeshi.saito.xv@renesas.com \
    --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 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.