Commit e18f601c5c7cce6f7365e467f9d1bbe3146f73dd

Authored by Ye Li
1 parent d9b7281ddc

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>
(cherry picked from commit 1d01cec0296d56ba8436941864d8da81013e0732)
(cherry picked from commit 89512c1b28add9daf8001c51a44b9da826cbb9ad)
(cherry picked from commit 61d9b430f9a21754441923d9aea350a931f7f7a5)

Showing 1 changed file with 34 additions and 0 deletions Side-by-side Diff

arch/arm/mach-imx/imx8m/soc.c
... ... @@ -350,6 +350,40 @@
350 350 int rc;
351 351 int nodeoff;
352 352  
  353 + if (get_boot_device() == USB_BOOT) {
  354 + static const char *nodes_path[] = {
  355 + "/dcss@32e00000",
  356 + "/hdmi@32c00000",
  357 + "/hdmi_cec@32c33800",
  358 + "/hdmi_drm@32c00000",
  359 + "/display-subsystem",
  360 + "/sound-hdmi"
  361 + };
  362 + const char *status = "disabled";
  363 +
  364 + for (i = 0; i < ARRAY_SIZE(nodes_path); i++) {
  365 + nodeoff = fdt_path_offset(blob, nodes_path[i]);
  366 + if (nodeoff < 0)
  367 + continue; /* Not found, skip it */
  368 +
  369 + printf("Found %s node\n", nodes_path[i]);
  370 +
  371 +add_status:
  372 + rc = fdt_setprop(blob, nodeoff, "status", status, strlen(status) + 1);
  373 + if (rc) {
  374 + if (rc == -FDT_ERR_NOSPACE) {
  375 + rc = fdt_increase_size(blob, 512);
  376 + if (!rc)
  377 + goto add_status;
  378 + }
  379 + printf("Unable to update property %s:%s, err=%s\n",
  380 + nodes_path[i], "status", fdt_strerror(rc));
  381 + } else {
  382 + printf("Modify %s:%s disabled\n",
  383 + nodes_path[i], "status");
  384 + }
  385 + }
  386 +
353 387 /* Disable the CPU idle for A0 chip since the HW does not support it */
354 388 if (is_soc_rev(CHIP_REV_1_0)) {
355 389 static const char * const nodes_path[] = {