[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3a364a72-1052-b0c8-35f5-2987c2c2784c@kapsi.fi>
Date: Wed, 25 Jul 2018 10:11:34 +0300
From: Mikko Perttunen <cyndis@...si.fi>
To: Aapo Vienamo <avienamo@...dia.com>,
Ulf Hansson <ulf.hansson@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Mikko Perttunen <mperttunen@...dia.com>
Cc: linux-mmc@...r.kernel.org, devicetree@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 03/10] mmc: tegra: Power on the calibration pad
Reviewed-by: Mikko Perttunen <mperttunen@...dia.com>
On 24.07.2018 17:34, Aapo Vienamo wrote:
> Automatic pad drive strength calibration is performed on a separate pad
> identical to the ones used for driving the actual bus. Power on the
> calibration pad during the calibration procedure and power it off
> afterwards to save power.
>
> Signed-off-by: Aapo Vienamo <avienamo@...dia.com>
> ---
> drivers/mmc/host/sdhci-tegra.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
> index 6008e2f..61067b7 100644
> --- a/drivers/mmc/host/sdhci-tegra.c
> +++ b/drivers/mmc/host/sdhci-tegra.c
> @@ -209,11 +209,30 @@ static void tegra_sdhci_reset(struct sdhci_host *host, u8 mask)
> tegra_host->ddr_signaling = false;
> }
>
> +static void tegra_sdhci_configure_cal_pad(struct sdhci_host *host, bool enable)
> +{
> + u32 reg;
> +
> + /*
> + * Enable or disable the additional I/O pad used by the drive strength
> + * calibration process.
> + */
> + reg = sdhci_readl(host, SDHCI_TEGRA_SDMEM_COMP_PADCTRL);
> + if (enable)
> + reg |= SDHCI_TEGRA_PAD_E_INPUT_OR_E_PWRD;
> + else
> + reg &= ~SDHCI_TEGRA_PAD_E_INPUT_OR_E_PWRD;
> + sdhci_writel(host, reg, SDHCI_TEGRA_SDMEM_COMP_PADCTRL);
> + udelay(1);
> +}
> +
> static void tegra_sdhci_pad_autocalib(struct sdhci_host *host)
> {
> unsigned timeout = 10;
> u32 reg;
>
> + tegra_sdhci_configure_cal_pad(host, true);
> +
> reg = sdhci_readl(host, SDHCI_TEGRA_AUTO_CAL_CONFIG);
> reg |= SDHCI_AUTO_CAL_ENABLE | SDHCI_AUTO_CAL_START;
> sdhci_writel(host, reg, SDHCI_TEGRA_AUTO_CAL_CONFIG);
> @@ -227,6 +246,8 @@ static void tegra_sdhci_pad_autocalib(struct sdhci_host *host)
> timeout--;
> } while (timeout);
>
> + tegra_sdhci_configure_cal_pad(host, false);
> +
> if (timeout == 0)
> dev_err(mmc_dev(host->mmc), "Pad autocal timed out\n");
> }
>
Powered by blists - more mailing lists