summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Nelson <eric@nelint.com>2015-12-05 12:32:28 -0700
committerTom Rini <trini@konsulko.com>2015-12-14 13:42:50 -0500
commit5915517b7bca560183d11c2260f01f3a93dd01b9 (patch)
tree5e3bb0198f78faaf821b5e2cfe7865ce6e11ef39
parent653447b407ba2774eb398e7b35f80d2e25463da6 (diff)
downloadu-boot-imx-5915517b7bca560183d11c2260f01f3a93dd01b9.zip
u-boot-imx-5915517b7bca560183d11c2260f01f3a93dd01b9.tar.gz
u-boot-imx-5915517b7bca560183d11c2260f01f3a93dd01b9.tar.bz2
spl: mmc: use block device number, not hard-coded 0
In order to support boot from multiple devices through board_boot_order, it's necessary to use the block number of a device. The use of a hard-coded 0 for the device number also creates a need to re-order block devices for use in SPL like this: http://git.denx.de/?p=u-boot.git;a=blob;f=board/freescale/mx6slevk/mx6slevk.c;hb=HEAD#l195 Signed-off-by: Eric Nelson <eric@nelint.com>
-rw-r--r--common/spl/spl_mmc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index f2c1af5..c1c29c0 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -23,12 +23,13 @@ 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(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;
@@ -45,7 +46,7 @@ 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(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);
@@ -149,7 +150,8 @@ static int mmc_load_image_raw_os(struct mmc *mmc)
{
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);