[PATCH] imx9: Improve boot device auto-selection

From: Benjamin Szőke egyszeregy@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.
Signed-off-by: Benjamin Szőke egyszeregy@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 \

Subject: [PATCH] imx9: Improve boot device auto-selection
From: Benjamin Szőke egyszeregy@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 egyszeregy@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

2024. 10. 14. 2:39 keltezéssel, Peng Fan írta:
Subject: [PATCH] imx9: Improve boot device auto-selection
From: Benjamin Szőke egyszeregy@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.
If CONFIG_ENV_IS_NOWHERE is used in u-boot config instead of CONFIG_ENV_IS_IN_MMC, boot auto-selection does not work because of the incorrect #ifdef usage in /arch/arm/mach-imx/imx9/soc.c.
If CONFIG_ENV_IS_IN_MMC is not used, also need to define CONFIG_SYS_MMC_ENV_DEV to any default zero value manually, because the code of mmc_get_env_dev() of imx9 soc like to use it, if auto detection of boot is failed or it is not in SD or MMC boot mode.
Same things were solved in pico-imx7d source also. https://github.com/u-boot/u-boot/blob/master/board/technexion/pico-imx7d/pic...
Signed-off-by: Benjamin Szőke egyszeregy@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

Benjamin,
On Sun, Oct 13, 2024 at 9:39 PM Peng Fan peng.fan@nxp.com wrote:
Would you please give more background on this, I not got the point on why doing this?
I also do not understand the reason for this change. It is not clear by reading the commit log.
Please describe what exactly fails to work before the patch and what works after your change.
+#ifndef CONFIG_SYS_MMC_ENV_DEV +#define CONFIG_SYS_MMC_ENV_DEV 0 +#endif
I don't understand the need for this.
env/Kconfig has a default 0 for SYS_MMC_ENV_DEV.

2024. 10. 16. 20:28 keltezéssel, Fabio Estevam írta:
Benjamin,
On Sun, Oct 13, 2024 at 9:39 PM Peng Fan peng.fan@nxp.com wrote:
Would you please give more background on this, I not got the point on why doing this?
I also do not understand the reason for this change. It is not clear by reading the commit log.
Please describe what exactly fails to work before the patch and what works after your change.
+#ifndef CONFIG_SYS_MMC_ENV_DEV +#define CONFIG_SYS_MMC_ENV_DEV 0 +#endif
I don't understand the need for this.
env/Kconfig has a default 0 for SYS_MMC_ENV_DEV.
You can use only one of config from CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y in U-boot config in same time.
If you like to use CONFIG_ENV_IS_NOWHERE=y, these codes in the patched source files will be not part of the build, and the autodetection of the boot mode will never work. At the moment it works only if you use CONFIG_ENV_IS_IN_MMC=y in U-boot config but it should work also in case of use CONFIG_ENV_IS_NOWHERE=y option also.
Other poblem is that CONFIG_SYS_MMC_ENV_DEV can be defined only if CONFIG_ENV_IS_IN_MMC=y is active in config of U-boot. It means, it needs to be manually defined in case when CONFIG_ENV_IS_NOWHERE=y is used, because the codes in the patched sources like to use it as a return value in some error/default cases.

2024. 10. 16. 21:41 keltezéssel, Szőke Benjamin írta:
- 20:28 keltezéssel, Fabio Estevam írta:
Benjamin,
On Sun, Oct 13, 2024 at 9:39 PM Peng Fan peng.fan@nxp.com wrote:
Would you please give more background on this, I not got the point on why doing this?
I also do not understand the reason for this change. It is not clear by reading the commit log.
Please describe what exactly fails to work before the patch and what works after your change.
+#ifndef CONFIG_SYS_MMC_ENV_DEV +#define CONFIG_SYS_MMC_ENV_DEV 0 +#endif
I don't understand the need for this.
env/Kconfig has a default 0 for SYS_MMC_ENV_DEV.
You can use only one of config from CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y in U-boot config in same time.
If you like to use CONFIG_ENV_IS_NOWHERE=y, these codes in the patched source files will be not part of the build, and the autodetection of the boot mode will never work. At the moment it works only if you use CONFIG_ENV_IS_IN_MMC=y in U- boot config but it should work also in case of use CONFIG_ENV_IS_NOWHERE=y option also.
Other poblem is that CONFIG_SYS_MMC_ENV_DEV can be defined only if CONFIG_ENV_IS_IN_MMC=y is active in config of U-boot. It means, it needs to be manually defined in case when CONFIG_ENV_IS_NOWHERE=y is used, because the codes in the patched sources like to use it as a return value in some error/default cases.
Did you get what is the problem?
https://github.com/u-boot/u-boot/commit/636c95f82b9a184a9b45a8965488cea2dedc... The implementation of mmc_get_env_dev() in arch/arm/mach-imx/imx9/soc.c is not able to support CONFIG_ENV_IS_NOWHERE=y using. It was fixed in my patch.

