> Subject: [PATCH] imx9: Improve boot device auto-selection > > From: Benjamin Szőke <egyszer...@freemail.hu> > > Improve "mmcautodetect=yes" boot device auto-selection to able to > use it if CONFIG_ENV_IS_NOWHERE is enabled for i.MX9 SoC and > i.MX93 EVK board.
Would you please give more background on this, I not got the point on why doing this? Thanks, Peng. > > Signed-off-by: Benjamin Szőke <egyszer...@freemail.hu> > --- > arch/arm/mach-imx/imx9/soc.c | 6 +++++- > board/freescale/imx93_evk/imx93_evk.c | 2 +- > include/configs/imx93_evk.h | 6 ++++++ > 3 files changed, 12 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/mach-imx/imx9/soc.c b/arch/arm/mach- > imx/imx9/soc.c index 7c28fa39e1..79ddbc7241 100644 > --- a/arch/arm/mach-imx/imx9/soc.c > +++ b/arch/arm/mach-imx/imx9/soc.c > @@ -42,12 +42,16 @@ DECLARE_GLOBAL_DATA_PTR; > > 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) { > return devno; > } > > +#ifndef CONFIG_SYS_MMC_ENV_DEV > +#define CONFIG_SYS_MMC_ENV_DEV 0 > +#endif > + > int mmc_get_env_dev(void) > { > int ret; > diff --git a/board/freescale/imx93_evk/imx93_evk.c > b/board/freescale/imx93_evk/imx93_evk.c > index 341831a7d3..c9171df330 100644 > --- a/board/freescale/imx93_evk/imx93_evk.c > +++ b/board/freescale/imx93_evk/imx93_evk.c > @@ -58,7 +58,7 @@ int board_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(); > #endif > > diff --git a/include/configs/imx93_evk.h b/include/configs/imx93_evk.h > index 53fb8c9b1b..2a9595a261 100644 > --- a/include/configs/imx93_evk.h > +++ b/include/configs/imx93_evk.h > @@ -27,6 +27,12 @@ > #define BOOTENV > #endif > > +#if CONFIG_IS_ENABLED(ENV_IS_NOWHERE) > +#ifndef CONFIG_SYS_MMC_ENV_DEV > +#define CONFIG_SYS_MMC_ENV_DEV 0 > +#endif > +#endif > + > /* Initial environment variables */ > #define CFG_EXTRA_ENV_SETTINGS \ > BOOTENV \ > -- > 2.47.0.windows.1