[U-Boot] [PATCH] mmc: seperate block number into small parts for multi-write cmd

Lei Wen adrian.wenl at gmail.com
Mon Sep 6 12:48:46 CEST 2010


On Mon, Sep 6, 2010 at 6:16 PM, Reinhard Meyer <u-boot at emk-elektronik.de> wrote:
> Lei Wen schrieb:
>> On Mon, Sep 6, 2010 at 5:23 PM, Reinhard Meyer <u-boot at emk-elektronik.de> wrote:
>>> Dear Lei Wen,
>>>> As mmc host limitation, the max number of block in one go
>
> You already write it's a HOST limitation.
>
>>>> should be limited to 65535, and the max buffer size should
>>>> not excceed 512k bytes.
>
> Which would limit the #blocks to 1024 (assuming a 512 byte blocks)
>
>>> Where does this limitation supposedly come from?
>>
>> This limitation comes from the SD/MMC sepc. You could find one and
>> check the 0x6 offset register(BLOCK COUNT REGISTER).
>
> This might refer to certain HOST controllers, but not to Cards!

You are right, this comes from HOST, not card. But since the host spec
define so, then is there any host don't follow the sepc? ...

>
>> You could get that register is only 16bit width and only cound contain
>> the 65535 block.
>>
>> This register is only validate for multi-operation, like multi-read or
>> multi-write command.
>
> Hmm, CMD25 states: "Continuously writes blocks of data until a
> STOP_TRANSMISSION follows."
>
> So the Card itself does not limit the number of blocks written in one go.
>
> I do not mind the transfer to be split into chunks if required by some hosts,
> but the "number of blocks in a go" should be configurable.
>
> And you still do not explain why the buffer size shall be limited to 512KB?

The 512 KB comes from the SDMA boundary, and this value is also adopt by Linux.
You could refer to drivers/mmc/host/sdhci.c in Linux code.

This way makes UBOOT don't need to check the boundary interrupt and
make the process more smooth.

>
> Best Regards,
> Reinhard
>
>
Best regards,
Lei


More information about the U-Boot mailing list