Merge branch 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm

Pull opertaing performance points (OPP) framework fixes for 5.10-rc1
from Viresh Kumar:

"- Return -EPROBE_DEFER properly from dev_pm_opp_get_opp_table()
   (Stephan Gerhold).

 - Minor cleanups around required-opps (Stephan Gerhold).

 - Extends opp-supported-hw property to contain multiple versions
   (Viresh Kumar).

 - Multiple cleanups around dev_pm_opp_attach_genpd() (Viresh Kumar).

 - Multiple fixes, cleanups in the OPP core for overall better design
   (Viresh Kumar)."

* 'opp/linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm:
  opp: Allow opp-level to be set to 0
  opp: Prevent memory leak in dev_pm_opp_attach_genpd()
  ARM: tegra: Pass multiple versions in opp-supported-hw property
  opp: Allow opp-supported-hw to contain multiple versions
  dt-bindings: opp: Allow opp-supported-hw to contain multiple versions
  opp: Set required OPPs in reverse order when scaling down
  opp: Reduce code duplication in _set_required_opps()
  opp: Drop unnecessary check from dev_pm_opp_attach_genpd()
  opp: Handle multiple calls for same OPP table in _of_add_opp_table_v1()
  opp: Allow dev_pm_opp_get_opp_table() to return -EPROBE_DEFER
  opp: Remove _dev_pm_opp_find_and_remove_table() wrapper
  opp: Split out _opp_set_rate_zero()
  opp: Reuse the enabled flag in !target_freq path
  opp: Rename regulator_enabled and use it as status of all resources
This commit is contained in:
Rafael J. Wysocki 2020-10-05 13:31:32 +02:00
commit 757e282188
11 changed files with 321 additions and 1577 deletions

View File

@ -154,25 +154,27 @@ Optional properties:
- opp-suspend: Marks the OPP to be used during device suspend. If multiple OPPs - opp-suspend: Marks the OPP to be used during device suspend. If multiple OPPs
in the table have this, the OPP with highest opp-hz will be used. in the table have this, the OPP with highest opp-hz will be used.
- opp-supported-hw: This enables us to select only a subset of OPPs from the - opp-supported-hw: This property allows a platform to enable only a subset of
larger OPP table, based on what version of the hardware we are running on. We the OPPs from the larger set present in the OPP table, based on the current
still can't have multiple nodes with the same opp-hz value in OPP table. version of the hardware (already known to the operating system).
It's a user defined array containing a hierarchy of hardware version numbers, Each block present in the array of blocks in this property, represents a
supported by the OPP. For example: a platform with hierarchy of three levels sub-group of hardware versions supported by the OPP. i.e. <sub-group A>,
of versions (A, B and C), this field should be like <X Y Z>, where X <sub-group B>, etc. The OPP will be enabled if _any_ of these sub-groups match
corresponds to Version hierarchy A, Y corresponds to version hierarchy B and Z the hardware's version.
corresponds to version hierarchy C.
Each level of hierarchy is represented by a 32 bit value, and so there can be Each sub-group is a platform defined array representing the hierarchy of
only 32 different supported version per hierarchy. i.e. 1 bit per version. A hardware versions supported by the platform. For a platform with three
value of 0xFFFFFFFF will enable the OPP for all versions for that hierarchy hierarchical levels of version (X.Y.Z), this field shall look like
level. And a value of 0x00000000 will disable the OPP completely, and so we
never want that to happen.
If 32 values aren't sufficient for a version hierarchy, than that version opp-supported-hw = <X1 Y1 Z1>, <X2 Y2 Z2>, <X3 Y3 Z3>.
hierarchy can be contained in multiple 32 bit values. i.e. <X Y Z1 Z2> in the
above example, Z1 & Z2 refer to the version hierarchy Z. Each level (eg. X1) in version hierarchy is represented by a 32 bit value, one
bit per version and so there can be maximum 32 versions per level. Logical AND
(&) operation is performed for each level with the hardware's level version
and a non-zero output for _all_ the levels in a sub-group means the OPP is
supported by hardware. A value of 0xFFFFFFFF for each level in the sub-group
will enable the OPP for all versions for the hardware.
- status: Marks the node enabled/disabled. - status: Marks the node enabled/disabled.
@ -503,7 +505,6 @@ Example 5: opp-supported-hw
*/ */
opp-supported-hw = <0xF 0xFFFFFFFF 0xFFFFFFFF> opp-supported-hw = <0xF 0xFFFFFFFF 0xFFFFFFFF>
opp-hz = /bits/ 64 <600000000>; opp-hz = /bits/ 64 <600000000>;
opp-microvolt = <915000 900000 925000>;
... ...
}; };
@ -516,7 +517,17 @@ Example 5: opp-supported-hw
*/ */
opp-supported-hw = <0x20 0xff0000ff 0x0000f4f0> opp-supported-hw = <0x20 0xff0000ff 0x0000f4f0>
opp-hz = /bits/ 64 <800000000>; opp-hz = /bits/ 64 <800000000>;
opp-microvolt = <915000 900000 925000>; ...
};
opp-900000000 {
/*
* Supports:
* - All cuts and substrate where process version is 0x2.
* - All cuts and process where substrate version is 0x2.
*/
opp-supported-hw = <0xFFFFFFFF 0xFFFFFFFF 0x02>, <0xFFFFFFFF 0x01 0xFFFFFFFF>
opp-hz = /bits/ 64 <900000000>;
... ...
}; };
}; };

View File

@ -26,14 +26,6 @@ opp@456000000,800 {
opp-microvolt = <800000 800000 1125000>; opp-microvolt = <800000 800000 1125000>;
}; };
opp@456000000,800,2,2 {
opp-microvolt = <800000 800000 1125000>;
};
opp@456000000,800,3,2 {
opp-microvolt = <800000 800000 1125000>;
};
opp@456000000,825 { opp@456000000,825 {
opp-microvolt = <825000 825000 1125000>; opp-microvolt = <825000 825000 1125000>;
}; };
@ -46,10 +38,6 @@ opp@608000000,800 {
opp-microvolt = <800000 800000 1125000>; opp-microvolt = <800000 800000 1125000>;
}; };
opp@608000000,800,3,2 {
opp-microvolt = <800000 800000 1125000>;
};
opp@608000000,825 { opp@608000000,825 {
opp-microvolt = <825000 825000 1125000>; opp-microvolt = <825000 825000 1125000>;
}; };
@ -78,18 +66,6 @@ opp@760000000,875 {
opp-microvolt = <875000 875000 1125000>; opp-microvolt = <875000 875000 1125000>;
}; };
opp@760000000,875,1,1 {
opp-microvolt = <875000 875000 1125000>;
};
opp@760000000,875,0,2 {
opp-microvolt = <875000 875000 1125000>;
};
opp@760000000,875,1,2 {
opp-microvolt = <875000 875000 1125000>;
};
opp@760000000,900 { opp@760000000,900 {
opp-microvolt = <900000 900000 1125000>; opp-microvolt = <900000 900000 1125000>;
}; };
@ -134,14 +110,6 @@ opp@912000000,950 {
opp-microvolt = <950000 950000 1125000>; opp-microvolt = <950000 950000 1125000>;
}; };
opp@912000000,950,0,2 {
opp-microvolt = <950000 950000 1125000>;
};
opp@912000000,950,2,2 {
opp-microvolt = <950000 950000 1125000>;
};
opp@912000000,1000 { opp@912000000,1000 {
opp-microvolt = <1000000 1000000 1125000>; opp-microvolt = <1000000 1000000 1125000>;
}; };
@ -170,10 +138,6 @@ opp@1000000000,1000 {
opp-microvolt = <1000000 1000000 1125000>; opp-microvolt = <1000000 1000000 1125000>;
}; };
opp@1000000000,1000,0,2 {
opp-microvolt = <1000000 1000000 1125000>;
};
opp@1000000000,1025 { opp@1000000000,1025 {
opp-microvolt = <1025000 1025000 1125000>; opp-microvolt = <1025000 1025000 1125000>;
}; };

View File

