aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2011-08-29 08:17:04 -0600
committerJohn Rigby <john.rigby@linaro.org>2012-12-06 12:16:44 -0700
commit2f493573627169f1d01f88239811815d5dd61125 (patch)
tree1cc853dd8d7aea40f5615a4147cecac43a253a23 /drivers
parentb2006902b4a098f8c57de38cdb511278aa05eeb1 (diff)
downloadu-boot-linaro-stable-2f493573627169f1d01f88239811815d5dd61125.tar.gz
Allow loading of u-boot.bin for backward compatibility
Signed-off-by: John Rigby <john.rigby@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/spl_mmc.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/mmc/spl_mmc.c b/drivers/mmc/spl_mmc.c
index 753c6a014..07a6226cd 100644
--- a/drivers/mmc/spl_mmc.c
+++ b/drivers/mmc/spl_mmc.c
@@ -71,6 +71,7 @@ static void mmc_load_image_fat(struct mmc *mmc)
{
s32 err;
struct image_header *header;
+ char *payloadname;
header = (struct image_header *)(CONFIG_SYS_TEXT_BASE -
sizeof(struct image_header));
@@ -82,20 +83,27 @@ static void mmc_load_image_fat(struct mmc *mmc)
hang();
}
- err = file_fat_read(CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME,
+ payloadname = CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME;
+ err = file_fat_read(payloadname,
(u8 *)header, sizeof(struct image_header));
- if (err <= 0)
- goto end;
+ if (err <= 0) {
+ payloadname = "u-boot.bin";
+ err = file_fat_read(payloadname,
+ (u8 *)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,
+ err = file_fat_read(payloadname,
(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);
+ payloadname, err);
hang();
}
}