diff mbox series

[07/13] mmc: renesas-sdhi: Flag non-standard SDnH handling for V3M

Message ID 20230126200607.73185-7-marek.vasut+renesas@mailbox.org
State Accepted
Commit 3c78ce868047bdd3028e5bc741dae13e17ad4a1e
Delegated to: Marek Vasut
Headers show
Series [01/13] mmc: renesas-sdhi: R-Car M3 r1.3 also uses 4 tuning taps | expand

Commit Message

Marek Vasut Jan. 26, 2023, 8:06 p.m. UTC
From: Hai Pham <hai.pham.ud@renesas.com>

V3M handles SDnH differently than other Gen3 SoCs, so let's add a
separate entry for that. This will allow better SDnH handling in the
future.

Based on Linux commit 627151b4966f ("mmc: renesas_sdhi: Flag
non-standard SDnH handling for V3M") by Wolfram Sang

Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
---
 drivers/mmc/renesas-sdhi.c | 6 ++++++
 drivers/mmc/tmio-common.h  | 1 +
 2 files changed, 7 insertions(+)

Comments

Jaehoon Chung Jan. 31, 2023, 11:36 p.m. UTC | #1
On 1/27/23 05:06, Marek Vasut wrote:
> From: Hai Pham <hai.pham.ud@renesas.com>
> 
> V3M handles SDnH differently than other Gen3 SoCs, so let's add a
> separate entry for that. This will allow better SDnH handling in the
> future.
> 
> Based on Linux commit 627151b4966f ("mmc: renesas_sdhi: Flag
> non-standard SDnH handling for V3M") by Wolfram Sang
> 
> Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/renesas-sdhi.c | 6 ++++++
>  drivers/mmc/tmio-common.h  | 1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/mmc/renesas-sdhi.c b/drivers/mmc/renesas-sdhi.c
> index f85ced26ed8..f30d7847bf2 100644
> --- a/drivers/mmc/renesas-sdhi.c
> +++ b/drivers/mmc/renesas-sdhi.c
> @@ -930,6 +930,12 @@ static void renesas_sdhi_filter_caps(struct udevice *dev)
>  		priv->read_poll_flag = TMIO_SD_DMA_INFO1_END_RD;
>  	else
>  		priv->read_poll_flag = TMIO_SD_DMA_INFO1_END_RD2;
> +
> +	/* V3M handles SD0H differently than other Gen3 SoCs */
> +	if (rmobile_get_cpu_type() == RMOBILE_CPU_TYPE_R8A77970)
> +		priv->needs_clkh_fallback = true;
> +	else
> +		priv->needs_clkh_fallback = false;
>  }
>  
>  static int renesas_sdhi_probe(struct udevice *dev)
> diff --git a/drivers/mmc/tmio-common.h b/drivers/mmc/tmio-common.h
> index 59d5a0e22e9..e517ed978bf 100644
> --- a/drivers/mmc/tmio-common.h
> +++ b/drivers/mmc/tmio-common.h
> @@ -151,6 +151,7 @@ struct tmio_sd_priv {
>  	u8				hs400_bad_tap;
>  	const u8			*adjust_hs400_calib_table;
>  	u32			quirks;
> +	bool				needs_clkh_fallback;
>  #endif
>  	ulong (*clk_get_rate)(struct tmio_sd_priv *);
>  };
diff mbox series

Patch

diff --git a/drivers/mmc/renesas-sdhi.c b/drivers/mmc/renesas-sdhi.c
index f85ced26ed8..f30d7847bf2 100644
--- a/drivers/mmc/renesas-sdhi.c
+++ b/drivers/mmc/renesas-sdhi.c
@@ -930,6 +930,12 @@  static void renesas_sdhi_filter_caps(struct udevice *dev)
 		priv->read_poll_flag = TMIO_SD_DMA_INFO1_END_RD;
 	else
 		priv->read_poll_flag = TMIO_SD_DMA_INFO1_END_RD2;
+
+	/* V3M handles SD0H differently than other Gen3 SoCs */
+	if (rmobile_get_cpu_type() == RMOBILE_CPU_TYPE_R8A77970)
+		priv->needs_clkh_fallback = true;
+	else
+		priv->needs_clkh_fallback = false;
 }
 
 static int renesas_sdhi_probe(struct udevice *dev)
diff --git a/drivers/mmc/tmio-common.h b/drivers/mmc/tmio-common.h
index 59d5a0e22e9..e517ed978bf 100644
--- a/drivers/mmc/tmio-common.h
+++ b/drivers/mmc/tmio-common.h
@@ -151,6 +151,7 @@  struct tmio_sd_priv {
 	u8				hs400_bad_tap;
 	const u8			*adjust_hs400_calib_table;
 	u32			quirks;
+	bool				needs_clkh_fallback;
 #endif
 	ulong (*clk_get_rate)(struct tmio_sd_priv *);
 };