English
Language : 

UM0851 Datasheet, PDF (235/245 Pages) STMicroelectronics – SPEAr is a family of highly customizable ARM-based embedded
UM0851
Power management section
Ethernet and USB are asynchronous to data transfers, so once the network has been
initialized or the USB enumeration is complete, the clocks of the respective modules should
be on, for the modules to function properly.
10.4.3
The clock framework is mainly used by the drivers in the kernel space. This is done to allow
the drivers to fetch the clock from the clock dependency tree through the set of kernel
interfaces such as clk_get, clk_put, clk_enable etc. To illustrate this, a sample from the I2C
driver is given below:
1) During the initialization probe time, the calls are made to the clock framework to
get the clock. The return value is a handler to manage the clocks related
functionality in future.
dev->iclk = clk_get(dev->dev, "i2c_ick");
dev->fclk = clk_get(dev->dev, "i2c_fck");
2) /* Prior to the data transfers enable the clock, do the transfers and then disable
the clock.*/
clk_enable(dev->iclk);
clk_enable(dev->fclk);
..
..
/*DO DATA TRANSFERS*/
..
..
clk_disable(dev->fclk);
clk_disable(dev->iclk);
Some other kernel interfaces such as clk_get_rate() have been defined to get the clock rate,
and clk_set_rate() to set the clock rate.
Usage: CPUfreq user interface
The user interface to CPUfreq is through sysfs. CPUfreq provides the flexibility to manage
CPUs at a per-processor level (as long as hardware agrees to manage CPUs at that level).
The interface for each CPU will be under sysfs, typically at /sys/devices/system/cpu/
cpuX/cpufreq, where X ranges from 0 through N-1, with N being total number of logical
CPUs in the system.
The basic interfaces provided by CPUfreq are:
$: cd /sys/devices/system/cpu/cpu0/cpufreq
$: ls -la
affected_cpus
cpuinfo_cur_freq
: Current CPU freq
cpuinfo_max_freq
: Max CPU Freq
cpuinfo_min_freq
: Min CPU freq
scaling_available_frequencies : All available CPU freq
scaling_available_governors
: lists out all the governors supported by the
kernel.
scaling_cur_freq
: cached value of current frequency from cpufreq
subsystem.
scaling_driver
: CPU Freq driver used to change the freq
scaling_governor
: User assigned governor
scaling_max_freq
: User Controlled Upper Limit
scaling_min_freq
: User Controlled Lower Limit
To show the available governors you can use
Doc ID 16604 Rev 2
235/245