summaryrefslogtreecommitdiff
path: root/arch/arm/mach-imx/imx8m/soc.c
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2020-11-16 01:14:25 -0800
committerYe Li <ye.li@nxp.com>2022-04-06 18:04:15 +0800
commite99706eaac11c6cca0c57d17e89f12bd56c81ae7 (patch)
tree37448264b893109f0b284829f674971053480780 /arch/arm/mach-imx/imx8m/soc.c
parent2bd5c32e8a650d516bf7a63c2a2c0c94033b4fec (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) (cherry picked from commit 968b42dd710f4c051eaf958b706fba12675531f2) (cherry picked from commit da4317bef107b78440c6df771e5eb7c6c0726f70) (cherry picked from commit f958691ff975adf40c2c2064123c781445054a95)
Diffstat (limited to 'arch/arm/mach-imx/imx8m/soc.c')
-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 ea46394e4e..69ef645023 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -951,30 +951,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