From 56940caa49520dcc53ff8a26c4b495f434f46f83 Mon Sep 17 00:00:00 2001 From: Zeng Zhaoming Date: Fri, 24 Jun 2011 09:26:28 +0800 Subject: ENGR00139229-4 SDHC: Add SDHC support for i.MX6 Add sdhc support to make it easy mount rootfs from SD card. Merge from imx6_bringup branch. Signed-off-by: Anish Trivedi Signed-off-by: Dong Aisheng Signed-off-by: Richard Zhu Merged-by: Zeng Zhaoming --- drivers/mmc/host/Kconfig | 2 +- drivers/mmc/host/sdhci-esdhc-imx.c | 14 ++++++++++++-- drivers/mmc/host/sdhci-esdhc.h | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'drivers/mmc/host') diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 56dbf3f6ad08..64aac7898334 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -134,7 +134,7 @@ config MMC_SDHCI_CNS3XXX config MMC_SDHCI_ESDHC_IMX bool "SDHCI platform support for the Freescale eSDHC i.MX controller" - depends on MMC_SDHCI_PLTFM && (ARCH_MX25 || ARCH_MX35 || ARCH_MX5) + depends on MMC_SDHCI_PLTFM && (ARCH_MX25 || ARCH_MX35 || ARCH_MX5 || ARCH_MX6) select MMC_SDHCI_IO_ACCESSORS help This selects the Freescale eSDHC controller support on the platform diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index ce56d3ffab77..2204c65b02e1 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -30,6 +30,7 @@ /* VENDOR SPEC register */ #define SDHCI_VENDOR_SPEC 0xC0 #define SDHCI_VENDOR_SPEC_SDIO_QUIRK 0x00000002 +#define SDHCI_MIX_CTRL 0x48 #define ESDHC_FLAG_GPIO_FOR_CD_WP (1 << 0) /* @@ -142,8 +143,17 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) if ((host->cmd->opcode == MMC_STOP_TRANSMISSION) && (imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT)) val |= SDHCI_CMD_ABORTCMD; - writel(val << 16 | imx_data->scratchpad, - host->ioaddr + SDHCI_TRANSFER_MODE); + + writel(0x08800880, host->ioaddr + SDHCI_CAPABILITIES_1); + if (cpu_is_mx6q()) { + writel(imx_data->scratchpad, + host->ioaddr + SDHCI_MIX_CTRL); + writel(val << 16, + host->ioaddr + SDHCI_TRANSFER_MODE); + } else { + writel(val << 16 | imx_data->scratchpad, + host->ioaddr + SDHCI_TRANSFER_MODE); + } return; case SDHCI_BLOCK_SIZE: val &= ~SDHCI_MAKE_BLKSZ(0x7, 0); diff --git a/drivers/mmc/host/sdhci-esdhc.h b/drivers/mmc/host/sdhci-esdhc.h index c3b08f111942..02ff6da7ccab 100644 --- a/drivers/mmc/host/sdhci-esdhc.h +++ b/drivers/mmc/host/sdhci-esdhc.h @@ -1,7 +1,7 @@ /* * Freescale eSDHC controller driver generics for OF and pltfm. * - * Copyright (c) 2007 Freescale Semiconductor, Inc. + * Copyright (C) 2007, 2011 Freescale Semiconductor, Inc. * Copyright (c) 2009 MontaVista Software, Inc. * Copyright (c) 2010 Pengutronix e.K. * Author: Wolfram Sang -- cgit v1.2.3