From: xiaoyao Date: Tue, 10 Nov 2015 02:55:33 +0000 (+0800) Subject: mmc: rk_sdmmc: support RK3228 chip X-Git-Tag: firefly_0821_release~3630 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a3b0c6b8e2f99a026af8d93d8b8dd815275596b0;p=firefly-linux-kernel-4.4.55.git mmc: rk_sdmmc: support RK3228 chip Add a variable to distinguish between types of chips, eg: DW_MCI_TYPE_RK3228. The purpose is to add a unique code in the future. Change-Id: I6608ae7af0579343cabe92deddefe73b8e5d2194 Signed-off-by: xiaoyao --- diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c index dff11ff8d8e6..7efd7b15e3ad 100644 --- a/drivers/mmc/host/dw_mmc-rockchip.c +++ b/drivers/mmc/host/dw_mmc-rockchip.c @@ -62,6 +62,10 @@ static struct dw_mci_rockchip_compatible { .compatible = "rockchip,rk3368-sdmmc", .ctrl_type = DW_MCI_TYPE_RK3368, }, + { + .compatible = "rockchip,rk3228-sdmmc", + .ctrl_type = DW_MCI_TYPE_RK3228, + }, }; #define syscon_find(np, property) \ @@ -111,7 +115,8 @@ static int dw_mci_rockchip_setup_clock(struct dw_mci *host) if ((priv->ctrl_type == DW_MCI_TYPE_RK3288) || (priv->ctrl_type == DW_MCI_TYPE_RK3036) || (priv->ctrl_type == DW_MCI_TYPE_RK312X) || - (priv->ctrl_type == DW_MCI_TYPE_RK3368)) + (priv->ctrl_type == DW_MCI_TYPE_RK3368) || + (priv->ctrl_type == DW_MCI_TYPE_RK3228)) host->bus_hz /= (priv->ciu_div + 1); return 0; diff --git a/drivers/mmc/host/rk_sdmmc.c b/drivers/mmc/host/rk_sdmmc.c index 352a7846eb85..1d0a2737331e 100755 --- a/drivers/mmc/host/rk_sdmmc.c +++ b/drivers/mmc/host/rk_sdmmc.c @@ -3566,6 +3566,8 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) regmap_write(host->grf, 0x43c, (1<<13)<<16 | (0 << 13)); } else if (cpu_is_rk3288()) { grf_writel(((1 << 12) << 16) | (0 << 12), RK3288_GRF_SOC_CON0); + } else if (host->cid == DW_MCI_TYPE_RK3228) { + grf_writel(((1 << 8) << 16) | (0 << 8), RK3228_GRF_SOC_CON6); } /* We assume only low-level chip use gpio_cd */ diff --git a/drivers/mmc/host/rk_sdmmc.h b/drivers/mmc/host/rk_sdmmc.h index f1ddc3cdad73..cad989246002 100755 --- a/drivers/mmc/host/rk_sdmmc.h +++ b/drivers/mmc/host/rk_sdmmc.h @@ -381,6 +381,7 @@ DW_MCI_TYPE_RK3288, DW_MCI_TYPE_RK3036, DW_MCI_TYPE_RK312X, DW_MCI_TYPE_RK3368, +DW_MCI_TYPE_RK3228, }; #endif /* _DW_MMC_H_ */