Hello.
Sudhakar Rajashekhara wrote:
Adds support for MMC/SD on TI's DA830 architecture.
On TI's DA830, the DMATRIG bit should be set for CPU transfers.
Could you call them PIO transfers for clarity?
If MMC is being used for both CPU and EDMA based transfers, then
it is likely that, an extra MMC EVENT is latched in the EDMA Event
register even when just the CPU and MMC are in play. To properly
switch from CPU to EDMA, clear any extra/unexpected event latched
in the Event register, by doing a write to the corresponding bits
in the ECR register.
Tested on DM644x EVM.
Signed-off-by: Sudhakar Rajashekhara <[email protected]>
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c
b/arch/arm/mach-davinci/board-dm355-evm.c
index e104650..c2cf531 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -215,6 +215,7 @@ static struct davinci_mmc_config dm355evm_mmc_config = {
.wires = 4,
.max_freq = 50000000,
.caps = MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED,
+ .version = MMC_CTLR_VERSION_1,
Could've been omitted as MMC_CTLR_VERSION_1 == 0.
diff --git a/arch/arm/mach-davinci/include/mach/mmc.h
b/arch/arm/mach-davinci/include/mach/mmc.h
index aad20a5..5426fac 100644
--- a/arch/arm/mach-davinci/include/mach/mmc.h
+++ b/arch/arm/mach-davinci/include/mach/mmc.h
@@ -19,7 +19,15 @@ struct davinci_mmc_config {
/* any additional host capabilities: OR'd in to mmc->f_caps */
u32 caps;
+
+ /* Version of the MMC/SD controller */
+ u8 version;
};
void davinci_setup_mmc(int module, struct davinci_mmc_config *config);
+enum {
+ MMC_CTLR_VERSION_1, /* DM644x and DM355 */
+ MMC_CTLR_VERSION_2, /* DA830 */
+};
+
#endif
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 49c1004..f943be2 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -195,6 +195,9 @@ struct mmc_davinci_host {
/* For PIO we walk scatterlists one segment at a time. */
unsigned int sg_len;
int sg_idx;
+
+ /* Version of the MMC/SD controller */
+ u8 version;
};
@@ -317,6 +320,10 @@ static void mmc_davinci_start_command(struct mmc_davinci_host *host,
if (host->do_dma)
cmd_reg |= MMCCMD_DMATRIG;
+ if ((host->version == MMC_CTLR_VERSION_2) && (host->data != NULL) &&
+ (host->data_dir == DAVINCI_MMC_DATADIR_READ))
Unneeded parens around == and !=.
@@ -1114,6 +1127,9 @@ static int __init davinci_mmcsd_probe(struct
platform_device *pdev)
if (!pdata || pdata->wires == 4 || pdata->wires == 0)
mmc->caps |= MMC_CAP_4_BIT_DATA;
+ if (pdata->version)
Unneeded check...
+ host->version = pdata->version;
+
WBR, Sergei
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source