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-08-16 10:09:13 -0600
commit9b1eb6e7c04afd3763db35b6f661415d292b7a52 (patch)
treecd1b29ab4e8ee009ec0018a1cd7d8f46ba6704e9
parentd2e97e75dd84ee79e3b44d5040b1e44fb40ee6d7 (diff)
downloadu-boot-linaro-stable-9b1eb6e7c04afd3763db35b6f661415d292b7a52.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 7ca2b229c..56d4bcdc5 100644
--- a/arch/arm/cpu/armv7/omap-common/spl_mmc.c
+++ b/arch/arm/cpu/armv7/omap-common/spl_mmc.c
@@ -89,6 +89,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));
@@ -100,20 +101,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();
}
}