summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorPeter Korsgaard <peter.korsgaard@barco.com>2013-05-13 08:36:28 +0000
committerTom Rini <trini@ti.com>2013-06-07 14:17:00 -0400
commit721931f805267c084f9e4f422e987c0704d3d102 (patch)
tree396c35ddf44666de257b2c15b36683919f36ae79 /common
parent7ad2cc7964d37f3a444a0472bbccda487d51c7f6 (diff)
downloadu-boot-imx-721931f805267c084f9e4f422e987c0704d3d102.zip
u-boot-imx-721931f805267c084f9e4f422e987c0704d3d102.tar.gz
u-boot-imx-721931f805267c084f9e4f422e987c0704d3d102.tar.bz2
spl_mmc: mmc_load_image_raw(): Add sector argument
So we can use it for falcon mode as well. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl_mmc.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index d250b40..d710c0d 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -32,7 +32,7 @@
DECLARE_GLOBAL_DATA_PTR;
-static int mmc_load_image_raw(struct mmc *mmc)
+static int mmc_load_image_raw(struct mmc *mmc, unsigned long sector)
{
unsigned long err;
u32 image_size_sectors;
@@ -42,10 +42,7 @@ static int mmc_load_image_raw(struct mmc *mmc)
sizeof(struct image_header));
/* read image header to find the image size & load address */
- err = mmc->block_dev.block_read(0,
- CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR, 1,
- header);
-
+ err = mmc->block_dev.block_read(0, sector, 1, header);
if (err == 0)
goto end;
@@ -56,9 +53,8 @@ static int mmc_load_image_raw(struct mmc *mmc)
mmc->read_bl_len;
/* Read the header too to avoid extra memcpy */
- err = mmc->block_dev.block_read(0,
- CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR,
- image_size_sectors, (void *)spl_image.load_addr);
+ err = mmc->block_dev.block_read(0, sector, image_size_sectors,
+ (void *)spl_image.load_addr);
end:
if (err == 0)
@@ -134,7 +130,8 @@ void spl_mmc_load_image(void)
boot_mode = spl_boot_mode();
if (boot_mode == MMCSD_MODE_RAW) {
debug("boot mode - RAW\n");
- err = mmc_load_image_raw(mmc);
+ err = mmc_load_image_raw(mmc,
+ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
#ifdef CONFIG_SPL_FAT_SUPPORT
} else if (boot_mode == MMCSD_MODE_FAT) {
debug("boot mode - FAT\n");