summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2020-11-16 01:14:25 -0800
committerYe Li <ye.li@nxp.com>2020-11-18 21:44:09 -0800
commitf8b6a0ea9371ea8d5a3c4c6216510b4052302656 (patch)
tree903736c21fe47847818ef7de7cc021c2d2912546
parent010173028e553b3ecde036402a46d7e33b928e00 (diff)
MLK-25010 iMX8MN: Update low_drive_gpu_freq for new GPU node path
Low drive mode needs to update GPU freq in kernel DTB. But 5.4 and 5.10 kernel are using different GPU node pathes. Update low_drive_gpu_freq to support both two paths. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> (cherry picked from commit cb1c6e4279030b859133b9e4e4a0fb2c3e3cd45c)
-rw-r--r--arch/arm/mach-imx/imx8m/soc.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index 220af97a9c..c55ea8df7d 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -821,30 +821,34 @@ static int low_drive_gpu_freq(void *blob)
"/soc@0/gpu@38000000"
};
- int nodeoff, cnt, i;
+ int nodeoff, cnt, i, j;
u32 assignedclks[7];
- nodeoff = fdt_path_offset(blob, nodes_path_8mn[0]);
- if (nodeoff < 0)
- return nodeoff;
+ for (i = 0; i < ARRAY_SIZE(nodes_path_8mn); i++) {
+ nodeoff = fdt_path_offset(blob, nodes_path_8mn[i]);
+ if (nodeoff < 0)
+ continue;
+
+ cnt = fdtdec_get_int_array_count(blob, nodeoff, "assigned-clock-rates", assignedclks, 7);
+ if (cnt < 0)
+ return cnt;
- cnt = fdtdec_get_int_array_count(blob, nodeoff, "assigned-clock-rates", assignedclks, 7);
- if (cnt < 0)
- return cnt;
+ if (cnt != 7)
+ printf("Warning: %s, assigned-clock-rates count %d\n", nodes_path_8mn[i], cnt);
- if (cnt != 7)
- printf("Warning: %s, assigned-clock-rates count %d\n", nodes_path_8mn[0], cnt);
+ assignedclks[cnt - 1] = 200000000;
+ assignedclks[cnt - 2] = 200000000;
- assignedclks[cnt - 1] = 200000000;
- assignedclks[cnt - 2] = 200000000;
+ for (j = 0; j < cnt; j++) {
+ debug("<%u>, ", assignedclks[j]);
+ assignedclks[j] = cpu_to_fdt32(assignedclks[j]);
+ }
+ debug("\n");
- for (i = 0; i < cnt; i++) {
- debug("<%u>, ", assignedclks[i]);
- assignedclks[i] = cpu_to_fdt32(assignedclks[i]);
+ return fdt_setprop(blob, nodeoff, "assigned-clock-rates", &assignedclks, sizeof(assignedclks));
}
- debug("\n");
- return fdt_setprop(blob, nodeoff, "assigned-clock-rates", &assignedclks, sizeof(assignedclks));
+ return -ENOENT;
}
#endif