diff mbox series

[09/10] imx: imx8qxp: update fdt_file according to m4 state

Message ID 20200505122846.15992-10-peng.fan@nxp.com
State Accepted
Commit a6c36f15ebc5e004c5914bb55ef93bb453e640db
Headers show
Series imx: imx8qm/qxp update | expand

Commit Message

Peng Fan May 5, 2020, 12:28 p.m. UTC
Update fdt_file according to m4 parts state

Signed-off-by: Peng Fan <peng.fan at nxp.com>
---
 board/freescale/imx8qxp_mek/imx8qxp_mek.c | 13 +++++++++++++
 include/configs/imx8qxp_mek.h             |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)

Comments

Stefano Babic May 11, 2020, 10:15 a.m. UTC | #1
> Update fdt_file according to m4 parts state
> Signed-off-by: Peng Fan <peng.fan at nxp.com>
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/board/freescale/imx8qxp_mek/imx8qxp_mek.c b/board/freescale/imx8qxp_mek/imx8qxp_mek.c
index 93f0cd827c..dc9ffaabf2 100644
--- a/board/freescale/imx8qxp_mek/imx8qxp_mek.c
+++ b/board/freescale/imx8qxp_mek/imx8qxp_mek.c
@@ -146,10 +146,23 @@  int board_mmc_get_env_dev(int devno)
 
 int board_late_init(void)
 {
+	char *fdt_file;
+	bool m4_booted;
+
 #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
 	env_set("board_name", "MEK");
 	env_set("board_rev", "iMX8QXP");
 #endif
 
+	fdt_file = env_get("fdt_file");
+	m4_booted = m4_parts_booted();
+
+	if (fdt_file && !strcmp(fdt_file, "undefined")) {
+		if (m4_booted)
+			env_set("fdt_file", "imx8qxp-mek-rpmsg.dtb");
+		else
+			env_set("fdt_file", "imx8qxp-mek.dtb");
+	}
+
 	return 0;
 }
diff --git a/include/configs/imx8qxp_mek.h b/include/configs/imx8qxp_mek.h
index 0aaca3325b..341e93e61e 100644
--- a/include/configs/imx8qxp_mek.h
+++ b/include/configs/imx8qxp_mek.h
@@ -69,7 +69,7 @@ 
 	"fdt_addr=0x83000000\0"			\
 	"fdt_high=0xffffffffffffffff\0"		\
 	"boot_fdt=try\0" \
-	"fdt_file=imx8qxp-mek.dtb\0" \
+	"fdt_file=undefined\0" \
 	"initrd_addr=0x83800000\0"		\
 	"initrd_high=0xffffffffffffffff\0" \
 	"mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \