Commit 32943c7d81ebd70ddc1916a2523fbff512733f93

Authored by Ye Li
1 parent e18f601c5c

MLK-16974 imx8m: Modify kernel DTB to limit USB to high-speed for mfgtool

We found USB issue when using super-speed for mfgtool, temporally work around
the problem to use high-speed only.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit e31f99c05c37ac35080e415cfd8c8e2a1c96f865)
(cherry picked from commit 6134c7ee3967fe303bdb2bb7e981ac698b909c5d)
(cherry picked from commit 46f606811b9adfb5bff35ef487de31bae8109801)

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

arch/arm/mach-imx/imx8m/soc.c
... ... @@ -384,6 +384,32 @@
384 384 }
385 385 }
386 386  
  387 + const char *usb_dwc3_path = "/usb@38100000/dwc3";
  388 + nodeoff = fdt_path_offset(blob, usb_dwc3_path);
  389 + if (nodeoff >= 0) {
  390 + const char *speed = "high-speed";
  391 + printf("Found %s node\n", usb_dwc3_path);
  392 +
  393 +usb_modify_speed:
  394 +
  395 + rc = fdt_setprop(blob, nodeoff, "maximum-speed", speed, strlen(speed) + 1);
  396 + if (rc) {
  397 + if (rc == -FDT_ERR_NOSPACE) {
  398 + rc = fdt_increase_size(blob, 512);
  399 + if (!rc)
  400 + goto usb_modify_speed;
  401 + }
  402 + printf("Unable to set property %s:%s, err=%s\n",
  403 + usb_dwc3_path, "maximum-speed", fdt_strerror(rc));
  404 + } else {
  405 + printf("Modify %s:%s = %s\n",
  406 + usb_dwc3_path, "maximum-speed", speed);
  407 + }
  408 + }else {
  409 + printf("Can't found %s node\n", usb_dwc3_path);
  410 + }
  411 + }
  412 +
387 413 /* Disable the CPU idle for A0 chip since the HW does not support it */
388 414 if (is_soc_rev(CHIP_REV_1_0)) {
389 415 static const char * const nodes_path[] = {