Hi Jerry,

On Fri, Jan 06 2012, r66...@freescale.com wrote:
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 2db0d5c..d5a2259 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -832,14 +832,29 @@ static void sdhci_prepare_data(struct sdhci_host *host, 
> struct mmc_command *cmd)
>        * is ADMA.
>        */
>       if (host->version >= SDHCI_SPEC_200) {
> -             ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
> -             ctrl &= ~SDHCI_CTRL_DMA_MASK;
> -             if ((host->flags & SDHCI_REQ_USE_DMA) &&
> -                     (host->flags & SDHCI_USE_ADMA))
> -                     ctrl |= SDHCI_CTRL_ADMA32;
> -             else
> -                     ctrl |= SDHCI_CTRL_SDMA;
> -             sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
> +             if (host->quirks2 & SDHCI_QUIRK2_QORIQ_PROCTL_WEIRD) {
> +#define ESDHCI_PROCTL_DMAS_MASK              0x00000300
> +#define ESDHCI_PROCTL_ADMA32         0x00000200
> +#define ESDHCI_PROCTL_SDMA           0x00000000
> +                     u32 ctrl;
> +                     ctrl = sdhci_readl(host, SDHCI_HOST_CONTROL);
> +                     ctrl &= ~ESDHCI_PROCTL_DMAS_MASK;
> +                     if ((host->flags & SDHCI_REQ_USE_DMA) &&
> +                             (host->flags & SDHCI_USE_ADMA))
> +                             ctrl |= ESDHCI_PROCTL_ADMA32;
> +                     else
> +                             ctrl |= ESDHCI_PROCTL_SDMA;
> +                     sdhci_writel(host, ctrl, SDHCI_HOST_CONTROL);
> +             } else {
> +                     ctrl = sdhci_readb(host, SDHCI_HOST_CONTROL);
> +                     ctrl &= ~SDHCI_CTRL_DMA_MASK;
> +                     if ((host->flags & SDHCI_REQ_USE_DMA) &&
> +                             (host->flags & SDHCI_USE_ADMA))
> +                             ctrl |= SDHCI_CTRL_ADMA32;
> +                     else
> +                             ctrl |= SDHCI_CTRL_SDMA;
> +                     sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
> +             }

drivers/mmc/host/sdhci.c must know nothing about ESDHC registers.
It's a generic driver.  We can add hooks so that your own driver
can run code in the right place instead.

Thanks,

- Chris.
-- 
Chris Ball   <c...@laptop.org>   <http://printf.net/>
One Laptop Per Child
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to