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

Stephen Warren swarren at wwwdotorg.org
Thu May 29 18:25:17 CEST 2014


On 05/28/2014 04:15 PM, 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.

This feels wrong; why wouldn't mmc_get_dev() return a block_dev_desc_t
containing block_read/block_write functions that do the HW partition
switching. That way, this is all completely hidden, and all client code
only knows about block devices, rather than having to know about
MMC-specific mmc_block_read/write/erase_hwpart() functions.


More information about the U-Boot mailing list