diff options
author | Simon Glass <sjg@chromium.org> | 2016-05-01 13:52:41 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-05-17 09:54:43 -0600 |
commit | 33fb211dd2706e666db4008801dc0d5903fd82f6 (patch) | |
tree | 5d29a3fea60d78047d2afa7b884c667ac84c35ad /drivers/mmc/mmc_write.c | |
parent | ad27dd5e13436b554f0f3cb9cd3e79634494072d (diff) | |
download | u-boot-33fb211dd2706e666db4008801dc0d5903fd82f6.tar.gz |
dm: mmc: Add support for driver-model block devices
Add support for enabling CONFIG_BLK with MMC. This involves changing a
few functions to use struct udevice and adding a MMC block device driver.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/mmc/mmc_write.c')
-rw-r--r-- | drivers/mmc/mmc_write.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c index bd07b20f5f..0f8b5c79d7 100644 --- a/drivers/mmc/mmc_write.c +++ b/drivers/mmc/mmc_write.c @@ -9,6 +9,7 @@ #include <config.h> #include <common.h> +#include <dm.h> #include <part.h> #include <div64.h> #include <linux/math64.h> @@ -172,9 +173,17 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start, return blkcnt; } +#ifdef CONFIG_BLK +ulong mmc_bwrite(struct udevice *dev, lbaint_t start, lbaint_t blkcnt, + const void *src) +#else ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, const void *src) +#endif { +#ifdef CONFIG_BLK + struct blk_desc *block_dev = dev_get_uclass_platdata(dev); +#endif int dev_num = block_dev->devnum; lbaint_t cur, blocks_todo = blkcnt; int err; |