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(0, sector, 1, header);
+ count = mmc->block_dev.block_read(dev_num, sector, 1, header);
debug("read sector %lx, count=%lu\n", sector, count);
if (count == 0)
goto end;
mmc->read_bl_len;
/* Read the header too to avoid extra memcpy */
- count = mmc->block_dev.block_read(0, sector, image_size_sectors,
+ count = mmc->block_dev.block_read(dev_num, sector, image_size_sectors,
(void *)(ulong)spl_image.load_addr);
debug("read %x sectors to %x\n", image_size_sectors,
spl_image.load_addr);
{
unsigned long count;
- count = mmc->block_dev.block_read(0,
+ count = mmc->block_dev.block_read(
+ mmc->block_dev.dev,
CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR,
CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
(void *) CONFIG_SYS_SPL_ARGS_ADDR);