From 89512c1b28add9daf8001c51a44b9da826cbb9ad Mon Sep 17 00:00:00 2001 From: Ye Li Date: Wed, 23 Aug 2017 04:40:58 -0500 Subject: [PATCH] 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 Acked-by: Peng Fan (cherry picked from commit 1d01cec0296d56ba8436941864d8da81013e0732) --- arch/arm/mach-imx/imx8m/soc.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 514e2f7346..cf0ef0d2c6 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -186,6 +186,40 @@ int ft_system_setup(void *blob, bd_t *bd) int i = 0; int rc; int nodeoff; + + if (get_boot_device() == USB_BOOT) { + static const char *nodes_path[] = { + "/dcss@32e00000", + "/hdmi@32c00000", + "/hdmi_cec@32c33800", + "/hdmi_drm@32c00000", + "/display-subsystem", + "/sound-hdmi" + }; + 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"); + } + } /* Disable the CPU idle for A0 chip since the HW does not support it */ if (is_soc_rev(CHIP_REV_1_0)) {