[U-Boot] [PATCH] mmc: add wrappers for MMC block_{read, write, erase}

Stephen Warren swarren at wwwdotorg.org
Mon Jun 2 18:30:34 CEST 2014


On 06/02/2014 12:42 AM, Pantelis Antoniou wrote:
> Hi Steve,
> 
> I wanted the discussion to settle a bit before I reply to this series.
> On May 29, 2014, at 1:15 AM, Steve Rae wrote:
> 
>> Each wrapper function:
>> - switches to the specified physical partition, then
>> - performs the original function, and then
>> - switches back to the original physical partition
>> where the physical partition (aka HW partition) is
>>  0=User, 1=Boot1, 2=Boot2, etc.
>>
>> Signed-off-by: Steve Rae <srae at broadcom.com>
>> ---
> 
> [snip]
> 
>> /**
>>  * Start device initialization and return immediately; it does not block on
>>  * polling OCR (operation condition register) status.  Then you should call
>> -- 
>> 1.8.5
>>
> 
> The thing IMO should be modeled in the same way that block devices work in
> Linux.
> 
> TBH I'm not very fond of the way block devices/partitions and the block_ops
> are intermixed in block_dev_t. This part of code could use some refactoring
> to make it operate more like a regular linux block device (with each partition
> being it's own block device), but I don't know if we have enough votes to change
> it ATM.

Refactoring that would make sense to me. That way, any client code could
just pass the user's command-line (or whatever) parameters to some
lookup function, which could return something that accesses whatever the
user wants, without the code that accesses the data caring whether it's
a complete block device, a complete HW partition, or a SW partition
within one of those. Of course, I guess that's already the case, it's
just that the information is split across block_dev_desc_t and
disk_partition_t, when it doesn't really need to be.


More information about the U-Boot mailing list