[PATCH 11/13] imx: Update runtime SD/MMC boot env device and env variables
Peng Fan (OSS)
peng.fan at oss.nxp.com
Thu Jan 14 08:28:08 CET 2021
From: Ye Li <ye.li at nxp.com>
Since we enabled MMC alias, the USDHC index in u-boot is the usdhc port.
So we don't need to convert them for kernel and u-boot env device.
Signed-off-by: Ye Li <ye.li at nxp.com>
Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
arch/arm/mach-imx/imx8/cpu.c | 2 +-
arch/arm/mach-imx/mmc_env.c | 2 +-
arch/arm/mach-imx/mx6/soc.c | 2 +-
arch/arm/mach-imx/mx7ulp/soc.c | 2 +-
board/freescale/imx8mm_evk/imx8mm_evk.c | 9 ++++-----
board/freescale/imx8mq_evk/imx8mq_evk.c | 9 ++++-----
board/freescale/imx8qm_mek/imx8qm_mek.c | 8 +++-----
board/freescale/imx8qxp_mek/imx8qxp_mek.c | 9 ++++-----
board/freescale/mx6sabreauto/mx6sabreauto.c | 4 ++++
board/freescale/mx6sabresd/mx6sabresd.c | 4 ++++
board/freescale/mx6slevk/mx6slevk.c | 5 -----
11 files changed, 27 insertions(+), 29 deletions(-)
diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c
index 911d6a51d1..bdd4b87192 100644
--- a/arch/arm/mach-imx/imx8/cpu.c
+++ b/arch/arm/mach-imx/imx8/cpu.c
@@ -205,7 +205,7 @@ void get_board_serial(struct tag_serialnr *serialnr)
#ifdef CONFIG_ENV_IS_IN_MMC
__weak int board_mmc_get_env_dev(int devno)
{
- return CONFIG_SYS_MMC_ENV_DEV;
+ return devno;
}
int mmc_get_env_dev(void)
diff --git a/arch/arm/mach-imx/mmc_env.c b/arch/arm/mach-imx/mmc_env.c
index 9c822f721c..9c1d3cdfcb 100644
--- a/arch/arm/mach-imx/mmc_env.c
+++ b/arch/arm/mach-imx/mmc_env.c
@@ -11,7 +11,7 @@
__weak int board_mmc_get_env_dev(int devno)
{
- return CONFIG_SYS_MMC_ENV_DEV;
+ return devno;
}
int mmc_get_env_dev(void)
diff --git a/arch/arm/mach-imx/mx6/soc.c b/arch/arm/mach-imx/mx6/soc.c
index f43a2460f9..5c6eddef3b 100644
--- a/arch/arm/mach-imx/mx6/soc.c
+++ b/arch/arm/mach-imx/mx6/soc.c
@@ -492,7 +492,7 @@ int arch_cpu_init(void)
#ifdef CONFIG_ENV_IS_IN_MMC
__weak int board_mmc_get_env_dev(int devno)
{
- return CONFIG_SYS_MMC_ENV_DEV;
+ return devno;
}
static int mmc_get_boot_dev(void)
diff --git a/arch/arm/mach-imx/mx7ulp/soc.c b/arch/arm/mach-imx/mx7ulp/soc.c
index 8dd6b4d40e..6dcb8e736f 100644
--- a/arch/arm/mach-imx/mx7ulp/soc.c
+++ b/arch/arm/mach-imx/mx7ulp/soc.c
@@ -319,7 +319,7 @@ static char *get_reset_cause(char *ret)
#ifdef CONFIG_ENV_IS_IN_MMC
__weak int board_mmc_get_env_dev(int devno)
{
- return CONFIG_SYS_MMC_ENV_DEV;
+ return devno;
}
int mmc_get_env_dev(void)
diff --git a/board/freescale/imx8mm_evk/imx8mm_evk.c b/board/freescale/imx8mm_evk/imx8mm_evk.c
index 6af7100696..02dfe5bd22 100644
--- a/board/freescale/imx8mm_evk/imx8mm_evk.c
+++ b/board/freescale/imx8mm_evk/imx8mm_evk.c
@@ -52,13 +52,12 @@ int board_init(void)
return 0;
}
-int board_mmc_get_env_dev(int devno)
-{
- return devno;
-}
-
int board_late_init(void)
{
+#ifdef CONFIG_ENV_IS_IN_MMC
+ board_late_mmc_env_init();
+#endif
+
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
env_set("board_name", "EVK");
env_set("board_rev", "iMX8MM");
diff --git a/board/freescale/imx8mq_evk/imx8mq_evk.c b/board/freescale/imx8mq_evk/imx8mq_evk.c
index 1ad670b8cc..a1a77041fa 100644
--- a/board/freescale/imx8mq_evk/imx8mq_evk.c
+++ b/board/freescale/imx8mq_evk/imx8mq_evk.c
@@ -88,11 +88,6 @@ int board_init(void)
return 0;
}
-int board_mmc_get_env_dev(int devno)
-{
- return devno;
-}
-
int board_late_init(void)
{
#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
@@ -100,5 +95,9 @@ int board_late_init(void)
env_set("board_rev", "iMX8MQ");
#endif
+#ifdef CONFIG_ENV_IS_IN_MMC
+ board_late_mmc_env_init();
+#endif
+
return 0;
}
diff --git a/board/freescale/imx8qm_mek/imx8qm_mek.c b/board/freescale/imx8qm_mek/imx8qm_mek.c
index fba3baa126..106e7127dc 100644
--- a/board/freescale/imx8qm_mek/imx8qm_mek.c
+++ b/board/freescale/imx8qm_mek/imx8qm_mek.c
@@ -116,11 +116,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
}
#endif
-int board_mmc_get_env_dev(int devno)
-{
- return devno;
-}
-
int board_late_init(void)
{
char *fdt_file;
@@ -141,5 +136,8 @@ int board_late_init(void)
env_set("fdt_file", "imx8qm-mek.dtb");
}
+#ifdef CONFIG_ENV_IS_IN_MMC
+ board_late_mmc_env_init();
+#endif
return 0;
}
diff --git a/board/freescale/imx8qxp_mek/imx8qxp_mek.c b/board/freescale/imx8qxp_mek/imx8qxp_mek.c
index da55933e21..6576ee112e 100644
--- a/board/freescale/imx8qxp_mek/imx8qxp_mek.c
+++ b/board/freescale/imx8qxp_mek/imx8qxp_mek.c
@@ -140,11 +140,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
}
#endif
-int board_mmc_get_env_dev(int devno)
-{
- return devno;
-}
-
int board_late_init(void)
{
char *fdt_file;
@@ -165,5 +160,9 @@ int board_late_init(void)
env_set("fdt_file", "imx8qxp-mek.dtb");
}
+#ifdef CONFIG_ENV_IS_IN_MMC
+ board_late_mmc_env_init();
+#endif
+
return 0;
}
diff --git a/board/freescale/mx6sabreauto/mx6sabreauto.c b/board/freescale/mx6sabreauto/mx6sabreauto.c
index c031cf8538..55ff7c607c 100644
--- a/board/freescale/mx6sabreauto/mx6sabreauto.c
+++ b/board/freescale/mx6sabreauto/mx6sabreauto.c
@@ -594,6 +594,10 @@ int board_late_init(void)
env_set("board_rev", "MX6DL");
#endif
+#ifdef CONFIG_ENV_IS_IN_MMC
+ board_late_mmc_env_init();
+#endif
+
return 0;
}
diff --git a/board/freescale/mx6sabresd/mx6sabresd.c b/board/freescale/mx6sabresd/mx6sabresd.c
index 9a176f4711..cc336fd8dd 100644
--- a/board/freescale/mx6sabresd/mx6sabresd.c
+++ b/board/freescale/mx6sabresd/mx6sabresd.c
@@ -572,6 +572,10 @@ int board_late_init(void)
env_set("board_rev", "MX6DL");
#endif
+#ifdef CONFIG_ENV_IS_IN_MMC
+ board_late_mmc_env_init();
+#endif
+
return 0;
}
diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c
index 5d2f815d23..92ecdb4d3d 100644
--- a/board/freescale/mx6slevk/mx6slevk.c
+++ b/board/freescale/mx6slevk/mx6slevk.c
@@ -108,11 +108,6 @@ static void setup_iomux_uart(void)
imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
}
-int board_mmc_get_env_dev(int devno)
-{
- return devno;
-}
-
#ifdef CONFIG_DM_PMIC_PFUZE100
int power_init_board(void)
{
--
2.28.0
More information about the U-Boot
mailing list