spl: mmc: Fix raw boot mode (related to commit 4c5bbc2328a24f5e1ee990c9a9527e48e5fb3b5f)
authorGuillaume GARDET <guillaume.gardet@free.fr>
Tue, 16 Dec 2014 11:00:44 +0000 (12:00 +0100)
committerPantelis Antoniou <pantelis.antoniou@konsulko.com>
Tue, 6 Jan 2015 08:10:30 +0000 (10:10 +0200)
As reported by Robert Nelson, commit 4c5bbc2328a24f5e1ee990c9a9527e48e5fb3b5f
may break MMC RAW boot mode.
This patch fixes the check path to fix MMC Raw boot mode.

Tested raw boot mode and FS boot mode on a pandaboard (rev. A3).

Reported-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Tom Rini <trini@ti.com>
Cc: Robert Nelson <robertcnelson@gmail.com>
Tested-by: Robert Nelson <robertcnelson@gmail.com>
common/spl/spl_mmc.c

index 7bae16beba064472c5f4ebd48d17d4e63b3b78fc..c2e596be69bc4310790de1160ddaef40f8c02759 100644 (file)
@@ -172,11 +172,24 @@ void spl_mmc_load_image(void)
                err = mmc_load_image_raw_sector(mmc,
                        CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR);
 #endif
-       } else {
+       }
+
+       switch(boot_mode){
+               case MMCSD_MODE_RAW:
+#if defined(CONFIG_SPL_FAT_SUPPORT) || defined(CONFIG_SPL_EXT_SUPPORT)
+               case MMCSD_MODE_FS:
+#endif
+#ifdef CONFIG_SUPPORT_EMMC_BOOT
+               case MMCSD_MODE_EMMCBOOT:
+#endif
+                       /* Boot mode is ok. Nothing to do. */
+                       break;
+               case MMCSD_MODE_UNDEFINED:
+               default:
 #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
-               puts("spl: wrong MMC boot mode\n");
+                       puts("spl: wrong MMC boot mode\n");
 #endif
-               hang();
+                       hang();
        }
 
        if (err)