summaryrefslogtreecommitdiff
path: root/drivers/block/blk-uclass.c
Commit message (Collapse)AuthorAgeLines
* dm: blk: Add functions to select a hardware partitionSimon Glass2016-05-17-0/+29
| | | | | | | | The block device uclass does not currently support selecting a particular hardware partition but this is needed for MMC. Add it so that the blk API can support MMC properly. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: blk: Free the block device name when unboundSimon Glass2016-05-17-2/+10
| | | | | | | Mark the device name as allocated so that it will be freed correctly when the device is unbound. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: blk: Fix allocation of block-device numberingSimon Glass2016-05-17-9/+9
| | | | | | | Due to code ordering the block devices are not numbered sequentially. Fix this. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: blk: Add a easier way to create a named block deviceSimon Glass2016-05-17-0/+15
| | | | | | | | Add a function that automatically builds the device name given the parent and a supplied string. Most callers will want to do this, so putting this functionality in one place makes more sense. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: blk: Allow blk_create_device() to allocate the device numberSimon Glass2016-05-17-0/+29
| | | | | | | | Allow a devnum parameter of -1 to indicate that the device number should be alocated automatically. The next highest available device number for that interface type is used. Signed-off-by: Simon Glass <sjg@chromium.org>
* dm: mmc: Add an implementation of the 'devnum' functionsSimon Glass2016-05-17-0/+280
| | | | | | | | | | Now that the MMC code accesses devices by number, we can implement this same interface for driver model, allowing MMC to support using driver model for block devices. Add the required functions to the uclass. Signed-off-by: Simon Glass <sjg@chromium.org>
* drivers: block: add block device cacheEric Nelson2016-04-01-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a block device cache to speed up repeated reads of block devices by various filesystems. This small amount of cache can dramatically speed up filesystem operations by skipping repeated reads of common areas of a block device (typically directory structures). This has shown to have some benefit on FAT filesystem operations of loading a kernel and RAM disk, but more dramatic benefits on ext4 filesystems when the kernel and/or RAM disk are spread across multiple extent header structures as described in commit fc0fc50. The cache is implemented through a minimal list (block_cache) maintained in most-recently-used order and count of the current number of entries (cache_count). It uses a maximum block count setting to prevent copies of large block reads and an upper bound on the number of cached areas. The maximum number of entries in the cache defaults to 32 and the maximum number of blocks per cache entry has a default of 2, which has shown to produce the best results on testing of ext4 and FAT filesystems. The 'blkcache' command (enabled through CONFIG_CMD_BLOCK_CACHE) allows changing these values and can be used to tune for a particular filesystem layout. Signed-off-by: Eric Nelson <eric@nelint.com>
* dm: blk: Add a block-device uclassSimon Glass2016-03-14-0/+175
Add a uclass for block devices. These provide block-oriented data access, supporting reading, writing and erasing of whole blocks. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>