* pm-opp: PM / OPP: Add binding for 'opp-suspend' PM / OPP: Allow multiple OPP tables to be passed via DT PM / OPP: Add new bindings to address shortcomings of existing bindings
···11-* Generic OPP Interface11+Generic OPP (Operating Performance Points) Bindings22+----------------------------------------------------2333-SoCs have a standard set of tuples consisting of frequency and44-voltage pairs that the device will support per voltage domain. These55-are called Operating Performance Points or OPPs.44+Devices work at voltage-current-frequency combinations and some implementations55+have the liberty of choosing these. These combinations are called Operating66+Performance Points aka OPPs. This document defines bindings for these OPPs77+applicable across wide range of devices. For illustration purpose, this document88+uses CPU as a device.99+1010+This document contain multiple versions of OPP binding and only one of them1111+should be used per device.1212+1313+Binding 1: operating-points1414+============================1515+1616+This binding only supports voltage-frequency pairs.617718Properties:819- operating-points: An array of 2-tuples items, and each item consists···3322 396000 9500003423 198000 8500003524 >;2525+};2626+2727+2828+Binding 2: operating-points-v22929+============================3030+3131+* Property: operating-points-v23232+3333+Devices supporting OPPs must set their "operating-points-v2" property with3434+phandle to a OPP table in their DT node. The OPP core will use this phandle to3535+find the operating points for the device.3636+3737+Devices may want to choose OPP tables at runtime and so can provide a list of3838+phandles here. But only *one* of them should be chosen at runtime. This must be3939+accompanied by a corresponding "operating-points-names" property, to uniquely4040+identify the OPP tables.4141+4242+If required, this can be extended for SoC vendor specfic bindings. Such bindings4343+should be documented as Documentation/devicetree/bindings/power/<vendor>-opp.txt4444+and should have a compatible description like: "operating-points-v2-<vendor>".4545+4646+Optional properties:4747+- operating-points-names: Names of OPP tables (required if multiple OPP4848+ tables are present), to uniquely identify them. The same list must be present4949+ for all the CPUs which are sharing clock/voltage rails and hence the OPP5050+ tables.5151+5252+* OPP Table Node5353+5454+This describes the OPPs belonging to a device. This node can have following5555+properties:5656+5757+Required properties:5858+- compatible: Allow OPPs to express their compatibility. It should be:5959+ "operating-points-v2".6060+6161+- OPP nodes: One or more OPP nodes describing voltage-current-frequency6262+ combinations. Their name isn't significant but their phandle can be used to6363+ reference an OPP.6464+6565+Optional properties:6666+- opp-shared: Indicates that device nodes using this OPP Table Node's phandle6767+ switch their DVFS state together, i.e. they share clock/voltage/current lines.6868+ Missing property means devices have independent clock/voltage/current lines,6969+ but they share OPP tables.7070+7171+- status: Marks the OPP table enabled/disabled.7272+7373+7474+* OPP Node7575+7676+This defines voltage-current-frequency combinations along with other related7777+properties.7878+7979+Required properties:8080+- opp-hz: Frequency in Hz8181+8282+Optional properties:8383+- opp-microvolt: voltage in micro Volts.8484+8585+ A single regulator's voltage is specified with an array of size one or three.8686+ Single entry is for target voltage and three entries are for <target min max>8787+ voltages.8888+8989+ Entries for multiple regulators must be present in the same order as9090+ regulators are specified in device's DT node.9191+9292+- opp-microamp: The maximum current drawn by the device in microamperes9393+ considering system specific parameters (such as transients, process, aging,9494+ maximum operating temperature range etc.) as necessary. This may be used to9595+ set the most efficient regulator operating mode.9696+9797+ Should only be set if opp-microvolt is set for the OPP.9898+9999+ Entries for multiple regulators must be present in the same order as100100+ regulators are specified in device's DT node. If this property isn't required101101+ for few regulators, then this should be marked as zero for them. If it isn't102102+ required for any regulator, then this property need not be present.103103+104104+- clock-latency-ns: Specifies the maximum possible transition latency (in105105+ nanoseconds) for switching to this OPP from any other OPP.106106+107107+- turbo-mode: Marks the OPP to be used only for turbo modes. Turbo mode is108108+ available on some platforms, where the device can run over its operating109109+ frequency for a short duration of time limited by the device's power, current110110+ and thermal limits.111111+112112+- opp-suspend: Marks the OPP to be used during device suspend. Only one OPP in113113+ the table should have this.114114+115115+- status: Marks the node enabled/disabled.116116+117117+Example 1: Single cluster Dual-core ARM cortex A9, switch DVFS states together.118118+119119+/ {120120+ cpus {121121+ #address-cells = <1>;122122+ #size-cells = <0>;123123+124124+ cpu@0 {125125+ compatible = "arm,cortex-a9";126126+ reg = <0>;127127+ next-level-cache = <&L2>;128128+ clocks = <&clk_controller 0>;129129+ clock-names = "cpu";130130+ cpu-supply = <&cpu_supply0>;131131+ operating-points-v2 = <&cpu0_opp_table>;132132+ };133133+134134+ cpu@1 {135135+ compatible = "arm,cortex-a9";136136+ reg = <1>;137137+ next-level-cache = <&L2>;138138+ clocks = <&clk_controller 0>;139139+ clock-names = "cpu";140140+ cpu-supply = <&cpu_supply0>;141141+ operating-points-v2 = <&cpu0_opp_table>;142142+ };143143+ };144144+145145+ cpu0_opp_table: opp_table0 {146146+ compatible = "operating-points-v2";147147+ opp-shared;148148+149149+ opp00 {150150+ opp-hz = <1000000000>;151151+ opp-microvolt = <970000 975000 985000>;152152+ opp-microamp = <70000>;153153+ clock-latency-ns = <300000>;154154+ opp-suspend;155155+ };156156+ opp01 {157157+ opp-hz = <1100000000>;158158+ opp-microvolt = <980000 1000000 1010000>;159159+ opp-microamp = <80000>;160160+ clock-latency-ns = <310000>;161161+ };162162+ opp02 {163163+ opp-hz = <1200000000>;164164+ opp-microvolt = <1025000>;165165+ clock-latency-ns = <290000>;166166+ turbo-mode;167167+ };168168+ };169169+};170170+171171+Example 2: Single cluster, Quad-core Qualcom-krait, switches DVFS states172172+independently.173173+174174+/ {175175+ cpus {176176+ #address-cells = <1>;177177+ #size-cells = <0>;178178+179179+ cpu@0 {180180+ compatible = "qcom,krait";181181+ reg = <0>;182182+ next-level-cache = <&L2>;183183+ clocks = <&clk_controller 0>;184184+ clock-names = "cpu";185185+ cpu-supply = <&cpu_supply0>;186186+ operating-points-v2 = <&cpu_opp_table>;187187+ };188188+189189+ cpu@1 {190190+ compatible = "qcom,krait";191191+ reg = <1>;192192+ next-level-cache = <&L2>;193193+ clocks = <&clk_controller 1>;194194+ clock-names = "cpu";195195+ cpu-supply = <&cpu_supply1>;196196+ operating-points-v2 = <&cpu_opp_table>;197197+ };198198+199199+ cpu@2 {200200+ compatible = "qcom,krait";201201+ reg = <2>;202202+ next-level-cache = <&L2>;203203+ clocks = <&clk_controller 2>;204204+ clock-names = "cpu";205205+ cpu-supply = <&cpu_supply2>;206206+ operating-points-v2 = <&cpu_opp_table>;207207+ };208208+209209+ cpu@3 {210210+ compatible = "qcom,krait";211211+ reg = <3>;212212+ next-level-cache = <&L2>;213213+ clocks = <&clk_controller 3>;214214+ clock-names = "cpu";215215+ cpu-supply = <&cpu_supply3>;216216+ operating-points-v2 = <&cpu_opp_table>;217217+ };218218+ };219219+220220+ cpu_opp_table: opp_table {221221+ compatible = "operating-points-v2";222222+223223+ /*224224+ * Missing opp-shared property means CPUs switch DVFS states225225+ * independently.226226+ */227227+228228+ opp00 {229229+ opp-hz = <1000000000>;230230+ opp-microvolt = <970000 975000 985000>;231231+ opp-microamp = <70000>;232232+ clock-latency-ns = <300000>;233233+ opp-suspend;234234+ };235235+ opp01 {236236+ opp-hz = <1100000000>;237237+ opp-microvolt = <980000 1000000 1010000>;238238+ opp-microamp = <80000>;239239+ clock-latency-ns = <310000>;240240+ };241241+ opp02 {242242+ opp-hz = <1200000000>;243243+ opp-microvolt = <1025000>;244244+ opp-microamp = <90000;245245+ lock-latency-ns = <290000>;246246+ turbo-mode;247247+ };248248+ };249249+};250250+251251+Example 3: Dual-cluster, Dual-core per cluster. CPUs within a cluster switch252252+DVFS state together.253253+254254+/ {255255+ cpus {256256+ #address-cells = <1>;257257+ #size-cells = <0>;258258+259259+ cpu@0 {260260+ compatible = "arm,cortex-a7";261261+ reg = <0>;262262+ next-level-cache = <&L2>;263263+ clocks = <&clk_controller 0>;264264+ clock-names = "cpu";265265+ cpu-supply = <&cpu_supply0>;266266+ operating-points-v2 = <&cluster0_opp>;267267+ };268268+269269+ cpu@1 {270270+ compatible = "arm,cortex-a7";271271+ reg = <1>;272272+ next-level-cache = <&L2>;273273+ clocks = <&clk_controller 0>;274274+ clock-names = "cpu";275275+ cpu-supply = <&cpu_supply0>;276276+ operating-points-v2 = <&cluster0_opp>;277277+ };278278+279279+ cpu@100 {280280+ compatible = "arm,cortex-a15";281281+ reg = <100>;282282+ next-level-cache = <&L2>;283283+ clocks = <&clk_controller 1>;284284+ clock-names = "cpu";285285+ cpu-supply = <&cpu_supply1>;286286+ operating-points-v2 = <&cluster1_opp>;287287+ };288288+289289+ cpu@101 {290290+ compatible = "arm,cortex-a15";291291+ reg = <101>;292292+ next-level-cache = <&L2>;293293+ clocks = <&clk_controller 1>;294294+ clock-names = "cpu";295295+ cpu-supply = <&cpu_supply1>;296296+ operating-points-v2 = <&cluster1_opp>;297297+ };298298+ };299299+300300+ cluster0_opp: opp_table0 {301301+ compatible = "operating-points-v2";302302+ opp-shared;303303+304304+ opp00 {305305+ opp-hz = <1000000000>;306306+ opp-microvolt = <970000 975000 985000>;307307+ opp-microamp = <70000>;308308+ clock-latency-ns = <300000>;309309+ opp-suspend;310310+ };311311+ opp01 {312312+ opp-hz = <1100000000>;313313+ opp-microvolt = <980000 1000000 1010000>;314314+ opp-microamp = <80000>;315315+ clock-latency-ns = <310000>;316316+ };317317+ opp02 {318318+ opp-hz = <1200000000>;319319+ opp-microvolt = <1025000>;320320+ opp-microamp = <90000>;321321+ clock-latency-ns = <290000>;322322+ turbo-mode;323323+ };324324+ };325325+326326+ cluster1_opp: opp_table1 {327327+ compatible = "operating-points-v2";328328+ opp-shared;329329+330330+ opp10 {331331+ opp-hz = <1300000000>;332332+ opp-microvolt = <1045000 1050000 1055000>;333333+ opp-microamp = <95000>;334334+ clock-latency-ns = <400000>;335335+ opp-suspend;336336+ };337337+ opp11 {338338+ opp-hz = <1400000000>;339339+ opp-microvolt = <1075000>;340340+ opp-microamp = <100000>;341341+ clock-latency-ns = <400000>;342342+ };343343+ opp12 {344344+ opp-hz = <1500000000>;345345+ opp-microvolt = <1010000 1100000 1110000>;346346+ opp-microamp = <95000>;347347+ clock-latency-ns = <400000>;348348+ turbo-mode;349349+ };350350+ };351351+};352352+353353+Example 4: Handling multiple regulators354354+355355+/ {356356+ cpus {357357+ cpu@0 {358358+ compatible = "arm,cortex-a7";359359+ ...360360+361361+ cpu-supply = <&cpu_supply0>, <&cpu_supply1>, <&cpu_supply2>;362362+ operating-points-v2 = <&cpu0_opp_table>;363363+ };364364+ };365365+366366+ cpu0_opp_table: opp_table0 {367367+ compatible = "operating-points-v2";368368+ opp-shared;369369+370370+ opp00 {371371+ opp-hz = <1000000000>;372372+ opp-microvolt = <970000>, /* Supply 0 */373373+ <960000>, /* Supply 1 */374374+ <960000>; /* Supply 2 */375375+ opp-microamp = <70000>, /* Supply 0 */376376+ <70000>, /* Supply 1 */377377+ <70000>; /* Supply 2 */378378+ clock-latency-ns = <300000>;379379+ };380380+381381+ /* OR */382382+383383+ opp00 {384384+ opp-hz = <1000000000>;385385+ opp-microvolt = <970000 975000 985000>, /* Supply 0 */386386+ <960000 965000 975000>, /* Supply 1 */387387+ <960000 965000 975000>; /* Supply 2 */388388+ opp-microamp = <70000>, /* Supply 0 */389389+ <70000>, /* Supply 1 */390390+ <70000>; /* Supply 2 */391391+ clock-latency-ns = <300000>;392392+ };393393+394394+ /* OR */395395+396396+ opp00 {397397+ opp-hz = <1000000000>;398398+ opp-microvolt = <970000 975000 985000>, /* Supply 0 */399399+ <960000 965000 975000>, /* Supply 1 */400400+ <960000 965000 975000>; /* Supply 2 */401401+ opp-microamp = <70000>, /* Supply 0 */402402+ <0>, /* Supply 1 doesn't need this */403403+ <70000>; /* Supply 2 */404404+ clock-latency-ns = <300000>;405405+ };406406+ };407407+};408408+409409+Example 5: Multiple OPP tables410410+411411+/ {412412+ cpus {413413+ cpu@0 {414414+ compatible = "arm,cortex-a7";415415+ ...416416+417417+ cpu-supply = <&cpu_supply>418418+ operating-points-v2 = <&cpu0_opp_table_slow>, <&cpu0_opp_table_fast>;419419+ operating-points-names = "slow", "fast";420420+ };421421+ };422422+423423+ cpu0_opp_table_slow: opp_table_slow {424424+ compatible = "operating-points-v2";425425+ status = "okay";426426+ opp-shared;427427+428428+ opp00 {429429+ opp-hz = <600000000>;430430+ ...431431+ };432432+433433+ opp01 {434434+ opp-hz = <800000000>;435435+ ...436436+ };437437+ };438438+439439+ cpu0_opp_table_fast: opp_table_fast {440440+ compatible = "operating-points-v2";441441+ status = "okay";442442+ opp-shared;443443+444444+ opp10 {445445+ opp-hz = <1000000000>;446446+ ...447447+ };448448+449449+ opp11 {450450+ opp-hz = <1100000000>;451451+ ...452452+ };453453+ };36454};