diff options
author | Tom Rini <trini@konsulko.com> | 2017-01-12 21:20:51 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-01-12 21:20:51 -0500 |
commit | 70c1e0474a9df2c4493b4e2330cc41d3132b4e90 (patch) | |
tree | 094753a072930130a4588d32d560af1d3feebf05 /drivers/mmc | |
parent | c2538421b28424b9705865e838c5fba19c9dc651 (diff) | |
parent | 35a05761a1aebc857e73bec7d9e72a7f84cd96ba (diff) | |
download | u-boot-imx-70c1e0474a9df2c4493b4e2330cc41d3132b4e90.zip u-boot-imx-70c1e0474a9df2c4493b4e2330cc41d3132b4e90.tar.gz u-boot-imx-70c1e0474a9df2c4493b4e2330cc41d3132b4e90.tar.bz2 |
Merge git://git.denx.de/u-boot-rockchip
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/rockchip_sdhci.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/mmc/rockchip_sdhci.c b/drivers/mmc/rockchip_sdhci.c index c56e1a3..e33e35e 100644 --- a/drivers/mmc/rockchip_sdhci.c +++ b/drivers/mmc/rockchip_sdhci.c @@ -12,7 +12,9 @@ #include <libfdt.h> #include <malloc.h> #include <sdhci.h> +#include <clk.h> +DECLARE_GLOBAL_DATA_PTR; /* 400KHz is max freq for card ID etc. Use that as min */ #define EMMC_MIN_FREQ 400000 @@ -32,11 +34,24 @@ static int arasan_sdhci_probe(struct udevice *dev) struct rockchip_sdhc_plat *plat = dev_get_platdata(dev); struct rockchip_sdhc *prv = dev_get_priv(dev); struct sdhci_host *host = &prv->host; - int ret; + int max_frequency, ret; + struct clk clk; + + + max_frequency = fdtdec_get_int(gd->fdt_blob, dev->of_offset, + "max-frequency", 0); + ret = clk_get_by_index(dev, 0, &clk); + if (!ret) { + ret = clk_set_rate(&clk, max_frequency); + if (IS_ERR_VALUE(ret)) + printf("%s clk set rate fail!\n", __func__); + } else { + printf("%s fail to get clk\n", __func__); + } host->quirks = SDHCI_QUIRK_WAIT_SEND_CMD; - ret = sdhci_setup_cfg(&plat->cfg, host, CONFIG_ROCKCHIP_SDHCI_MAX_FREQ, + ret = sdhci_setup_cfg(&plat->cfg, host, max_frequency, EMMC_MIN_FREQ); host->mmc = &plat->mmc; |