summaryrefslogtreecommitdiff
path: root/common/spl
diff options
context:
space:
mode:
authorPeter Korsgaard <peter.korsgaard@barco.com>2013-05-13 08:36:27 +0000
committerTom Rini <trini@ti.com>2013-06-07 14:17:00 -0400
commit7ad2cc7964d37f3a444a0472bbccda487d51c7f6 (patch)
treee3c782db48a23cbc84369d4f7f3e60c594b10429 /common/spl
parentb6144dfce98c6a893a411052256b81b5afc6e5c4 (diff)
downloadu-boot-imx-7ad2cc7964d37f3a444a0472bbccda487d51c7f6.zip
u-boot-imx-7ad2cc7964d37f3a444a0472bbccda487d51c7f6.tar.gz
u-boot-imx-7ad2cc7964d37f3a444a0472bbccda487d51c7f6.tar.bz2
spl_mmc: add Falcon mode support for FAT variant
If Falcon mode support is enabled (and the system isn't directed into booting u-boot), it will instead try to load kernel from CONFIG_SPL_FAT_LOAD_KERNEL_NAME file and kernel argument parameters from CONFIG_SPL_FAT_LOAD_ARGS_NAME, both from the same partition as u-boot. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
Diffstat (limited to 'common/spl')
-rw-r--r--common/spl/spl_mmc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index fac6f2d..d250b40 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -91,6 +91,24 @@ end:
return (err <= 0);
}
+
+#ifdef CONFIG_SPL_OS_BOOT
+static int mmc_load_image_fat_os(struct mmc *mmc)
+{
+ int err;
+
+ err = file_fat_read(CONFIG_SPL_FAT_LOAD_ARGS_NAME,
+ (void *)CONFIG_SYS_SPL_ARGS_ADDR, 0);
+ if (err <= 0) {
+ printf("spl: error reading image %s, err - %d\n",
+ CONFIG_SPL_FAT_LOAD_ARGS_NAME, err);
+ return -1;
+ }
+
+ return mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_KERNEL_NAME);
+}
+#endif
+
#endif
void spl_mmc_load_image(void)
@@ -128,6 +146,9 @@ void spl_mmc_load_image(void)
hang();
}
+#ifdef CONFIG_SPL_OS_BOOT
+ if (spl_start_uboot() || mmc_load_image_fat_os(mmc))
+#endif
err = mmc_load_image_fat(mmc, CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME);
#endif
} else {