Difference between revisions of "Tests:R-CAR-GEN3-CPUFreq"

From eLinux.org
Jump to: navigation, search
(Kernel Version Configuration)
(Change to cpu sysfs directory)
Line 33: Line 33:
 
</pre>
 
</pre>
  
=== Change to cpu sysfs directory ===
+
=== Change to cpu0's cpufreq sysfs directory ===
  
 
<pre>
 
<pre>
# cd /sys/devices/system/cpu
+
# cd /sys/devices/system/cpu/cpu0/cpufreq
 
</pre>
 
</pre>
  

Revision as of 05:42, 3 January 2018

Kernel Version Configuration

CPUFreq support for R-Car Gen3 H3 (ES1.*) is currently available in a topic branch:

https://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git topic/rcar-gen3-cpufreq-v4

The ARM64 renesas_defconfig present in the above branch was used.

Hardware Environment

  • Salvator-X/r8a7795 (Gen 3 R-Car H3 SoC) ES1.0
  • Salvator-XS/r8a7795 (Gen 3 R-Car H3 SoC) ES2.0
  • Salvator-X/r8a7796 (Gen 3 R-Car M3-W SoC) ES1.0

The results shown below are from tests performed on the Salvator-X/r8a7795.
The Salvator-XS/r8a7795 gives the same results.
The Salvator-X/r8a7796 gives similar results but with 2 CPU cores rather than 4.

Verify CPUFreq Support

Verify Driver Initialisation

Initialisation of CPUFreq can be checked by checking for the presence of cpufreq directories in sysfs

# find /sys -name cpufreq
/sys/devices/system/cpu/cpu3/cpufreq
/sys/devices/system/cpu/cpu1/cpufreq
/sys/devices/system/cpu/cpufreq
/sys/devices/system/cpu/cpu2/cpufreq
/sys/devices/system/cpu/cpu0/cpufreq
/sys/module/cpufreq

Change to cpu0's cpufreq sysfs directory

# cd /sys/devices/system/cpu/cpu0/cpufreq

Inspect Available Frequencies

# grep . */cpufreq/scaling_available_frequencies
cpu0/cpufreq/scaling_available_frequencies:500000 1000000 1500000 
cpu1/cpufreq/scaling_available_frequencies:500000 1000000 1500000 
cpu2/cpufreq/scaling_available_frequencies:500000 1000000 1500000 
cpu3/cpufreq/scaling_available_frequencies:500000 1000000 1500000 

Inspect Available Governors

# grep . */cpufreq/scaling_available_governors
cpu0/cpufreq/scaling_available_governors:conservative performance 
cpu1/cpufreq/scaling_available_governors:conservative performance 
cpu2/cpufreq/scaling_available_governors:conservative performance 
cpu3/cpufreq/scaling_available_governors:conservative performance 

Exercise CPUFreq Support

Change to cpu sysfs directory

# cd /sys/devices/system/cpu

Set Governor

The conservative governor will be used for this test

# echo conservative > cpu0/cpufreq/scaling_governor

# grep . */cpufreq/scaling_governor
cpu0/cpufreq/scaling_governor:conservative
cpu1/cpufreq/scaling_governor:conservative
cpu2/cpufreq/scaling_governor:conservative
cpu3/cpufreq/scaling_governor:conservative

Observe CPU Frequency Changes

On an idle system:

  1. Check the frequency; it should be a low value
  2. Apply some load to the system
  3. Check the frequency again; it should be a higher value
  4. Wait; the system is once again idle
  5. Check the frequency one last time; it should be reduced again
# grep . */cpufreq/scaling_cur_freq                                            
cpu0/cpufreq/scaling_cur_freq:500000
cpu1/cpufreq/scaling_cur_freq:500000
cpu2/cpufreq/scaling_cur_freq:500000
cpu3/cpufreq/scaling_cur_freq:500000

# for i in $(seq 1000000); do :; done
# grep . */cpufreq/scaling_cur_freq
cpu0/cpufreq/scaling_cur_freq:1500000
cpu1/cpufreq/scaling_cur_freq:1500000
cpu2/cpufreq/scaling_cur_freq:1500000
cpu3/cpufreq/scaling_cur_freq:1500000

# sleep 5
# grep . */cpufreq/scaling_cur_freq
cpu0/cpufreq/scaling_cur_freq:500000
cpu1/cpufreq/scaling_cur_freq:500000
cpu2/cpufreq/scaling_cur_freq:500000
cpu3/cpufreq/scaling_cur_freq:500000