[U-Boot] [PATCH 2/9] mx23: Use XFER_COUNT field in HW_SSP_CTRL0 register in MMC PIO mode

Marek Vasut
2013-01-22T01:45:44Z

Dear Otavio Salvador,

> From: Marek Vasut <marex@denx.de>
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> drivers/mmc/mxsmmc.c | 24 +++++++++++++++++++++---
> 1 file changed, 21 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
> index 0c4cd54..4b178be 100644
> --- a/drivers/mmc/mxsmmc.c
> +++ b/drivers/mmc/mxsmmc.c
> @@ -211,14 +211,32 @@ mxsmmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd,
> struct mmc_data *data) }
>
> ctrl0 |= SSP_CTRL0_DATA_XFER;
> +
> + reg = data->blocksize * data->blocks;
> +#if defined(CONFIG_MX23)
> + if (reg & ~SSP_CTRL0_XFER_COUNT_MASK) {
> + printf("MMC%d: Transfer too large (%i bytes)!\n",
> + mmc->block_dev.dev, reg);
> + return -EINVAL;
> + }
> +
> + ctrl0 |= reg & SSP_CTRL0_XFER_COUNT_MASK;
> +
> + reg = readl(&ssp_regs->hw_ssp_cmd0);
> + reg &= ~0xfff00;
> + reg |= (data->blocks - 1) << 8;
> + reg |= (ffs(data->blocksize) - 1) << 16;

This is using some random hard-coded offsets, I told you numerous times I will
NAK this.

Sorry.

Best regards,
Marek Vasut