mmc: sh_mmcif: Add support rmobile
authorNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Wed, 3 Dec 2014 08:57:48 +0000 (17:57 +0900)
committerNobuhiro Iwamatsu <iwamatsu@nigauri.org>
Fri, 5 Dec 2014 02:16:22 +0000 (11:16 +0900)
Renesas R-Mobile/R-Car ARM SoC of MMC has the same IP that are supported by
sh_mmcif. This adds support R-Mobile/R-Car ARM SoC with the setting of the
clock support.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
drivers/mmc/sh_mmcif.c
drivers/mmc/sh_mmcif.h

index 3a2022c81393885c8eac195a26ee8fed84449950..76ba93b81d4f42e4307aaeca3213e956eef58462 100644 (file)
@@ -596,7 +596,7 @@ int mmcif_mmc_init(void)
        host->clk = CONFIG_SH_MMCIF_CLK;
 
        sh_mmcif_cfg.f_min = MMC_CLK_DIV_MIN(host->clk);
-       sh_mmcif_cfg.f_max = MMC_CLK_DIV_MAX;
+       sh_mmcif_cfg.f_max = MMC_CLK_DIV_MAX(host->clk);
 
        mmc = mmc_create(&sh_mmcif_cfg, host);
        if (mmc == NULL) {
index 70034e2576d9ddc54f815e17d905c69b571edd3d..4b6752f7f98a581dd56cfdda46a74c97eee25642 100644 (file)
@@ -199,8 +199,13 @@ struct sh_mmcif_regs {
 #define SOFT_RST_OFF           (0 << 31)
 
 #define CLKDEV_EMMC_DATA       52000000        /* 52MHz */
+#ifdef CONFIG_RMOBILE
+#define MMC_CLK_DIV_MIN(clk)   (clk / (1 << 9))
+#define MMC_CLK_DIV_MAX(clk)   (clk / (1 << 1))
+#else
 #define MMC_CLK_DIV_MIN(clk)   (clk / (1 << 8))
-#define MMC_CLK_DIV_MAX                CLKDEV_EMMC_DATA
+#define MMC_CLK_DIV_MAX(clk)   CLKDEV_EMMC_DATA
+#endif
 
 #define MMC_BUS_WIDTH_1                0
 #define MMC_BUS_WIDTH_4                2