summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-11-15 23:29:33 -0600
committerYe Li <ye.li@nxp.com>2017-11-16 00:05:52 -0600
commitf340d0678d8f3576e769b87984ddddf71243a29b (patch)
tree0430180ad86e4361b16809dcb1038fcf52c80b82
parentc662e0a70cc1ec2d251ac7eac48a253710acf78b (diff)
MLK-16831 imx8m: Remove cpu-idle-states property from kernel FDT for rev A0
Since i.MX8M A0 has HW issue in CPU idle, we must disable the function when running on A0 chip. This patch checks the CPU rev and remove the "cpu-idle-states" from cpu nodes to disable the CPU idle. Signed-off-by: Ye Li <ye.li@nxp.com> Tested-by: Bai Ping <ping.bai@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
-rw-r--r--arch/arm/cpu/armv8/imx8m/soc.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/imx8m/soc.c b/arch/arm/cpu/armv8/imx8m/soc.c
index 1a1e908d00..8602c4a596 100644
--- a/arch/arm/cpu/armv8/imx8m/soc.c
+++ b/arch/arm/cpu/armv8/imx8m/soc.c
@@ -473,6 +473,37 @@ add_status:
}
}
+ /* Disable the CPU idle for A0 chip since the HW does not support it */
+ if (is_soc_rev(CHIP_REV_1_0)) {
+ const char *nodes_path[] = {
+ "/cpus/cpu@0",
+ "/cpus/cpu@1",
+ "/cpus/cpu@2",
+ "/cpus/cpu@3",
+ };
+
+ int i = 0;
+ int rc;
+ int nodeoff;
+
+ 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]);
+
+ rc = fdt_delprop(blob, nodeoff, "cpu-idle-states");
+ if (rc) {
+ printf("Unable to update property %s:%s, err=%s\n",
+ nodes_path[i], "status", fdt_strerror(rc));
+ } else {
+ printf("Remove %s:%s\n",
+ nodes_path[i], "cpu-idle-states");
+ }
+ }
+ }
+
return ft_add_optee_node(blob, bd);
}
#endif