[U-Boot] MMC and buffer alignment question

Eric Nelson
2014-03-19T14:22:03Z

Hi Markus,

On 03/19/2014 07:16 AM, Markus Niebel wrote:
> Hello Pantelis,
>
> short question to the usage of the mmc command (and also the mmc
> driver API): is it intended that mmc read / write may fail when the
> supplied address in RAM is not aligned?
>

If not intended, it is known.

> ARMV7 will give output like this:
>
> U-Boot > mmc read 12000002 44 44
>
Why would you want to do this?

> MMC read: dev # 0, block # 68, count 68 ... INFO: 24994 of 25000 loops left to DAT0 timeout
> ERROR: v7_dcache_inval_range - start address is not aligned - 0x12000002
> ERROR: v7_dcache_inval_range - stop address is not aligned - 0x12008802
> 68 blocks read: OK
>
> On my platform (i.MX6 / Cortex A9) the alignment needed is 32 Byte.
>
> Special commands inside the mmc drivers and in env_mmc implement the
> alignment magic. Shouldn't the mmc do the magic (and if neccesarry
> provide help using temp buffers if needed) so that all users outside can
> read / write without caring for special cases?
>

Is there a use case here? There are plenty of memory addresses that
won't work with commands like "mmc read".

Is it worth **any** code to try and catch them?

Please advise,

Eric