@ -37,19 +37,8 @@ opp@456000000,750 {
opp@456000000,800 { opp@456000000,800 {
clock-latency-ns = <400000>; clock-latency-ns = <400000>;
opp-supported-hw = <0x03 0x0006>; opp-supported-hw = <0x03 0x0006>, <0x04 0x0004>,
opp-hz = /bits/ 64 <456000000>; <0x08 0x0004>;
};
opp@456000000,800,2,2 {
clock-latency-ns = <400000>;
opp-supported-hw = <0x04 0x0004>;
opp-hz = /bits/ 64 <456000000>;
};
opp@456000000,800,3,2 {
clock-latency-ns = <400000>;
opp-supported-hw = <0x08 0x0004>;
opp-hz = /bits/ 64 <456000000>; opp-hz = /bits/ 64 <456000000>;
}; };
@ -67,13 +56,7 @@ opp@608000000,750 {
opp@608000000,800 { opp@608000000,800 {
clock-latency-ns = <400000>; clock-latency-ns = <400000>;
opp-supported-hw = <0x04 0x0006>; opp-supported-hw = <0x04 0x0006>, <0x08 0x0004>;
opp-hz = /bits/ 64 <608000000>;
};
opp@608000000,800,3,2 {
clock-latency-ns = <400000>;
opp-supported-hw = <0x08 0x0004>;
opp-hz = /bits/ 64 <608000000>; opp-hz = /bits/ 64 <608000000>;
}; };
@ -115,25 +98,8 @@ opp@760000000,850 {
opp@760000000,875 { opp@760000000,875 {
clock-latency-ns = <400000>; clock-latency-ns = <400000>;
opp-supported-hw = <0x04 0x0001>; opp-supported-hw = <0x04 0x0001>, <0x02 0x0002>,
opp-hz = /bits/ 64 <760000000>; <0x01 0x0004>, <0x02 0x0004>;
};
opp@760000000,875,1,1 {
clock-latency-ns = <400000>;
opp-supported-hw = <0x02 0x0002>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,875,0,2 {
clock-latency-ns = <400000>;
opp-supported-hw = <0x01 0x0004>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,875,1,2 {
clock-latency-ns = <400000>;
opp-supported-hw = <0x02 0x0004>;
opp-hz = /bits/ 64 <760000000>; opp-hz = /bits/ 64 <760000000>;
}; };
@ -199,19 +165,8 @@ opp@912000000,925 {
opp@912000000,950 { opp@912000000,950 {
clock-latency-ns = <400000>; clock-latency-ns = <400000>;
opp-supported-hw = <0x02 0x0006>; opp-supported-hw = <0x02 0x0006>, <0x01 0x0004>,
opp-hz = /bits/ 64 <912000000>; <0x04 0x0004>;
};
opp@912000000,950,0,2 {
clock-latency-ns = <400000>;
opp-supported-hw = <0x01 0x0004>;
opp-hz = /bits/ 64 <912000000>;
};
opp@912000000,950,2,2 {
clock-latency-ns = <400000>;
opp-supported-hw = <0x04 0x0004>;
opp-hz = /bits/ 64 <912000000>; opp-hz = /bits/ 64 <912000000>;
}; };
@ -253,13 +208,7 @@ opp@1000000000,975 {
opp@1000000000,1000 { opp@1000000000,1000 {
clock-latency-ns = <400000>; clock-latency-ns = <400000>;
opp-supported-hw = <0x02 0x0006>; opp-supported-hw = <0x02 0x0006>, <0x01 0x0004>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,1000,0,2 {
clock-latency-ns = <400000>;
opp-supported-hw = <0x01 0x0004>;
opp-hz = /bits/ 64 <1000000000>; opp-hz = /bits/ 64 <1000000000>;
}; };

View File

@ -74,22 +74,6 @@ opp@475000000,850 {
opp-microvolt = <850000 850000 1250000>; opp-microvolt = <850000 850000 1250000>;
}; };
opp@475000000,850,0,1 {
opp-microvolt = <850000 850000 1250000>;
};
opp@475000000,850,0,4 {
opp-microvolt = <850000 850000 1250000>;
};
opp@475000000,850,0,7 {
opp-microvolt = <850000 850000 1250000>;
};
opp@475000000,850,0,8 {
opp-microvolt = <850000 850000 1250000>;
};
opp@608000000,850 { opp@608000000,850 {
opp-microvolt = <850000 850000 1250000>; opp-microvolt = <850000 850000 1250000>;
}; };
@ -106,62 +90,6 @@ opp@640000000,850 {
opp-microvolt = <850000 850000 1250000>; opp-microvolt = <850000 850000 1250000>;
}; };
opp@640000000,850,1,1 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,2,1 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,3,1 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,1,4 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,2,4 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,3,4 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,1,7 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,2,7 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,3,7 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,4,7 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,1,8 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,2,8 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,3,8 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,850,4,8 {
opp-microvolt = <850000 850000 1250000>;
};
opp@640000000,900 { opp@640000000,900 {
opp-microvolt = <900000 900000 1250000>; opp-microvolt = <900000 900000 1250000>;
}; };
@ -170,94 +98,10 @@ opp@760000000,850 {
opp-microvolt = <850000 850000 1250000>; opp-microvolt = <850000 850000 1250000>;
}; };
opp@760000000,850,3,1 {
opp-microvolt = <850000 850000 1250000>;
};
opp@760000000,850,3,2 {
opp-microvolt = <850000 850000 1250000>;
};
opp@760000000,850,3,3 {
opp-microvolt = <850000 850000 1250000>;
};
opp@760000000,850,3,4 {
opp-microvolt = <850000 850000 1250000>;
};
opp@760000000,850,3,7 {
opp-microvolt = <850000 850000 1250000>;
};
opp@760000000,850,4,7 {
opp-microvolt = <850000 850000 1250000>;
};
opp@760000000,850,3,8 {
opp-microvolt = <850000 850000 1250000>;
};
opp@760000000,850,4,8 {
opp-microvolt = <850000 850000 1250000>;
};
opp@760000000,850,0,10 {
opp-microvolt = <850000 850000 1250000>;
};
opp@760000000,900 { opp@760000000,900 {
opp-microvolt = <900000 900000 1250000>; opp-microvolt = <900000 900000 1250000>;
}; };
opp@760000000,900,1,1 {
opp-microvolt = <900000 900000 1250000>;
};
opp@760000000,900,2,1 {
opp-microvolt = <900000 900000 1250000>;
};
opp@760000000,900,1,2 {
opp-microvolt = <900000 900000 1250000>;
};
opp@760000000,900,2,2 {
opp-microvolt = <900000 900000 1250000>;
};
opp@760000000,900,1,3 {
opp-microvolt = <900000 900000 1250000>;
};
opp@760000000,900,2,3 {
opp-microvolt = <900000 900000 1250000>;
};
opp@760000000,900,1,4 {
opp-microvolt = <900000 900000 1250000>;
};
opp@760000000,900,2,4 {
opp-microvolt = <900000 900000 1250000>;
};
opp@760000000,900,1,7 {
opp-microvolt = <900000 900000 1250000>;
};
opp@760000000,900,2,7 {
opp-microvolt = <900000 900000 1250000>;
};
opp@760000000,900,1,8 {
opp-microvolt = <900000 900000 1250000>;
};
opp@760000000,900,2,8 {
opp-microvolt = <900000 900000 1250000>;
};
opp@760000000,912 { opp@760000000,912 {
opp-microvolt = <912000 912000 1250000>; opp-microvolt = <912000 912000 1250000>;
}; };
@ -282,90 +126,10 @@ opp@860000000,900 {
opp-microvolt = <900000 900000 1250000>; opp-microvolt = <900000 900000 1250000>;
}; };
opp@860000000,900,2,1 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,3,1 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,2,2 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,3,2 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,2,3 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,3,3 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,2,4 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,3,4 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,2,7 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,3,7 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,4,7 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,2,8 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,3,8 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,900,4,8 {
opp-microvolt = <900000 900000 1250000>;
};
opp@860000000,975 { opp@860000000,975 {
opp-microvolt = <975000 975000 1250000>; opp-microvolt = <975000 975000 1250000>;
}; };
opp@860000000,975,1,1 {
opp-microvolt = <975000 975000 1250000>;
};
opp@860000000,975,1,2 {
opp-microvolt = <975000 975000 1250000>;
};
opp@860000000,975,1,3 {
opp-microvolt = <975000 975000 1250000>;
};
opp@860000000,975,1,4 {
opp-microvolt = <975000 975000 1250000>;
};
opp@860000000,975,1,7 {
opp-microvolt = <975000 975000 1250000>;
};
opp@860000000,975,1,8 {
opp-microvolt = <975000 975000 1250000>;
};
opp@860000000,1000 { opp@860000000,1000 {
opp-microvolt = <1000000 1000000 1250000>; opp-microvolt = <1000000 1000000 1250000>;
}; };
@ -382,62 +146,6 @@ opp@1000000000,975 {
opp-microvolt = <975000 975000 1250000>; opp-microvolt = <975000 975000 1250000>;
}; };
opp@1000000000,975,2,1 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,3,1 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,2,2 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,3,2 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,2,3 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,3,3 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,2,4 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,3,4 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,2,7 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,3,7 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,4,7 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,2,8 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,3,8 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,975,4,8 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1000000000,1000 { opp@1000000000,1000 {
opp-microvolt = <1000000 1000000 1250000>; opp-microvolt = <1000000 1000000 1250000>;
}; };
@ -454,66 +162,10 @@ opp@1100000000,975 {
opp-microvolt = <975000 975000 1250000>; opp-microvolt = <975000 975000 1250000>;
}; };
opp@1100000000,975,3,1 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1100000000,975,3,2 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1100000000,975,3,3 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1100000000,975,3,4 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1100000000,975,3,7 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1100000000,975,4,7 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1100000000,975,3,8 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1100000000,975,4,8 {
opp-microvolt = <975000 975000 1250000>;
};
opp@1100000000,1000 { opp@1100000000,1000 {
opp-microvolt = <1000000 1000000 1250000>; opp-microvolt = <1000000 1000000 1250000>;
}; };
opp@1100000000,1000,2,1 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1100000000,1000,2,2 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1100000000,1000,2,3 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1100000000,1000,2,4 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1100000000,1000,2,7 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1100000000,1000,2,8 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1100000000,1025 { opp@1100000000,1025 {
opp-microvolt = <1025000 1025000 1250000>; opp-microvolt = <1025000 1025000 1250000>;
}; };
@ -534,66 +186,10 @@ opp@1200000000,1000 {
opp-microvolt = <1000000 1000000 1250000>; opp-microvolt = <1000000 1000000 1250000>;
}; };
opp@1200000000,1000,3,1 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1200000000,1000,3,2 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1200000000,1000,3,3 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1200000000,1000,3,4 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1200000000,1000,3,7 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1200000000,1000,4,7 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1200000000,1000,3,8 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1200000000,1000,4,8 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1200000000,1025 { opp@1200000000,1025 {
opp-microvolt = <1025000 1025000 1250000>; opp-microvolt = <1025000 1025000 1250000>;
}; };
opp@1200000000,1025,2,1 {
opp-microvolt = <1025000 1025000 1250000>;
};
opp@1200000000,1025,2,2 {
opp-microvolt = <1025000 1025000 1250000>;
};
opp@1200000000,1025,2,3 {
opp-microvolt = <1025000 1025000 1250000>;
};
opp@1200000000,1025,2,4 {
opp-microvolt = <1025000 1025000 1250000>;
};
opp@1200000000,1025,2,7 {
opp-microvolt = <1025000 1025000 1250000>;
};
opp@1200000000,1025,2,8 {
opp-microvolt = <1025000 1025000 1250000>;
};
opp@1200000000,1050 { opp@1200000000,1050 {
opp-microvolt = <1050000 1050000 1250000>; opp-microvolt = <1050000 1050000 1250000>;
}; };
@ -610,90 +206,18 @@ opp@1300000000,1000 {
opp-microvolt = <1000000 1000000 1250000>; opp-microvolt = <1000000 1000000 1250000>;
}; };
opp@1300000000,1000,4,7 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1300000000,1000,4,8 {
opp-microvolt = <1000000 1000000 1250000>;
};
opp@1300000000,1025 { opp@1300000000,1025 {
opp-microvolt = <1025000 1025000 1250000>; opp-microvolt = <1025000 1025000 1250000>;
}; };
opp@1300000000,1025,3,1 {
opp-microvolt = <1025000 1025000 1250000>;
};
opp@1300000000,1025,3,7 {
opp-microvolt = <1025000 1025000 1250000>;
};
opp@1300000000,1025,3,8 {
opp-microvolt = <1025000 1025000 1250000>;
};
opp@1300000000,1050 { opp@1300000000,1050 {
opp-microvolt = <1050000 1050000 1250000>; opp-microvolt = <1050000 1050000 1250000>;
}; };
opp@1300000000,1050,2,1 {
opp-microvolt = <1050000 1050000 1250000>;
};
opp@1300000000,1050,3,2 {
opp-microvolt = <1050000 1050000 1250000>;
};
opp@1300000000,1050,3,3 {
opp-microvolt = <1050000 1050000 1250000>;
};
opp@1300000000,1050,3,4 {
opp-microvolt = <1050000 1050000 1250000>;
};
opp@1300000000,1050,3,5 {
opp-microvolt = <1050000 1050000 1250000>;
};
opp@1300000000,1050,3,6 {
opp-microvolt = <1050000 1050000 1250000>;
};
opp@1300000000,1050,2,7 {
opp-microvolt = <1050000 1050000 1250000>;
};
opp@1300000000,1050,2,8 {
opp-microvolt = <1050000 1050000 1250000>;
};
opp@1300000000,1050,3,12 {
opp-microvolt = <1050000 1050000 1250000>;
};
opp@1300000000,1050,3,13 {
opp-microvolt = <1050000 1050000 1250000>;
};
opp@1300000000,1075 { opp@1300000000,1075 {
opp-microvolt = <1075000 1075000 1250000>; opp-microvolt = <1075000 1075000 1250000>;
}; };
opp@1300000000,1075,2,2 {
opp-microvolt = <1075000 1075000 1250000>;
};
opp@1300000000,1075,2,3 {
opp-microvolt = <1075000 1075000 1250000>;
};
opp@1300000000,1075,2,4 {
opp-microvolt = <1075000 1075000 1250000>;
};
opp@1300000000,1100 { opp@1300000000,1100 {
opp-microvolt = <1100000 1100000 1250000>; opp-microvolt = <1100000 1100000 1250000>;
}; };
@ -722,10 +246,6 @@ opp@1400000000,1150 {
opp-microvolt = <1150000 1150000 1250000>; opp-microvolt = <1150000 1150000 1250000>;
}; };
opp@1400000000,1150,2,4 {
opp-microvolt = <1150000 1150000 1250000>;
};
opp@1400000000,1175 { opp@1400000000,1175 {
opp-microvolt = <1175000 1175000 1250000>; opp-microvolt = <1175000 1175000 1250000>;
}; };
@ -738,42 +258,10 @@ opp@1500000000,1125 {
opp-microvolt = <1125000 1125000 1250000>; opp-microvolt = <1125000 1125000 1250000>;
}; };
opp@1500000000,1125,4,5 {
opp-microvolt = <1125000 1125000 1250000>;
};
opp@1500000000,1125,4,6 {
opp-microvolt = <1125000 1125000 1250000>;
};
opp@1500000000,1125,4,12 {
opp-microvolt = <1125000 1125000 1250000>;
};
opp@1500000000,1125,4,13 {
opp-microvolt = <1125000 1125000 1250000>;
};
opp@1500000000,1150 { opp@1500000000,1150 {
opp-microvolt = <1150000 1150000 1250000>; opp-microvolt = <1150000 1150000 1250000>;
}; };
opp@1500000000,1150,3,5 {
opp-microvolt = <1150000 1150000 1250000>;
};
opp@1500000000,1150,3,6 {
opp-microvolt = <1150000 1150000 1250000>;
};
opp@1500000000,1150,3,12 {
opp-microvolt = <1150000 1150000 1250000>;
};
opp@1500000000,1150,3,13 {
opp-microvolt = <1150000 1150000 1250000>;
};
opp@1500000000,1200 { opp@1500000000,1200 {
opp-microvolt = <1200000 1200000 1250000>; opp-microvolt = <1200000 1200000 1250000>;
}; };

