tegrakernel/kernel/nvidia/Documentation/devicetree/bindings/cpufreq/tegra_cpufreq_t18x.txt

157 lines
6.5 KiB
Plaintext
Raw Permalink Normal View History

2022-02-16 09:13:02 -06:00
* Device tree binding for Nvidia Tegra18x cpufreq driver for EDVD device
--------------------------------------------
This document defines the device-specific binding for the Tegra18x cpufreq
driver. It should not contain bindings for generic tegra cpufreq driver
which are common across all the tegra cpufreq platform driver.
The Tegra18x cpufreq driver adjusts CPU frequency by writing voltage and
freq hint in EDVD per core volt freq request registers. It calculates per
core cpufreq by reading per core cycle counters. Cycles are measured by
reading EDVD per core clock count registers and divided by ref clock counter.
The ressult is multiplied by ref clock.
Tegra18x cpufreq driver considers these EDVD registers as device to measure
and adjust cpu freq. There is one instance of EDVD for the Denver cluster
and one for the A57 cluster.
Required properties:
- compatible: should be "nvidia,tegra18x-cpufreq".
- reg: an array of four 64-bit unsigned integers.
the base address and size for Denver EDVD aperture and the base
address and size for the A57 EDVD aperture.
- status: "okay" or "disabled" to enable/disable the node.
Optional properties:
- freq_table_step_size:
Cpu frequency table step size. If not provided, default value 4.
For example, if list of original available frequencies(in KHz) are:
345600 384000 422400 460800 499200 537600 576000 614400 652800 691200
729600 768000 806400 844800 883200 921600 960000 998400 1036800 1075200
1113600 1152000 1190400 1228800 1267200 1305600 1344000 1382400 1420800
1459200 1497600 1536000 1574400 1612800 1651200 1689600 1728000 1766400
1804800 1843200
Setting freq_table_step_size to 1 will include all these frequencies in
cpufreq table as available frequencies.
Setting freq_table_step_size to 2 will skip alternative entries and will
include remaining entries in cpufreq table as available frequencies.
With freq_table_step_size as 2, cpufreq table available frequencies will be:
345600 422400 499200 576000 652800 729600 806400 883200 960000 1036800
1113600 1190400 1267200 1344000 1420800 1497600 1574400 1651200 1728000
1804800 1843200
Similarly, freq_table_step_size of value 3 will skip every 2nd and 3rd entries
in groups of 3 entries consecutively.
- nvidia,enable-autocc3: Enable auto_cc3.
Auto cc3 is the idle state where freq request is not considered for the cpus
in WFI/WFE. It has per cluster, <cluster_no enable/disable> entries to enable
/ disable per cluster cc3.
It assumes that 0th index of the array as entry for 0th(M_CLUSTER)
cluster. It should be set as <cluster_no and enable/disable> way.
Therfore 1nd index is considered as enable/disable value for
0th cluster. Like that 2nd index will have entry for 1st(B_cluster)
cluster 3rd index will have enable/disable value for 1st cluster.
Assumptions -
clusters values -
0 - M_CLUSTER
1 - B_CLUSTER
Disable/Enable
0 - Disable
1 - Enable
* Need to fill all the clusters state.
* If a cluster is disabled its cc3 freq will be Don't care.
- nvidia,autocc3-freq: autocc3 cluster freq.
If a cluster goes in idle, cc3 freq will be requested for the cluster.
It has per cluster values to request per cluster cc3 freq.
It takes values as <cluster_no freq_in_khz>. It assumes 0th index of
the array has entry of 0th(M_CLUSTER) cluster, 1st index as 0th cluster
cc3 freq, 2nd index as 1st(B_CLUSTER) cluster and 3rd index as 1st
cluster cc3 freq.
Assumptions -
clusters values -
0 - M_CLUSTER
1 - B_CLUSTER
freq_in_khz values -
0 - Fmin@Vmin
freq_khz - cc3 freq for the cluster
* Need to fill all the clusters state.
* If a cluster is disabled its cc3 freq will be Don't care.
Example 1:
----------
cpufreq@e070000 {
compatible = "nvidia,tegra18x-cpufreq";
reg = <0x0 0x0e070000 0x0 0x1000>, /* M/Denver cluster */
<0x0 0x0e060000 0x0 0x1000>; /* B/ARM cluster */
status = "disabled";
};
Example 2:
----------
cpufreq@e070000 {
compatible = "nvidia,tegra18x-cpufreq";
reg = <0x0 0x0e070000 0x0 0x1000>, /* M/Denver cluster */
<0x0 0x0e060000 0x0 0x1000>; /* B/ARM cluster */
freq_table_step_size = /bits/ 16 <1>;
};
Example 3: cpufreq and auto-cc3 enabled, freq = Fmax@Vmin for each cluster
----------
cpufreq@e070000 {
compatible = "nvidia,tegra18x-cpufreq";
reg = <0x0 0x0e070000 0x0 0x1000>, /* M/Denver cluster */
<0x0 0x0e060000 0x0 0x1000>; /* B/ARM cluster */
status = "okay";
nvidia,enable-autocc3 = <0 1>, /* M_CLUSTER Enable*/
<1 1>; /* B_CLUSTER Enable*/
nvidia,autocc3-freq = <0 0>, /* M_CLUSTER Fmin@vmin*/
<1 0>; /* B_CLUSTER Fmin@vmin*/
};
Example 4: cpufreq and auto-cc3 enabled, cc3_freq for both cluster
----------
cpufreq@e070000 {
compatible = "nvidia,tegra18x-cpufreq";
reg = <0x0 0x0e070000 0x0 0x1000>, /* M/Denver cluster */
<0x0 0x0e060000 0x0 0x1000>; /* B/ARM cluster */
status = "okay";
nvidia,enable-autocc3 = <0 0>, /* M_CLUSTER Disable*/
<1 1>; /* B_CLUSTER Enable*/
nvidia,autocc3-freq = <0 0>, /* M_CLUSTER Fmin@vmin*/
<1 0>; /* B_CLUSTER Fmin@vmin*/
};
Example 5: cpufreq and auto-cc3 enabled, cc3_freq for M cluster
auto-cc3 is disabled for B cluster
----------
cpufreq@e070000 {
compatible = "nvidia,tegra18x-cpufreq";
reg = <0x0 0x0e070000 0x0 0x1000>, /* M/Denver cluster */
<0x0 0x0e060000 0x0 0x1000>; /* B/ARM cluster */
status = "okay";
nvidia,enable-autocc3 = <0 0>, /* M_CLUSTER Enable*/
<1 0>; /* B_CLUSTER Disable*/
};
Example 6: cpufreq and auto-cc3 enabled, freq = Fmax@Vmin for M cluster
auto-cc3 is disabled for B cluster
----------
cpufreq@e070000 {
compatible = "nvidia,tegra18x-cpufreq";
reg = <0x0 0x0e070000 0x0 0x1000>, /* M/Denver cluster */
<0x0 0x0e060000 0x0 0x1000>; /* B/ARM cluster */
status = "okay";
nvidia,enable-autocc3 = <0 1>, /* M_CLUSTER Enable*/
<1 1>; /* B_CLUSTER Enable*/
nvidia,autocc3-freq = <0 512000>, /* M_CLUSTER 512Mhz*/
<1 644000>; /* B_CLUSTER 644 Mhz*/
};