On Wed, Oct 16, 2024 at 4:42 PM Szőke Benjamin egyszeregy@freemail.hu wrote:
You can use only one of config from CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y in U-boot config in same time.
imx93_11x11_evk_defconfig selects both CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y.
If you like to use CONFIG_ENV_IS_NOWHERE=y, these codes in the patched source files will be not part of the build, and the autodetection of the boot mode will never work. At the moment it works only if you use CONFIG_ENV_IS_IN_MMC=y in U-boot config but it should work also in case of use CONFIG_ENV_IS_NOWHERE=y option also.
But like I said imx93_11x11_evk_defconfig selects both CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y.
I am still confused by your patch.
I would like to get a feedback from Peng Fan.

Subject: Re: [PATCH] imx9: Improve boot device auto-selection
On Wed, Oct 16, 2024 at 4:42 PM Szőke Benjamin egyszeregy@freemail.hu wrote:
You can use only one of config from CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y in U-boot config in same time.
imx93_11x11_evk_defconfig selects both CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y.
If you like to use CONFIG_ENV_IS_NOWHERE=y, these codes in the
patched
source files will be not part of the build, and the autodetection of the boot mode will never work. At the moment it works only if you
use
CONFIG_ENV_IS_IN_MMC=y in U-boot config but it should work also
in
case of use CONFIG_ENV_IS_NOWHERE=y option also.
But like I said imx93_11x11_evk_defconfig selects both CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y.
I am still confused by your patch.
I would like to get a feedback from Peng Fan.
In UUU boot mode, we use the env inside U-Boot proper, so it is NOWHERE.
In this patch, I think use changing to mmc for NOWHERE may break the rule.
Thanks, Peng.

2024. 10. 22. 14:23 keltezéssel, Peng Fan írta:
Subject: Re: [PATCH] imx9: Improve boot device auto-selection
On Wed, Oct 16, 2024 at 4:42 PM Szőke Benjamin egyszeregy@freemail.hu wrote:
You can use only one of config from CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y in U-boot config in same time.
imx93_11x11_evk_defconfig selects both CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y.
If you like to use CONFIG_ENV_IS_NOWHERE=y, these codes in the
patched
source files will be not part of the build, and the autodetection of the boot mode will never work. At the moment it works only if you
use
CONFIG_ENV_IS_IN_MMC=y in U-boot config but it should work also
in
case of use CONFIG_ENV_IS_NOWHERE=y option also.
But like I said imx93_11x11_evk_defconfig selects both CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y.
I am still confused by your patch.
I would like to get a feedback from Peng Fan.
In UUU boot mode, we use the env inside U-Boot proper, so it is NOWHERE.
In this patch, I think use changing to mmc for NOWHERE may break the rule.
Thanks, Peng.
If both CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y are in the config, CONFIG_ENV_IS_IN_MMC=y will be overrideing default CONFIG_ENV_IS_NOWHERE settings, so in imx9 defconfig it is useless to use both of them.
In my board i can use CONFIG_ENV_IS_NOWHERE=y without CONFIG_ENV_IS_IN_MMC=y in imX93 EVK board but i needed to make this patch in imx9/soc.c and imx93_evk.c source files imx9 to get it work.
It will not break any rules. In this boot mode selection it just a simple process to set "mmcdev" and "mmcroot" according your actual MMC device IDs from boot switches states. It never be able to break any rules for UUU booting in Serial download mode because you have to use manual commands from UUU script which will never use this mmc variables. https://elixir.bootlin.com/u-boot/v2024.10/source/board/congatec/common/mmc....
Goal in my patch to able to use the boot mode autodecetion in case of use only CONFIG_ENV_IS_NOWHERE=y option (without CONFIG_ENV_IS_IN_MMC). It works for me. Please sit down, put your NXP board i your desk and try it, then analyse how well works for you also.

