How do i get cpu frequency in imx8mm?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do i get cpu frequency in imx8mm?

Jump to solution
702 Views
takeshi100
Contributor III

Hi.

 

I can't get cpu frequency on imx8mm with /proc/cpuinfo etc.

How do i get it?

■conditions
BSP = i.MX Linux Yocto Project BSP 6.1.55_2.2.0
image =   image based core-image-full-cmdline-imx8mm-lpddr4-evk
hardware = custom board with imx8mm

■log(cpu info)

root@XXX:~# cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  no or unknown cpufreq driver is active on this CPU
analyzing CPU 1:
  no or unknown cpufreq driver is active on this CPU
analyzing CPU 2:
  no or unknown cpufreq driver is active on this CPU
analyzing CPU 3:
  no or unknown cpufreq driver is active on this CPU

root@XXX:~# cat /proc/cpuinfo
processor       : 0
BogoMIPS        : 16.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
 
processor       : 1
BogoMIPS        : 16.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
 
processor       : 2
BogoMIPS        : 16.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
 
processor       : 3
BogoMIPS        : 16.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4
 
root@XXX:~# lscpu
Architecture:            aarch64
  CPU op-mode(s):        32-bit, 64-bit
  Byte Order:            Little Endian
CPU(s):                  4
  On-line CPU(s) list:   0-3
Vendor ID:               ARM
  Model name:            Cortex-A53
    Model:               4
    Thread(s) per core:  1
    Core(s) per cluster: 4
    Socket(s):           -
    Cluster(s):          1
    Stepping:            r0p4
    BogoMIPS:            16.00
    Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
Caches (sum of all):
  L1d:                   128 KiB (4 instances)
  L1i:                   128 KiB (4 instances)
  L2:                    512 KiB (1 instance)
NUMA:
  NUMA node(s):          1
  NUMA node0 CPU(s):     0-3
Vulnerabilities:
  Gather data sampling:  Not affected
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Not affected
  Retbleed:              Not affected
  Spec rstack overflow:  Not affected
  Spec store bypass:     Not affected
  Spectre v1:            Mitigation; __user pointer sanitization
  Spectre v2:            Not affected
  Srbds:                 Not affected
  Tsx async abort:       Not affected

■log(kernel config)
root@XXX:~# zcat /proc/config.gz | grep CPU_FREQ
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_GOV_ATTR_SET=y
CONFIG_CPU_FREQ_GOV_COMMON=y
CONFIG_CPU_FREQ_STAT=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set
CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
CONFIG_CPU_FREQ_GOV_POWERSAVE=y
CONFIG_CPU_FREQ_GOV_USERSPACE=y
CONFIG_CPU_FREQ_GOV_ONDEMAND=y
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
CONFIG_CPU_FREQ_THERMAL=y

root@XXX:~# zcat /proc/config.gz | grep CPUFREQ
CONFIG_CPUFREQ_DT=y
CONFIG_CPUFREQ_DT_PLATDEV=y
CONFIG_ACPI_CPPC_CPUFREQ=m
CONFIG_ACPI_CPPC_CPUFREQ_FIE=y
CONFIG_ARM_SCPI_CPUFREQ=y
CONFIG_ARM_IMX_CPUFREQ_DT=y
CONFIG_ARM_SCMI_CPUFREQ=y
CONFIG_QORIQ_CPUFREQ=y
Labels (1)
0 Kudos
Reply
1 Solution
656 Views
takeshi100
Contributor III

I resolved this problem by fixing device tree.

Pending of cpufreq-dt was happend.
The cause of it was incorrect configuration of the PMIC in device tree.
The PMIC of the custom board and evk are different, and the I2C line to which they belong is also different.

■log
root@XXX:~# journalctl -b | grep cpufreq
Mar 03 09:49:19 XXX kernel: imx-cpufreq-dt imx-cpufreq-dt: cpu speed grade 3 mkt segment 0 supported-hw 0x8 0x1
Mar 03 11:38:17 XXX kernel: platform cpufreq-dt: deferred probe pending

■reference
https://www.reddit.com/r/linux4noobs/comments/1brkjja/trying_to_get_cpufreqdt_functioning_on_arm/
https://community.nxp.com/t5/i-MX-Processors/How-to-enable-cpufreq-in-Linux-imx8mmevk-5-10-35-lts-Ha...

View solution in original post

0 Kudos
Reply
3 Replies
681 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @takeshi100!

Thank you for contacting NXP Support!

 

The command should be:

cat /sys/devices/system/cpu/*/cpufreq/cpuinfo_cur_freq

 

You can see all the available options in our Linux User Guide on chapter "6.2 CPU frequency scaling"

 

https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf

 

Best Regards!

Chavira

0 Kudos
Reply
667 Views
takeshi100
Contributor III

Hi, Chavira.

Thanks for replying.


There aren't cpufreq directories.
Is there anything I need to configure?

■log

root@XXX:~# ls /sys/devices/system/cpu/cpu0/
cache cpu_capacity cpuidle crash_notes crash_notes_size hotplug node0 of_node online power regs subsystem topology uevent

Best Regards.

 

0 Kudos
Reply
657 Views
takeshi100
Contributor III

I resolved this problem by fixing device tree.

Pending of cpufreq-dt was happend.
The cause of it was incorrect configuration of the PMIC in device tree.
The PMIC of the custom board and evk are different, and the I2C line to which they belong is also different.

■log
root@XXX:~# journalctl -b | grep cpufreq
Mar 03 09:49:19 XXX kernel: imx-cpufreq-dt imx-cpufreq-dt: cpu speed grade 3 mkt segment 0 supported-hw 0x8 0x1
Mar 03 11:38:17 XXX kernel: platform cpufreq-dt: deferred probe pending

■reference
https://www.reddit.com/r/linux4noobs/comments/1brkjja/trying_to_get_cpufreqdt_functioning_on_arm/
https://community.nxp.com/t5/i-MX-Processors/How-to-enable-cpufreq-in-Linux-imx8mmevk-5-10-35-lts-Ha...

0 Kudos
Reply