Forum Discussion

Arun_Prabakatr's avatar
Arun_Prabakatr
Icon for New Contributor rankNew Contributor
3 months 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.

6 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.

    • Arun_Prabakatr's avatar
      Arun_Prabakatr
      Icon for New Contributor rankNew Contributor

      Hi AnnaK_Altera

      Thanks for the guidance. We've enabled the relevant CONFIG_CPU_FREQ options in our arm64 kernel config and included #include "socfpga_agilex5.dtsi" in our device tree, which contains all the necessary CPU-related nodes including TSC and others.

      However, after reboot, the /sys/devices/system/cpu/cpu0/cpufreq directory is still not appearing. We've also updated our kernel log file to help identify what might be missing. Could you please take a look and let us know if there's anything we've overlooked?

      Thanks again for your support.

      • BoonBengT_Altera's avatar
        BoonBengT_Altera
        Icon for Moderator rankModerator

        Dear Customer,

        As clarification has been provided and we do not hear any further follow up. Hence if there are no further inquiries during this period, I will step back and allow the community to assist with any future follow-up questions.

        Thank you for engaging with us!

        Best regards,
        Altera Technical Support