summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-11-24 01:33:21 -0600
committerYe Li <ye.li@nxp.com>2017-11-24 02:49:30 -0600
commite31f99c05c37ac35080e415cfd8c8e2a1c96f865 (patch)
treea5cff9d564153f2f62d839859b0d2ddab2d89126
parent5ad6d4cc562bac2a4ba9c05c39f039a939cbdf24 (diff)
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>
-rw-r--r--arch/arm/cpu/armv8/imx8m/soc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/imx8m/soc.c b/arch/arm/cpu/armv8/imx8m/soc.c
index a644e37b46..79cf1ead04 100644
--- a/arch/arm/cpu/armv8/imx8m/soc.c
+++ b/arch/arm/cpu/armv8/imx8m/soc.c
@@ -476,6 +476,31 @@ add_status:
nodes_path[i], "status");
}
}
+
+ const char *usb_dwc3_path = "/usb@38100000/dwc3";
+ nodeoff = fdt_path_offset(blob, usb_dwc3_path);
+ if (nodeoff >= 0) {
+ const char *speed = "high-speed";
+ printf("Found %s node\n", usb_dwc3_path);
+
+usb_modify_speed:
+
+ rc = fdt_setprop(blob, nodeoff, "maximum-speed", speed, strlen(speed) + 1);
+ if (rc) {
+ if (rc == -FDT_ERR_NOSPACE) {
+ rc = fdt_increase_size(blob, 512);
+ if (!rc)
+ goto usb_modify_speed;
+ }
+ printf("Unable to set property %s:%s, err=%s\n",
+ usb_dwc3_path, "maximum-speed", fdt_strerror(rc));
+ } else {
+ printf("Modify %s:%s = %s\n",
+ usb_dwc3_path, "maximum-speed", speed);
+ }
+ }else {
+ printf("Can't found %s node\n", usb_dwc3_path);
+ }
}
/* Disable the CPU idle for A0 chip since the HW does not support it */