I got i.MX 8M MINI Evb and work it with default Linux software.
i.MX8MMQ can run at to 1800MHz(1.8GHz) but the log of u-boot tells cpu is running at 1.2GHz.
CPU: i.MX8MMQ rev1.0 1800 MHz (running at 1200 MHz)
CPU: Commercial temperature grade (0C to 95C) at 32C
Reset cause: POR
Model: NXP i.MX8MM EVK board
And kernel shows same information.
root@imx8mmevk:/sys/devices/system/cpu/cpufreq# cat policy0/cpuinfo_cur_freq
root@imx8mmevk:/sys/devices/system/cpu/cpufreq# cat policy0/cpuinfo_max_freq
root@imx8mmevk:/sys/devices/system/cpu/cpufreq# cat policy0/cpuinfo_min_freq
I have 2 questions.
1. Why the cpu of i.MX 8M MINI does not run at 1.8GHz but 1.2GHz?
(Why the cpu is not running at fastest clock freq?)
2. Can I configure cpu clock freq by editing device-tree file or using other tools?
it is hardcoded in uboot sources, function clock_init() clock_imx8mm.c :
/* Configure ARM at 1.2GHz */
In linux one can try to change frequency using sect.2.5.3 CPU Frequency Scaling (CPUFREQ)
and sect.6.12. Important commands AN12410
i.MX 8M Mini Power Consumption Measurement
Thank you for your reply.
I understood that u-boot configure cpu frequency by hardcoded source at clock_imx8mm.c.
But the other, in Linux, shown commands (and shown by documents) did not work in my environment.
root@imx8mmevk:~# uname -a
Linux imx8mmevk 5.10.35-lts-5.10.y+gef3f2cfc6010 #1 SMP PREEMPT Tue Jun 8 14:42:10 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
root@imx8mmevk:~# echo 1800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
-sh: echo: write error: Invalid argument
root@imx8mmevk:~# cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
Does the cpufreq device need some conditions to run?
And 22.214.171.124 Menu Configuration Options in Linux Reference Manual shows the method to configure cpu freq in menuconfig. I have not yet make kernel image but try to configure in reference to that section.
please try to reproduce issue on i.MX8M Mini EVK with Demo Image
I'm sorry for the late reply.
I made SD card by imx-image-full-imx8mmevk.wic in LF_v5.10_2.0.0_images_IMX8MMEVK but I could not change cpu freq.
So I did bitbake Linux kernel image in refer to i.MX Yocto Project User's Guide. And I succeeded to change cpu freq on Linux by created image.
I'll change the default u-boot cpu freq and DDR memory freq next.
If you want to use the scaling_setspeed, the scaling_governor must be userspace.
And it is pure linux knowledge, You can find it in the linux/Documentation/admin-guide/pm/cpufreq.rst.
echo userspace > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 1800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed