]> git.ipfire.org Git - u-boot.git/blobdiff - board/engicam/common/spl.c
i.MX6: engicam: Add imx6q/imx6ul boards for existing boards
[u-boot.git] / board / engicam / common / spl.c
index f8ae3acb0d44db32c4077a018ae3c2493722890b..6e2389dd4b42e7ff9848f17e4294674ad6484b12 100644 (file)
@@ -55,6 +55,32 @@ int board_fit_config_name_match(const char *name)
 }
 #endif
 
+#ifdef CONFIG_ENV_IS_IN_MMC
+void board_boot_order(u32 *spl_boot_list)
+{
+       u32 bmode = imx6_src_get_boot_mode();
+       u8 boot_dev = BOOT_DEVICE_MMC1;
+
+       switch ((bmode & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
+       case IMX6_BMODE_SD:
+       case IMX6_BMODE_ESD:
+               /* SD/eSD - BOOT_DEVICE_MMC1 */
+               break;
+       case IMX6_BMODE_MMC:
+       case IMX6_BMODE_EMMC:
+               /* MMC/eMMC */
+               boot_dev = BOOT_DEVICE_MMC2;
+               break;
+       default:
+               /* Default - BOOT_DEVICE_MMC1 */
+               printf("Wrong board boot order\n");
+               break;
+       }
+
+       spl_boot_list[0] = boot_dev;
+}
+#endif
+
 #ifdef CONFIG_SPL_OS_BOOT
 int spl_start_uboot(void)
 {