arm: mx6: cm-fx6: define fallback boot devices for spl
authorNikita Kiryanov <nikita@compulab.co.il>
Sun, 8 Nov 2015 15:11:53 +0000 (17:11 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 18 Nov 2015 19:50:05 +0000 (14:50 -0500)
Use spl alternate boot device feature to define fallback to
the main boot device as it is defined by hardware.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
board/compulab/cm_fx6/spl.c
include/configs/cm_fx6.h

index d94ced9c6558ac87e92e4ddffa0c8552462061cc..d8328fdadd35e3c3fa0140f7ed104e6250245139 100644 (file)
@@ -337,16 +337,17 @@ void board_init_f(ulong dummy)
        board_init_r(NULL, 0);
 }
 
-void spl_board_init(void)
+void board_boot_order(u32 *spl_boot_list)
 {
-       u32 boot_device = spl_boot_device();
-
-       if (boot_device == BOOT_DEVICE_SPI)
-               puts("Booting from SPI flash\n");
-       else if (boot_device == BOOT_DEVICE_MMC1)
-               puts("Booting from MMC\n");
-       else
-               puts("Unknown boot device\n");
+       spl_boot_list[0] = spl_boot_device();
+       switch (spl_boot_list[0]) {
+       case BOOT_DEVICE_SPI:
+               spl_boot_list[1] = BOOT_DEVICE_MMC1;
+               break;
+       case BOOT_DEVICE_MMC1:
+               spl_boot_list[1] = BOOT_DEVICE_SPI;
+               break;
+       }
 }
 
 #ifdef CONFIG_SPL_MMC_SUPPORT
index 05132047b78595cf3377d42223d52a1e9a4d6ecd..180ea280be6b716b7dfae211c1c45b82838d908f 100644 (file)
 
 /* SPL */
 #include "imx6_spl.h"
-#define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_MMC_SUPPORT
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR        0x80 /* offset 64 kb */
 #define CONFIG_SYS_MONITOR_LEN (CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS / 2 * 1024)