aboutsummaryrefslogtreecommitdiff
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-05-02 19:44:11 -0600
commitd2f5fac206c1653411ddab58a02433a29c4df41f (patch)
treea8c87da2deefad6dfba18bf0d121cb54d5e845c5
parent97e6d25e69dfb62c49fbea02cfe4ad8ab174d2b1 (diff)
downloadu-boot-linaro-stable-d2f5fac206c1653411ddab58a02433a29c4df41f.tar.gz
Allow loading of u-boot.bin for backward compatibility
Signed-off-by: John Rigby <john.rigby@linaro.org>
-rw-r--r--arch/arm/cpu/armv7/omap-common/spl_mmc.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/arm/cpu/armv7/omap-common/spl_mmc.c b/arch/arm/cpu/armv7/omap-common/spl_mmc.c
index 4626ea4d7..4108f803d 100644
--- a/arch/arm/cpu/armv7/omap-common/spl_mmc.c
+++ b/arch/arm/cpu/armv7/omap-common/spl_mmc.c
@@ -88,6 +88,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));
@@ -99,20 +100,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();
}
}