summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorPeter Korsgaard <peter.korsgaard@barco.com>2013-05-13 08:36:29 +0000
committerTom Rini <trini@ti.com>2013-06-07 14:17:00 -0400
commit2b75b0ad3a2a47492a6d03199d85632f9ee3e42b (patch)
tree1cc005685848e5bd6d6dddf25cd87f413ef1797f /common
parent721931f805267c084f9e4f422e987c0704d3d102 (diff)
downloadu-boot-imx-2b75b0ad3a2a47492a6d03199d85632f9ee3e42b.zip
u-boot-imx-2b75b0ad3a2a47492a6d03199d85632f9ee3e42b.tar.gz
u-boot-imx-2b75b0ad3a2a47492a6d03199d85632f9ee3e42b.tar.bz2
spl_mmc: add Falcon mode support for raw 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 sector CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR and CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS of kernel argument parameters starting from sector CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl_mmc.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index d710c0d..170fa38 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -63,6 +63,21 @@ end:
return (err == 0);
}
+#ifdef CONFIG_SPL_OS_BOOT
+static int mmc_load_image_raw_os(struct mmc *mmc)
+{
+ if (!mmc->block_dev.block_read(0,
+ CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR,
+ CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS,
+ (void *)CONFIG_SYS_SPL_ARGS_ADDR)) {
+ printf("mmc args blk read error\n");
+ return -1;
+ }
+
+ return mmc_load_image_raw(mmc, CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR);
+}
+#endif
+
#ifdef CONFIG_SPL_FAT_SUPPORT
static int mmc_load_image_fat(struct mmc *mmc, const char *filename)
{
@@ -130,6 +145,9 @@ void spl_mmc_load_image(void)
boot_mode = spl_boot_mode();
if (boot_mode == MMCSD_MODE_RAW) {
debug("boot mode - RAW\n");
+#ifdef CONFIG_SPL_OS_BOOT
+ if (spl_start_uboot() || mmc_load_image_raw_os(mmc))
+#endif
err = mmc_load_image_raw(mmc,
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
#ifdef CONFIG_SPL_FAT_SUPPORT