ARM: imx8m: support env in fat and ext4
Subsystems (3)
PATCH 1/1 ARM: imx8m: support env in fat and ext4
Change boot device logic to also allow environment stored in fat and in ext4 when booting from SD or from eMMC.
As the boot device check for SD and for eMMC was depending on ENV_IS_IN_MMC being defined, change the ifdef blocks at env_get_location to use IS_ENABLED instead for all modes, returning NOWHERE when no valid mode is found.
--- arch/arm/mach-imx/imx8m/soc.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-)
arch/arm/mach-imx/imx8m/soc.c +15 -20
@@ -1306,40 +1306,35 @@ void do_error(struct pt_regs *pt_regs, unsigned int esr)enum env_location env_get_location (enum env_operation op,int prio) {enum boot_device dev =get_boot_device (); -enum env_location env_loc =ENVL_UNKNOWN ;if (prio) -return env_loc; +return ENVL_UNKNOWN ;switch (dev) { -#ifdef CONFIG_ENV_IS_IN_SPI_FLASH case QSPI_BOOT : - env_loc =ENVL_SPI_FLASH ; -break ; -#endif -#ifdef CONFIG_ENV_IS_IN_NAND +if (IS_ENABLED (CONFIG_ENV_IS_IN_SPI_FLASH )) +return ENVL_SPI_FLASH ; +return ENVL_NOWHERE ;case NAND_BOOT : - env_loc =ENVL_NAND ; -break ; -#endif -#ifdef CONFIG_ENV_IS_IN_MMC +if (IS_ENABLED (CONFIG_ENV_IS_IN_NAND )) +return ENVL_NAND ; +return ENVL_NOWHERE ;case SD1_BOOT :case SD2_BOOT :case SD3_BOOT :case MMC1_BOOT :case MMC2_BOOT :case MMC3_BOOT : - env_loc =ENVL_MMC ; -break ; -#endif +if (IS_ENABLED (CONFIG_ENV_IS_IN_MMC )) +return ENVL_MMC ; +else if (IS_ENABLED (CONFIG_ENV_IS_IN_EXT4 )) +return ENVL_EXT4 ; +else if (IS_ENABLED (CONFIG_ENV_IS_IN_FAT )) +return ENVL_FAT ; +return ENVL_NOWHERE ;default : -#if defined(CONFIG_ENV_IS_NOWHERE ) - env_loc =ENVL_NOWHERE ; -#endif -break ; +return ENVL_NOWHERE ; } - -return env_loc; }#ifndef ENV_IS_EMBEDDED
Signature · 1 line
2.33.0
Quoted 10 lines · Ricardo Salveti
Change boot device logic to also allow environment stored in fat and in ext4 when booting from SD or from eMMC.
As the boot device check for SD and for eMMC was depending on
ENV_IS_IN_MMCbeing defined, change the ifdef blocks atenv_get_locationto useIS_ENABLEDinstead for all modes, returning NOWHERE when no valid mode is found.Signed-off-by Ricardo Salveti <[email protected]>
Quoted 67 lines
--- arch/arm/mach-imx/imx8m/soc.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-)arch/arm/mach-imx/imx8m/soc.c +15
-21@@ -1306,40 +1306,35 @@ void do_error(struct pt_regs *pt_regs, unsigned int esr)enum env_location env_get_location (enum env_operation op,int prio) {enum boot_device dev =get_boot_device (); -enum env_location env_loc =ENVL_UNKNOWN ;if (prio) -return env_loc; +return ENVL_UNKNOWN ;switch (dev) { -#ifdef CONFIG_ENV_IS_IN_SPI_FLASH case QSPI_BOOT : - env_loc =ENVL_SPI_FLASH ; -break ; -#endif -#ifdef CONFIG_ENV_IS_IN_NAND +if (IS_ENABLED (CONFIG_ENV_IS_IN_SPI_FLASH )) +return ENVL_SPI_FLASH ; +return ENVL_NOWHERE ;case NAND_BOOT : - env_loc =ENVL_NAND ; -break ; -#endif -#ifdef CONFIG_ENV_IS_IN_MMC +if (IS_ENABLED (CONFIG_ENV_IS_IN_NAND )) +return ENVL_NAND ; +return ENVL_NOWHERE ;case SD1_BOOT :case SD2_BOOT :case SD3_BOOT :case MMC1_BOOT :case MMC2_BOOT :case MMC3_BOOT : - env_loc =ENVL_MMC ; -break ; -#endif +if (IS_ENABLED (CONFIG_ENV_IS_IN_MMC )) +return ENVL_MMC ; +else if (IS_ENABLED (CONFIG_ENV_IS_IN_EXT4 )) +return ENVL_EXT4 ; +else if (IS_ENABLED (CONFIG_ENV_IS_IN_FAT )) +return ENVL_FAT ; +return ENVL_NOWHERE ;default : -#if defined(CONFIG_ENV_IS_NOWHERE ) - env_loc =ENVL_NOWHERE ; -#endif -break ; +return ENVL_NOWHERE ; } - -return env_loc; }#ifndef ENV_IS_EMBEDDED --2.33.0
Signature · 5 lines
Best regards Oleksandr Oleksandr Suvorov [email protected]
Quoted 10 lines · Ricardo Salveti
Change boot device logic to also allow environment stored in fat and in ext4 when booting from SD or from eMMC.
As the boot device check for SD and for eMMC was depending on
ENV_IS_IN_MMCbeing defined, change the ifdef blocks atenv_get_locationto useIS_ENABLEDinstead for all modes, returning NOWHERE when no valid mode is found.Signed-off-by Ricardo Salveti <[email protected]>
PATCH 1/1 ARM: imx8m: support env in fat and ext4
In reply to Ricardo SalvetiQuoted 9 lines
Change boot device logic to also allow environment stored in fat and in ext4 when booting from SD or from eMMC.
As the boot device check for SD and for eMMC was depending onENV_IS_IN_MMCbeing defined, change the ifdef blocks atenv_get_locationto useIS_ENABLEDinstead for all modes, returning NOWHERE when no valid mode is found.Signed-off-by Ricardo Salveti <[email protected]>Reviewed-by Oleksandr Suvorov <[email protected]>Reviewed-by Fabio Estevam <[email protected]>
Applied to u-boot-imx, master, thanks !
Best regards,
Stefano Babic
Signature · 5 lines
===================================================================== DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: [email protected] =====================================================================