]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - arch/arm/mach-imx/spl.c
imx: spl: Partially revert "spl: eMMC/SD: Provide one __weak spl_boot_mode() function"
[people/ms/u-boot.git] / arch / arm / mach-imx / spl.c
index a9079fceac8d6a7d8f88999306ad4f90feb45526..b2521b2101ccd72334f24b01955d104113549bc1 100644 (file)
@@ -132,6 +132,29 @@ int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name)
 }
 #endif
 
+#if defined(CONFIG_SPL_MMC_SUPPORT)
+/* called from spl_mmc to see type of boot mode for storage (RAW or FAT) */
+u32 spl_boot_mode(const u32 boot_device)
+{
+       switch (spl_boot_device()) {
+       /* for MMC return either RAW or FAT mode */
+       case BOOT_DEVICE_MMC1:
+       case BOOT_DEVICE_MMC2:
+#if defined(CONFIG_SPL_FAT_SUPPORT)
+               return MMCSD_MODE_FS;
+#elif defined(CONFIG_SUPPORT_EMMC_BOOT)
+               return MMCSD_MODE_EMMCBOOT;
+#else
+               return MMCSD_MODE_RAW;
+#endif
+               break;
+       default:
+               puts("spl: ERROR:  unsupported device\n");
+               hang();
+       }
+}
+#endif
+
 #if defined(CONFIG_SECURE_BOOT)
 
 /*