From patchwork Tue May 5 12:28:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Fan X-Patchwork-Id: 245133 List-Id: U-Boot discussion From: peng.fan at nxp.com (Peng Fan) Date: Tue, 5 May 2020 20:28:44 +0800 Subject: [PATCH 08/10] imx: imx8qm: update fdt_file according to m4 state In-Reply-To: <20200505122846.15992-1-peng.fan@nxp.com> References: <20200505122846.15992-1-peng.fan@nxp.com> Message-ID: <20200505122846.15992-9-peng.fan@nxp.com> Update fdt_file according to m4 parts state Signed-off-by: Peng Fan --- board/freescale/imx8qm_mek/imx8qm_mek.c | 13 +++++++++++++ include/configs/imx8qm_mek.h | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/board/freescale/imx8qm_mek/imx8qm_mek.c b/board/freescale/imx8qm_mek/imx8qm_mek.c index c9b9b2547e..c0cae3540f 100644 --- a/board/freescale/imx8qm_mek/imx8qm_mek.c +++ b/board/freescale/imx8qm_mek/imx8qm_mek.c @@ -123,10 +123,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", "iMX8QM"); #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", "imx8qm-mek-rpmsg.dtb"); + else + env_set("fdt_file", "imx8qm-mek.dtb"); + } + return 0; } diff --git a/include/configs/imx8qm_mek.h b/include/configs/imx8qm_mek.h index 97170dc949..22d80f1747 100644 --- a/include/configs/imx8qm_mek.h +++ b/include/configs/imx8qm_mek.h @@ -70,7 +70,7 @@ "fdt_addr=0x83000000\0" \ "fdt_high=0xffffffffffffffff\0" \ "boot_fdt=try\0" \ - "fdt_file=imx8qm-mek.dtb\0" \ + "fdt_file=undefined\0" \ "initrd_addr=0x83800000\0" \ "initrd_high=0xffffffffffffffff\0" \ "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \