mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-07-14 07:06:19 +09:00
![Jagan Teki](/assets/img/avatar_default.png)
As per USDHC boot eFUSE descriptions: USDHC3 => devno 2 USDHC4 => devno 3 Linux will detect mmc0, mmc1, mmc2 based on the status "okay" on usdhc so imx6qdl-icore-rqs.dtsi has enabled usdhc1, usdhc3 and usdhc4.But U-Boot can detect based on the aliases so add mmc1, mmc2 for usdhc3 and usdhc4 respectively and return the board_mmc_get_env_dev by subtracting -1 Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
49 lines
934 B
C
49 lines
934 B
C
/*
|
|
* Copyright (C) 2016 Amarula Solutions B.V.
|
|
* Copyright (C) 2016 Engicam S.r.l.
|
|
* Author: Jagan Teki <jagan@amarulasolutions.com>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#include <asm/arch/sys_proto.h>
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
#ifdef CONFIG_ENV_IS_IN_MMC
|
|
int board_mmc_get_env_dev(int devno)
|
|
{
|
|
return devno - 1;
|
|
}
|
|
#endif
|
|
|
|
#ifdef CONFIG_SPL_BUILD
|
|
#include <spl.h>
|
|
|
|
#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
|
|
#endif /* CONFIG_SPL_BUILD */
|