mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-10-10 15:11:28 +02:00
blk: blkmap: Support mapping to device of any block size
At present if a device to map has a block size other than 512, the blkmap map process just fails. There is no reason why we can't just use the block size of the mapped device. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
42411e068d
commit
cf83ff3452
@ -171,11 +171,11 @@ int blkmap_map_linear(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
|
|||||||
|
|
||||||
bd = dev_get_uclass_plat(bm->blk);
|
bd = dev_get_uclass_plat(bm->blk);
|
||||||
lbd = dev_get_uclass_plat(lblk);
|
lbd = dev_get_uclass_plat(lblk);
|
||||||
if (lbd->blksz != bd->blksz)
|
if (lbd->blksz != bd->blksz) {
|
||||||
/* We could support block size translation, but we
|
/* update to match the mapped device */
|
||||||
* don't yet.
|
bd->blksz = lbd->blksz;
|
||||||
*/
|
bd->log2blksz = LOG2(bd->blksz);
|
||||||
return -EINVAL;
|
}
|
||||||
|
|
||||||
linear = malloc(sizeof(*linear));
|
linear = malloc(sizeof(*linear));
|
||||||
if (!linear)
|
if (!linear)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user