From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Biju <biju.das.au@gmail.com>
Cc: Ulf Hansson <ulfh@kernel.org>,
Biju Das <biju.das.jz@bp.renesas.com>,
linux-mmc@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Geert Uytterhoeven <geert+renesas@glider.be>,
Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: Re: [PATCH v17 08/17] mmc: renesas_sdhi: Add tuning_delay hw_info flag
Date: Wed, 17 Jun 2026 14:40:38 +0200 [thread overview]
Message-ID: <ajKVxixgTHaavVfi@shikoro> (raw)
In-Reply-To: <20260603065731.93243-9-biju.das.jz@bp.renesas.com>
[-- Attachment #1: Type: text/plain, Size: 3666 bytes --]
On Wed, Jun 03, 2026 at 07:57:08AM +0100, Biju wrote:
> From: Biju Das <biju.das.jz@bp.renesas.com>
>
> As per the RZ/G2L hardware manual, the TMPOUT bit field in the SCC_TMPPORT
> register needs to be set to 0 when transferring at 3.3V, and to 1 when
> transferring at 1.8V.
>
> Add a tuning_delay bitfield to renesas_sdhi_hw_info to indicate hardware
> that requires an adjustment when the signal voltage changes.
>
> Add sdhi_hw_info_rzg2l with tuning_delay = 1 and assign it to
> of_rzg2l_compatible, enabling the adjustment for RZ/G2L. All other
> platforms retain sdhi_hw_info_generic with tuning_delay = 0 and
> are unaffected.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v1->v2:
> * No change.
> ---
> drivers/mmc/host/renesas_sdhi.h | 2 +
> drivers/mmc/host/renesas_sdhi_core.c | 83 +++++++++++--------
> drivers/mmc/host/renesas_sdhi_internal_dmac.c | 8 +-
> 3 files changed, 58 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
> index a42934e6d49d..a3c5fa368242 100644
> --- a/drivers/mmc/host/renesas_sdhi.h
> +++ b/drivers/mmc/host/renesas_sdhi.h
> @@ -44,6 +44,8 @@ struct renesas_sdhi_of_data {
> struct renesas_sdhi_hw_info {
> u64 clk_mask;
> unsigned int max_divider;
> + /* hardware features */
> + unsigned tuning_delay:1; /* Has tuning delay */
> };
>
> struct renesas_sdhi_of_data_with_info {
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index 16ed6fd8470d..868ba6a6919e 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -257,40 +257,6 @@ static int renesas_sdhi_card_busy(struct mmc_host *mmc)
> TMIO_STAT_DAT0);
> }
>
> -static int renesas_sdhi_start_signal_voltage_switch(struct mmc_host *mmc,
> - struct mmc_ios *ios)
> -{
> - struct tmio_mmc_host *host = mmc_priv(mmc);
> - struct renesas_sdhi *priv = host_to_priv(host);
> - struct pinctrl_state *pin_state;
> - int ret;
> -
> - switch (ios->signal_voltage) {
> - case MMC_SIGNAL_VOLTAGE_330:
> - pin_state = priv->pins_default;
> - break;
> - case MMC_SIGNAL_VOLTAGE_180:
> - pin_state = priv->pins_uhs;
> - break;
> - default:
> - return -EINVAL;
> - }
> -
> - /*
> - * If anything is missing, assume signal voltage is fixed at
> - * 3.3V and succeed/fail accordingly.
> - */
> - if (IS_ERR(priv->pinctrl) || IS_ERR(pin_state))
> - return ios->signal_voltage ==
> - MMC_SIGNAL_VOLTAGE_330 ? 0 : -EINVAL;
> -
> - ret = mmc_regulator_set_vqmmc(host->mmc, ios);
> - if (ret < 0)
> - return ret;
> -
> - return pinctrl_select_state(priv->pinctrl, pin_state);
> -}
> -
I don't think this function needs to be moved downwards?
> /* SCC registers */
> #define SH_MOBILE_SDHI_SCC_DTCNTL 0x000
> #define SH_MOBILE_SDHI_SCC_TAPSET 0x002
> @@ -351,6 +317,55 @@ static inline void sd_scc_write32(struct tmio_mmc_host *host,
> writel(val, priv->scc_ctl + (addr << host->bus_shift));
> }
>
> +static void renesas_sdhi_set_hw_adjustment_delay(struct tmio_mmc_host *host)
> +{
> + struct renesas_sdhi *priv = host_to_priv(host);
> +
> + if (!priv->info->tuning_delay)
> + return;
> +
> + if (host->mmc->ios.signal_voltage == MMC_SIGNAL_VOLTAGE_330)
> + sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2, 0x0);
> + else
> + sd_scc_write32(host, priv, SH_MOBILE_SDHI_SCC_TMPPORT2, 0x1);
> +}
Isn't it enough to move this upwards? I don't see anything requiring
this function to be so late. Am I overlooking something?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2026-06-17 12:40 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 6:57 [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju
2026-06-03 6:57 ` [PATCH v17 01/17] dt-bindings: mmc: renesas,sdhi: Document RZ/G3L (r9a08g046) SoC Biju
2026-06-17 12:19 ` Wolfram Sang
2026-06-17 12:42 ` Biju Das
2026-06-03 6:57 ` [PATCH v17 02/17] clk: renesas: r9a08g046: Add clock and reset entries for SDHI Biju
2026-06-17 12:55 ` Geert Uytterhoeven
2026-06-03 6:57 ` [PATCH v17 03/17] pinctrl: renesas: rzg2l: Add SD channel POC support for RZ/G3L Biju
2026-06-04 9:32 ` Geert Uytterhoeven
2026-06-04 9:39 ` Biju Das
2026-06-03 6:57 ` [PATCH v17 04/17] mmc: renesas_sdhi: Fix whitespace alignment in struct renesas_sdhi_of_data Biju
2026-06-17 12:21 ` Wolfram Sang
2026-06-17 13:06 ` Biju Das
2026-06-03 6:57 ` [PATCH v17 05/17] mmc: renesas_sdhi_internal_dmac: Fix whitespace alignment in struct initializer Biju
2026-06-17 12:21 ` Wolfram Sang
2026-06-17 13:08 ` Biju Das
2026-06-03 6:57 ` [PATCH v17 06/17] mmc: renesas_sdhi: Introduce renesas_sdhi_hw_info to abstract clock mask Biju
2026-06-17 12:35 ` Wolfram Sang
2026-06-03 6:57 ` [PATCH v17 07/17] mmc: renesas_sdhi: Add max_divider to renesas_sdhi_hw_info Biju
2026-06-03 6:57 ` [PATCH v17 08/17] mmc: renesas_sdhi: Add tuning_delay hw_info flag Biju
2026-06-17 12:40 ` Wolfram Sang [this message]
2026-06-17 13:39 ` Biju Das
2026-06-17 14:19 ` wsa+renesas
2026-06-03 6:57 ` [PATCH v17 09/17] mmc: renesas_sdhi: Add internal_divider hw_info flag for clk rate adjustment Biju
2026-06-03 6:57 ` [PATCH v17 10/17] mmc: renesas_sdhi: Add optional axis/axim reset controls Biju
2026-06-03 7:47 ` Philipp Zabel
2026-06-03 8:02 ` Biju Das
2026-06-03 6:57 ` [PATCH v17 11/17] mmc: renesas_sdhi: Add RZ/G3L SDHI support Biju
2026-06-17 12:51 ` Wolfram Sang
2026-06-03 6:57 ` [PATCH v17 12/17] mmc: renesas_sdhi: Save and restore IOVS across suspend/resume Biju
2026-06-03 6:57 ` [PATCH v17 13/17] mmc: renesas_sdhi: Add RZ/G3L HS400 support Biju
2026-06-03 6:57 ` [PATCH v17 14/17] mmc: renesas_sdhi: Add HS400 enhanced strobe support for RZ/G3L Biju
2026-06-12 12:47 ` Biju Das
2026-06-03 6:57 ` [PATCH v17 15/17] arm64: dts: renesas: r9a08g046: Add SDHI nodes for RZ/G3L SoC and SDHI1 pincontrol on SMARC EVK Biju
2026-06-03 6:57 ` [PATCH v17 16/17] arm64: dts: renesas: rzg3l-smarc-som: Enable SD/eMMC on SDHI0 Biju
2026-06-03 6:57 ` [PATCH v17 17/17] arm64: dts: renesas: rzg3l-smarc-som: Enable SDHI2 Biju
2026-06-03 7:00 ` [PATCH v17 00/17] Add Renesas RZ/G3L SD/eMMC support Biju Das
2026-06-03 7:13 ` Geert Uytterhoeven
2026-06-03 7:20 ` Biju Das
2026-06-03 7:19 ` wsa+renesas
2026-06-03 7:27 ` Biju Das
2026-06-12 13:51 ` Biju Das
2026-06-12 14:56 ` wsa+renesas
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=ajKVxixgTHaavVfi@shikoro \
--to=wsa+renesas@sang-engineering.com \
--cc=biju.das.au@gmail.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=geert+renesas@glider.be \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=ulfh@kernel.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