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

Otavio Salvador otavio at ossystems.com.br
Tue Jan 22 02:53:32 CET 2013


On Mon, Jan 21, 2013 at 11:45 PM, Marek Vasut <marex at denx.de> wrote:
> Dear Otavio Salvador,
>
>> From: Marek Vasut <marex at denx.de>
>>
>> Signed-off-by: Marek Vasut <marex at denx.de>
>> Signed-off-by: Otavio Salvador <otavio at 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.

It is your patch ;-) So ...

--
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br


More information about the U-Boot mailing list