On Fri, Nov 1, 2024 at 7:56 AM Szőke Benjamin egyszeregy@freemail.hu wrote:
If both CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y are in the config, CONFIG_ENV_IS_IN_MMC=y will be overrideing default CONFIG_ENV_IS_NOWHERE settings, so in imx9 defconfig it is useless to use both of them.
In my board i can use CONFIG_ENV_IS_NOWHERE=y without CONFIG_ENV_IS_IN_MMC=y in imX93 EVK board but i needed to make this patch in imx9/soc.c and imx93_evk.c source files imx9 to get it work.
It will not break any rules. In this boot mode selection it just a simple process to set "mmcdev" and "mmcroot" according your actual MMC device IDs from boot switches states. It never be able to break any rules for UUU booting in Serial download mode because you have to use manual commands from UUU script which will never use this mmc variables. https://elixir.bootlin.com/u-boot/v2024.10/source/board/congatec/common/mmc....
Goal in my patch to able to use the boot mode autodecetion in case of use only CONFIG_ENV_IS_NOWHERE=y option (without CONFIG_ENV_IS_IN_MMC). It works for me. Please sit down, put your NXP board i your desk and try it, then analyse how well works for you also.
It would help to put some of the details you add above into the commit log.
There are checkpatch errors in your patch:
$ ./scripts/checkpatch.pl ~/Downloads/imx9-Improve-boot-device-auto-selection.patch WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible #121: FILE: arch/arm/mach-imx/imx9/soc.c:45: +#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC) || CONFIG_IS_ENABLED(ENV_IS_NOWHERE)
WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible #127: FILE: arch/arm/mach-imx/imx9/soc.c:51: +#ifndef CONFIG_SYS_MMC_ENV_DEV
ERROR: All CONFIG symbols are managed by Kconfig #128: FILE: arch/arm/mach-imx/imx9/soc.c:52: +#define CONFIG_SYS_MMC_ENV_DEV 0
WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible #143: FILE: board/freescale/imx93_evk/imx93_evk.c:61: +#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC) || CONFIG_IS_ENABLED(ENV_IS_NOWHERE)
ERROR: All CONFIG symbols are managed by Kconfig #157: FILE: include/configs/imx93_evk.h:32: +#define CONFIG_SYS_MMC_ENV_DEV 0
total: 2 errors, 3 warnings, 0 checks, 37 lines checked

2024. 11. 01. 13:30 keltezéssel, Fabio Estevam írta:
On Fri, Nov 1, 2024 at 7:56 AM Szőke Benjamin egyszeregy@freemail.hu wrote:
If both CONFIG_ENV_IS_IN_MMC=y and CONFIG_ENV_IS_NOWHERE=y are in the config, CONFIG_ENV_IS_IN_MMC=y will be overrideing default CONFIG_ENV_IS_NOWHERE settings, so in imx9 defconfig it is useless to use both of them.
In my board i can use CONFIG_ENV_IS_NOWHERE=y without CONFIG_ENV_IS_IN_MMC=y in imX93 EVK board but i needed to make this patch in imx9/soc.c and imx93_evk.c source files imx9 to get it work.
It will not break any rules. In this boot mode selection it just a simple process to set "mmcdev" and "mmcroot" according your actual MMC device IDs from boot switches states. It never be able to break any rules for UUU booting in Serial download mode because you have to use manual commands from UUU script which will never use this mmc variables. https://elixir.bootlin.com/u-boot/v2024.10/source/board/congatec/common/mmc....
Goal in my patch to able to use the boot mode autodecetion in case of use only CONFIG_ENV_IS_NOWHERE=y option (without CONFIG_ENV_IS_IN_MMC). It works for me. Please sit down, put your NXP board i your desk and try it, then analyse how well works for you also.
It would help to put some of the details you add above into the commit log.
There are checkpatch errors in your patch:
$ ./scripts/checkpatch.pl ~/Downloads/imx9-Improve-boot-device-auto-selection.patch WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible #121: FILE: arch/arm/mach-imx/imx9/soc.c:45: +#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC) || CONFIG_IS_ENABLED(ENV_IS_NOWHERE)
WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible #127: FILE: arch/arm/mach-imx/imx9/soc.c:51: +#ifndef CONFIG_SYS_MMC_ENV_DEV
ERROR: All CONFIG symbols are managed by Kconfig #128: FILE: arch/arm/mach-imx/imx9/soc.c:52: +#define CONFIG_SYS_MMC_ENV_DEV 0
WARNING: Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible #143: FILE: board/freescale/imx93_evk/imx93_evk.c:61: +#if CONFIG_IS_ENABLED(ENV_IS_IN_MMC) || CONFIG_IS_ENABLED(ENV_IS_NOWHERE)
ERROR: All CONFIG symbols are managed by Kconfig #157: FILE: include/configs/imx93_evk.h:32: +#define CONFIG_SYS_MMC_ENV_DEV 0
total: 2 errors, 3 warnings, 0 checks, 37 lines checked
In my next [PATCH v2], these errors were fixed: [PATCH v2] imx9: Improve boot mode autodetection https://lists.denx.de/pipermail/u-boot/2024-November/570295.html

Subject: [PATCH] imx9: Improve boot device auto-selection
From: Benjamin Szőke egyszeregy@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.
Signed-off-by: Benjamin Szőke egyszeregy@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
Reviewed-by: Peng Fan peng.fan@nxp.com
participants (4)
-
egyszeregy@freemail.hu
-
Fabio Estevam
-
Peng Fan
-
Szőke Benjamin