From 8ec6a04b6bf641f13402506c0f1b1d9dda699b51 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Wed, 13 Jun 2018 08:02:55 +0200 Subject: mmc: tmio: Switch to clock framework Switch the driver to using clk_get_rate()/clk_set_rate() instead of caching the mclk frequency in it's private data. This is required on the SDHI variant of the controller, where the upstream mclk need to be adjusted when using UHS modes. Platforms which do not support clock framework or do not support it in eg. SPL default to 100 MHz clock. Signed-off-by: Marek Vasut Cc: Masahiro Yamada --- V2: - Fix build on certain platforms using SPL without clock framework V3: - Turn clk_get_rate into a callback and fill it as needed on both renesas and socionext platforms --- drivers/mmc/tmio-common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/mmc/tmio-common.h') diff --git a/drivers/mmc/tmio-common.h b/drivers/mmc/tmio-common.h index 792b1ba5ae..6591c61c3c 100644 --- a/drivers/mmc/tmio-common.h +++ b/drivers/mmc/tmio-common.h @@ -117,7 +117,6 @@ struct tmio_sd_plat { struct tmio_sd_priv { void __iomem *regbase; - unsigned long mclk; unsigned int version; u32 caps; #define TMIO_SD_CAP_NONREMOVABLE BIT(0) /* Nonremovable e.g. eMMC */ @@ -133,6 +132,10 @@ struct tmio_sd_priv { #ifdef CONFIG_DM_REGULATOR struct udevice *vqmmc_dev; #endif +#if CONFIG_IS_ENABLED(CLK) + struct clk clk; +#endif + ulong (*clk_get_rate)(struct tmio_sd_priv *); }; int tmio_sd_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, -- cgit From 95ead3d98de4e2ccdd5b36efb9ca3d2a97835d7e Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Wed, 13 Jun 2018 08:02:55 +0200 Subject: mmc: tmio: sdhi: Move tap_pos to private data Move the tap_pos variable, which is the HS200/HS400/SDR104 calibration offset, into private data, so it can be passed around. This is done in preparation for the HS400 mode, which needs to adjust this value. Signed-off-by: Marek Vasut Cc: Masahiro Yamada --- drivers/mmc/tmio-common.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/mmc/tmio-common.h') diff --git a/drivers/mmc/tmio-common.h b/drivers/mmc/tmio-common.h index 6591c61c3c..9a427b5311 100644 --- a/drivers/mmc/tmio-common.h +++ b/drivers/mmc/tmio-common.h @@ -134,6 +134,9 @@ struct tmio_sd_priv { #endif #if CONFIG_IS_ENABLED(CLK) struct clk clk; +#endif +#if CONFIG_IS_ENABLED(RENESAS_SDHI) + u8 tap_set; #endif ulong (*clk_get_rate)(struct tmio_sd_priv *); }; -- cgit From 50aa1d99ed2e656a4d0366452908aa9d8783d102 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Wed, 13 Jun 2018 08:02:55 +0200 Subject: mmc: tmio: sdhi: Add HS400 support Add support for the HS400 mode to SDHI driver. This uses the up-tune mechanism from already supported HS200 tuning. Signed-off-by: Marek Vasut Cc: Masahiro Yamada --- drivers/mmc/tmio-common.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/mmc/tmio-common.h') diff --git a/drivers/mmc/tmio-common.h b/drivers/mmc/tmio-common.h index 9a427b5311..192026ce3e 100644 --- a/drivers/mmc/tmio-common.h +++ b/drivers/mmc/tmio-common.h @@ -137,6 +137,7 @@ struct tmio_sd_priv { #endif #if CONFIG_IS_ENABLED(RENESAS_SDHI) u8 tap_set; + u8 nrtaps; #endif ulong (*clk_get_rate)(struct tmio_sd_priv *); }; -- cgit