summaryrefslogtreecommitdiff
path: root/common/spl/spl_mmc.c
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2015-12-07 11:38:48 -0700
committerTom Rini <trini@konsulko.com>2016-01-13 21:05:18 -0500
commit7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86 (patch)
tree8dfb6b9f5721891de191bad798b0533e3a0bf69a /common/spl/spl_mmc.c
parentadc421e4cee8275cd99367b3b455ffbb5ead3990 (diff)
downloadu-boot-7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86.tar.gz
u-boot-7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86.tar.bz2
u-boot-7c4213f6a52f35ff6ba2d97aa4eb04cbfc963b86.zip
block: pass block dev not num to read/write/erase()
This will allow the implementation to make use of data in the block_dev structure beyond the base device number. This will be useful so that eMMC block devices can encompass the HW partition ID rather than treating this out-of-band. Equally, the existence of the priv field is crying out for this patch to exist. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common/spl/spl_mmc.c')
-rw-r--r--common/spl/spl_mmc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index c1c29c02d7..c3931c6c4d 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -23,13 +23,12 @@ static int mmc_load_image_raw_sector(struct mmc *mmc, unsigned long sector)
unsigned long count;
u32 image_size_sectors;
struct image_header *header;
- int dev_num = mmc->block_dev.dev;
header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
sizeof(struct image_header));
/* read image header to find the image size & load address */
- count = mmc->block_dev.block_read(dev_num, sector, 1, header);
+ count = mmc->block_dev.block_read(&mmc->block_dev, sector, 1, header);
debug("read sector %lx, count=%lu\n", sector, count);
if (count == 0)
goto end;
@@ -46,7 +45,8 @@ static int mmc_load_image_raw_sector(struct mmc *mmc, unsigned long sector)
mmc->read_bl_len;
/* Read the header too to avoid extra memcpy */
- count = mmc->block_dev.block_read(dev_num, sector, image_size_sectors,
+ count = mmc->block_dev.block_read(&mmc->block_dev, sector,
+ image_size_sectors,
(void *)(ulong)spl_image.load_addr);
debug("read %x sectors to %x\n", image_size_sectors,
spl_image.load_addr);
@@ -150,8 +150,7 @@ static int mmc_load_image_raw_os(struct mmc *mmc)
{
unsigned long count;
- count = mmc->block_dev.block_read(
- mmc->block_dev.dev,
+ count = mmc->block_dev.block_read(&mmc->block_dev,
CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR,
CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
(void *) CONFIG_SYS_SPL_ARGS_ADDR);