[U-Boot] [PATCH 9/9] mx23: Use PIO mode support for MMC

Otavio Salvador otavio at ossystems.com.br
Tue Jan 22 02:47:29 CET 2013


Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
---
 drivers/mmc/mxsmmc.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
index 0a3f0c4..628d609 100644
--- a/drivers/mmc/mxsmmc.c
+++ b/drivers/mmc/mxsmmc.c
@@ -50,6 +50,7 @@ struct mxsmmc_priv {
 	uint32_t		buswidth;
 	int			(*mmc_is_wp)(int);
 	struct mxs_dma_desc	*desc;
+	int force_pio;
 };
 
 #define	MXSMMC_MAX_TIMEOUT	10000
@@ -184,7 +185,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 	if (cmd->resp_type & MMC_RSP_136)	/* It's a 136 bits response */
 		ctrl0 |= SSP_CTRL0_LONG_RESP;
 
-	if (data && (data->blocksize * data->blocks < MXSMMC_SMALL_TRANSFER))
+	if (priv->force_pio || (data && (data->blocksize * data->blocks < MXSMMC_SMALL_TRANSFER)))
 		writel(SSP_CTRL1_DMA_ENABLE, &ssp_regs->hw_ssp_ctrl1_clr);
 	else
 		writel(SSP_CTRL1_DMA_ENABLE, &ssp_regs->hw_ssp_ctrl1_set);
@@ -287,7 +288,7 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
 	if (!data)
 		return 0;
 
-	if (data->blocksize * data->blocks < MXSMMC_SMALL_TRANSFER) {
+	if (priv->force_pio || (data->blocksize * data->blocks < MXSMMC_SMALL_TRANSFER)) {
 		ret = mxsmmc_send_cmd_pio(priv, data);
 		if (ret) {
 			printf("MMC%d: Data timeout with command %d "
@@ -385,9 +386,11 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int))
 #if defined(CONFIG_MX23)
 	const unsigned int mxsmmc_max_id = 2;
 	const unsigned int mxsmmc_clk_id = 0;
+	const unsigned int mxsmmc_force_pio = 1;
 #elif defined(CONFIG_MX28)
 	const unsigned int mxsmmc_max_id = 4;
 	const unsigned int mxsmmc_clk_id = id;
+	const unsigned int mxsmmc_force_pio = 0;
 #endif
 
 	if (id >= mxsmmc_max_id)
@@ -417,6 +420,7 @@ int mxsmmc_initialize(bd_t *bis, int id, int (*wp)(int))
 	priv->mmc_is_wp = wp;
 	priv->id = id;
 	priv->regs = mxs_ssp_regs_by_bus(id);
+	priv->force_pio = mxsmmc_force_pio;
 
 	sprintf(mmc->name, "MXS MMC");
 	mmc->send_cmd = mxsmmc_send_cmd;
-- 
1.8.1



More information about the U-Boot mailing list