Skip to content

Commit

Permalink
mmc: meson-gx: enable signal re-sampling together with tuning
Browse files Browse the repository at this point in the history
card detection fails on "BeeLink Mini M8 SII" if enabled too early
mmc1: error -110 whilst initialising MMC card

Fixes: 71645e6 ("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>
  • Loading branch information
Andreas Fenkart authored and Ulf Hansson committed Jan 22, 2019
1 parent 2bd44da commit 71e3e00
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions drivers/mmc/host/meson-gx-mmc.c
Original file line number Diff line number Diff line change
@@ -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)
{
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);
}
@@ -770,6 +775,9 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
if (!IS_ERR(mmc->supply.vmmc))
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);

/* disable signal resampling */
writel(0, host->regs + host->data->adjust);

/* Reset rx phase */
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)
{
u32 cfg = 0, adj = 0;
u32 cfg = 0;

cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK,
ilog2(SD_EMMC_CFG_RESP_TIMEOUT));
@@ -1179,10 +1187,6 @@ static void meson_mmc_cfg_init(struct meson_host *host)
cfg |= CFG_ERR_ABORT;

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)

0 comments on commit 71e3e00

Please sign in to comment.