mmc: add default_phase

Add default sample clock phase and it can be used when
run mmc_send_tuning.

The function mmc_send_tuning will use default_phase directly
to set the sample clock phase, and this can improve tuning's
efficiency. If use default_phase to run mmc_send_tuning fail,
it will change to tune 0&45...&270 phase.

Change-Id: I747f7820a7d2a67ffb9152794acec31b15e97e2b
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
This commit is contained in:
Jason Zhu 2018-07-25 09:50:11 +08:00 committed by Kever Yang
parent 26dd3474b3
commit 09494d3a1b
2 changed files with 3 additions and 0 deletions

View File

@ -282,6 +282,8 @@ static int rockchip_dwmmc_probe(struct udevice *dev)
dwmci_setup_cfg(&plat->cfg, host, priv->minmax[1], priv->minmax[0]);
if (dev_read_bool(dev, "mmc-hs200-1_8v"))
plat->cfg.host_caps |= MMC_MODE_HS200;
plat->mmc.default_phase =
dev_read_u32_default(dev, "default-sample-phase", 0);
host->mmc = &plat->mmc;
host->mmc->priv = &priv->host;
host->mmc->dev = dev;

View File

@ -566,6 +566,7 @@ struct mmc {
uint write_bl_len;
uint erase_grp_size; /* in 512-byte sectors */
uint hc_wp_grp_size; /* in 512-byte sectors */
int default_phase; /* set the default sample clock phase */
struct sd_ssr ssr; /* SD status register */
struct emmc_esr esr; /* emmc status register */
u64 capacity;