summaryrefslogtreecommitdiff
path: root/common/spl/spl_mmc.c
diff options
context:
space:
mode:
authorPeter Korsgaard <peter.korsgaard@barco.com>2013-05-13 08:36:26 +0000
committerTom Rini <trini@ti.com>2013-06-07 08:37:48 -0400
commit2fabd0bcaa941e6b960077cf7693ca3a98fa655f (patch)
tree5e4dc469b422e0e1251c1f796792eecd93561a7b /common/spl/spl_mmc.c
parent79adb7a2b54b0b34ec4defac33d6ee8277976ddf (diff)
downloadu-boot-imx-2fabd0bcaa941e6b960077cf7693ca3a98fa655f.zip
u-boot-imx-2fabd0bcaa941e6b960077cf7693ca3a98fa655f.tar.gz
u-boot-imx-2fabd0bcaa941e6b960077cf7693ca3a98fa655f.tar.bz2
spl_mmc: mmc_load_image_fat(): Add filename argument and move fat init out
So we can use it for falcon mode as well. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
Diffstat (limited to 'common/spl/spl_mmc.c')
-rw-r--r--common/spl/spl_mmc.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index 0c50657..fac6f2d 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -68,7 +68,7 @@ end:
}
#ifdef CONFIG_SPL_FAT_SUPPORT
-static int mmc_load_image_fat(struct mmc *mmc)
+static int mmc_load_image_fat(struct mmc *mmc, const char *filename)
{
int err;
struct image_header *header;
@@ -76,27 +76,18 @@ static int mmc_load_image_fat(struct mmc *mmc)
header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
sizeof(struct image_header));
- err = fat_register_device(&mmc->block_dev,
- CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION);
- if (err) {
- printf("spl: fat register err - %d\n", err);
- hang();
- }
-
- err = file_fat_read(CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME,
- header, sizeof(struct image_header));
+ err = file_fat_read(filename, header, sizeof(struct image_header));
if (err <= 0)
goto end;
spl_parse_image_header(header);
- err = file_fat_read(CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME,
- (u8 *)spl_image.load_addr, 0);
+ err = file_fat_read(filename, (u8 *)spl_image.load_addr, 0);
end:
if (err <= 0)
printf("spl: error reading image %s, err - %d\n",
- CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME, err);
+ filename, err);
return (err <= 0);
}
@@ -129,7 +120,15 @@ void spl_mmc_load_image(void)
#ifdef CONFIG_SPL_FAT_SUPPORT
} else if (boot_mode == MMCSD_MODE_FAT) {
debug("boot mode - FAT\n");
- err = mmc_load_image_fat(mmc);
+
+ err = fat_register_device(&mmc->block_dev,
+ CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION);
+ if (err) {
+ printf("spl: fat register err - %d\n", err);
+ hang();
+ }
+
+ err = mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
#endif
} else {
puts("spl: wrong MMC boot mode\n");