ARM: MMCI: support 8bit mode on the ST Micro version
PATCH 1/1 ARM: MMCI: support 8bit mode on the ST Micro version
This adds support for an 8bit wide bus to the card (data lines MCIDAT0 through 7 exist) on the ST Micro version and alters the U300 platform to support this.
----
This thing comes in on top of the DMA and all, no hurries to get this in really so it's pending conclusion of the DMA debate and will be rewritten if need be.
--- arch/arm/mach-u300/mmc.c | 2 +- drivers/mmc/host/mmci.c | 10 +++++++++- drivers/mmc/host/mmci.h | 4 +++- 3 files changed, 13 insertions(+), 3 deletions(-)
arch/arm/mach-u300/mmc.c +1 -1
@@ -109,7 +109,7 @@ int __devinit mmc_init(struct amba_device *adev) mmci_card->mmc0_plat_data.gpio_wp =-1 ; mmci_card->mmc0_plat_data.gpio_cd =-1 ; mmci_card->mmc0_plat_data.capabilities =MMC_CAP_MMC_HIGHSPEED | -MMC_CAP_SD_HIGHSPEED |MMC_CAP_4_BIT_DATA ; +MMC_CAP_SD_HIGHSPEED |MMC_CAP_4_BIT_DATA |MMC_CAP_8_BIT_DATA ;#ifdef CONFIG_DMA_ENGINE mmci_card->mmc0_plat_data.dma_filter = coh901318_filter_id; mmci_card->mmc0_plat_data.dma_rx_param =
drivers/mmc/host/mmci.c +9 -1
@@ -65,7 +65,15 @@ static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired) }if (host->mmc->ios.bus_width ==MMC_BUS_WIDTH_4 ) - clk |=MCI_WIDE_BUS ; + clk |=MCI_4BIT_BUS ; + +if (host->mmc->ios.bus_width ==MMC_BUS_WIDTH_8 ) { +if (host->hw_designer ==AMBA_VENDOR_ST ) + clk |=MCI_8BIT_BUS ; +else +dev_err (mmc_dev (host->mmc), +"8bit bus mode requested but not available\n" ); + }writel (clk, host->base +MMCICLOCK ); }
drivers/mmc/host/mmci.h +3 -1
@@ -25,7 +25,9 @@#define MCI_CLK_ENABLE (1 << 8)#define MCI_CLK_PWRSAVE (1 << 9)#define MCI_CLK_BYPASS (1 << 10) -#define MCI_WIDE_BUS (1 << 11) +#define MCI_4BIT_BUS (1 << 11) +/* The ST Micro version has an 8bit mode as well */ +#define MCI_8BIT_BUS (1 << 12)/* HW flow control on the ST Micro version */ #define MCI_FCEN (1 << 13)
Signature · 1 line
1.6.3.3
PATCH 1/1 ARM: MMCI: support 8bit mode on the ST Micro version
drivers/mmc/host/mmci.c static void mmci_set_clkreg(struct mmci_host *host, unsigned int desired) · line 76
Quoted 7 lines · Linus Walleij
drivers/mmc/host/mmci.c +7
-0+if (host->mmc->ios.bus_width ==MMC_BUS_WIDTH_8 ) { +if (host->hw_designer ==AMBA_VENDOR_ST ) + clk |=MCI_8BIT_BUS ; +else +dev_err (mmc_dev (host->mmc), +"8bit bus mode requested but not available\n" ); + }
Hmm. I don't think this is necessary - just arrange for the 8-bit capability flag to be cleared for non-ST devices.
It might be a good idea to call this register bit 'MCI_ST_8BIT_BUS' so that people don't mistake it as something present on all implementations.