summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-08-23 04:40:58 -0500
committerYe Li <ye.li@nxp.com>2017-08-23 04:46:22 -0500
commitb6b4b9498a5b531f9173e60db6b9b8c2a76d6523 (patch)
tree1b8b89501644b92b7876d378314235175bb52ec2
parent3150830e67eec1848654f5d76a89e7b33661ecf5 (diff)
MLK-16246 imx8mq_evk: Update DTB to disable DCSS and HDMI for mfgtool
When booting for mfgtool, we need to disable DCSS and HDMI since the HDMI firmware won't be loaded by mfgtool. Add the detect in u-boot and update the DTB. Signed-off-by: Ye Li <ye.li@nxp.com> Acked-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r--arch/arm/cpu/armv8/imx8m/soc.c42
-rw-r--r--include/configs/imx8mq_evk.h2
2 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/imx8m/soc.c b/arch/arm/cpu/armv8/imx8m/soc.c
index 65c5f9ff65..4bd8ec6386 100644
--- a/arch/arm/cpu/armv8/imx8m/soc.c
+++ b/arch/arm/cpu/armv8/imx8m/soc.c
@@ -12,6 +12,7 @@
#include <asm/imx-common/boot_mode.h>
#include <asm/armv8/mmu.h>
#include <errno.h>
+#include <fdt_support.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -365,3 +366,44 @@ void get_board_serial(struct tag_serialnr *serialnr)
serialnr->high = 0;
}
#endif
+
+#ifdef CONFIG_OF_SYSTEM_SETUP
+int ft_system_setup(void *blob, bd_t *bd)
+{
+ if (get_boot_device() == USB_BOOT) {
+ const char *nodes_path[] = {
+ "/dcss@32e00000",
+ "/hdmi@32c00000",
+ };
+
+ int i = 0;
+ int rc;
+ int nodeoff;
+ const char *status = "disabled";
+
+ for (i = 0; i < ARRAY_SIZE(nodes_path); i++) {
+ nodeoff = fdt_path_offset(blob, nodes_path[i]);
+ if (nodeoff < 0)
+ continue; /* Not found, skip it */
+
+ printf("Found %s node\n", nodes_path[i]);
+
+add_status:
+ rc = fdt_setprop(blob, nodeoff, "status", status, strlen(status) + 1);
+ if (rc) {
+ if (rc == -FDT_ERR_NOSPACE) {
+ rc = fdt_increase_size(blob, 512);
+ if (!rc)
+ goto add_status;
+ }
+ printf("Unable to update property %s:%s, err=%s\n",
+ nodes_path[i], "status", fdt_strerror(rc));
+ } else {
+ printf("Modify %s:%s disabled\n",
+ nodes_path[i], "status");
+ }
+ }
+ }
+ return 0;
+}
+#endif
diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h
index fe8d775173..9dfba26b07 100644
--- a/include/configs/imx8mq_evk.h
+++ b/include/configs/imx8mq_evk.h
@@ -271,6 +271,8 @@
#define CONFIG_CMD_EXT2
#endif
+#define CONFIG_OF_SYSTEM_SETUP
+
#if defined(CONFIG_ANDROID_SUPPORT)
#include "imx8mq_evk_android.h"
#endif