mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-04 07:51:21 +00:00 
			
		
		
		
	cpufreq: add methods to configure all CPUs at once
Sometimes it could be required to change governor or frequency for a all the online CPUs of a target. This patch provides an utility method to easily do that using a single method call. Signed-off-by: Patrick Bellasi <patrick.bellasi@arm.com>
This commit is contained in:
		@@ -349,3 +349,17 @@ class CpufreqModule(Module):
 | 
				
			|||||||
        for cpu in online_cpus:
 | 
					        for cpu in online_cpus:
 | 
				
			||||||
            self.set_frequency(cpu, freq, exact)
 | 
					            self.set_frequency(cpu, freq, exact)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def set_all_frequencies(self, freq, exact=False):
 | 
				
			||||||
 | 
					        self.target.execute(
 | 
				
			||||||
 | 
					                "for CPU in /sys/devices/system/cpu/cpu[0-9]*; do "\
 | 
				
			||||||
 | 
					                        "echo {} > $CPU/cpufreq/scaling_cur_freq; "\
 | 
				
			||||||
 | 
					                "done"\
 | 
				
			||||||
 | 
					                .format(freq), as_root=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def set_all_governors(self, governor):
 | 
				
			||||||
 | 
					        self.target.execute(
 | 
				
			||||||
 | 
					                "for CPU in /sys/devices/system/cpu/cpu[0-9]*; do "\
 | 
				
			||||||
 | 
					                        "echo {} > $CPU/cpufreq/scaling_governor; "\
 | 
				
			||||||
 | 
					                "done"\
 | 
				
			||||||
 | 
					                .format(governor), as_root=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user