Forum Discussion

Arun_Prabakatr's avatar
Arun_Prabakatr
Icon for New Contributor rankNew Contributor
29 days ago

To evaluate and monitor CPU frequency behavior in the Kernel OS

We need to verify CPU frequency behaviour straight from the Linux kernel because we are currently working with a customised Agilex 5 System-on-Module (SOM). Ensuring appropriate frequency scaling and governor functionality under a range of workloads is our aim. Would you kindly provide guidance regarding the device tree modifications, kernel configurations, and testing methods needed to enable and validate CPU frequency scaling on this platform? I would be very grateful for any advice or reference materials that are specific to Agilex 5.

4 Replies

  • Hi Arun,

    In the arm64 config you can see the CPU_FREQ options which will help you implement governor functionality with frequency scaling: https://github.com/altera-fpga/linux-socfpga/blob/socfpga-6.12.33-lts/arch/arm64/configs/defconfig

    Your kernel will look for operating points in your device tree to set available frequencies. Here is an idea of what the implementation could look like:

    cpu0: cpu@0 {
        ...
        operating-points-v2 = <&cpu_opp_table>;
        ...
    };
    
    ...
    
    cpu_opp_table: opp-table {
        compatible = "operating-points-v2";
        opp-1000000000 {
            opp-hz = /bits/ 64 <1000000000>;
            opp-microvolt = <950000>;
        };
        opp-1400000000 {
            opp-hz = /bits/ 64 <1400000000>;
            opp-microvolt = <1050000>;
        };
    };

    After reboot you can use the /sys/devices/system/cpu/cpu0/cpufreq utilities to check available governors, frequencies, and watch how the CPU responds to stress.