imx: imx8qxp: update fdt_file according to m4 state
authorPeng Fan <peng.fan@nxp.com>
Tue, 5 May 2020 12:28:45 +0000 (20:28 +0800)
committerStefano Babic <sbabic@denx.de>
Sun, 10 May 2020 18:55:20 +0000 (20:55 +0200)
Update fdt_file according to m4 parts state

Signed-off-by: Peng Fan <peng.fan@nxp.com>
board/freescale/imx8qxp_mek/imx8qxp_mek.c
include/configs/imx8qxp_mek.h

index 93f0cd827c31557dc2c8c4f3b8ddedef922d453d..dc9ffaabf205aacb7f41a0b9ba6a89a0899d850e 100644 (file)
@@ -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;
 }
index 0aaca3325bd3f9a03625fb39081bd63b94baf276..341e93e61e747610662c630a4c3fd81130c8100f 100644 (file)
@@ -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" \