mmc: renesas-sdhi: Flag non-standard SDnH handling for V3M
authorHai Pham <hai.pham.ud@renesas.com>
Thu, 26 Jan 2023 20:06:01 +0000 (21:06 +0100)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Thu, 2 Feb 2023 00:49:20 +0000 (01:49 +0100)
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>
drivers/mmc/renesas-sdhi.c
drivers/mmc/tmio-common.h

index f85ced2..f30d784 100644 (file)
@@ -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)
index 59d5a0e..e517ed9 100644 (file)
@@ -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 *);
 };