View File

@ -109,31 +109,9 @@ opp@475000000,800 {
opp@475000000,850 { opp@475000000,850 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x0F 0x0001>; opp-supported-hw = <0x0F 0x0001>, <0x01 0x0002>,
opp-hz = /bits/ 64 <475000000>; <0x01 0x0010>, <0x01 0x0080>,
}; <0x01 0x0100>;
opp@475000000,850,0,1 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x01 0x0002>;
opp-hz = /bits/ 64 <475000000>;
};
opp@475000000,850,0,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x01 0x0010>;
opp-hz = /bits/ 64 <475000000>;
};
opp@475000000,850,0,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x01 0x0080>;
opp-hz = /bits/ 64 <475000000>;
};
opp@475000000,850,0,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x01 0x0100>;
opp-hz = /bits/ 64 <475000000>; opp-hz = /bits/ 64 <475000000>;
}; };
@ -157,91 +135,14 @@ opp@620000000,850 {
opp@640000000,850 { opp@640000000,850 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x0F 0x0001>; opp-supported-hw = <0x0F 0x0001>, <0x02 0x0002>,
opp-hz = /bits/ 64 <640000000>; <0x04 0x0002>, <0x08 0x0002>,
}; <0x02 0x0010>, <0x04 0x0010>,
<0x08 0x0010>, <0x02 0x0080>,
opp@640000000,850,1,1 { <0x04 0x0080>, <0x08 0x0080>,
clock-latency-ns = <100000>; <0x10 0x0080>, <0x02 0x0100>,
opp-supported-hw = <0x02 0x0002>; <0x04 0x0100>, <0x08 0x0100>,
opp-hz = /bits/ 64 <640000000>; <0x10 0x0100>;
};
opp@640000000,850,2,1 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0002>;
opp-hz = /bits/ 64 <640000000>;
};
opp@640000000,850,3,1 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0002>;
opp-hz = /bits/ 64 <640000000>;
};
opp@640000000,850,1,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0010>;
opp-hz = /bits/ 64 <640000000>;
};
opp@640000000,850,2,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0010>;
opp-hz = /bits/ 64 <640000000>;
};
opp@640000000,850,3,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0010>;
opp-hz = /bits/ 64 <640000000>;
};
opp@640000000,850,1,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0080>;
opp-hz = /bits/ 64 <640000000>;
};
opp@640000000,850,2,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0080>;
opp-hz = /bits/ 64 <640000000>;
};
opp@640000000,850,3,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0080>;
opp-hz = /bits/ 64 <640000000>;
};
opp@640000000,850,4,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0080>;
opp-hz = /bits/ 64 <640000000>;
};
opp@640000000,850,1,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0100>;
opp-hz = /bits/ 64 <640000000>;
};
opp@640000000,850,2,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0100>;
opp-hz = /bits/ 64 <640000000>;
};
opp@640000000,850,3,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0100>;
opp-hz = /bits/ 64 <640000000>;
};
opp@640000000,850,4,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0100>;
opp-hz = /bits/ 64 <640000000>; opp-hz = /bits/ 64 <640000000>;
}; };
@ -253,139 +154,23 @@ opp@640000000,900 {
opp@760000000,850 { opp@760000000,850 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x1E 0x3461>; opp-supported-hw = <0x1E 0x3461>, <0x08 0x0002>,
opp-hz = /bits/ 64 <760000000>; <0x08 0x0004>, <0x08 0x0008>,
}; <0x08 0x0010>, <0x08 0x0080>,
<0x10 0x0080>, <0x08 0x0100>,
opp@760000000,850,3,1 { <0x10 0x0100>, <0x01 0x0400>;
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0002>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,850,3,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0004>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,850,3,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0008>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,850,3,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0010>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,850,3,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0080>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,850,4,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0080>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,850,3,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0100>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,850,4,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0100>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,850,0,10 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x01 0x0400>;
opp-hz = /bits/ 64 <760000000>; opp-hz = /bits/ 64 <760000000>;
}; };
opp@760000000,900 { opp@760000000,900 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x01 0x0001>; opp-supported-hw = <0x01 0x0001>, <0x02 0x0002>,
opp-hz = /bits/ 64 <760000000>; <0x04 0x0002>, <0x02 0x0004>,
}; <0x04 0x0004>, <0x02 0x0008>,
<0x04 0x0008>, <0x02 0x0010>,
opp@760000000,900,1,1 { <0x04 0x0010>, <0x02 0x0080>,
clock-latency-ns = <100000>; <0x04 0x0080>, <0x02 0x0100>,
opp-supported-hw = <0x02 0x0002>; <0x04 0x0100>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,900,2,1 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0002>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,900,1,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0004>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,900,2,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0004>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,900,1,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0008>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,900,2,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0008>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,900,1,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0010>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,900,2,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0010>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,900,1,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0080>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,900,2,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0080>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,900,1,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0100>;
opp-hz = /bits/ 64 <760000000>;
};
opp@760000000,900,2,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0100>;
opp-hz = /bits/ 64 <760000000>; opp-hz = /bits/ 64 <760000000>;
}; };
@ -421,133 +206,23 @@ opp@860000000,850 {
opp@860000000,900 { opp@860000000,900 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0001>; opp-supported-hw = <0x02 0x0001>, <0x04 0x0002>,
opp-hz = /bits/ 64 <860000000>; <0x08 0x0002>, <0x04 0x0004>,
}; <0x08 0x0004>, <0x04 0x0008>,
<0x08 0x0008>, <0x04 0x0010>,
opp@860000000,900,2,1 { <0x08 0x0010>, <0x04 0x0080>,
clock-latency-ns = <100000>; <0x08 0x0080>, <0x10 0x0080>,
opp-supported-hw = <0x04 0x0002>; <0x04 0x0100>, <0x08 0x0100>,
opp-hz = /bits/ 64 <860000000>; <0x10 0x0100>;
};
opp@860000000,900,3,1 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0002>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,900,2,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0004>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,900,3,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0004>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,900,2,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0008>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,900,3,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0008>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,900,2,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0010>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,900,3,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0010>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,900,2,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0080>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,900,3,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0080>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,900,4,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0080>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,900,2,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0100>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,900,3,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0100>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,900,4,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0100>;
opp-hz = /bits/ 64 <860000000>; opp-hz = /bits/ 64 <860000000>;
}; };
opp@860000000,975 { opp@860000000,975 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x01 0x0001>; opp-supported-hw = <0x01 0x0001>, <0x02 0x0002>,
opp-hz = /bits/ 64 <860000000>; <0x02 0x0004>, <0x02 0x0008>,
}; <0x02 0x0010>, <0x02 0x0080>,
<0x02 0x0100>;
opp@860000000,975,1,1 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0002>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,975,1,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0004>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,975,1,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0008>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,975,1,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0010>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,975,1,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0080>;
opp-hz = /bits/ 64 <860000000>;
};
opp@860000000,975,1,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0100>;
opp-hz = /bits/ 64 <860000000>; opp-hz = /bits/ 64 <860000000>;
}; };
@ -571,91 +246,14 @@ opp@1000000000,900 {
opp@1000000000,975 { opp@1000000000,975 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x03 0x0001>; opp-supported-hw = <0x03 0x0001>, <0x04 0x0002>,
opp-hz = /bits/ 64 <1000000000>; <0x08 0x0002>, <0x04 0x0004>,
}; <0x08 0x0004>, <0x04 0x0008>,
<0x08 0x0008>, <0x04 0x0010>,
opp@1000000000,975,2,1 { <0x08 0x0010>, <0x04 0x0080>,
clock-latency-ns = <100000>; <0x08 0x0080>, <0x10 0x0080>,
opp-supported-hw = <0x04 0x0002>; <0x04 0x0100>, <0x08 0x0100>,
opp-hz = /bits/ 64 <1000000000>; <0x10 0x0100>;
};
opp@1000000000,975,3,1 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0002>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,975,2,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0004>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,975,3,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0004>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,975,2,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0008>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,975,3,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0008>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,975,2,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0010>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,975,3,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0010>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,975,2,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0080>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,975,3,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0080>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,975,4,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0080>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,975,2,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0100>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,975,3,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0100>;
opp-hz = /bits/ 64 <1000000000>;
};
opp@1000000000,975,4,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0100>;
opp-hz = /bits/ 64 <1000000000>; opp-hz = /bits/ 64 <1000000000>;
}; };
@ -679,97 +277,20 @@ opp@1100000000,900 {
opp@1100000000,975 { opp@1100000000,975 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x06 0x0001>; opp-supported-hw = <0x06 0x0001>, <0x08 0x0002>,
opp-hz = /bits/ 64 <1100000000>; <0x08 0x0004>, <0x08 0x0008>,
}; <0x08 0x0010>, <0x08 0x0080>,
<0x10 0x0080>, <0x08 0x0100>,
opp@1100000000,975,3,1 { <0x10 0x0100>;
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0002>;
opp-hz = /bits/ 64 <1100000000>;
};
opp@1100000000,975,3,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0004>;
opp-hz = /bits/ 64 <1100000000>;
};
opp@1100000000,975,3,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0008>;
opp-hz = /bits/ 64 <1100000000>;
};
opp@1100000000,975,3,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0010>;
opp-hz = /bits/ 64 <1100000000>;
};
opp@1100000000,975,3,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0080>;
opp-hz = /bits/ 64 <1100000000>;
};
opp@1100000000,975,4,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0080>;
opp-hz = /bits/ 64 <1100000000>;
};
opp@1100000000,975,3,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0100>;
opp-hz = /bits/ 64 <1100000000>;
};
opp@1100000000,975,4,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0100>;
opp-hz = /bits/ 64 <1100000000>; opp-hz = /bits/ 64 <1100000000>;
}; };
opp@1100000000,1000 { opp@1100000000,1000 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x01 0x0001>; opp-supported-hw = <0x01 0x0001>, <0x04 0x0002>,
opp-hz = /bits/ 64 <1100000000>; <0x04 0x0004>, <0x04 0x0008>,
}; <0x04 0x0010>, <0x04 0x0080>,
<0x04 0x0100>;
opp@1100000000,1000,2,1 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0002>;
opp-hz = /bits/ 64 <1100000000>;
};
opp@1100000000,1000,2,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0004>;
opp-hz = /bits/ 64 <1100000000>;
};
opp@1100000000,1000,2,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0008>;
opp-hz = /bits/ 64 <1100000000>;
};
opp@1100000000,1000,2,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0010>;
opp-hz = /bits/ 64 <1100000000>;
};
opp@1100000000,1000,2,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0080>;
opp-hz = /bits/ 64 <1100000000>;
};
opp@1100000000,1000,2,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0100>;
opp-hz = /bits/ 64 <1100000000>; opp-hz = /bits/ 64 <1100000000>;
}; };
@ -799,97 +320,20 @@ opp@1200000000,975 {
opp@1200000000,1000 { opp@1200000000,1000 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0001>; opp-supported-hw = <0x04 0x0001>, <0x08 0x0002>,
opp-hz = /bits/ 64 <1200000000>; <0x08 0x0004>, <0x08 0x0008>,
}; <0x08 0x0010>, <0x08 0x0080>,
<0x10 0x0080>, <0x08 0x0100>,
opp@1200000000,1000,3,1 { <0x10 0x0100>;
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0002>;
opp-hz = /bits/ 64 <1200000000>;
};
opp@1200000000,1000,3,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0004>;
opp-hz = /bits/ 64 <1200000000>;
};
opp@1200000000,1000,3,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0008>;
opp-hz = /bits/ 64 <1200000000>;
};
opp@1200000000,1000,3,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0010>;
opp-hz = /bits/ 64 <1200000000>;
};
opp@1200000000,1000,3,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0080>;
opp-hz = /bits/ 64 <1200000000>;
};
opp@1200000000,1000,4,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0080>;
opp-hz = /bits/ 64 <1200000000>;
};
opp@1200000000,1000,3,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0100>;
opp-hz = /bits/ 64 <1200000000>;
};
opp@1200000000,1000,4,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0100>;
opp-hz = /bits/ 64 <1200000000>; opp-hz = /bits/ 64 <1200000000>;
}; };
opp@1200000000,1025 { opp@1200000000,1025 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0001>; opp-supported-hw = <0x02 0x0001>, <0x04 0x0002>,
opp-hz = /bits/ 64 <1200000000>; <0x04 0x0004>, <0x04 0x0008>,
}; <0x04 0x0010>, <0x04 0x0080>,
<0x04 0x0100>;
opp@1200000000,1025,2,1 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0002>;
opp-hz = /bits/ 64 <1200000000>;
};
opp@1200000000,1025,2,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0004>;
opp-hz = /bits/ 64 <1200000000>;
};
opp@1200000000,1025,2,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0008>;
opp-hz = /bits/ 64 <1200000000>;
};
opp@1200000000,1025,2,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0010>;
opp-hz = /bits/ 64 <1200000000>;
};
opp@1200000000,1025,2,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0080>;
opp-hz = /bits/ 64 <1200000000>;
};
opp@1200000000,1025,2,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0100>;
opp-hz = /bits/ 64 <1200000000>; opp-hz = /bits/ 64 <1200000000>;
}; };
@ -913,133 +357,33 @@ opp@1200000000,1100 {
opp@1300000000,1000 { opp@1300000000,1000 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0001>; opp-supported-hw = <0x08 0x0001>, <0x10 0x0080>,
opp-hz = /bits/ 64 <1300000000>; <0x10 0x0100>;
};
opp@1300000000,1000,4,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0080>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1000,4,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0100>;
opp-hz = /bits/ 64 <1300000000>; opp-hz = /bits/ 64 <1300000000>;
}; };
opp@1300000000,1025 { opp@1300000000,1025 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0001>; opp-supported-hw = <0x04 0x0001>, <0x08 0x0002>,
opp-hz = /bits/ 64 <1300000000>; <0x08 0x0080>, <0x08 0x0100>;
};
opp@1300000000,1025,3,1 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0002>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1025,3,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0080>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1025,3,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0100>;
opp-hz = /bits/ 64 <1300000000>; opp-hz = /bits/ 64 <1300000000>;
}; };
opp@1300000000,1050 { opp@1300000000,1050 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x12 0x3061>; opp-supported-hw = <0x12 0x3061>, <0x04 0x0002>,
opp-hz = /bits/ 64 <1300000000>; <0x08 0x0004>, <0x08 0x0008>,
}; <0x08 0x0010>, <0x08 0x0020>,
<0x08 0x0040>, <0x04 0x0080>,
opp@1300000000,1050,2,1 { <0x04 0x0100>, <0x08 0x1000>,
clock-latency-ns = <100000>; <0x08 0x2000>;
opp-supported-hw = <0x04 0x0002>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1050,3,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0004>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1050,3,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0008>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1050,3,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0010>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1050,3,5 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0020>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1050,3,6 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0040>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1050,2,7 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0080>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1050,2,8 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0100>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1050,3,12 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x1000>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1050,3,13 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x2000>;
opp-hz = /bits/ 64 <1300000000>; opp-hz = /bits/ 64 <1300000000>;
}; };
opp@1300000000,1075 { opp@1300000000,1075 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x0182>; opp-supported-hw = <0x02 0x0182>, <0x04 0x0004>,
opp-hz = /bits/ 64 <1300000000>; <0x04 0x0008>, <0x04 0x0010>;
};
opp@1300000000,1075,2,2 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0004>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1075,2,3 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0008>;
opp-hz = /bits/ 64 <1300000000>;
};
opp@1300000000,1075,2,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0010>;
opp-hz = /bits/ 64 <1300000000>; opp-hz = /bits/ 64 <1300000000>;
}; };
@ -1081,13 +425,7 @@ opp@1400000000,1125 {
opp@1400000000,1150 { opp@1400000000,1150 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x02 0x000C>; opp-supported-hw = <0x02 0x000C>, <0x04 0x0010>;
opp-hz = /bits/ 64 <1400000000>;
};
opp@1400000000,1150,2,4 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0010>;
opp-hz = /bits/ 64 <1400000000>; opp-hz = /bits/ 64 <1400000000>;
}; };
@ -1105,61 +443,17 @@ opp@1400000000,1237 {
opp@1500000000,1125 { opp@1500000000,1125 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0010>; opp-supported-hw = <0x08 0x0010>, <0x10 0x0020>,
opp-hz = /bits/ 64 <1500000000>; <0x10 0x0040>, <0x10 0x1000>,
}; <0x10 0x2000>;
opp@1500000000,1125,4,5 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0020>;
opp-hz = /bits/ 64 <1500000000>;
};
opp@1500000000,1125,4,6 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x0040>;
opp-hz = /bits/ 64 <1500000000>;
};
opp@1500000000,1125,4,12 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x1000>;
opp-hz = /bits/ 64 <1500000000>;
};
opp@1500000000,1125,4,13 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x10 0x2000>;
opp-hz = /bits/ 64 <1500000000>; opp-hz = /bits/ 64 <1500000000>;
}; };
opp@1500000000,1150 { opp@1500000000,1150 {
clock-latency-ns = <100000>; clock-latency-ns = <100000>;
opp-supported-hw = <0x04 0x0010>; opp-supported-hw = <0x04 0x0010>, <0x08 0x0020>,
opp-hz = /bits/ 64 <1500000000>; <0x08 0x0040>, <0x08 0x1000>,
}; <0x08 0x2000>;
opp@1500000000,1150,3,5 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0020>;
opp-hz = /bits/ 64 <1500000000>;
};
opp@1500000000,1150,3,6 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x0040>;
opp-hz = /bits/ 64 <1500000000>;
};
opp@1500000000,1150,3,12 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x1000>;
opp-hz = /bits/ 64 <1500000000>;
};
opp@1500000000,1150,3,13 {
clock-latency-ns = <100000>;
opp-supported-hw = <0x08 0x2000>;
opp-hz = /bits/ 64 <1500000000>; opp-hz = /bits/ 64 <1500000000>;
}; };

