]> git.ipfire.org Git - people/ms/u-boot.git/blob - board/engicam/icorem6_rqs/icorem6_rqs.c
cd73dfa9babbe6c02c540655653f46b0aedc8824
[people/ms/u-boot.git] / board / engicam / icorem6_rqs / icorem6_rqs.c
1 /*
2 * Copyright (C) 2016 Amarula Solutions B.V.
3 * Copyright (C) 2016 Engicam S.r.l.
4 * Author: Jagan Teki <jagan@amarulasolutions.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0+
7 */
8
9 #include <asm/arch/sys_proto.h>
10
11 DECLARE_GLOBAL_DATA_PTR;
12
13 #ifdef CONFIG_ENV_IS_IN_MMC
14 int board_mmc_get_env_dev(int devno)
15 {
16 return devno;
17 }
18 #endif
19
20 #ifdef CONFIG_SPL_BUILD
21 #include <spl.h>
22
23 #ifdef CONFIG_ENV_IS_IN_MMC
24 void board_boot_order(u32 *spl_boot_list)
25 {
26 u32 bmode = imx6_src_get_boot_mode();
27 u8 boot_dev = BOOT_DEVICE_MMC1;
28
29 switch ((bmode & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) {
30 case IMX6_BMODE_SD:
31 case IMX6_BMODE_ESD:
32 /* SD/eSD - BOOT_DEVICE_MMC1 */
33 break;
34 case IMX6_BMODE_MMC:
35 case IMX6_BMODE_EMMC:
36 /* MMC/eMMC */
37 boot_dev = BOOT_DEVICE_MMC2;
38 break;
39 default:
40 /* Default - BOOT_DEVICE_MMC1 */
41 printf("Wrong board boot order\n");
42 break;
43 }
44
45 spl_boot_list[0] = boot_dev;
46 }
47 #endif
48 #endif /* CONFIG_SPL_BUILD */