mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-26 07:17:10 +00:00
imx9: Improve boot mode autodetection
Improve "mmcautodetect=yes" boot mode autodetection to able to use it if CONFIG_ENV_IS_NOWHERE=y is used for i.MX9 SoCs and i.MX93 EVK board. If both CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y are in the defconfig, CONFIG_ENV_IS_IN_MMC=y will be overiden default CONFIG_ENV_IS_NOWHERE settings. Goal is in this patch to able to use the boot mode autodetection if defconfig use only CONFIG_ENV_IS_NOWHERE=y option (without CONFIG_ENV_IS_IN_MMC) for any i.MX9 SoC. Signed-off-by: Benjamin Szőke <egyszeregy@freemail.hu>
This commit is contained in:
parent
0bf7d6b497
commit
6bc9d4407c
3 changed files with 17 additions and 5 deletions
|
@ -42,12 +42,18 @@ DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
struct rom_api *g_rom_api = (struct rom_api *)0x1980;
|
struct rom_api *g_rom_api = (struct rom_api *)0x1980;
|
||||||
|
|
||||||
#ifdef CONFIG_ENV_IS_IN_MMC
|
#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC) || CONFIG_IS_ENABLED(ENV_IS_NOWHERE)
|
||||||
__weak int board_mmc_get_env_dev(int devno)
|
__weak int board_mmc_get_env_dev(int devno)
|
||||||
{
|
{
|
||||||
return devno;
|
return devno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONFIG_SYS_MMC_ENV_DEV
|
||||||
|
#define IMX9_MMC_ENV_DEV CONFIG_SYS_MMC_ENV_DEV
|
||||||
|
#else
|
||||||
|
#define IMX9_MMC_ENV_DEV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
int mmc_get_env_dev(void)
|
int mmc_get_env_dev(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -59,7 +65,7 @@ int mmc_get_env_dev(void)
|
||||||
|
|
||||||
if (ret != ROM_API_OKAY) {
|
if (ret != ROM_API_OKAY) {
|
||||||
puts("ROMAPI: failure at query_boot_info\n");
|
puts("ROMAPI: failure at query_boot_info\n");
|
||||||
return CONFIG_SYS_MMC_ENV_DEV;
|
return IMX9_MMC_ENV_DEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
boot_type = boot >> 16;
|
boot_type = boot >> 16;
|
||||||
|
@ -69,7 +75,7 @@ int mmc_get_env_dev(void)
|
||||||
|
|
||||||
/* If not boot from sd/mmc, use default value */
|
/* If not boot from sd/mmc, use default value */
|
||||||
if (boot_type != BOOT_TYPE_SD && boot_type != BOOT_TYPE_MMC)
|
if (boot_type != BOOT_TYPE_SD && boot_type != BOOT_TYPE_MMC)
|
||||||
return env_get_ulong("mmcdev", 10, CONFIG_SYS_MMC_ENV_DEV);
|
return env_get_ulong("mmcdev", 10, IMX9_MMC_ENV_DEV);
|
||||||
|
|
||||||
return board_mmc_get_env_dev(boot_instance);
|
return board_mmc_get_env_dev(boot_instance);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ int board_init(void)
|
||||||
|
|
||||||
int board_late_init(void)
|
int board_late_init(void)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ENV_IS_IN_MMC
|
#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC) || CONFIG_IS_ENABLED(ENV_IS_NOWHERE)
|
||||||
board_late_mmc_env_init();
|
board_late_mmc_env_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,12 @@
|
||||||
#define BOOTENV
|
#define BOOTENV
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_SYS_MMC_ENV_DEV
|
||||||
|
#define IMX93_EVK_MMC_ENV_DEV CONFIG_SYS_MMC_ENV_DEV
|
||||||
|
#else
|
||||||
|
#define IMX93_EVK_MMC_ENV_DEV 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initial environment variables */
|
/* Initial environment variables */
|
||||||
#define CFG_EXTRA_ENV_SETTINGS \
|
#define CFG_EXTRA_ENV_SETTINGS \
|
||||||
BOOTENV \
|
BOOTENV \
|
||||||
|
@ -42,7 +48,7 @@
|
||||||
"boot_fit=no\0" \
|
"boot_fit=no\0" \
|
||||||
"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
|
"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
|
||||||
"bootm_size=0x10000000\0" \
|
"bootm_size=0x10000000\0" \
|
||||||
"mmcdev=" __stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \
|
"mmcdev=" __stringify(IMX93_EVK_MMC_ENV_DEV)"\0" \
|
||||||
"mmcpart=1\0" \
|
"mmcpart=1\0" \
|
||||||
"mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
|
"mmcroot=/dev/mmcblk1p2 rootwait rw\0" \
|
||||||
"mmcautodetect=yes\0" \
|
"mmcautodetect=yes\0" \
|
||||||
|
|
Loading…
Add table
Reference in a new issue