View File

@ -2044,8 +2044,9 @@ int of_genpd_add_provider_simple(struct device_node *np,
if (genpd->set_performance_state) { if (genpd->set_performance_state) {
ret = dev_pm_opp_of_add_table(&genpd->dev); ret = dev_pm_opp_of_add_table(&genpd->dev);
if (ret) { if (ret) {
dev_err(&genpd->dev, "Failed to add OPP table: %d\n", if (ret != -EPROBE_DEFER)
ret); dev_err(&genpd->dev, "Failed to add OPP table: %d\n",
ret);
goto unlock; goto unlock;
} }
@ -2054,7 +2055,7 @@ int of_genpd_add_provider_simple(struct device_node *np,
* state. * state.
*/ */
genpd->opp_table = dev_pm_opp_get_opp_table(&genpd->dev); genpd->opp_table = dev_pm_opp_get_opp_table(&genpd->dev);
WARN_ON(!genpd->opp_table); WARN_ON(IS_ERR(genpd->opp_table));
} }
ret = genpd_add_provider(np, genpd_xlate_simple, genpd); ret = genpd_add_provider(np, genpd_xlate_simple, genpd);
@ -2111,8 +2112,9 @@ int of_genpd_add_provider_onecell(struct device_node *np,
if (genpd->set_performance_state) { if (genpd->set_performance_state) {
ret = dev_pm_opp_of_add_table_indexed(&genpd->dev, i); ret = dev_pm_opp_of_add_table_indexed(&genpd->dev, i);
if (ret) { if (ret) {
dev_err(&genpd->dev, "Failed to add OPP table for index %d: %d\n", if (ret != -EPROBE_DEFER)
i, ret); dev_err(&genpd->dev, "Failed to add OPP table for index %d: %d\n",
i, ret);
goto error; goto error;
} }
@ -2121,7 +2123,7 @@ int of_genpd_add_provider_onecell(struct device_node *np,
* performance state. * performance state.
*/ */
genpd->opp_table = dev_pm_opp_get_opp_table_indexed(&genpd->dev, i); genpd->opp_table = dev_pm_opp_get_opp_table_indexed(&genpd->dev, i);
WARN_ON(!genpd->opp_table); WARN_ON(IS_ERR(genpd->opp_table));
} }
genpd->provider = &np->fwnode; genpd->provider = &np->fwnode;

View File

@ -703,12 +703,10 @@ static int _generic_set_opp_regulator(struct opp_table *opp_table,
* Enable the regulator after setting its voltages, otherwise it breaks * Enable the regulator after setting its voltages, otherwise it breaks
* some boot-enabled regulators. * some boot-enabled regulators.
*/ */
if (unlikely(!opp_table->regulator_enabled)) { if (unlikely(!opp_table->enabled)) {
ret = regulator_enable(reg); ret = regulator_enable(reg);
if (ret < 0) if (ret < 0)
dev_warn(dev, "Failed to enable regulator: %d", ret); dev_warn(dev, "Failed to enable regulator: %d", ret);
else
opp_table->regulator_enabled = true;
} }
return 0; return 0;
@ -781,29 +779,39 @@ static int _set_opp_custom(const struct opp_table *opp_table,
return opp_table->set_opp(data); return opp_table->set_opp(data);
} }
static int _set_required_opp(struct device *dev, struct device *pd_dev,
struct dev_pm_opp *opp, int i)
{
unsigned int pstate = likely(opp) ? opp->required_opps[i]->pstate : 0;
int ret;
if (!pd_dev)
return 0;
ret = dev_pm_genpd_set_performance_state(pd_dev, pstate);
if (ret) {
dev_err(dev, "Failed to set performance rate of %s: %d (%d)\n",
dev_name(pd_dev), pstate, ret);
}
return ret;
}
/* This is only called for PM domain for now */ /* This is only called for PM domain for now */
static int _set_required_opps(struct device *dev, static int _set_required_opps(struct device *dev,
struct opp_table *opp_table, struct opp_table *opp_table,
struct dev_pm_opp *opp) struct dev_pm_opp *opp, bool up)
{ {
struct opp_table **required_opp_tables = opp_table->required_opp_tables; struct opp_table **required_opp_tables = opp_table->required_opp_tables;
struct device **genpd_virt_devs = opp_table->genpd_virt_devs; struct device **genpd_virt_devs = opp_table->genpd_virt_devs;
unsigned int pstate;
int i, ret = 0; int i, ret = 0;
if (!required_opp_tables) if (!required_opp_tables)
return 0; return 0;
/* Single genpd case */ /* Single genpd case */
if (!genpd_virt_devs) { if (!genpd_virt_devs)
pstate = likely(opp) ? opp->required_opps[0]->pstate : 0; return _set_required_opp(dev, dev, opp, 0);
ret = dev_pm_genpd_set_performance_state(dev, pstate);
if (ret) {
dev_err(dev, "Failed to set performance state of %s: %d (%d)\n",
dev_name(dev), pstate, ret);
}
return ret;
}
/* Multiple genpd case */ /* Multiple genpd case */
@ -813,19 +821,21 @@ static int _set_required_opps(struct device *dev,
*/ */
mutex_lock(&opp_table->genpd_virt_dev_lock); mutex_lock(&opp_table->genpd_virt_dev_lock);
for (i = 0; i < opp_table->required_opp_count; i++) { /* Scaling up? Set required OPPs in normal order, else reverse */
pstate = likely(opp) ? opp->required_opps[i]->pstate : 0; if (up) {
for (i = 0; i < opp_table->required_opp_count; i++) {
if (!genpd_virt_devs[i]) ret = _set_required_opp(dev, genpd_virt_devs[i], opp, i);
continue; if (ret)
break;
ret = dev_pm_genpd_set_performance_state(genpd_virt_devs[i], pstate); }
if (ret) { } else {
dev_err(dev, "Failed to set performance rate of %s: %d (%d)\n", for (i = opp_table->required_opp_count - 1; i >= 0; i--) {
dev_name(genpd_virt_devs[i]), pstate, ret); ret = _set_required_opp(dev, genpd_virt_devs[i], opp, i);
break; if (ret)
break;
} }
} }
mutex_unlock(&opp_table->genpd_virt_dev_lock); mutex_unlock(&opp_table->genpd_virt_dev_lock);
return ret; return ret;
@ -862,6 +872,34 @@ int dev_pm_opp_set_bw(struct device *dev, struct dev_pm_opp *opp)
} }
EXPORT_SYMBOL_GPL(dev_pm_opp_set_bw); EXPORT_SYMBOL_GPL(dev_pm_opp_set_bw);
static int _opp_set_rate_zero(struct device *dev, struct opp_table *opp_table)
{
int ret;
if (!opp_table->enabled)
return 0;
/*
* Some drivers need to support cases where some platforms may
* have OPP table for the device, while others don't and
* opp_set_rate() just needs to behave like clk_set_rate().
*/
if (!_get_opp_count(opp_table))
return 0;
ret = _set_opp_bw(opp_table, NULL, dev, true);
if (ret)
return ret;
if (opp_table->regulators)
regulator_disable(opp_table->regulators[0]);
ret = _set_required_opps(dev, opp_table, NULL, false);
opp_table->enabled = false;
return ret;
}
/** /**
* dev_pm_opp_set_rate() - Configure new OPP based on frequency * dev_pm_opp_set_rate() - Configure new OPP based on frequency
* @dev: device for which we do this operation * @dev: device for which we do this operation
@ -888,33 +926,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
} }
if (unlikely(!target_freq)) { if (unlikely(!target_freq)) {
/* ret = _opp_set_rate_zero(dev, opp_table);
* Some drivers need to support cases where some platforms may
* have OPP table for the device, while others don't and
* opp_set_rate() just needs to behave like clk_set_rate().
*/
if (!_get_opp_count(opp_table)) {
ret = 0;
goto put_opp_table;
}
if (!opp_table->required_opp_tables && !opp_table->regulators &&
!opp_table->paths) {
dev_err(dev, "target frequency can't be 0\n");
ret = -EINVAL;
goto put_opp_table;
}
ret = _set_opp_bw(opp_table, NULL, dev, true);
if (ret)
goto put_opp_table;
if (opp_table->regulator_enabled) {
regulator_disable(opp_table->regulators[0]);
opp_table->regulator_enabled = false;
}
ret = _set_required_opps(dev, opp_table, NULL);
goto put_opp_table; goto put_opp_table;
} }
@ -933,14 +945,11 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
old_freq = clk_get_rate(clk); old_freq = clk_get_rate(clk);
/* Return early if nothing to do */ /* Return early if nothing to do */
if (old_freq == freq) { if (opp_table->enabled && old_freq == freq) {
if (!opp_table->required_opp_tables && !opp_table->regulators && dev_dbg(dev, "%s: old/new frequencies (%lu Hz) are same, nothing to do\n",
!opp_table->paths) { __func__, freq);
dev_dbg(dev, "%s: old/new frequencies (%lu Hz) are same, nothing to do\n", ret = 0;
__func__, freq); goto put_opp_table;
ret = 0;
goto put_opp_table;
}
} }
/* /*
@ -976,7 +985,7 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
/* Scaling up? Configure required OPPs before frequency */ /* Scaling up? Configure required OPPs before frequency */
if (freq >= old_freq) { if (freq >= old_freq) {
ret = _set_required_opps(dev, opp_table, opp); ret = _set_required_opps(dev, opp_table, opp, true);
if (ret) if (ret)
goto put_opp; goto put_opp;
} }
@ -996,13 +1005,16 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
/* Scaling down? Configure required OPPs after frequency */ /* Scaling down? Configure required OPPs after frequency */
if (!ret && freq < old_freq) { if (!ret && freq < old_freq) {
ret = _set_required_opps(dev, opp_table, opp); ret = _set_required_opps(dev, opp_table, opp, false);
if (ret) if (ret)
dev_err(dev, "Failed to set required opps: %d\n", ret); dev_err(dev, "Failed to set required opps: %d\n", ret);
} }
if (!ret) if (!ret) {
ret = _set_opp_bw(opp_table, opp, dev, false); ret = _set_opp_bw(opp_table, opp, dev, false);
if (!ret)
opp_table->enabled = true;
}
put_opp: put_opp:
dev_pm_opp_put(opp); dev_pm_opp_put(opp);
@ -1068,7 +1080,7 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
*/ */
opp_table = kzalloc(sizeof(*opp_table), GFP_KERNEL); opp_table = kzalloc(sizeof(*opp_table), GFP_KERNEL);
if (!opp_table) if (!opp_table)
return NULL; return ERR_PTR(-ENOMEM);
mutex_init(&opp_table->lock); mutex_init(&opp_table->lock);
mutex_init(&opp_table->genpd_virt_dev_lock); mutex_init(&opp_table->genpd_virt_dev_lock);
@ -1079,8 +1091,8 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
opp_dev = _add_opp_dev(dev, opp_table); opp_dev = _add_opp_dev(dev, opp_table);
if (!opp_dev) { if (!opp_dev) {
kfree(opp_table); ret = -ENOMEM;
return NULL; goto err;
} }
_of_init_opp_table(opp_table, dev, index); _of_init_opp_table(opp_table, dev, index);
@ -1089,16 +1101,21 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
opp_table->clk = clk_get(dev, NULL); opp_table->clk = clk_get(dev, NULL);
if (IS_ERR(opp_table->clk)) { if (IS_ERR(opp_table->clk)) {
ret = PTR_ERR(opp_table->clk); ret = PTR_ERR(opp_table->clk);
if (ret != -EPROBE_DEFER) if (ret == -EPROBE_DEFER)
dev_dbg(dev, "%s: Couldn't find clock: %d\n", __func__, goto err;
ret);
dev_dbg(dev, "%s: Couldn't find clock: %d\n", __func__, ret);
} }
/* Find interconnect path(s) for the device */ /* Find interconnect path(s) for the device */
ret = dev_pm_opp_of_find_icc_paths(dev, opp_table); ret = dev_pm_opp_of_find_icc_paths(dev, opp_table);
if (ret) if (ret) {
if (ret == -EPROBE_DEFER)
goto err;
dev_warn(dev, "%s: Error finding interconnect paths: %d\n", dev_warn(dev, "%s: Error finding interconnect paths: %d\n",
__func__, ret); __func__, ret);
}
BLOCKING_INIT_NOTIFIER_HEAD(&opp_table->head); BLOCKING_INIT_NOTIFIER_HEAD(&opp_table->head);
INIT_LIST_HEAD(&opp_table->opp_list); INIT_LIST_HEAD(&opp_table->opp_list);
@ -1107,6 +1124,10 @@ static struct opp_table *_allocate_opp_table(struct device *dev, int index)
/* Secure the device table modification */ /* Secure the device table modification */
list_add(&opp_table->node, &opp_tables); list_add(&opp_table->node, &opp_tables);
return opp_table; return opp_table;
err:
kfree(opp_table);
return ERR_PTR(ret);
} }
void _get_opp_table_kref(struct opp_table *opp_table) void _get_opp_table_kref(struct opp_table *opp_table)
@ -1129,7 +1150,7 @@ static struct opp_table *_opp_get_opp_table(struct device *dev, int index)
if (opp_table) { if (opp_table) {
if (!_add_opp_dev_unlocked(dev, opp_table)) { if (!_add_opp_dev_unlocked(dev, opp_table)) {
dev_pm_opp_put_opp_table(opp_table); dev_pm_opp_put_opp_table(opp_table);
opp_table = NULL; opp_table = ERR_PTR(-ENOMEM);
} }
goto unlock; goto unlock;
} }
@ -1581,8 +1602,8 @@ struct opp_table *dev_pm_opp_set_supported_hw(struct device *dev,
struct opp_table *opp_table; struct opp_table *opp_table;
opp_table = dev_pm_opp_get_opp_table(dev); opp_table = dev_pm_opp_get_opp_table(dev);
if (!opp_table) if (IS_ERR(opp_table))
return ERR_PTR(-ENOMEM); return opp_table;
/* Make sure there are no concurrent readers while updating opp_table */ /* Make sure there are no concurrent readers while updating opp_table */
WARN_ON(!list_empty(&opp_table->opp_list)); WARN_ON(!list_empty(&opp_table->opp_list));
@ -1640,8 +1661,8 @@ struct opp_table *dev_pm_opp_set_prop_name(struct device *dev, const char *name)
struct opp_table *opp_table; struct opp_table *opp_table;
opp_table = dev_pm_opp_get_opp_table(dev); opp_table = dev_pm_opp_get_opp_table(dev);
if (!opp_table) if (IS_ERR(opp_table))
return ERR_PTR(-ENOMEM); return opp_table;
/* Make sure there are no concurrent readers while updating opp_table */ /* Make sure there are no concurrent readers while updating opp_table */
WARN_ON(!list_empty(&opp_table->opp_list)); WARN_ON(!list_empty(&opp_table->opp_list));
@ -1733,8 +1754,8 @@ struct opp_table *dev_pm_opp_set_regulators(struct device *dev,
int ret, i; int ret, i;
opp_table = dev_pm_opp_get_opp_table(dev); opp_table = dev_pm_opp_get_opp_table(dev);
if (!opp_table) if (IS_ERR(opp_table))
return ERR_PTR(-ENOMEM); return opp_table;
/* This should be called before OPPs are initialized */ /* This should be called before OPPs are initialized */
if (WARN_ON(!list_empty(&opp_table->opp_list))) { if (WARN_ON(!list_empty(&opp_table->opp_list))) {
@ -1804,11 +1825,9 @@ void dev_pm_opp_put_regulators(struct opp_table *opp_table)
/* Make sure there are no concurrent readers while updating opp_table */ /* Make sure there are no concurrent readers while updating opp_table */
WARN_ON(!list_empty(&opp_table->opp_list)); WARN_ON(!list_empty(&opp_table->opp_list));
if (opp_table->regulator_enabled) { if (opp_table->enabled) {
for (i = opp_table->regulator_count - 1; i >= 0; i--) for (i = opp_table->regulator_count - 1; i >= 0; i--)
regulator_disable(opp_table->regulators[i]); regulator_disable(opp_table->regulators[i]);
opp_table->regulator_enabled = false;
} }
for (i = opp_table->regulator_count - 1; i >= 0; i--) for (i = opp_table->regulator_count - 1; i >= 0; i--)
@ -1843,8 +1862,8 @@ struct opp_table *dev_pm_opp_set_clkname(struct device *dev, const char *name)
int ret; int ret;
opp_table = dev_pm_opp_get_opp_table(dev); opp_table = dev_pm_opp_get_opp_table(dev);
if (!opp_table) if (IS_ERR(opp_table))
return ERR_PTR(-ENOMEM); return opp_table;
/* This should be called before OPPs are initialized */ /* This should be called before OPPs are initialized */
if (WARN_ON(!list_empty(&opp_table->opp_list))) { if (WARN_ON(!list_empty(&opp_table->opp_list))) {
@ -1911,8 +1930,8 @@ struct opp_table *dev_pm_opp_register_set_opp_helper(struct device *dev,
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
opp_table = dev_pm_opp_get_opp_table(dev); opp_table = dev_pm_opp_get_opp_table(dev);
if (!opp_table) if (!IS_ERR(opp_table))
return ERR_PTR(-ENOMEM); return opp_table;
/* This should be called before OPPs are initialized */ /* This should be called before OPPs are initialized */
if (WARN_ON(!list_empty(&opp_table->opp_list))) { if (WARN_ON(!list_empty(&opp_table->opp_list))) {
@ -1949,6 +1968,9 @@ static void _opp_detach_genpd(struct opp_table *opp_table)
{ {
int index; int index;
if (!opp_table->genpd_virt_devs)
return;
for (index = 0; index < opp_table->required_opp_count; index++) { for (index = 0; index < opp_table->required_opp_count; index++) {
if (!opp_table->genpd_virt_devs[index]) if (!opp_table->genpd_virt_devs[index])
continue; continue;
@ -1992,8 +2014,11 @@ struct opp_table *dev_pm_opp_attach_genpd(struct device *dev,
const char **name = names; const char **name = names;
opp_table = dev_pm_opp_get_opp_table(dev); opp_table = dev_pm_opp_get_opp_table(dev);
if (!opp_table) if (IS_ERR(opp_table))
return ERR_PTR(-ENOMEM); return opp_table;
if (opp_table->genpd_virt_devs)
return opp_table;
/* /*
* If the genpd's OPP table isn't already initialized, parsing of the * If the genpd's OPP table isn't already initialized, parsing of the
@ -2020,12 +2045,6 @@ struct opp_table *dev_pm_opp_attach_genpd(struct device *dev,
goto err; goto err;
} }
if (opp_table->genpd_virt_devs[index]) {
dev_err(dev, "Genpd virtual device already set %s\n",
*name);
goto err;
}
virt_dev = dev_pm_domain_attach_by_name(dev, *name); virt_dev = dev_pm_domain_attach_by_name(dev, *name);
if (IS_ERR(virt_dev)) { if (IS_ERR(virt_dev)) {
ret = PTR_ERR(virt_dev); ret = PTR_ERR(virt_dev);
@ -2098,9 +2117,6 @@ int dev_pm_opp_xlate_performance_state(struct opp_table *src_table,
int dest_pstate = -EINVAL; int dest_pstate = -EINVAL;
int i; int i;
if (!pstate)
return 0;
/* /*
* Normally the src_table will have the "required_opps" property set to * Normally the src_table will have the "required_opps" property set to
* point to one of the OPPs in the dst_table, but in some cases the * point to one of the OPPs in the dst_table, but in some cases the
@ -2163,8 +2179,8 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)
int ret; int ret;
opp_table = dev_pm_opp_get_opp_table(dev); opp_table = dev_pm_opp_get_opp_table(dev);
if (!opp_table) if (IS_ERR(opp_table))
return -ENOMEM; return PTR_ERR(opp_table);
/* Fix regulator count for dynamic OPPs */ /* Fix regulator count for dynamic OPPs */
opp_table->regulator_count = 1; opp_table->regulator_count = 1;
@ -2405,7 +2421,14 @@ int dev_pm_opp_unregister_notifier(struct device *dev,
} }
EXPORT_SYMBOL(dev_pm_opp_unregister_notifier); EXPORT_SYMBOL(dev_pm_opp_unregister_notifier);
void _dev_pm_opp_find_and_remove_table(struct device *dev) /**
* dev_pm_opp_remove_table() - Free all OPPs associated with the device
* @dev: device pointer used to lookup OPP table.
*
* Free both OPPs created using static entries present in DT and the
* dynamically added entries.
*/
void dev_pm_opp_remove_table(struct device *dev)
{ {
struct opp_table *opp_table; struct opp_table *opp_table;
@ -2432,16 +2455,4 @@ void _dev_pm_opp_find_and_remove_table(struct device *dev)
/* Drop reference taken by _find_opp_table() */ /* Drop reference taken by _find_opp_table() */
dev_pm_opp_put_opp_table(opp_table); dev_pm_opp_put_opp_table(opp_table);
} }
/**
* dev_pm_opp_remove_table() - Free all OPPs associated with the device
* @dev: device pointer used to lookup OPP table.
*
* Free both OPPs created using static entries present in DT and the
* dynamically added entries.
*/
void dev_pm_opp_remove_table(struct device *dev)
{
_dev_pm_opp_find_and_remove_table(dev);
}
EXPORT_SYMBOL_GPL(dev_pm_opp_remove_table); EXPORT_SYMBOL_GPL(dev_pm_opp_remove_table);

View File

@ -124,7 +124,7 @@ void _dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask,
continue; continue;
} }
_dev_pm_opp_find_and_remove_table(cpu_dev); dev_pm_opp_remove_table(cpu_dev);
} }
} }

View File

@ -434,9 +434,9 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_of_find_icc_paths);
static bool _opp_is_supported(struct device *dev, struct opp_table *opp_table, static bool _opp_is_supported(struct device *dev, struct opp_table *opp_table,
struct device_node *np) struct device_node *np)
{ {
unsigned int count = opp_table->supported_hw_count; unsigned int levels = opp_table->supported_hw_count;
u32 version; int count, versions, ret, i, j;
int ret; u32 val;
if (!opp_table->supported_hw) { if (!opp_table->supported_hw) {
/* /*
@ -451,21 +451,40 @@ static bool _opp_is_supported(struct device *dev, struct opp_table *opp_table,
return true; return true;
} }
while (count--) { count = of_property_count_u32_elems(np, "opp-supported-hw");
ret = of_property_read_u32_index(np, "opp-supported-hw", count, if (count <= 0 || count % levels) {
&version); dev_err(dev, "%s: Invalid opp-supported-hw property (%d)\n",
if (ret) { __func__, count);
dev_warn(dev, "%s: failed to read opp-supported-hw property at index %d: %d\n", return false;
__func__, count, ret);
return false;
}
/* Both of these are bitwise masks of the versions */
if (!(version & opp_table->supported_hw[count]))
return false;
} }
return true; versions = count / levels;
/* All levels in at least one of the versions should match */
for (i = 0; i < versions; i++) {
bool supported = true;
for (j = 0; j < levels; j++) {
ret = of_property_read_u32_index(np, "opp-supported-hw",
i * levels + j, &val);
if (ret) {
dev_warn(dev, "%s: failed to read opp-supported-hw property at index %d: %d\n",
__func__, i * levels + j, ret);
return false;
}
/* Check if the level is supported */
if (!(val & opp_table->supported_hw[j])) {
supported = false;
break;
}
}
if (supported)
return true;
}
return false;
} }
static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev, static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev,
@ -616,7 +635,7 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev,
*/ */
void dev_pm_opp_of_remove_table(struct device *dev) void dev_pm_opp_of_remove_table(struct device *dev)
{ {
_dev_pm_opp_find_and_remove_table(dev); dev_pm_opp_remove_table(dev);
} }
EXPORT_SYMBOL_GPL(dev_pm_opp_of_remove_table); EXPORT_SYMBOL_GPL(dev_pm_opp_of_remove_table);
@ -823,7 +842,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table) static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table)
{ {
struct device_node *np; struct device_node *np;
int ret, count = 0, pstate_count = 0; int ret, count = 0;
struct dev_pm_opp *opp; struct dev_pm_opp *opp;
/* OPP table is already initialized for the device */ /* OPP table is already initialized for the device */
@ -857,20 +876,14 @@ static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table)
goto remove_static_opp; goto remove_static_opp;
} }
list_for_each_entry(opp, &opp_table->opp_list, node) list_for_each_entry(opp, &opp_table->opp_list, node) {
pstate_count += !!opp->pstate; /* Any non-zero performance state would enable the feature */
if (opp->pstate) {
/* Either all or none of the nodes shall have performance state set */ opp_table->genpd_performance_state = true;
if (pstate_count && pstate_count != count) { break;
dev_err(dev, "Not all nodes have performance state set (%d: %d)\n", }
count, pstate_count);
ret = -ENOENT;
goto remove_static_opp;
} }
if (pstate_count)
opp_table->genpd_performance_state = true;
return 0; return 0;
remove_static_opp: remove_static_opp:
@ -886,11 +899,25 @@ static int _of_add_opp_table_v1(struct device *dev, struct opp_table *opp_table)
const __be32 *val; const __be32 *val;
int nr, ret = 0; int nr, ret = 0;
mutex_lock(&opp_table->lock);
if (opp_table->parsed_static_opps) {
opp_table->parsed_static_opps++;
mutex_unlock(&opp_table->lock);
return 0;
}
opp_table->parsed_static_opps = 1;
mutex_unlock(&opp_table->lock);
prop = of_find_property(dev->of_node, "operating-points", NULL); prop = of_find_property(dev->of_node, "operating-points", NULL);
if (!prop) if (!prop) {
return -ENODEV; ret = -ENODEV;
if (!prop->value) goto remove_static_opp;
return -ENODATA; }
if (!prop->value) {
ret = -ENODATA;
goto remove_static_opp;
}
/* /*
* Each OPP is a set of tuples consisting of frequency and * Each OPP is a set of tuples consisting of frequency and
@ -899,13 +926,10 @@ static int _of_add_opp_table_v1(struct device *dev, struct opp_table *opp_table)
nr = prop->length / sizeof(u32); nr = prop->length / sizeof(u32);
if (nr % 2) { if (nr % 2) {
dev_err(dev, "%s: Invalid OPP table\n", __func__); dev_err(dev, "%s: Invalid OPP table\n", __func__);
return -EINVAL; ret = -EINVAL;
goto remove_static_opp;
} }
mutex_lock(&opp_table->lock);
opp_table->parsed_static_opps = 1;
mutex_unlock(&opp_table->lock);
val = prop->value; val = prop->value;
while (nr) { while (nr) {
unsigned long freq = be32_to_cpup(val++) * 1000; unsigned long freq = be32_to_cpup(val++) * 1000;
@ -915,12 +939,14 @@ static int _of_add_opp_table_v1(struct device *dev, struct opp_table *opp_table)
if (ret) { if (ret) {
dev_err(dev, "%s: Failed to add OPP %ld (%d)\n", dev_err(dev, "%s: Failed to add OPP %ld (%d)\n",
__func__, freq, ret); __func__, freq, ret);
_opp_remove_all_static(opp_table); goto remove_static_opp;
return ret;
} }
nr -= 2; nr -= 2;
} }
remove_static_opp:
_opp_remove_all_static(opp_table);
return ret; return ret;
} }
@ -947,8 +973,8 @@ int dev_pm_opp_of_add_table(struct device *dev)
int ret; int ret;
opp_table = dev_pm_opp_get_opp_table_indexed(dev, 0); opp_table = dev_pm_opp_get_opp_table_indexed(dev, 0);
if (!opp_table) if (IS_ERR(opp_table))
return -ENOMEM; return PTR_ERR(opp_table);
/* /*
* OPPs have two version of bindings now. Also try the old (v1) * OPPs have two version of bindings now. Also try the old (v1)
@ -1002,8 +1028,8 @@ int dev_pm_opp_of_add_table_indexed(struct device *dev, int index)
} }
opp_table = dev_pm_opp_get_opp_table_indexed(dev, index); opp_table = dev_pm_opp_get_opp_table_indexed(dev, index);
if (!opp_table) if (IS_ERR(opp_table))
return -ENOMEM; return PTR_ERR(opp_table);
ret = _of_add_opp_table_v2(dev, opp_table); ret = _of_add_opp_table_v2(dev, opp_table);
if (ret) if (ret)

View File

@ -147,11 +147,11 @@ enum opp_table_access {
* @clk: Device's clock handle * @clk: Device's clock handle
* @regulators: Supply regulators * @regulators: Supply regulators
* @regulator_count: Number of power supply regulators. Its value can be -1 * @regulator_count: Number of power supply regulators. Its value can be -1
* @regulator_enabled: Set to true if regulators were previously enabled.
* (uninitialized), 0 (no opp-microvolt property) or > 0 (has opp-microvolt * (uninitialized), 0 (no opp-microvolt property) or > 0 (has opp-microvolt
* property). * property).
* @paths: Interconnect path handles * @paths: Interconnect path handles
* @path_count: Number of interconnect paths * @path_count: Number of interconnect paths
* @enabled: Set to true if the device's resources are enabled/configured.
* @genpd_performance_state: Device's power domain support performance state. * @genpd_performance_state: Device's power domain support performance state.
* @is_genpd: Marks if the OPP table belongs to a genpd. * @is_genpd: Marks if the OPP table belongs to a genpd.
* @set_opp: Platform specific set_opp callback * @set_opp: Platform specific set_opp callback
@ -195,9 +195,9 @@ struct opp_table {
struct clk *clk; struct clk *clk;
struct regulator **regulators; struct regulator **regulators;
int regulator_count; int regulator_count;
bool regulator_enabled;
struct icc_path **paths; struct icc_path **paths;
unsigned int path_count; unsigned int path_count;
bool enabled;
bool genpd_performance_state; bool genpd_performance_state;
bool is_genpd; bool is_genpd;
@ -217,7 +217,6 @@ void _get_opp_table_kref(struct opp_table *opp_table);
int _get_opp_count(struct opp_table *opp_table); int _get_opp_count(struct opp_table *opp_table);
struct opp_table *_find_opp_table(struct device *dev); struct opp_table *_find_opp_table(struct device *dev);
struct opp_device *_add_opp_dev(const struct device *dev, struct opp_table *opp_table); struct opp_device *_add_opp_dev(const struct device *dev, struct opp_table *opp_table);
void _dev_pm_opp_find_and_remove_table(struct device *dev);
struct dev_pm_opp *_opp_allocate(struct opp_table *opp_table); struct dev_pm_opp *_opp_allocate(struct opp_table *opp_table);
void _opp_free(struct dev_pm_opp *opp); void _opp_free(struct dev_pm_opp *opp);
int _opp_compare_key(struct dev_pm_opp *opp1, struct dev_pm_opp *opp2); int _opp_compare_key(struct dev_pm_opp *opp1, struct dev_pm_opp *opp2);

View File

@ -93,7 +93,7 @@ static int exynos_asv_update_opps(struct exynos_asv *asv)
continue; continue;
opp_table = dev_pm_opp_get_opp_table(cpu); opp_table = dev_pm_opp_get_opp_table(cpu);
if (IS_ERR_OR_NULL(opp_table)) if (IS_ERR(opp_table))
continue; continue;
if (!last_opp_table || opp_table != last_opp_table) { if (!last_opp_table || opp_table != last_opp_table) {