mmc: meson-gx: enable signal re-sampling together with tuning

card detection fails on "BeeLink Mini M8 SII" if enabled too early
mmc1: error -110 whilst initialising MMC card

Fixes: 71645e6572 ("mmc: meson-gx: add signal resampling")
Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
Reviewed-by: Jerome Brunet <jbrunet@baylibre.com>
Tested-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Andreas Fenkart 2019-01-18 14:32:23 +01:00 committed by Ulf Hansson
parent 2bd44dadd5
commit 71e3e00c96
1 changed files with 9 additions and 5 deletions

View File

@ -740,6 +740,11 @@ static int meson_mmc_clk_phase_tuning(struct mmc_host *mmc, u32 opcode,
static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode) static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
{ {
struct meson_host *host = mmc_priv(mmc); struct meson_host *host = mmc_priv(mmc);
int adj = 0;
/* enable signal resampling w/o delay */
adj = ADJUST_ADJ_EN;
writel(adj, host->regs + host->data->adjust);
return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk); return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk);
} }
@ -770,6 +775,9 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
if (!IS_ERR(mmc->supply.vmmc)) if (!IS_ERR(mmc->supply.vmmc))
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd); mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
/* disable signal resampling */
writel(0, host->regs + host->data->adjust);
/* Reset rx phase */ /* Reset rx phase */
clk_set_phase(host->rx_clk, 0); clk_set_phase(host->rx_clk, 0);
@ -1168,7 +1176,7 @@ static int meson_mmc_get_cd(struct mmc_host *mmc)
static void meson_mmc_cfg_init(struct meson_host *host) static void meson_mmc_cfg_init(struct meson_host *host)
{ {
u32 cfg = 0, adj = 0; u32 cfg = 0;
cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK, cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK,
ilog2(SD_EMMC_CFG_RESP_TIMEOUT)); ilog2(SD_EMMC_CFG_RESP_TIMEOUT));
@ -1179,10 +1187,6 @@ static void meson_mmc_cfg_init(struct meson_host *host)
cfg |= CFG_ERR_ABORT; cfg |= CFG_ERR_ABORT;
writel(cfg, host->regs + SD_EMMC_CFG); writel(cfg, host->regs + SD_EMMC_CFG);
/* enable signal resampling w/o delay */
adj = ADJUST_ADJ_EN;
writel(adj, host->regs + host->data->adjust);
} }
static int meson_mmc_card_busy(struct mmc_host *mmc) static int meson_mmc_card_busy(struct mmc_host *mmc)