summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorSubbaraman Narayanamurthy <subbaram@codeaurora.org>2016-03-10 12:56:50 -0800
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:22:58 -0700
commit8e2dd2ff9bafa85484de22da194e5986525ca553 (patch)
treedd988e970df93c266662ab61781b2de531c14711 /Documentation
parent2810bf90110c62b976ba1b5334017f212f717ca0 (diff)
regulator: Add snapshot of devicetree documentation for CPR regulators
This devicetree bindings documentation snapshot is taken as of msm-3.18 commit 96a424f00642 (regulator: cpr4: Fix highest voltage corner open-loop voltage calculation). Change-Id: I9b62013a8049c3a22a62b34cd06b87245bcdc5de Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/devicetree/bindings/regulator/cpr-regulator.txt978
-rw-r--r--Documentation/devicetree/bindings/regulator/cpr2-gfx-regulator.txt395
-rw-r--r--Documentation/devicetree/bindings/regulator/cpr3-hmss-regulator.txt546
-rw-r--r--Documentation/devicetree/bindings/regulator/cpr3-mmss-regulator.txt260
-rw-r--r--Documentation/devicetree/bindings/regulator/cpr3-regulator.txt575
-rw-r--r--Documentation/devicetree/bindings/regulator/cpr4-apss-regulator.txt258
6 files changed, 3012 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/regulator/cpr-regulator.txt b/Documentation/devicetree/bindings/regulator/cpr-regulator.txt
new file mode 100644
index 000000000000..1c4dfbf58795
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/cpr-regulator.txt
@@ -0,0 +1,978 @@
+QTI CPR (Core Power Reduction) Regulator
+
+CPR regulator device is for QTI RBCPR (RapidBridge CPR) on
+ application processor core. It takes voltage corner level
+ as input and converts it to actual voltage based on the
+ suggestions from factory production process. When CPR is
+ enabled for application processer core, it will suggest
+ scaling the voltage up or down for best performance and
+ power of the core. The scaling based on factory production
+ process is called PVS (Process Voltage Scaling) with efuse
+ bits to indicate what bin (and voltage range) a chip is in.
+
+Required properties:
+- compatible: Must be "qcom,cpr-regulator"
+- reg: Register addresses for RBCPR, RBCPR clock
+ select, PVS and CPR eFuse address
+- reg-names: Register names. Must be "rbcpr" and "efuse_addr".
+ "rbcpr_clk" is optional.
+- regulator-name: A string used to describe the regulator
+- interrupts: Interrupt line from RBCPR to interrupt controller.
+- qcom,cpr-fuse-corners: Number of fuse corners present. Many other properties
+ are sized based upon this value.
+- regulator-min-microvolt: Minimum corner value which should be 1 to
+ represent the lowest supported corner.
+- regulator-max-microvolt: Maximum corner value which should be equal to
+ qcom,cpr-fuse-corners if consumers request fuse
+ corners or the length of qcom,cpr-corner-map if
+ consumers request virtual corners.
+- qcom,cpr-voltage-ceiling: Array of ceiling voltages in microvolts for fuse
+ corners ordered from lowest voltage corner to highest
+ voltage corner. This property must be of length
+ defined by qcom,cpr-fuse-corners.
+- qcom,cpr-voltage-floor: Array of floor voltages in microvolts for fuse
+ corners ordered from lowest voltage corner to highest
+ voltage corner. This property must be of length
+ defined by qcom,cpr-fuse-corners.
+- vdd-apc-supply: Regulator to supply VDD APC power
+- qcom,vdd-apc-step-up-limit: Limit of vdd-apc-supply steps for scaling up.
+- qcom,vdd-apc-step-down-limit: Limit of vdd-apc-supply steps for scaling down.
+- qcom,cpr-ref-clk: The reference clock in kHz.
+- qcom,cpr-timer-delay: The delay in microseconds for the timer interval.
+- qcom,cpr-timer-cons-up: Consecutive number of timer interval (qcom,cpr-timer-delay)
+ occurred before issuing UP interrupt.
+- qcom,cpr-timer-cons-down: Consecutive number of timer interval (qcom,cpr-timer-delay)
+ occurred before issuing DOWN interrupt.
+- qcom,cpr-irq-line: Internal interrupt route signal of RBCPR, one of 0, 1 or 2.
+- qcom,cpr-step-quotient: Defines the number of CPR quotient (i.e. Ring Oscillator(RO)
+ count) per vdd-apc-supply output voltage step. A single
+ integer value may be specified which is to be used for all
+ RO's. Alternatively, 8 integer values may be specified which
+ define the step quotients for RO0 to RO7 in order.
+- qcom,cpr-up-threshold: The threshold for CPR to issue interrupt when
+ error_steps is greater than it when stepping up.
+- qcom,cpr-down-threshold: The threshold for CPR to issue interrupt when
+ error_steps is greater than it when stepping down.
+- qcom,cpr-idle-clocks: Idle clock cycles RO can be in.
+- qcom,cpr-gcnt-time: The time for gate count in microseconds.
+- qcom,cpr-apc-volt-step: The voltage in microvolt per CPR step, such as 5000uV.
+- qcom,cpr-fuse-row: Array of row number of CPR fuse and method to read that row. It should have
+ index and value like this:
+ [0] => the fuse row number
+ [1] => fuse reading method, 0 for direct reading or 1 for SCM reading
+- qcom,cpr-fuse-target-quot: Array of bit positions in the primary CPR fuse row defined
+ by qcom,cpr-fuse-row for the target quotients of each
+ fuse corner. Each bit position corresponds to the LSB
+ of the quotient parameter. The elements in the array
+ are ordered from lowest voltage corner to highest voltage
+ corner. This property must be of length defined by
+ qcom,cpr-fuse-corners.
+- qcom,cpr-fuse-ro-sel: Array of bit positions in the primary CPR fuse row defined
+ by qcom,cpr-fuse-row for the ring oscillator selection for each
+ fuse corner. Each bit position corresponds to the LSB
+ of the RO select parameter. The elements in the array
+ are ordered from lowest voltage corner to highest voltage
+ corner. This property must be of length defined by
+ qcom,cpr-fuse-corners.
+
+Optional properties:
+- vdd-mx-supply: Regulator to supply memory power as dependency
+ of VDD APC.
+- qcom,vdd-mx-vmax: The maximum voltage in uV for vdd-mx-supply. This
+ is required when vdd-mx-supply is present.
+- qcom,vdd-mx-vmin-method: The method to determine the minimum voltage for
+ vdd-mx-supply, which can be one of following
+ choices compared with VDD APC:
+ 0 => equal to the voltage(vmin) of VDD APC
+ 1 => equal to PVS corner ceiling voltage
+ 2 => equal to slow speed corner ceiling
+ 3 => equal to qcom,vdd-mx-vmax
+ 4 => equal to VDD_APC fuse corner mapped vdd-mx voltage
+ 5 => equal to VDD_APC virtual corner mapped vdd-mx voltage
+ This is required when vdd-mx-supply is present.
+- qcom,vdd-mx-corner-map: Array of integers which defines the mapping from VDD_APC
+ voltage corners to vdd-mx-supply voltages.
+ Each element is a voltage to request from vdd-mx for the
+ corresponding fuse corner or virtual corner. The elements
+ in the array are ordered from lowest voltage corner
+ to highest voltage corner. The length of this property
+ depends on the value of qcom,vdd-mx-vmin-method property.
+ When qcom,vdd-mx-vmin-method property has a value of 4, the length
+ of this property must be equal to the value defined by qcom,cpr-fuse-corners.
+ When qcom,vdd-mx-vmin-method property has a value of 5, the length of
+ this property must be equal to the number of elements in the qcom,cpr-corner-map
+ property.
+- qcom,pvs-voltage-table: Array of N-tuples in which each tuple specifies the
+ initial voltage in microvolts of the PVS bin for each
+ fuse voltage corner. The location or 0-based index
+ of a tuple in the list corresponds to the PVS bin number.
+ Each tuple must be of length defined by qcom,cpr-fuse-corners.
+ A given cpr-regulator device must have either
+ qcom,pvs-voltage-table specified or
+ qcom,cpr-fuse-init-voltage (and its associated properties).
+- qcom,pvs-fuse-redun-sel: Array of 5 elements to indicate where to read the bits, what value to
+ compare with in order to decide if the redundant PVS fuse bits would be
+ used instead of the original bits and method to read fuse row, reading
+ register through SCM or directly. The 5 elements with index [0..4] are:
+ [0] => the fuse row number of the selector
+ [1] => LSB bit position of the bits
+ [2] => number of bits
+ [3] => the value to indicate redundant selection
+ [4] => fuse reading method, 0 for direct reading or 1 for SCM reading
+ When the value of the fuse bits specified by first 3 elements equals to
+ the value in 4th element, redundant PVS fuse bits should be selected.
+ Otherwise, the original PVS bits should be selected. If the 5th
+ element is 0, read the fuse row from register directly. Otherwise,
+ read it through SCM.
+ This property is required if qcom,pvs-voltage-table is present.
+- qcom,pvs-fuse: Array of 4 elements to indicate the bits for PVS fuse and read method.
+ The array should have index and value like this:
+ [0] => the PVS fuse row number
+ [1] => LSB bit position of the bits
+ [2] => number of bits
+ [3] => fuse reading method, 0 for direct reading or 1 for SCM reading
+ This property is required if qcom,pvs-voltage-table is present.
+- qcom,pvs-fuse-redun: Array of 4 elements to indicate the bits for redundant PVS fuse.
+ The array should have index and value like this:
+ [0] => the redundant PVS fuse row number
+ [1] => LSB bit position of the bits
+ [2] => number of bits
+ [3] => fuse reading method, 0 for direct reading or 1 for SCM reading
+ This property is required if qcom,pvs-voltage-table is present.
+- qcom,cpr-fuse-redun-sel: Array of 5 elements to indicate where to read the bits, what value to
+ compare with in order to decide if the redundant CPR fuse bits would be
+ used instead of the original bits and method to read fuse row, using SCM
+ to read or read register directly. The 5 elements with index [0..4] are:
+ [0] => the fuse row number of the selector
+ [1] => LSB bit position of the bits
+ [2] => number of bits
+ [3] => the value to indicate redundant selection
+ [4] => fuse reading method, 0 for direct reading or 1 for SCM reading
+ When the value of the fuse bits specified by first 3 elements equals to
+ the value in 4th element, redundant CPR fuse bits should be selected.
+ Otherwise, the original CPR bits should be selected. If the 5th element
+ is 0, read the fuse row from register directly. Otherwise, read it through
+ SCM.
+- qcom,cpr-fuse-redun-row: Array of row number of redundant CPR fuse and method to read that
+ row. It should have index and value like this:
+ [0] => the redundant fuse row number
+ [1] => the value to indicate reading the fuse row directly or using SCM
+ This property is required if qcom,cpr-fuse-redun-sel is present.
+- qcom,cpr-fuse-redun-target-quot: Array of bit positions in the redundant CPR fuse row defined
+ by qcom,cpr-fuse-redun-row for the target quotients of each
+ fuse corner. Each bit position corresponds to the LSB
+ of the quotient parameter. The elements in the array
+ are ordered from lowest voltage corner to highest voltage corner.
+ This property must be of length defined by qcom,cpr-fuse-corners.
+ This property is required if qcom,cpr-fuse-redun-sel is present.
+- qcom,cpr-fuse-redun-ro-sel: Array of bit positions in the redundant CPR fuse row defined
+ by qcom,cpr-fuse-redun-row for the ring oscillator select of each
+ fuse corner. Each bit position corresponds to the LSB of the RO
+ select parameter. The elements in the array are ordered from
+ lowest voltage corner to highest voltage corner.
+ This property must be of length defined by qcom,cpr-fuse-corners.
+ This property is required if qcom,cpr-fuse-redun-sel is present.
+- qcom,cpr-fuse-redun-bp-cpr-disable: Redundant bit position of the bit to indicate if CPR should be disable
+- qcom,cpr-fuse-redun-bp-scheme: Redundant bit position of the bit to indicate if it's a global/local scheme
+ This property is required if cpr-fuse-redun-bp-cpr-disable
+ is present, and vise versa.
+- qcom,cpr-fuse-bp-cpr-disable: Bit position of the bit to indicate if CPR should be disabled
+- qcom,cpr-fuse-bp-scheme: Bit position of the bit to indicate if it's a global/local scheme
+- qcom,cpr-fuse-revision: Array of 4 integer elements which define the location of the bits for
+ the CPR fusing revision fuse parameter. The 4 elements are:
+ [0]: => the fuse row number of the bits
+ [1]: => LSB bit position of the bits
+ [2]: => the number of bits
+ [3]: => fuse reading method, 0 for direct reading or 1 for SCM reading
+ The fusing revision value is used to determine which specific adjustments
+ are required on some chips.
+- qcom,cpr-fuse-target-quot-size: Array of target quotient parameter bit sizes in the primary
+ or redundant CPR fuse row for each fuse corner. The elements in the
+ array are ordered from lowest voltage corner to highest voltage corner.
+ If this property is not present, then all target quotient fuse values
+ are assumed to be the default length of 12 bits.
+- qcom,cpr-fuse-target-quot-scale: Array of doubles which defines the scaling coefficients to decode
+ the target quotients of each fuse corner. The first element in each
+ double represents the offset to add to the scaled quotient. The second
+ element represents the multiplier to scale the quotient by. For example,
+ given a tuple <A B>, quot_decoded = A + (B * quot_raw).
+ The doubles in the array are ordered from lowest voltage corner to highest
+ voltage corner. This property must contain a number of doubles equal to
+ the value of qcom,cpr-fuse-corners. If this property is not present,
+ then all target quotient parameters are assumed to have an offset of 0
+ and a multiplier of 1 (i.e. no decoding needed).
+- qcom,cpr-enable: Present: CPR enabled by default.
+ Not Present: CPR disable by default.
+- qcom,cpr-fuse-cond-min-volt-sel: Array of 5 elements to indicate where to read the bits, what value to
+ compare with in order to decide if the conditional minimum apc voltage needs
+ to be applied and the fuse reading method.
+ The 5 elements with index[0..4] are:
+ [0] => the fuse row number;
+ [1] => LSB bit position of the bits;
+ [2] => number of the bits;
+ [3] => the expected data to read;
+ [4] => fuse reading method, 0 for direct reading or 1 for SCM reading;
+ When the value of the fuse bits specified by first 3 elements is not equal to
+ the value in 4th element, then set the apc voltage for all parts running
+ at each voltage corner to be not lower than the voltage defined
+ using "qcom,cpr-cond-min-voltage".
+- qcom,cpr-cond-min-voltage: Minimum voltage in microvolts allowed for cpr-regulator output if the fuse bits
+ defined in qcom,cpr-fuse-cond-min-volt-sel have not been programmed with the
+ expected data. This is required if cpr-fuse-cond-min-volt-sel is present.
+- qcom,cpr-fuse-uplift-sel: Array of 5 elements to indicate where to read the bits, what value to
+ compare with in order to enable or disable the pvs voltage uplift workaround,
+ and the fuse reading method.
+ The 5 elements with index[0..4] are:
+ [0]: => the fuse row number of the selector;
+ [1]: => LSB bit position of the bits;
+ [2]: => number of the bits;
+ [3]: => the value to indicate if the apc pvs voltage uplift workaround will
+ be enabled;
+ [4]: => fuse reading method, 0 for direct reading or 1 for SCM reading.
+ When the value of the fuse bits specified by first 3 elements equals to the
+ value in 4th element, the pvs voltage uplift workaround will be enabled.
+- qcom,speed-bin-fuse-sel: Array of 4 elements to indicate where to read the speed bin of the processor,
+ and the fuse reading method.
+ The 4 elements with index[0..3] are:
+ [0]: => the fuse row number of the selector;
+ [1]: => LSB bit position of the bits;
+ [2]: => number of the bits;
+ [3]: => fuse reading method, 0 for direct reading or 1 for SCM reading.
+ This is required if cpr-fuse-uplift-disable-sel is present.
+- qcom,cpr-uplift-voltage: Uplift in microvolts used for increasing pvs init voltage. If this property is present,
+ This is required if cpr-fuse-uplift-disable-sel is present.
+- qcom,cpr-uplift-max-volt: Maximum voltage in microvolts used for pvs voltage uplift workaround to limit
+ the maximum pvs voltage.
+ This is required if cpr-fuse-uplift-disable-sel is present.
+- qcom,cpr-uplift-quotient: Array of target quotient increments to add to the fused quotients of each
+ fuse corner as part of the PVS voltage uplift workaround.
+ The elements in the array are ordered from lowest voltage
+ corner to highest voltage corner. This property must be of
+ length defined by qcom,cpr-fuse-corners. This is required
+ if cpr-fuse-uplift-disable-sel is present.
+- qcom,cpr-uplift-speed-bin: The speed bin value corresponding to one type of processor which needs to apply the
+ pvs voltage uplift workaround.
+ This is required if cpr-fuse-uplift-disable-sel is present.
+- qcom,cpr-fuse-version-map: Array of integer tuples which each match to a given combination of CPR
+ fuse parameter values. Each tuple consists of N + 3 elements. Where
+ N is the number of fuse corners defined by the qcom,cpr-fuse-corners
+ property. The elements in one tuple are:
+ [0]: => the speed bin of the CPU
+ [1]: => the PVS version of the CPU
+ [2]: => the CPR fuse revision
+ [3 - N+2]: => the ring oscillator select value of each fuse corner
+ ordered from lowest to highest
+ Any element in a tuple may use the value 0xffffffff as a wildcard
+ which will match against any fuse parameter value. The first tuple
+ that matches against the fuse values read from hardware will be used.
+ This property is used by several properties to provide an index into
+ their lists.
+- qcom,cpr-allowed: Integer values that specifies whether the closed loop CPR is allowed or
+ not for a particular fuse revision. If the qcom,cpr-fuse-version-map
+ property is specified, then qcom,cpr-allowed must contain the same number
+ of integers as that of the number of tuples in qcom,cpr-fuse-version-map.
+ If the integer value has a value 0 for a particular fuse revision, then it
+ is treated as if the closed loop operation is disabled in the fuse. If the
+ integer value has a value 1 for a particular fuse revision, then the closed
+ loop operation is enabled for that fuse revision. If nothing is specified
+ for a particular fuse revision, then the closed loop operation is enabled
+ for that fuse revision by default.
+- qcom,cpr-quotient-adjustment: Array of integer tuples of target quotient adjustments to add to the fused
+ quotients of each fuse corner. The elements in a tuple are ordered from
+ lowest voltage corner to highest voltage corner. Each tuple must be of
+ length defined by qcom,cpr-fuse-corners. If the qcom,cpr-fuse-version-map
+ property is specified, then qcom,cpr-quotient-adjustment must contain the
+ same number of tuples as qcom,cpr-fuse-version-map. These tuples are then
+ mapped one-to-one in the order specified. E.g. if the second
+ qcom,cpr-fuse-version-map tuple matches for a given device, then the quotient
+ adjustments defined in the second qcom,cpr-quotient-adjustment tuple will
+ be applied. If the qcom,cpr-fuse-version-map property is not specified,
+ then qcom,cpr-quotient-adjustment must contain a single tuple which is then
+ applied unconditionally. If this property is specified, then the quotient
+ adjustment values are added to the target quotient values read from fuses
+ before writing them into the CPR GCNT target control registers.
+ This property can be used to add or subtract static voltage margin from the
+ regulator managed by the CPR controller.
+- qcom,cpr-init-voltage-adjustment: Array of integer tuples of initial voltage adjustments in microvolts to
+ add to the fused initial voltage values of each fuse corner. The elements
+ in a tuple are ordered from lowest voltage corner to highest voltage corner.
+ Each tuple must be of the length defined by qcom,cpr-fuse-corners. If the
+ qcom,cpr-fuse-version-map property is specified, then
+ qcom,cpr-init-voltage-adjustment must contain the same number of tuples as
+ qcom,cpr-fuse-version-map. These tuples are then mapped one-to-one in the
+ order specified. E.g. if the second qcom,cpr-fuse-version-map tuple matches
+ for a given device, then the initial voltage adjustments defined in the
+ second qcom,cpr-init-voltage-adjustment tuple will be applied. If the
+ qcom,cpr-fuse-version-map property is not specified, then
+ qcom,cpr-init-voltage-adjustment must contain a single tuple which is then
+ applied unconditionally. This property can be used to add or subtract
+ static initial voltage margin from the regulator managed by the CPR
+ controller.
+- qcom,cpr-quot-offset-adjustment: Array of integer tuples of target quotient offset adjustments to add
+ to the fused quotient offsets of each fuse corner. The elements in a tuple
+ are ordered from lowest voltage corner to highest voltage corner. Each tuple
+ must be of length defined by qcom,cpr-fuse-corners. If the qcom,cpr-fuse-version-map
+ property is specified, then qcom,cpr-quot-offset-adjustment must contain the
+ same number of tuples as qcom,cpr-fuse-version-map. These tuples are then
+ mapped one-to-one in the order specified. E.g. if the second
+ qcom,cpr-fuse-version-map tuple matches for a given device, then the quotient
+ offset adjustments defined in the second qcom,cpr-quot-offset-adjustment tuple
+ will be applied. If the qcom,cpr-fuse-version-map property is not specified,
+ then qcom,cpr-quot-offset-adjustment must contain a single tuple which is then
+ applied unconditionally. If this property is specified, then the quotient
+ offset adjustment values are added to the target quotient offset values read
+ from fuses.
+ This property can be used to add or subtract static quotient offset margin from
+ the regulator managed by the CPR controller.
+- qcom,cpr-clamp-timer-interval: The number of 64 reference clock cycle blocks to delay for whenever
+ the clamp signal, sensor mask registers or sensor bypass registers
+ change. The CPR controller loop is disabled during this delay.
+ Supported values are 0 to 255. If this property is not specified,
+ then a value of 0 is assumed. Note that if this property has a
+ value greater than 0, then software cannot accurately determine the
+ error_steps value that corresponds to a given CPR measurement
+ unless processor power collapsing is disabled. If this property
+ has a value of 0, then the CPR controller loop is not disabled and
+ re-enabled while idle if the clamp signal changes. Instead, it
+ will remain idle until software issues an ACK or NACK command.
+ This ensures that software can read the error_steps value which
+ resulted in the CPR up or down interrupt. Setting this property to
+ a value greater than 0 is useful for resetting the CPR sensors of a
+ processor that uses BHS type voltage switches in order to avoid
+ anomalous CPR up interrupts when exiting from power collapse.
+- vdd-apc-optional-prim-supply: Present: Regulator of highest priority to supply VDD APC power
+ Not Present: No such regulator.
+- vdd-apc-optional-sec-supply: Present: Regulator of second highest priority to supply VDD APC power.
+ Not Present: No such regulator.
+- qcom,cpr-speed-bin-max-corners: Array of (N+2)-tuples in which each tuple maps a CPU speed bin and PVS version to
+ the maximum virtual voltage corner corresponding to each fuse corner. The value N
+ corresponds to the number of fuse corners specified by qcom,cpr-fuse-corners.
+ The elements in one tuple are:
+ [0]: => the speed bin of the CPU. It may use the value 0xffffffff as a
+ wildcard to match any speed bin values.
+ [1]: => the PVS version of the CPU. It may use the value 0xffffffff as
+ a wildcard to match any PVS version values.
+ [2 - N+1]: => the max virtual voltage corner value corresponding to each fuse corner
+ for this speed bin, ordered from lowest voltage corner to highest
+ voltage corner.
+ No CPR target quotient scaling is applied on chips which have a speed bin + PVS version
+ pair that does not appear in one of the tuples in this property. If the property is
+ specified, then quotient scaling is enabled for the highest voltage corner. If this property is
+ not specified, then no quotient scaling can take place.
+- qcom,cpr-corner-map: Array of elements of fuse corner value for each virtual corner.
+ The location or 1-based index of an element in the list corresponds to
+ the virtual corner value. For example, the first element in the list is the fuse corner
+ value that virtual corner 1 maps to.
+ This property is required if qcom,cpr-speed-bin-max-corners is present.
+- qcom,cpr-corner-frequency-map: Array of tuples in which a tuple describes a corner to application processor frequency
+ mapping.
+ The 2 elements in one tuple are:
+ [0]: => a virtual voltage corner.
+ [1]: => the application processor frequency in Hz corresponding to the virtual corner.
+ This property is required if qcom,cpr-speed-bin-max-corners is present.
+- qcom,pvs-version-fuse-sel: Array of 4 elements to indicate where to read the pvs version of the processor,
+ and the fuse reading method.
+ The 4 elements with index[0..3] are:
+ [0]: => the fuse row number of the selector;
+ [1]: => LSB bit position of the bits;
+ [2]: => the number of bits;
+ [3]: => fuse reading method, 0 for direct reading or 1 for SCM reading.
+- qcom,cpr-voltage-ceiling-override: Array of (N+2)-tuples in which each tuple maps a CPU speed bin and PVS version
+ to the ceiling voltage to apply for each virtual voltage corner. The value N
+ corresponds to the number of virtual corners as specified by the number of elements
+ in the qcom,cpr-corner-map property.
+ The elements in one tuple are:
+ [0]: => the speed bin of the CPU. It may use the value 0xffffffff as a
+ wildcard to match any speed bin values.
+ [1]: => the PVS version of the CPU. It may use the value 0xffffffff as a
+ wildcard to match any PVS version values.
+ [2 - N+1]: => the ceiling voltage value in microvolts corresponding to each virtual
+ corner for this speed bin, ordered from lowest voltage corner to
+ highest voltage corner.
+ No ceiling override is applied on chips which have a speed bin + PVS version
+ pair that does not appear in one of the tuples in this property. If the property is
+ specified and the speed bin + PVS version matches, then the per-virtual-corner ceiling
+ voltages will be used in place of the per-fuse-corner ceiling voltages defined in the
+ qcom,cpr-voltage-ceiling property. If this property is not specified, then the
+ per-fuse-corner ceiling voltages will always be used.
+- qcom,cpr-voltage-floor-override: Array of (N+2)-tuples in which each tuple maps a CPU speed bin and PVS version
+ to the floor voltage to apply for each virtual voltage corner. The value N
+ corresponds to the number of virtual corners as specified by the number of elements
+ in the qcom,cpr-corner-map property.
+ The elements in one tuple are:
+ [0]: => the speed bin of the CPU. It may use the value 0xffffffff as a
+ wildcard to match any speed bin values.
+ [1]: => the PVS version of the CPU. It may use the value 0xffffffff as a
+ wildcard to match any PVS version values.
+ [2 - N+1]: => the floor voltage value in microvolts corresponding to each virtual
+ corner for this speed bin, ordered from lowest voltage corner to
+ highest voltage corner.
+ No floor override is applied on chips which have a speed bin + PVS version
+ pair that does not appear in one of the tuples in this property. If the property is
+ specified and the speed bin + PVS version matches, then the per-virtual-corner floor
+ voltages will be used in place of the per-fuse-corner floor voltages defined in the
+ qcom,cpr-voltage-floor property. If this property is not specified, then the
+ per-fuse-corner floor voltages will always be used.
+- qcom,cpr-floor-to-ceiling-max-range: Array of integer tuples of floor-to-ceiling max range values in microvolts
+ to be subtracted from the ceiling voltage values of each virtual corner.
+ Supported values are those greater than or equal 0, or (-1). The value 0 for a corner
+ implies that the floor value for that corner has to equal to its ceiling value.
+ The value (-1) for a corner implies that no modification to the default floor voltage
+ is required. The elements in a tuple are ordered from lowest voltage corner to highest
+ voltage corner. Each tuple must be of the length equal to the number of virtual corners
+ as specified by the number of elements in the qcom,cpr-corner-map property. If the
+ qcom,cpr-fuse-version-map property is specified, then
+ qcom,cpr-dynamic-floor-override-adjustment must contain the same number of
+ tuples as qcom,cpr-fuse-version-map. These tuples are then mapped one-to-one in the
+ order specified. E.g. if the second qcom,cpr-fuse-version-map tuple matches
+ for a given device, then voltage adjustments defined in the second
+ qcom,cpr-dynamic-floor-override-adjustment tuple will be applied. If the
+ qcom,cpr-fuse-version-map property is not specified, then
+ qcom,cpr-dynamic-floor-override-adjustment must contain a single tuple which
+ is then applied unconditionally.
+- qcom,cpr-virtual-corner-init-voltage-adjustment: Array of integer tuples of voltage adjustments in microvolts to be
+ added to the initial voltage values of each virtual corner. The elements
+ in a tuple are ordered from lowest voltage corner to highest voltage corner.
+ Each tuple must be of the length equal to the number of virtual corners as
+ specified by the number of elements in the qcom,cpr-corner-map property. If the
+ qcom,cpr-fuse-version-map property is specified, then
+ qcom,cpr-virtual-corner-init-voltage-adjustment must contain the same number of
+ tuples as qcom,cpr-fuse-version-map. These tuples are then mapped one-to-one in the
+ order specified. E.g. if the second qcom,cpr-fuse-version-map tuple matches
+ for a given device, then voltage adjustments defined in the second
+ qcom,cpr-virtual-corner-init-voltage-adjustment tuple will be applied. If the
+ qcom,cpr-fuse-version-map property is not specified, then
+ qcom,cpr-virtual-corner-init-voltage-adjustment must contain a single tuple which
+ is then applied unconditionally.
+- qcom,cpr-virtual-corner-quotient-adjustment: Array of integer tuples of quotient offsets to be added to
+ the scaled target quotient of each virtual corner. The elements
+ in a tuple are ordered from lowest voltage corner to highest voltage corner.
+ Each tuple must be of the length equal to the number of virtual corners as
+ specified by the number of elements in the qcom,cpr-corner-map property.
+ If the qcom,cpr-fuse-version-map property is specified, then
+ qcom,cpr-virtual-corner-quotient-adjustment must contain the same number of tuples as
+ qcom,cpr-fuse-version-map. These tuples are then mapped one-to-one in the
+ order specified. E.g. if the second qcom,cpr-fuse-version-map tuple matches
+ for a given device, then quotient adjustments defined in the second
+ qcom,cpr-virtual-corner-quotient-adjustment tuple will be applied. If the
+ qcom,cpr-fuse-version-map property is not specified, then
+ qcom,cpr-virtual-corner-quotient-adjustment must contain a single tuple which is then
+ applied unconditionally.
+- qcom,cpr-cpus: Array of CPU phandles which correspond to the cores that this cpr-regulator
+ device must monitor when adjusting the voltage and/or target quotient based
+ upon the number of online cores or make sure that one of them must be online
+ when performing de-aging measurements. This property must be specified in order to
+ utilize the qcom,cpr-online-cpu-virtual-corner-init-voltage-adjustment or
+ qcom,cpr-online-cpu-virtual-corner-quotient-adjustment or qcom,cpr-aging-sensor-id properties.
+- qcom,cpr-online-cpu-virtual-corner-init-voltage-adjustment: Array of tuples where each tuple specifies
+ the voltage adjustment for each corner. These adjustments apply to the
+ initial voltage of each corner. The size of each tuple must be equal
+ to qcom,cpr-fuse-corners if consumers request fuse corners or the length of
+ qcom,cpr-corner-map if consumers request virtual corners. In each tuple, the
+ value corresponds to the voltage adjustment when running at that corner at
+ init, from lowest to highest. The tuples must be organized into 1 group if
+ qcom,cpr-fuse-version-map is not specified or the same number of groups as
+ the number of tuples in qcom,cpr-fuse-version-map. The i-th group of tuples
+ corresponds to the voltage adjustments for i-th fuse version map tuple. In
+ each group, there are 1 plus length of qcom,cpr-cpus tuples, each tuple
+ corresponds to the number of cores online, from 0 to the number of elements
+ in qcom,cpr-cpus.
+- qcom,cpr-online-cpu-init-voltage-as-ceiling: Boolean which indicates that the ceiling voltage used for a
+ given virtual corner may be reduced to the per number of cores online,
+ per-virtual corner ceiling voltage value. This property takes precedence
+ over qcom,cpr-scaled-init-voltage-as-ceiling if both are specified.
+- qcom,cpr-online-cpu-virtual-corner-quotient-adjustment: Array of tuples where each tuple specifies
+ the quotient adjustment for each corner. These adjustments will be applied
+ to each corner at run time. The size of each tuple must be equal to
+ qcom,cpr-fuse-corners if consumers request fuse corners or the length of
+ qcom,cpr-corner-map if consumers request virtual corners. In each tuple,
+ the value corresponds to the quotient adjustment when running at that corner,
+ from lowest to highest. The tuples must be organized into 1 group if
+ qcom,cpr-fuse-version-map is not specified or the same number of groups
+ as the number of tuples in qcom,cpr-fuse-version-map. The i-th group of
+ tuples corresponds to the quotient adjustments for i-th fuse version map
+ tuple. In each group, there are 1 plus length of qcom,cpr-cpus tuples,
+ each tuple corresponds to the number of cores online, from 0 to the
+ number of elements in qcom,cpr-cpus.
+- qcom,cpr-init-voltage-as-ceiling: Boolean which indicates that the ceiling voltage used for a given virtual
+ corner may be reduced to the per-fuse-corner initial voltage fuse value.
+- qcom,cpr-scaled-init-voltage-as-ceiling: Boolean which indicates that the ceiling voltage used for a given
+ virtual corner may be reduced to the interpolated, per-virtual-corner initial
+ voltage value. Note that if both qcom,cpr-init-voltage-as-ceiling and
+ qcom,cpr-scaled-init-voltage-as-ceiling are specified, then
+ qcom,cpr-scaled-init-voltage-as-ceiling will take precedence since the interpolated
+ voltages are necessarily less than or equal to the fused initial voltage values.
+- qcom,cpr-voltage-scaling-factor-max: Array of values which define the maximum allowed scaling factor to apply
+ when calculating per-corner initial voltage values for each fuse corner. The
+ array must be of length equal to the value of the qcom,cpr-fuse-corners property.
+ Each element in the array maps to the fuse corners in increasing order.
+ The elements have units of uV/MHz. Each element corresponds to 'max_factor' in
+ the following equation:
+ init_voltage_min(f) = fuse_init_voltage(f) - (fuse_f_max - f) * max_factor
+ If this property is not specified, then the initial voltage for each virtual
+ corner will be set to the initial voltage of the associated fuse corner.
+- qcom,cpr-quot-adjust-scaling-factor-max: Array of values which define the maximum allowed scaling factor to
+ apply when calculating per-virtual-corner target quotients for each fuse
+ corner. Two data formats are allowed for this property. The primary one
+ requires that the array be of length equal to the value of the
+ qcom,cpr-fuse-corners property. When using this format, each element in the
+ array maps to the fuse corners in increasing order. The second depreciated
+ format allows for only a single element to be specified which defines the
+ maximum scaling factor for the highest fuse corner. In this case, a value of
+ 0 is assumed for the lower fuse corners. The elements of this property have
+ units of QUOT/GHz. Each element corresponds to 'max_factor' in the following
+ equation:
+ quot_min(f) = fuse_quot(f) - (fuse_f_max - f) * max_factor / 1000
+ where f and fuse_f_max have units of MHz.
+ This property is required if qcom,cpr-speed-bin-max-corners is present.
+- qcom,cpr-fuse-init-voltage: Array of quadruples in which each quadruple specifies a fuse location to
+ read in order to get an initial voltage for a fuse corner. The fuse values
+ are encoded as voltage steps higher or lower than the voltages defined in
+ qcom,cpr-voltage-ceiling. Each step corresponds to the voltage defined by
+ the qcom,cpr-init-voltage-step property.
+ The 4 elements in one quadruple are:
+ [0]: => the fuse row number of the bits
+ [1]: => LSB bit position of the bits
+ [2]: => number of the bits
+ [3]: => fuse reading method, 0 for direct reading or 1 for SCM reading
+ The quadruples are ordered from the lowest voltage fuse corner to the
+ highest voltage fuse corner.
+ A given cpr-regulator device must have either qcom,cpr-fuse-init-voltage
+ specified or qcom,pvs-voltage-table (and its associated properties).
+- qcom,cpr-fuse-redun-init-voltage: Array of quadruples in which each quadruple specifies a fuse location
+ to read in order to get the redundant initial voltage for a fuse corner.
+ This property is the same as qcom,cpr-fuse-init-voltage except that it is
+ only utilized if a chip is configured to use the redundant set of fuse
+ values. This property is required if qcom,cpr-fuse-redun-sel and
+ qcom,cpr-fuse-init-voltage are specified.
+- qcom,cpr-init-voltage-ref: Array of reference voltages in microvolts used when decoding the initial
+ voltage fuse values. The elements in the array are ordered from lowest
+ voltage corner to highest voltage corner. This property must be of length
+ defined by qcom,cpr-fuse-corners.
+ This property is required if qcom,cpr-fuse-init-voltage is present.
+- qcom,cpr-init-voltage-step: The voltage step size in microvolts of the CPR initial voltage fuses described by the
+ qcom,cpr-fuse-init-voltage property.
+ This property is required if qcom,cpr-fuse-init-voltage is present.
+- mem-acc-supply: Regulator to vote for the memory accelerator configuration.
+ Not Present: memory accelerator configuration not supported.
+- qcom,mem-acc-corner-map: Array of integer which defines the mapping from mem-acc corner value for each
+ virtual corner. Each element is a mem-acc state for the corresponding virtual corner.
+ The elements in the array are ordered from lowest voltage corner to highest voltage corner.
+- qcom,fuse-remap-source: Array of quadruples in which each quadruple specifies a fuse location to
+ remap. The 4 elements in one quadruple are:
+ [0]: => the fuse row number of the bits
+ [1]: => LSB bit position of the bits
+ [2]: => the number of bits
+ [3]: => fuse reading method, 0 for direct reading or 1 for SCM reading
+ The fuse bits for all quadruples are packed together in the order specified
+ into 64-bit virtual fuse rows beginning at the row number defined in the
+ qcom,fuse-remap-base-row property. The remapped rows may be used by any
+ other properties.
+ Example:
+ qcom,fuse-remap-base-row = <1000>;
+ qcom,fuse-remap-source =
+ <13 57 2 0>,
+ <14 30 3 0>,
+ <20 1 7 0>,
+ <40 47 120 0>;
+
+ This results in the following bit remapping:
+
+ Row Bits Remap Row Remap Bits
+ 13 57..58 --> 1000 0..1
+ 14 30..32 --> 1000 2..4
+ 20 1..7 --> 1000 5..11
+ 40 47..63 --> 1000 12..28
+ 41 0..34 --> 1000 29..63
+ 41 35..63 --> 1001 0..28
+ 42 0..34 --> 1001 29..63
+ 42 35..38 --> 1002 0..3
+
+ A tuple like this could then be used to reference some of the
+ concatenated bits from rows 13, 14, and 20:
+
+ qcom,cpr-fuse-init-voltage = <1000 0 6 0>;
+- qcom,fuse-remap-base-row: Integer which defines the virtual row number to use as a base when remapping
+ fuse bits. The remap base row number can be any value as long as it is
+ greater than all of the real row numbers addressed in other properties of
+ the cpr-regulator device node. This property is required if
+ qcom,fuse-remap-source is specified.
+- qcom,cpr-quot-min-diff: Integer which defines the minimum target-quotient difference between
+ the highest and (highest - 1) fuse corner to keep CPR enabled. If this
+ property is not specified a default value of 50 is used.
+- qcom,cpr-fuse-quot-offset: Array of quadruples in which each quadruple specifies a fuse location to
+ read in order to get the quotient offset for a fuse corner. The fuse values
+ are encoded as the difference between quotients of that fuse corner and its
+ adjacent lower fuse corner divided by an unpacking multiplier value defined
+ under qcom,cpr-fuse-quot-offset-scale property.
+ The 4 elements in one quadruple are:
+ [0]: => the fuse row number of the bits
+ [1]: => LSB bit position of the bits
+ [2]: => number of the bits
+ [3]: => fuse reading method, 0 for direct reading or 1 for SCM reading
+ The quadruples are ordered from the lowest fuse corner to the highest
+ fuse corner.
+ Quotient offset read from the fuse locations above can be overridden with
+ the property qcom,cpr-quot-adjust-scaling-factor-max.
+- qcom,cpr-fuse-quot-offset-scale: Array of integer values which defines the multipliers to decode the quotient offsets
+ of each fuse corner. The elements in the array are ordered from the lowest voltage fuse corner
+ to the highest voltage fuse corner. If this property is not present, then all target quotient
+ parameters are assumed to have a multiplier of 1 (i.e. no decoding needed).
+- qcom,cpr-redun-fuse-quot-offset: Array of quadruples in which each quadruple specifies a fuse location to
+ read in order to get the redundant quotient offset for a fuse corner. This
+ property is the same as qcom,cpr-fuse-quot-offset except that it is only
+ utilized if a chip is configured to use the redundant set of fuse values.
+- qcom,cpr-fuse-min-quot-diff: Array of values which define the minimum difference allowed between the adjusted
+ quotients of the fuse corners. The length of the array should be equal to the value
+ of the qcom,cpr-fuse-corners property. Where each element in the array maps to the
+ fuse corners in increasing order.
+- qcom,cpr-min-quot-diff-adjustment: Array of integer tuples of target quotient offsets to be added to
+ the adjusted target quotients of each fuse corner. When the quotient difference
+ between two adjacent fuse corners is insufficient, the quotient for the higher fuse corner is
+ replaced with that of the lower fuse corner plus the adjustment value.
+ The elements in a tuple are ordered from lowest voltage corner to highest voltage corner.
+ Each tuple must be of the length defined by qcom,cpr-fuse-corners.
+ If the qcom,cpr-fuse-version-map property is specified, then qcom,cpr-min-quot-diff-adjustment
+ must contain the same number of tuples as qcom,cpr-fuse-version-map. These tuples are then mapped
+ one-to-one in the order specified. E.g. if the second qcom,cpr-fuse-version-map tuple matches
+ for a given device, then the quotient adjustments defined in the
+ second qcom,cpr-min-quot-diff-adjustment tuple will be applied. If the
+ qcom,cpr-fuse-version-map property is not specified, then
+ qcom,cpr-min-quot-diff-adjustment must contain a single tuple which is then
+ applied unconditionally. The qcom,cpr-min-quot-diff-adjustment property must be specified
+ if the qcom,cpr-fuse-min-quot-diff property is specified.
+- qcom,cpr-skip-voltage-change-during-suspend: Boolean property which indicates that the CPR voltage
+ should not be adjusted based upon the number of online cores while
+ entering or exiting system suspend.
+- rpm-apc-supply: Regulator to notify RPM of the APC operating
+ corner
+- qcom,rpm-apc-corner-map: Array of integers which define the mapping of
+ the RPM corner to the corresponding APC virtual
+ corner. This property must be defined if
+ 'rpm-apc-supply' is present.
+- qcom,vsens-corner-map: Array of integers which define the mapping of the VSENS corner to the
+ corresponding APC fuse corner. The qcom,vsens-corner-map and
+ vdd-vsense-corner-supply properties must both be specified for a given
+ cpr-regulator device or neither must be specified.
+- vdd-vsens-corner-supply: Regulator to specify the current operating fuse corner to the Voltage Sensor.
+- vdd-vsens-voltage-supply: Regulator to specify the corner floor/ceiling voltages to the Voltage Sensor.
+- qcom,cpr-aging-sensor-id: Array of CPR sensor IDs to be used in the CPR de-aging algorithm. The number
+ of values should be equal to number of sensors selected for age calibration.
+ If this property is not specified, then the de-aging procedure is not enabled.
+- qcom,cpr-de-aging-allowed: Integer values that specify whether the CPR de-aging procedure is allowed or
+ not for a particular fuse revision. If the qcom,cpr-fuse-version-map
+ property is specified, then qcom,cpr-de-aging-allowed must contain the same number
+ of elements as there are tuples in qcom,cpr-fuse-version-map. If qcom,cpr-fuse-version-map
+ is not specified, then qcom,cpr-de-aging-allowed must contain a single value that
+ is used unconditionally. An element value of 1 means that the CPR de-aging procedure
+ can be performed for parts with the corresponding fuse revision. An element value of 0
+ means that CPR de-aging cannot be performed.
+ This property is required if the qcom,cpr-aging-sensor-id property has been specified.
+- qcom,cpr-aging-ref-corner: The vdd-apc-supply reference virtual voltage corner to be set during the CPR de-aging
+ measurements. This corner value is needed to set appropriate voltage on
+ the dependent voltage rails such as vdd-mx and mem-acc.
+ This property is required if the qcom,cpr-aging-sensor-id property has been specified.
+- qcom,cpr-aging-ref-voltage: The vdd-apc-supply reference voltage in microvolts to be set during the
+ CPR de-aging measurements.
+ This property is required if the qcom,cpr-aging-sensor-id property has been specified.
+- qcom,cpr-max-aging-margin: The maximum allowed aging voltage margin in microvolts. This is used to limit
+ the calculated aging voltage margin.
+ This property is required if the qcom,cpr-aging-sensor-id property has been specified.
+- qcom,cpr-non-collapsible-sensors: Array of CPR sensor IDs which are in non-collapsible domain. The sensor IDs not
+ specified in the array should be bypassed for the de-aging procedure. The number of
+ elements should be less than or equal to 32. The values of the array elements should
+ be greater than or equal to 0 and less than or equal to 31.
+ This property is required for power-domains with bypass mux present in HW.
+ This property can be required if the qcom,cpr-aging-sensor-id property has been specified.
+- qcom,cpr-aging-ro-scaling-factor: The aging ring oscillator (RO) scaling factor with units of QUOT/V.
+ This value is used for calculating a voltage margin from RO measurements.
+ This property is required if the qcom,cpr-aging-sensor-id property has been specified.
+- qcom,cpr-ro-scaling-factor: Array of scaling factors with units of QUOT/V for each ring oscillator ordered
+ from the lowest to the highest RO. These values are used to calculate
+ the aging voltage margin adjustment for all of the ROs. Since CPR2 supports
+ exactly 8 ROs, the array must contain 8 elements corresponding to RO0 through RO7 in order.
+ If a given RO is unused for a fuse corner, then its scaling factor may be specified as 0.
+ This property is required if the qcom,cpr-aging-sensor-id property has been specified.
+- qcom,cpr-aging-derate: Array of scaling factors which define the amount of derating to apply to the reference
+ aging voltage margin adjustment for each of the fuse corners. Each element has units
+ of uV/mV. This property must be of length defined by qcom,cpr-fuse-corners.
+ The elements are ordered from the lowest to the highest fuse corner.
+ This property is required if the qcom,cpr-aging-sensor-id property has been specified.
+- qcom,cpr-fuse-aging-init-quot-diff: Array of quadruples in which each quadruple specifies a fuse location to read in
+ order to get an initial quotient difference. The difference between quot min and quot max
+ is fused as the initial quotient difference.
+ The 4 elements in one quadruple are:
+ [0]: => the fuse row number of the bits
+ [1]: => LSB bit position of the bits
+ [2]: => number of the bits
+ [3]: => fuse reading method, 0 for direct reading or 1 for SCM reading
+ The number of quadruples should be equal to the number of values specified in
+ the qcom,cpr-aging-sensor-id property. This property is required if
+ the qcom,cpr-aging-sensor-id property has been specified.
+- qcom,cpr-thermal-sensor-id: TSENS hardware sensor-id of the sensor which
+ needs to be monitored.
+- qcom,cpr-disable-temp-threshold: The TSENS temperature threshold in degrees Celsius at which CPR
+ closed-loop is disabled. CPR closed-loop will stay disabled as long as the
+ temperature is below this threshold. This property is required
+ only if 'qcom,cpr-thermal-sensor-id' is present.
+- qcom,cpr-enable-temp-threshold: The TSENS temperature threshold in degrees Celsius at which CPR
+ closed-loop is enabled. CPR closed-loop will stay enabled above this
+ temperature threshold. This property is required only if
+ 'qcom,cpr-thermal-sensor-id' is present.
+- qcom,disable-closed-loop-in-pc: Bool property to disable closed-loop CPR during
+ power-collapse. This can be enabled only for single core
+ designs. The property 'qcom,cpr-cpus' is required to enable this logic.
+Example:
+ apc_vreg_corner: regulator@f9018000 {
+ status = "okay";
+ compatible = "qcom,cpr-regulator";
+ reg = <0xf9018000 0x1000>, <0xfc4b8000 0x1000>;
+ reg-names = "rbcpr", "efuse_addr";
+ interrupts = <0 15 0>;
+ regulator-name = "apc_corner";
+ qcom,cpr-fuse-corners = <3>;
+ regulator-min-microvolt = <1>;
+ regulator-max-microvolt = <12>;
+
+ qcom,pvs-fuse = <22 6 5 1>;
+ qcom,pvs-fuse-redun-sel = <22 24 3 2 1>;
+ qcom,pvs-fuse-redun = <22 27 5 1>;
+
+ qcom,pvs-voltage-table =
+ <1050000 1150000 1350000>,
+ <1050000 1150000 1340000>,
+ <1050000 1150000 1330000>,
+ <1050000 1150000 1320000>,
+ <1050000 1150000 1310000>,
+ <1050000 1150000 1300000>,
+ <1050000 1150000 1290000>,
+ <1050000 1150000 1280000>,
+ <1050000 1150000 1270000>,
+ <1050000 1140000 1260000>,
+ <1050000 1130000 1250000>,
+ <1050000 1120000 1240000>,
+ <1050000 1110000 1230000>,
+ <1050000 1100000 1220000>,
+ <1050000 1090000 1210000>,
+ <1050000 1080000 1200000>,
+ <1050000 1070000 1190000>,
+ <1050000 1060000 1180000>,
+ <1050000 1050000 1170000>,
+ <1050000 1050000 1160000>,
+ <1050000 1050000 1150000>,
+ <1050000 1050000 1140000>,
+ <1050000 1050000 1140000>,
+ <1050000 1050000 1140000>,
+ <1050000 1050000 1140000>,
+ <1050000 1050000 1140000>,
+ <1050000 1050000 1140000>,
+ <1050000 1050000 1140000>,
+ <1050000 1050000 1140000>,
+ <1050000 1050000 1140000>,
+ <1050000 1050000 1140000>,
+ <1050000 1050000 1140000>;
+ qcom,cpr-voltage-ceiling = <1050000 1150000 1280000>;
+ qcom,cpr-voltage-floor = <1050000 1050000 1100000>;
+ vdd-apc-supply = <&pm8226_s2>;
+ vdd-apc-optional-prim-supply = <&ncp6335d>;
+ vdd-apc-optional-sec-supply = <&fan53555>;
+ vdd-mx-supply = <&pm8226_l3_ao>;
+ qcom,vdd-mx-vmax = <1350000>;
+ qcom,vdd-mx-vmin-method = <1>;
+ qcom,vdd-apc-step-up-limit = <1>;
+ qcom,vdd-apc-step-down-limit = <1>;
+ qcom,cpr-ref-clk = <19200>;
+ qcom,cpr-timer-delay = <5000>;
+ qcom,cpr-timer-cons-up = <1>;
+ qcom,cpr-timer-cons-down = <2>;
+ qcom,cpr-irq-line = <0>;
+ qcom,cpr-step-quotient = <15>;
+ qcom,cpr-up-threshold = <1>;
+ qcom,cpr-down-threshold = <2>;
+ qcom,cpr-idle-clocks = <5>;
+ qcom,cpr-gcnt-time = <1>;
+ qcom,cpr-clamp-timer-interval = <1>;
+ qcom,cpr-apc-volt-step = <5000>;
+
+ qcom,vsens-corner-map = <1 2 2>;
+ vdd-vsens-corner-supply = <&vsens_apc0_corner>;
+ vdd-vsens-voltage-supply = <&vsens_apc0_voltage>;
+
+ rpm-apc-supply = <&rpm_apc_vreg>;
+ qcom,rpm-apc-corner-map = <4 4 5 5 7 7 7 7 7 7 7 7>;
+
+ qcom,cpr-fuse-row = <138 1>;
+ qcom,cpr-fuse-bp-cpr-disable = <36>;
+ qcom,cpr-fuse-bp-scheme = <37>;
+ qcom,cpr-fuse-target-quot = <24 12 0>;
+ qcom,cpr-fuse-target-quot-size = <12 12 12>;
+ qcom,cpr-fuse-ro-sel = <54 38 41>;
+ qcom,cpr-fuse-revision = <140 26 2 0>;
+ qcom,cpr-fuse-redun-sel = <138 57 1 1 1>;
+ qcom,cpr-fuse-redun-row = <139 1>;
+ qcom,cpr-fuse-redun-target-quot = <24 12 0>;
+ qcom,cpr-fuse-redun-ro-sel = <46 36 39>;
+ qcom,cpr-fuse-cond-min-volt-sel = <54 42 6 7 1>;
+ qcom,cpr-cond-min-voltage = <1140000>;
+ qcom,cpr-fuse-uplift-sel = <22 53 1 0 0>;
+ qcom,cpr-uplift-voltage = <50000>;
+ qcom,cpr-uplift-quotient = <0 0 120>;
+ qcom,cpr-uplift-max-volt = <1350000>;
+ qcom,cpr-uplift-speed-bin = <1>;
+ qcom,speed-bin-fuse-sel = <22 0 3 0>;
+ qcom,cpr-corner-map = <1 1 2 2 3 3 3 3 3 3 3 3>;
+ qcom,cpr-corner-frequency-map =
+ <1 300000000>,
+ <2 384000000>,
+ <3 600000000>,
+ <4 787200000>,
+ <5 998400000>,
+ <6 1094400000>,
+ <7 1190400000>,
+ <8 1305600000>,
+ <9 1344000000>,
+ <10 1401600000>,
+ <11 1497600000>,
+ <12 1593600000>;
+ qcom,pvs-version-fuse-sel = <22 4 2 0>;
+ qcom,cpr-speed-bin-max-corners =
+ <0 1 2 4 7>,
+ <1 1 2 4 12>,
+ <2 1 2 4 10>,
+ <5 1 2 4 14>;
+ qcom,cpr-fuse-target-quot-scale =
+ <0 1>,
+ <0 1>,
+ <0 1>;
+ qcom,cpr-quot-adjust-scaling-factor-max = <0 650 650>;
+ qcom,cpr-fuse-quot-offset =
+ <138 53 5 0>,
+ <138 53 5 0>,
+ <138 48 5 0>,
+ <138 58 5 0>;
+ qcom,cpr-fuse-redun-quot-offset =
+ <200 53 5 0>,
+ <200 53 5 0>,
+ <200 48 5 0>,
+ <200 58 5 0>;
+ qcom,cpr-fuse-init-voltage =
+ <27 36 6 0>,
+ <27 18 6 0>,
+ <27 0 6 0>;
+ qcom,cpr-fuse-redun-init-voltage =
+ <140 36 6 0>,
+ <140 18 6 0>,
+ <140 0 6 0>;
+ qcom,cpr-init-voltage-ref = <1050000 1150000 1280000>;
+ qcom,cpr-init-voltage-step = <10000>;
+ qcom,cpr-voltage-ceiling-override =
+ <1 1 1050000 1050000 1150000 1150000 1280000
+ 1280000 1280000 1280000 1280000 1280000
+ 1280000 1280000>;
+ qcom,cpr-voltage-floor-override =
+ <1 1 1050000 1050000 1050000 1050000 1060000
+ 1070000 1080000 1090000 1100000 1100000
+ 1100000 1100000>;
+ qcom,cpr-scaled-init-voltage-as-ceiling;
+
+ qcom,cpr-fuse-version-map =
+ <0xffffffff 0xffffffff 2 4 4 4>,
+ <0xffffffff 0xffffffff 2 6 6 6>,
+ <0xffffffff 0xffffffff 3 4 4 4>;
+ qcom,cpr-quotient-adjustment =
+ <0 0 (-210)>,
+ <0 0 (-60)>,
+ <0 0 (-94)>;
+ qcom,cpr-quot-offset-adjustment =
+ <0 0 (-5)>;
+ qcom,cpr-init-voltage-adjustment =
+ <0 0 (-100000)>,
+ <0 0 (-100000)>,
+ <0 0 (-45000)>;
+ qcom,cpr-fuse-min-quot-diff = <0 0 40>;
+ qcom,cpr-min-quot-diff-adjustment =
+ <0 0 0>,
+ <0 0 72>,
+ <0 0 104>;
+ qcom,cpr-floor-to-ceiling-max-range =
+ <(-1) (-1) (-1) (-1) (-1) (-1) (-1) (-1) (-1) (-1) (-1) (-1)>,
+ <(-1) (-1) (-1) (-1) (-1) (-1) (-1) (-1) (-1) (-1) (-1) (-1)>,
+ <(-1) (-1) (-1) (-1) (-1) (-1) (-1) 50000 50000 50000 50000 50000>;
+ qcom,cpr-virtual-corner-init-voltage-adjustment =
+ <0 0 0 (-10000) 0 0 0 0 0 0 0 0>,
+ <0 0 0 0 0 0 0 0 0 0 0 (-20000)>,
+ <0 0 0 0 0 0 0 0 0 0 0 (-30000)>;
+ qcom,cpr-virtual-corner-quotient-adjustment =
+ <0 0 0 100 0 0 0 0 0 0 0 0>,
+ <0 0 0 0 0 0 0 0 0 0 0 (-300)>,
+ <0 0 0 (-60) 0 0 0 0 0 0 0 0>;
+ qcom,cpr-cpus = <&CPU0 &CPU1 &CPU2 &CPU3>;
+ qcom,cpr-online-cpu-virtual-corner-init-voltage-adjustment =
+ /* 1st fuse version tuple matched */
+ <0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 0 CPUs online */
+ <0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 1 CPUs online */
+ <0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) >, /* 2 CPUs online */
+ <0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */
+ <0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */
+ /* 2nd fuse version tuple matched */
+ <0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 0 CPUs online */
+ <0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 1 CPUs online */
+ <0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) >, /* 2 CPUs online */
+ <0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */
+ <0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */
+ /* 3rd fuse version tuple matched */
+ <0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 0 CPUs online */
+ <0 0 0 (-10000) (-10000) (-10000) (-15000) (-15000) (-20000) 0 (-20000) (-30000) >, /* 1 CPUs online */
+ <0 0 0 (-5000) (-5000) (-5000) (-5000) (-5000) (-10000) 0 (-10000) (-10000) >, /* 2 CPUs online */
+ <0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */
+ <0 0 0 0 0 0 0 0 0 0 0 0>; /* 4 CPUs online */
+ qcom,cpr-online-cpu-virtual-corner-quotient-adjustment =
+ /* 1st fuse version tuple matched */
+ <0 0 0 (-6) (-6) (-6) (-9) (-9) (-12) 0 (-12) (-18)>, /* 0 CPUs online */
+ <0 0 0 (-6) (-6) (-6) (-9) (-9) (-12) 0 (-12) (-18)>, /* 1 CPUs online */
+ <0 0 0 (-3) (-3) (-3) (-3) (-3) (-6) 0 (-6) (-6)>, /* 2 CPUs online */
+ <0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */
+ <0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */
+ /* 2nd fuse version tuple matched */
+ <0 0 0 (-6) (-6) (-6) (-9) (-9) (-12) 0 (-12) (-18)>, /* 0 CPUs online */
+ <0 0 0 (-6) (-6) (-6) (-9) (-9) (-12) 0 (-12) (-18)>, /* 1 CPUs online */
+ <0 0 0 (-3) (-3) (-3) (-3) (-3) (-6) 0 (-6) (-6)>, /* 2 CPUs online */
+ <0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */
+ <0 0 0 0 0 0 0 0 0 0 0 0>, /* 4 CPUs online */
+ /* 3rd fuse version tuple matched */
+ <0 0 0 (-21) (-21) (-21) (-32) (-32) (-42) 0 (-42) (-63)>, /* 0 CPUs online */
+ <0 0 0 (-21) (-21) (-21) (-32) (-32) (-42) 0 (-42) (-63)>, /* 1 CPUs online */
+ <0 0 0 (-11) (-11) (-11) (-11) (-11) (-21) 0 (-21) (-21)>, /* 2 CPUs online */
+ <0 0 0 0 0 0 0 0 0 0 0 0>, /* 3 CPUs online */
+ <0 0 0 0 0 0 0 0 0 0 0 0>; /* 4 CPUs online */
+ qcom,cpr-allowed =
+ <0>,
+ <1>,
+ <1>;
+
+ qcom,fuse-remap-base-row = <1000>;
+ qcom,fuse-remap-source =
+ <140 7 3 0>,
+ <138 45 5 0>;
+ qcom,cpr-fuse-quot-offset-scale = <5 5 5>;
+
+ qcom,cpr-aging-sensor-id = <17, 18>;
+ qcom,cpr-aging-ref-corner = <4>;
+ qcom,cpr-aging-ref-voltage = <1050000>;
+ qcom,cpr-max-aging-margin = <15000>;
+ qcom,cpr-de-aging-allowed =
+ <0>,
+ <0>,
+ <1>;
+ qcom,cpr-non-collapsible-sensors= <7 12 17 22>;
+ qcom,cpr-aging-ro-scaling-factor = <3500>;
+ qcom,cpr-ro-scaling-factor = <0 2500 2500 2500 0 0 0 0>;
+ qcom,cpr-aging-derate = <1000 1000 1250>;
+ qcom,cpr-fuse-aging-init-quot-diff =
+ <101 0 8 0>,
+ <101 8 8 0>;
+
+ qcom,cpr-thermal-sensor-id = <9>;
+ qcom,cpr-disable-temp-threshold = <5>;
+ qcom,cpr-enable-temp-threshold = <10>;
+ };
diff --git a/Documentation/devicetree/bindings/regulator/cpr2-gfx-regulator.txt b/Documentation/devicetree/bindings/regulator/cpr2-gfx-regulator.txt
new file mode 100644
index 000000000000..0ffd80c0740f
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/cpr2-gfx-regulator.txt
@@ -0,0 +1,395 @@
+Qualcomm Technologies, Inc. CPR regulator for Graphics
+
+GFX CPR controller monitors the voltage of the graphics processor(GPU)
+power rail. The CPR open-loop voltages are stored in hardware fuses
+for GFX CPR controller. However, the CPR target quotients must be defined
+in device tree. This driver supports CPR version 2 controller.
+
+This document describes the bindings that apply for GFX CPR controller.
+
+- compatible
+ Usage: required
+ Value type: <string>
+ Definition: should be "qcom,cpr2-gfx-regulator"
+
+- reg
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: Addresses and sizes for the memory of the CPR
+ controller and the first fuse row.
+
+- reg-names
+ Usage: required
+ Value type: <stringlist>
+ Definition: Address names. Must be "rbcpr" and "efuse_addr". Must be
+ specified in the same order as the corresponding addresses
+ are specified in the reg property.
+
+- regulator-name
+ Usage: required
+ Value type: <string>
+ Definition: A string used to describe the regulator.
+
+- clocks
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: Array of clock tuples in which each tuple consists of a
+ phandle to a clock device and a clock ID number. The
+ following clocks must be specified: GFX RBCPR, GFX RBCPR
+ AHB.
+
+- clock-names
+ Usage: required
+ Value type: <stringlist>
+ Definition: Clock names. This list must match up 1-to-1 with the clocks
+ specified in the 'clocks' property. "core_clk" and "iface_clk"
+ must be specified.
+
+- interrupts
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: CPR interrupt specifier.
+
+- vdd-gfx-supply
+ Usage: required
+ Value type: <phandle>
+ Definition: phandle of the underlying regulator device that is managed
+ by this CPR controller.
+
+- qcom,cpr-corners
+ Usage: required
+ Value type: <u32>
+ Definition: Number of voltage corners present. Many other
+ properties are sized based upon this value.
+
+- regulator-min-microvolt
+ Usage: required
+ Value type: <u32>
+ Definition: Minimum corner value which should be 1 to represent the
+ lowest supported corner.
+
+- regulator-max-microvolt
+ Usage: required
+ Value type: <u32>
+ Definition: Maximum corner value which should be equal to largest value
+ listed in qcom,cpr-corners.
+
+- qcom,cpr-voltage-ceiling
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: Array of ceiling voltages in microvolts for voltage corners
+ ordered from lowest voltage corner to highest voltage corner.
+ This property must be of length defined by qcom,cpr-corners.
+
+- qcom,cpr-voltage-floor
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: Array of floor voltages in microvolts for voltage corners
+ ordered from lowest voltage corner to highest voltage corner.
+ This property must be of length defined by qcom,cpr-corners.
+
+- qcom,vdd-gfx-step-up-limit
+ Usage: required
+ Value type: <u32>
+ Definition: Limit of vdd-gfx-supply steps for scaling up.
+
+- qcom,vdd-gfx-step-down-limit
+ Usage: required
+ Value type: <u32>
+ Definition: Limit of vdd-gfx-supply steps for scaling down.
+
+- qcom,cpr-ref-clk
+ Usage: required
+ Value type: <u32>
+ Definition: The reference clock rate in kHz.
+
+- qcom,cpr-timer-delay
+ Usage: required
+ Value type: <u32>
+ Definition: The delay in microseconds for the timer interval.
+
+- qcom,cpr-timer-cons-up
+ Usage: required
+ Value type: <u32>
+ Definition: The number of consecutive CPR step up events needed to
+ to trigger a up interrupt. Supported values: 0 - 15.
+
+- qcom,cpr-timer-cons-down
+ Usage: required
+ Value type: <u32>
+ Definition: The number of consecutive CPR step down events needed to
+ to trigger a down interrupt. Supported values: 0 - 15.
+
+- qcom,cpr-irq-line
+ Usage: required
+ Value type: <u32>
+ Definition: Internal interrupt route signal of RBCPR, one of 0, 1 or 2.
+
+- qcom,cpr-step-quotient
+ Usage: required
+ Value type: <u32>
+ Definition: Defines the number of CPR quotient (i.e. Ring Oscillator(RO)
+ count) per vdd-gfx-supply output voltage step. A single
+ integer value to be used for all RO's.
+
+- qcom,cpr-gfx-volt-step
+ Usage: required
+ Value type: <u32>
+ Definition: The voltage in microvolts of a single step of the VDD supply
+ regulator being controlled by CPR.
+
+- qcom,cpr-up-threshold
+ Usage: required
+ Value type: <u32>
+ Definition: The number CPR error steps required to generate an up event.
+ Supported values: 0 - 31.
+
+- qcom,cpr-down-threshold
+ Usage: required
+ Value type: <u32>
+ Definition: The number CPR error steps required to generate a down
+ event. Supported values: 0 - 31.
+
+- qcom,cpr-idle-clocks
+ Usage: required
+ Value type: <u32>
+ Definition: The number of CPR core clock cycles for the CPR controller
+ to wait in transitional states. Supported values: 0 - 31.
+
+- qcom,cpr-gcnt-time
+ Usage: required
+ Value type: <u32>
+ Definition: The time for gate count in microseconds.
+
+- qcom,cpr-fuse-init-voltage
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: Array of quadruples in which each quadruple specifies a fuse
+ location to read in order to get an initial voltage for a
+ voltage corner. The fuse values are encoded as voltage steps
+ higher or lower than the voltages defined in
+ qcom,cpr-init-voltage-ref. Each step corresponds to the
+ voltage defined by the qcom,cpr-init-voltage-step property.
+ The 3 elements in one quadruple are:
+ [0] => fuse row number
+ [1] => bit offset within the row
+ [2] => number of bits in the fuse parameter
+ The quadruples are ordered from the lowest voltage corner to
+ the highest voltage corner. The number for quadruples must be
+ equal to the value specified in qcom,cpr-corners property.
+
+- qcom,cpr-init-voltage-ref
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: Array of reference voltages in microvolts used when decoding
+ the initial voltage fuse values. The elements in the array
+ are ordered from lowest voltage corner to highest voltage
+ corner. This property must be of length defined by
+ qcom,cpr-corners.
+
+- qcom,cpr-init-voltage-step
+ Usage: required if qcom,cpr-fuse-init-voltage is specified.
+ Value type: <u32>
+ Definition: The voltage step size in microvolts of the CPR initial
+ voltage fuses described by the qcom,cpr-fuse-init-voltage
+ property.
+
+- qcom,cpr-ro-count
+ Usage: required
+ Value type: <u32>
+ Definition: Defines the number of Ring Oscillator(RO)s present.
+
+- qcom,cpr-target-quotients
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: A grouping of integer tuple lists. Each tuple defines the CPR
+ target quotient for each ring oscillator (RO) for a given corner.
+ Each tuple must be of the length defined by qcom,cpr-ro-count.
+ If a given RO is unused for a corner, then its target quotient
+ should be specified as 0. Each tuple list must contain the
+ number of tuples defined by the qcom,cpr-corners property.
+ The tuples in a given list are ordered from the lowest corner
+ to the highest corner. The tuple list grouping must contain
+ exactly 1 list if qcom,cpr-fuse-version-map is not specified or
+ the number of tuple lists must be equal to the number of tuples
+ in qcom,cpr-fuse-version-map.
+
+- vdd-mx-supply
+ Usage: optional
+ Value type: <phandle>
+ Definition: Regulator to supply memory power as dependency of VDD_GFX.
+
+- qcom,vdd-mx-corner-map
+ Usage: required if vdd-mx-supply is specified.
+ Value type: <prop-encoded-array>
+ Definition: Array of integers which define the mapping of the VDD_MX corner
+ to the corresponding GFX voltage corner. The elements in
+ the array are ordered from lowest voltage corner to highest
+ voltage corner. The length of this property must be equal to
+ the value defined by qcom,cpr-corners.
+
+- mem-acc-supply
+ Usage: optional
+ Value type: <phandle>
+ Definition: Regulator to vote for the memory accelerator configuration.
+ Not Present: memory accelerator configuration not supported.
+
+- qcom,cpr-fuse-revision
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: Array of 3 integer elements which define the location of the
+ bits for the CPR fusing revision fuse parameter.
+ The 3 elements are:
+ [0] => fuse row number
+ [1] => bit offset within the row
+ [2] => number of bits in the fuse parameter
+ The fusing revision value is used to determine specific
+ adjustments that maybe required on some chips.
+
+- qcom,process-id-fuse
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: Array of 3 integer elements which define the location of the
+ bits for the process node id fuse parameter.
+ The 3 elements are:
+ [0] => fuse row number
+ [1] => bit offset within the row
+ [2] => number of bits in the fuse parameter
+ This value is used to determine the specific adjustments that
+ may be required on some chips.
+
+- qcom,foundry-id-fuse
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: Array of 3 integer elements which define the location of the
+ bits for the foundry identification fuse parameter.
+ The 3 elements are:
+ [0] => fuse row number
+ [1] => bit offset within the row
+ [2] => number of bits in the fuse parameter
+ This value is used to determine the specific adjustments that
+ may be required on some chips.
+
+- qcom,cpr-fuse-version-map
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: Array of integer tuples which each match to a given
+ combination of CPR fuse parameter values. Each tuple
+ consists of 3 elements. The elements in one tuple are:
+ [0] => the foundry identification
+ [1] => the CPR fuse revision
+ [2] => the process node id
+ Any element in a tuple may use the value 0xffffffff as a
+ wild card which will match against any fuse parameter value.
+ The first tuple that matches against the fuse values read
+ from hardware will be used. This property is used by several
+ properties to provide an index into their lists.
+
+- qcom,cpr-init-voltage-adjustment
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: Array of integer tuples of initial voltage adjustments in
+ microvolts to add to the fused initial voltage values of
+ each fuse corner. The elements in a tuple are ordered from
+ lowest voltage corner to highest voltage corner. Each tuple
+ must be of the length defined by qcom,cpr-corners.
+ If the qcom,cpr-fuse-version-map property is specified, then
+ qcom,cpr-init-voltage-adjustment must contain the same
+ number of tuples as qcom,cpr-fuse-version-map. These tuples
+ are then mapped one-to-one in the order specified. E.g. if
+ the second qcom,cpr-fuse-version-map tuple matches for a
+ given device, then the initial voltage adjustments defined
+ in the second qcom,cpr-init-voltage-adjustment tuple will be
+ applied. If the qcom,cpr-fuse-version-map property is not
+ specified, then qcom,cpr-init-voltage-adjustment must contain
+ a single tuple which is then applied unconditionally. This
+ property can be used to add or subtract static initial voltage
+ margin from the regulator managed by the CPR controller.
+
+- qcom,cpr-init-voltage-as-ceiling
+ Usage: optional
+ Value type: <empty>
+ Definition: Boolean which indicates that the ceiling voltage used for
+ a given virtual corner may be reduced to the initial voltage
+ value.
+
+ - qcom,cpr-enable
+ Usage: optional
+ Value type: <empty>
+ Definition: Boolean flag which indicates that the CPR controller
+ should operate in closed-loop mode (i.e. CPR sensing loop
+ enabled) as opposed to open-loop mode (i.e. CPR sensing loop
+ disabled) by default.
+=======
+Example
+=======
+gfx_vreg_corner: regulator@98000 {
+ compatible = "qcom,cpr2-gfx-regulator";
+ reg = <0x98000 0x1000>, <0xa4000 0x1000>;
+ reg-names = "rbcpr", "efuse_addr";
+ clocks = <&clock_gcc clk_gcc_rbcpr_gfx_clk>,
+ <&clock_gcc clk_gcc_rbcpr_gfx_ahb_clk>;
+ clock-names = "core_clk", "iface_clk";
+ interrupts = <0 150 0>;
+
+ regulator-name = "gfx_corner";
+ qcom,cpr-corners = <8>;
+ regulator-min-microvolt = <1>;
+ regulator-max-microvolt = <8>;
+
+ qcom,cpr-voltage-ceiling = <810000 865000 900000 950000 1010000 1050000 1110000 1165000>;
+ qcom,cpr-voltage-floor = <755000 755000 755000 795000 835000 855000 920000 945000>;
+ vdd-gfx-supply = <&pm8004_s5>;
+
+ vdd-mx-supply = <&pm8950_s6_level_ao>;
+ qcom,vdd-mx-vmax = <RPM_SMD_REGULATOR_LEVEL_TURBO>;
+ qcom,vdd-mx-corner-map = <RPM_SMD_REGULATOR_LEVEL_SVS>,
+ <RPM_SMD_REGULATOR_LEVEL_SVS>,
+ <RPM_SMD_REGULATOR_LEVEL_SVS>,
+ <RPM_SMD_REGULATOR_LEVEL_SVS>,
+ <RPM_SMD_REGULATOR_LEVEL_SVS_PLUS>,
+ <RPM_SMD_REGULATOR_LEVEL_NOM>,
+ <RPM_SMD_REGULATOR_LEVEL_NOM_PLUS>,
+ <RPM_SMD_REGULATOR_LEVEL_TURBO>;
+
+ mem-acc-supply = <&mem_acc_gfx_vreg_corner>;
+
+ qcom,cpr-ref-clk = <19200>;
+ qcom,cpr-timer-delay = <5000>;
+ qcom,cpr-timer-cons-up = <0>;
+ qcom,cpr-timer-cons-down = <2>;
+ qcom,cpr-irq-line = <0>;
+ qcom,cpr-step-quotient = <16>;
+ qcom,cpr-up-threshold = <2>;
+ qcom,cpr-down-threshold = <4>;
+ qcom,cpr-idle-clocks = <15>;
+ qcom,cpr-gcnt-time = <1>;
+ qcom,vdd-gfx-step-up-limit = <1>;
+ qcom,vdd-gfx-step-down-limit = <1>;
+ qcom,cpr-gfx-volt-step = <5000>;
+
+ qcom,cpr-init-voltage-ref = <865000 865000 950000 950000 950000 1050000 1050000 1165000>;
+ qcom,cpr-fuse-init-voltage =
+ <72 50 5>,
+ <72 50 5>,
+ <72 45 5>,
+ <72 45 5>,
+ <72 45 5>,
+ <72 40 5>,
+ <72 40 5>,
+ <72 35 5>;
+ qcom,cpr-init-voltage-step = <12500>;
+ qcom,cpr-ro-count = <8>;
+ qcom,cpr-init-voltage-as-ceiling;
+ qcom,cpr-init-voltage-adjustment =
+ <(-55000) 0 (-60000) 0 (60000) 0 (65000) 0>;
+ qcom,cpr-target-quotients =
+ <513 489 620 574 237 272 144 177>,
+ <562 536 675 627 264 303 163 199>,
+ <631 606 744 699 315 356 205 245>,
+ <780 752 902 854 412 459 283 330>,
+ <879 847 1001 949 490 535 351 400>,
+ <1010 971 1138 1080 579 626 428 479>,
+ <1086 1039 1210 1146 643 684 489 538>,
+ <1238 1179 1367 1290 752 789 586 633>;
+};
diff --git a/Documentation/devicetree/bindings/regulator/cpr3-hmss-regulator.txt b/Documentation/devicetree/bindings/regulator/cpr3-hmss-regulator.txt
new file mode 100644
index 000000000000..ca129511bbd2
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/cpr3-hmss-regulator.txt
@@ -0,0 +1,546 @@
+Qualcomm Technologies, Inc. CPR3 Regulator - HMSS Specific Bindings
+
+HMSS CPR3 controllers each support two CPR threads that monitor the voltage of
+a pair of application processor (HMSS) clusters that are powered by a shared
+regulator supply. These controllers have a hardware aggregator to combine the
+UP/DOWN requests from each CPR thread into a single unified request. They also
+have a hardware channel to use these requests to directly change the supply
+voltage at the PMIC via the SPM without software intervention.
+
+HMSS CPR3 controllers also have to take into account the state of the memory
+array power mux (APM) when scaling voltage to ensure that memory always receives
+a sufficiently high voltage.
+
+Both CPR open-loop voltages and CPR target quotients are stored in hardware
+fuses for HMSS CPR3 controllers.
+
+This document describes the HMSS specific CPR3 bindings.
+
+=======================
+Required Node Structure
+=======================
+
+CPR3 regulators must be described in three levels of devices nodes. The first
+level describes the CPR3 controller. The second level describes one or more
+hardware threads managed by the controller. The third level describes one or
+more logical regulators handled by each CPR thread.
+
+All platform independent cpr3-regulator binding guidelines defined in
+cpr3-regulator.txt also apply to cpr3-hmss-regulator devices.
+
+====================================
+First Level Nodes - CPR3 Controllers
+====================================
+
+HMSS specific properties:
+- compatible
+ Usage: required
+ Value type: <string>
+ Definition: should be one of the following:
+ "qcom,cpr3-msm8996-v1-hmss-regulator",
+ "qcom,cpr3-msm8996-v2-hmss-regulator",
+ "qcom,cpr3-msm8996-v3-hmss-regulator",
+ "qcom,cpr3-msm8996-hmss-regulator".
+ If the SoC revision is not specified, then it is assumed to
+ be the most recent revision, i.e. v3.
+
+- interrupts
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: CPR interrupt specifier and a hardware closed-loop ceiling
+ interrupt specifier.
+
+- interrupt-names
+ Usage: required
+ Value type: <stringlist>
+ Definition: Interrupt names. This list must match up 1-to-1 with the
+ interrupts specified in the 'interrupts' property. "cpr"
+ and "ceiling" must be specified.
+
+- qcom,apm-ctrl
+ Usage: required on systems that need APM management
+ Value type: <phandle>
+ Definition: phandle of memory array power mux (APM) controller device
+ node for the APM that is used by the HMSS VDD supply
+
+- qcom,apm-threshold-voltage
+ Usage: required if qcom,apm-ctrl is specified
+ Value type: <u32>
+ Definition: Specifies the APM threshold voltage in microvolts. If the
+ vdd-supply voltage is greater than or equal to this level,
+ then the APM is switched to use the vdd-supply. If the
+ vdd-supply voltage is below this level, then the APM is
+ switched to use the system-supply.
+
+- qcom,apm-hysteresis-voltage
+ Usage: optional
+ Value type: <u32>
+ Definition: Specifies the voltage delta in microvolts between the APM
+ threshold voltage and the highest corner open-loop voltage
+ which may be used as the ceiling for the corner. If this
+ property is not specified, then a value of 0 is assumed.
+
+- qcom,system-supply-max-voltage
+ Usage: required if qcom,vdd-threadN-ldo-supply is specified for any
+ CPR3 regulator managed by any CPR3 thread of this controller.
+ Value type: <u32>
+ Definition: Maximum voltage setpoint for the system-supply regulator.
+
+- qcom,mem-acc-supply-threshold-voltage
+ Usage: required if mem-acc-supply or mem-acc-threadN-supply is
+ specified and the CPR3 controller or any of the CPR3 regulators
+ it controls needs to manage mem-acc settings.
+ Value type: <u32>
+ Definition: Specifies the mem-acc-supply threshold voltage in microvolts.
+ If the vdd-supply voltage is greater than or equal to this
+ level, then the mem-acc-supply regulator is switched to the
+ high voltage corner setting. Conversely, if the vdd-supply
+ voltage is below this level, then the mem-acc-supply regulator
+ is switched to the low voltage corner setting.
+
+- qcom,mem-acc-supply-corner-map
+ Usage: required if mem-acc-supply or mem-acc-threadN-supply is
+ specified and the CPR3 controller or any of the CPR3 regulators
+ it controls needs to manage mem-acc settings.
+ Value type: <prop-encoded-array>
+ Definition: A tuple containing two integers which defines the mem-acc-supply
+ corner to use for low and high vdd-supply voltages, respectively.
+
+- qcom,cpr-up-down-delay-time
+ Usage: required
+ Value type: <u32>
+ Definition: The time to delay in nanoseconds between consecutive CPR
+ measurements when the last measurement recommended
+ increasing or decreasing the vdd-supply voltage.
+
+- qcom,cpr-hw-closed-loop
+ Usage: optional
+ Value type: <empty>
+ Definition: Boolean flag which indicates that the HMSS CPR3 controller
+ should operate in hardware closed-loop mode as opposed to
+ software closed-loop mode.
+
+- vdd-limit-supply
+ Usage: required
+ Value type: <phandle>
+ Definition: phandle of the VDD supply limit regulator which controls the
+ CPR ceiling and floor voltages when operating in hardware
+ closed-loop mode.
+
+- qcom,cpr-clock-throttling
+ Usage: optional
+ Value type: <u32>
+ Definition: Specifies the power domains for which CPR processor clock
+ throttling should be enabled. This feature reduces the
+ processor's clock frequency when it is resuming from a low
+ power mode until CPR is able to raise the supply voltage to
+ a final settled value. The following bits may be set:
+ BIT(0) - Power cluster L2 cache
+ BIT(1) - Power cluster core 1
+ BIT(2) - Power cluster core 0
+ BIT(5) - Performance cluster L2 cache
+ BIT(6) - Performance cluster core 1
+ BIT(7) - Performance cluster core 0
+
+- mem-acc-threadN-supply
+ Usage: optional
+ Value type: <phandle>
+ Definition: phandle of the regulator device which manages mem-acc
+ configuration for the clusters per CPR thread. 'N' must
+ match with the hardware thread ID of the thread it controls.
+
+- vdd-threadN-ldo-supply
+ Usage: optional
+ Value type: <phandle>
+ Definition: phandle of the regulator device which manages LDO and BHS
+ modes for the clusters per CPR thread. 'N' must match with
+ the hardware thread ID of the thread it controls.
+
+- vdd-threadN-ldo-ret-supply
+ Usage: required if vdd-threadN-ldo-supply is specified for
+ this CPR thread.
+ Value type: <phandle>
+ Definition: phandle of the regulator device which manages LDO retention
+ modes for the clusters per CPR thread. 'N' must match with
+ the hardware thread ID of the thread it controls.
+
+=================================================
+Second Level Nodes - CPR Threads for a Controller
+=================================================
+
+HMSS specific properties:
+N/A
+
+===============================================
+Third Level Nodes - CPR Regulators for a Thread
+===============================================
+
+HMSS specific properties:
+- qcom,cpr-fuse-corners
+ Usage: required
+ Value type: <u32>
+ Definition: Specifies the number of fuse corners. This value must be 5
+ for HMSS. These fuse corners are: MinSVS, LowSVS, SVS,
+ Nominal, and Turbo. Note that a specific fused target
+ quotient is available for the LowSVS corner but a fused
+ open-loop voltage is not available. The LowSVS open-loop
+ voltage is calculated using linear interpolation between
+ the MinSVS and SVS values.
+
+- qcom,cpr-fuse-combos
+ Usage: required
+ Value type: <u32>
+ Definition: Specifies the number of fuse combinations being supported by
+ the device. This value is utilized by several other
+ properties. Supported values are 1 up to the maximum
+ possible for a given regulator type. For HMSS the maximum
+ supported value is 16. The first 8 fuse combos correspond
+ to speed bin fuse value 0 along with CPR revision fuse
+ values 0 to 7. The last 8 fuse combos correspond to speed
+ bin fuse value 1 along with CPR revision fuse values 0 to 7.
+
+- qcom,cpr-speed-bins
+ Usage: optional
+ Value type: <u32>
+ Definition: Specifies the number of speed bins being supported by the
+ device. This value is utilized by several other properties.
+ Supported values are 1 up to the maximum possible for a
+ given regulator type. For HMSS the maximum supported value
+ is 2.
+
+- qcom,ldo-min-headroom-voltage
+ Usage: required if vdd-threadN-ldo-supply is specified for the
+ CPR3 thread containing this CPR3 regulator and this CPR3
+ regulator needs to manage the cluster LDO state.
+ Value type: <u32>
+ Definition: Voltage in microvolts required between the VDD_APCC voltage
+ and the LDO output in order for the LDO to be operational.
+
+- qcom,ldo-max-headroom-voltage
+ Usage: required if vdd-threadN-ldo-supply is specified for the
+ CPR3 thread containing this CPR3 regulator and this CPR3
+ regulator needs to manage the cluster LDO state.
+ Value type: <u32>
+ Definition: Maximum voltage difference in microvolts between the vdd-supply
+ voltage and the LDO output voltage in order for active LDO mode
+ to be operational.
+
+- qcom,ldo-adjust-voltage
+ Usage: optional
+ Value type: <u32>
+ Definition: Voltage in microvolts used to offset margins between PMIC
+ output and CPU.
+
+- qcom,ldo-max-voltage
+ Usage: required if qcom,ldo-min-headroom-voltage is specified for this
+ CPR3 regulator.
+ Value type: <u32>
+ Definition: Voltage in microvolts which represents the maximum
+ physically supported voltage output of the LDO hardware.
+
+- qcom,uses-mem-acc
+ Usage: required if mem-acc-threadN-supply is specified for the
+ CPR3 thread containing this CPR3 regulator and this CPR3
+ regulator needs to manage mem-acc settings.
+ Value type: <empty>
+ Definition: Boolean flag which indicates that this CPR3 regulator must
+ manage mem-acc.
+
+- qcom,ldo-disable
+ Usage: optional
+ Value type: <empty>
+ Definition: Boolean flag which indicates that LDO mode usage is
+ disallowed. If this flag is present, then the
+ vdd-threadN-ldo-supply mode will not be modified.
+
+- qcom,allow-quotient-interpolation
+ Usage: optional
+ Value type: <empty>
+ Definition: Boolean flag which indicates that it is acceptable to use
+ interpolated CPR target quotient values. These values are
+ interpolated between the target quotient Fmax fuse values.
+
+- qcom,cpr-pd-bypass-mask
+ Usage: required
+ Value type: <u32>
+ Definition: Specifies the power domains associated with this CPR3
+ regulator. The following bits may be set:
+ BIT(0) - Power cluster L2 cache
+ BIT(1) - Power cluster core 1
+ BIT(2) - Power cluster core 0
+ BIT(3) - CBF
+ BIT(4) - L3 cache
+ BIT(5) - Performance cluster L2 cache
+ BIT(6) - Performance cluster core 1
+ BIT(7) - Performance cluster core 0
+
+- qcom,cpr-dynamic-floor-corner
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: A list of integers which defines for each fuse combination
+ the CPR corner whose closed-loop voltage should be used as
+ a CPR floor voltage whenever the power domains for this CPR3
+ regulator are bypassed. Supported values are 0 and 1 to N.
+ A value of 0 means that no dynamic floor is needed. N is
+ the number of corners defined for this fuse combination in
+ the qcom,cpr-corners property.
+
+ The list must contain qcom,cpr-fuse-combos number of
+ elements in which case the elements are matched to fuse
+ combinations 1-to-1 or qcom,cpr-speed-bins number of
+ elements in which case the elements are matched to
+ speed bins 1-to-1 or exactly 1 element which is used
+ regardless of the fuse combination and speed bin found
+ on a given chip.
+
+=======
+Example
+=======
+
+apcc_cpr: cpr3-ctrl@99e8000 {
+ compatible = "qcom,cpr3-msm8996-hmss-regulator";
+ reg = <0x099e8000 0x4000>, <0x00074000 0x1000>;
+ reg-names = "cpr_ctrl", "fuse_base";
+ clocks = <&clock_gcc clk_gcc_hmss_rbcpr_clk>;
+ clock-names = "core_clk";
+ interrupts = <0 48 0>, <0 47 0>;
+ interrupt-names = "cpr", "ceiling";
+ qcom,cpr-ctrl-name = "apcc";
+
+ qcom,cpr-sensor-time = <1000>;
+ qcom,cpr-loop-time = <5000000>;
+ qcom,cpr-idle-cycles = <15>;
+ qcom,cpr-up-down-delay-time = <3000>;
+ qcom,cpr-step-quot-init-min = <13>;
+ qcom,cpr-step-quot-init-max = <13>;
+ qcom,cpr-count-mode = <2>;
+
+ qcom,apm-ctrl = <&apc_apm>;
+ qcom,apm-threshold-voltage = <850000>;
+ qcom,apm-hysteresis-voltage = <5000>;
+ qcom,system-supply-max-voltage = <1015000>;
+ qcom,mem-acc-supply-threshold-voltage = <700000>;
+ qcom,mem-acc-supply-corner-map = <1 2>;
+
+ vdd-supply = <&pm8994_s11>;
+ qcom,voltage-step = <5000>;
+ vdd-limit-supply = <&pm8994_s11_limit>;
+ mem-acc-thread0-supply = <&apc0_pwrcl_mem_acc_vreg>;
+ mem-acc-thread1-supply = <&apc1_perfcl_mem_acc_vreg>;
+ mem-acc-supply = <&apcc_l3_mem_acc_vreg>;
+ vdd-thread0-ldo-supply = <&kryo0_vreg>;
+ vdd-thread1-ldo-supply = <&kryo1_vreg>;
+ vdd-thread0-ldo-ret-supply = <&kryo0_retention_vreg>;
+ vdd-thread1-ldo-ret-supply = <&kryo1_retention_vreg>;
+
+ qcom,cpr-enable;
+ qcom,cpr-hw-closed-loop;
+ qcom,cpr-clock-throttling = <0x20>;
+
+ qcom,cpr-aging-ref-voltage = <905000>;
+
+ thread@0 {
+ qcom,cpr-thread-id = <0>;
+ qcom,cpr-consecutive-up = <0>;
+ qcom,cpr-consecutive-down = <2>;
+ qcom,cpr-up-threshold = <0>;
+ qcom,cpr-down-threshold = <2>;
+
+ apc0_pwrcl_vreg: regulator-pwrcl {
+ regulator-name = "apc0_pwrcl_corner";
+ regulator-min-microvolt = <1>;
+ regulator-max-microvolt = <19>;
+
+ qcom,cpr-pd-bypass-mask = <0x07>;
+ qcom,cpr-fuse-corners = <5>;
+ qcom,cpr-fuse-combos = <1>;
+ qcom,cpr-corners = <19>;
+
+ qcom,ldo-min-headroom-voltage = <150000>;
+ qcom,ldo-max-headroom-voltage = <470000>;
+ qcom,ldo-max-voltage = <805000>;
+ qcom,uses-mem-acc;
+
+ qcom,cpr-corner-fmax-map = <1 2 6 11 19>;
+
+ qcom,cpr-voltage-ceiling =
+ <670000 670000 745000 745000 745000
+ 745000 905000 905000 905000 905000
+ 905000 1015000 1015000 1015000 1015000
+ 1015000 1015000 1015000 1015000>;
+ qcom,cpr-voltage-floor =
+ <520000 550000 555000 565000 585000
+ 615000 635000 655000 690000 720000
+ 740000 750000 760000 770000 780000
+ 790000 815000 840000 850000>;
+ qcom,corner-frequencies =
+ <192000000 268800000 307200000
+ 345600000 403200000 480000000
+ 576000000 633600000 729600000
+ 806400000 883200000 960000000
+ 1017600000 1113600000 1190400000
+ 1267200000 1344000000 1420800000
+ 1459200000>;
+
+ qcom,cpr-ro-scaling-factor =
+ < 0 0 0 0 2222 2275 2506 2491
+ 2649 2640 2886 2866 0 0 0 0>,
+ < 0 0 0 0 2222 2275 2506 2491
+ 2649 2640 2886 2866 0 0 0 0>,
+ < 0 0 0 0 2222 2275 2506 2491
+ 2649 2640 2886 2866 0 0 0 0>,
+ < 0 0 0 0 2147 2226 2310 2312
+ 2450 2447 2603 2600 0 0 0 0>,
+ < 0 0 0 0 1989 2079 2066 2083
+ 2193 2201 2283 2296 0 0 0 0>;
+
+ qcom,cpr-open-loop-voltage-fuse-adjustment =
+ <0 0 0 0 0>;
+ qcom,cpr-closed-loop-voltage-fuse-adjustment =
+ <0 0 0 0 0>;
+
+ qcom,allow-voltage-interpolation;
+ qcom,allow-quotient-interpolation;
+ qcom,cpr-scaled-open-loop-voltage-as-ceiling;
+
+ qcom,cpr-aging-max-voltage-adjustment = <25000>;
+ qcom,cpr-aging-ref-corner = <11>;
+ qcom,cpr-aging-ro-scaling-factor = <3200>;
+ qcom,cpr-aging-derate =
+ <1000 1000 1000 1000 1000 1000 1000 1000
+ 1000 1000 1000 1000 1000 1000 1000 1000
+ 1000 1000 1000>;
+ qcom,allow-aging-voltage-adjustment = <1>;
+ };
+
+ apc0_cbf_vreg: regulator-cbf {
+ regulator-name = "apc0_cbf_corner";
+ regulator-min-microvolt = <1>;
+ regulator-max-microvolt = <10>;
+
+ qcom,cpr-pd-bypass-mask = <0x18>;
+ qcom,cpr-fuse-corners = <5>;
+ qcom,cpr-fuse-combos = <1>;
+ qcom,cpr-corners = <10>;
+
+ qcom,cpr-corner-fmax-map = <1 2 5 9 10>;
+
+ qcom,cpr-voltage-ceiling =
+ <605000 670000 745000 745000 745000
+ 905000 905000 905000 905000 1015000>;
+ qcom,cpr-voltage-floor =
+ <520000 545000 565000 595000 635000
+ 660000 690000 730000 750000 850000>;
+
+ qcom,corner-frequencies =
+ <150000000 307200000 384000000
+ 499200000 595200000 691200000
+ 787200000 883200000 960000000
+ 1036800000>;
+
+ qcom,cpr-ro-scaling-factor =
+ < 0 0 0 0 2222 2275 2506 2491
+ 2649 2640 2886 2866 0 0 0 0>,
+ < 0 0 0 0 2222 2275 2506 2491
+ 2649 2640 2886 2866 0 0 0 0>,
+ < 0 0 0 0 2222 2275 2506 2491
+ 2649 2640 2886 2866 0 0 0 0>,
+ < 0 0 0 0 2147 2226 2310 2312
+ 2450 2447 2603 2600 0 0 0 0>,
+ < 0 0 0 0 1989 2079 2066 2083
+ 2193 2201 2283 2296 0 0 0 0>;
+
+ qcom,cpr-open-loop-voltage-fuse-adjustment =
+ <0 0 0 0 0>;
+ qcom,cpr-closed-loop-voltage-fuse-adjustment =
+ <0 0 0 0 0>;
+
+ qcom,allow-voltage-interpolation;
+ qcom,allow-quotient-interpolation;
+ qcom,cpr-scaled-open-loop-voltage-as-ceiling;
+
+ qcom,cpr-aging-max-voltage-adjustment = <25000>;
+ qcom,cpr-aging-ref-corner = <9>;
+ qcom,cpr-aging-ro-scaling-factor = <3200>;
+ qcom,cpr-aging-derate =
+ <1000 1000 1000 1000 1000 1000 1000 1000
+ 1000 1000>;
+ qcom,allow-aging-voltage-adjustment = <1>;
+ };
+ };
+
+ thread@1 {
+ qcom,cpr-thread-id = <1>;
+ qcom,cpr-consecutive-up = <0>;
+ qcom,cpr-consecutive-down = <2>;
+ qcom,cpr-up-threshold = <0>;
+ qcom,cpr-down-threshold = <2>;
+
+ apc1_vreg: regulator {
+ regulator-name = "apc1_corner";
+ regulator-min-microvolt = <1>;
+ regulator-max-microvolt = <18>;
+
+ qcom,cpr-pd-bypass-mask = <0xe0>;
+ qcom,cpr-fuse-corners = <5>;
+ qcom,cpr-fuse-combos = <1>;
+ qcom,cpr-corners = <18>;
+
+ qcom,ldo-min-headroom-voltage = <150000>;
+ qcom,ldo-max-headroom-voltage = <470000>;
+ qcom,ldo-max-voltage = <805000>;
+ qcom,uses-mem-acc;
+
+ qcom,cpr-corner-fmax-map = <1 3 5 11 18>;
+
+ qcom,cpr-voltage-ceiling =
+ <670000 670000 670000 745000 745000
+ 905000 905000 905000 905000 905000
+ 905000 1015000 1015000 1015000 1015000
+ 1015000 1015000 1015000>;
+ qcom,cpr-voltage-floor =
+ <520000 530000 545000 590000 620000
+ 635000 660000 685000 700000 730000
+ 740000 750000 765000 790000 805000
+ 815000 830000 850000>;
+
+ qcom,corner-frequencies =
+ <307200000 345600000 403200000
+ 480000000 576000000 633600000
+ 729600000 806400000 883200000
+ 960000000 1017600000 1113600000
+ 1190400000 1267200000 1344000000
+ 1420800000 1497600000 1593600000>;
+
+ qcom,cpr-ro-scaling-factor =
+ < 0 0 0 0 2212 2273 2517 2506
+ 2663 2650 2908 2891 0 0 0 0>,
+ < 0 0 0 0 2212 2273 2517 2506
+ 2663 2650 2908 2891 0 0 0 0>,
+ < 0 0 0 0 2212 2273 2517 2506
+ 2663 2650 2908 2891 0 0 0 0>,
+ < 0 0 0 0 2152 2237 2321 2337
+ 2475 2469 2636 2612 0 0 0 0>,
+ < 0 0 0 0 2001 2102 2092 2090
+ 2203 2210 2297 2297 0 0 0 0>;
+
+ qcom,cpr-open-loop-voltage-fuse-adjustment =
+ <0 0 0 5000 0>;
+ qcom,cpr-closed-loop-voltage-fuse-adjustment =
+ <0 0 0 20000 0>;
+
+ qcom,allow-voltage-interpolation;
+ qcom,allow-quotient-interpolation;
+ qcom,cpr-scaled-open-loop-voltage-as-ceiling;
+
+ qcom,cpr-aging-max-voltage-adjustment = <25000>;
+ qcom,cpr-aging-ref-corner = <11>;
+ qcom,cpr-aging-ro-scaling-factor = <3200>;
+ qcom,cpr-aging-derate =
+ <1000 1000 1000 1000 1000 1000 1000 1000
+ 1000 1000 1000 1000 1000 1000 1000 1000
+ 1000 1000>;
+ qcom,allow-aging-voltage-adjustment = <1>;
+ };
+ };
+};
diff --git a/Documentation/devicetree/bindings/regulator/cpr3-mmss-regulator.txt b/Documentation/devicetree/bindings/regulator/cpr3-mmss-regulator.txt
new file mode 100644
index 000000000000..fbb097fd76db
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/cpr3-mmss-regulator.txt
@@ -0,0 +1,260 @@
+Qualcomm Technologies, Inc. CPR3 Regulator - MMSS Specific Bindings
+
+MMSS CPR3 controllers each support one CPR thread that monitors the voltage of
+the graphics processor (MMSS) supply regulator. The CPR open-loop voltages are
+stored in hardware fuses for MMSS CPR3 controllers. However, the CPR target
+quotients must be defined in device tree.
+
+This document describes the MMSS specific CPR3 bindings.
+
+=======================
+Required Node Structure
+=======================
+
+CPR3 regulators must be described in three levels of devices nodes. The first
+level describes the CPR3 controller. The second level describes exacly one
+hardware thread managed by the controller. The third level describes one or
+more logical regulators handled by the CPR thread.
+
+All platform independent cpr3-regulator binding guidelines defined in
+cpr3-regulator.txt also apply to cpr3-hmss-regulator devices.
+
+====================================
+First Level Nodes - CPR3 Controllers
+====================================
+
+MMSS specific properties:
+- compatible
+ Usage: required
+ Value type: <string>
+ Definition: should be "qcom,cpr3-msm8996-mmss-regulator"
+
+- clocks
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: Array of clock tuples in which each tuple consists of a
+ phandle to a clock device and a clock ID number. The
+ following clocks must be specified: MMSS RBCPR, MMSS RBCPR
+ AHB, and MMSS MMAGIC AHB.
+
+- clock-names
+ Usage: required
+ Value type: <stringlist>
+ Definition: Clock names. This list must match up 1-to-1 with the clocks
+ specified in the 'clocks' property. "core_clk", "iface_clk",
+ and "bus_clk" must be specified.
+
+=================================================
+Second Level Nodes - CPR Threads for a Controller
+=================================================
+
+MMSS specific properties:
+N/A
+
+===============================================
+Third Level Nodes - CPR Regulators for a Thread
+===============================================
+
+MMSS specific properties:
+- qcom,cpr-fuse-corners
+ Usage: required
+ Value type: <u32>
+ Definition: Specifies the number of fuse corners. This value must be 4
+ for MMSS.
+
+- qcom,cpr-fuse-combos
+ Usage: required
+ Value type: <u32>
+ Definition: Specifies the number of fuse combinations being supported by
+ the device. This value is utilized by several other
+ properties. Supported values are 1 up to the maximum
+ possible for a given regulator type. For MMSS the maximum
+ supported value is 8. These combos correspond to CPR
+ revision fuse values from 0 to 7 in order.
+
+- qcom,cpr-speed-bins
+ Usage: optional
+ Value type: <u32>
+ Definition: Specifies the number of speed bins being supported by the
+ device. This value is utilized by several other properties.
+ Supported values are 1 up to the maximum possible for a
+ given regulator type. For MMSS the maximum supported value
+ is 1.
+
+- qcom,mem-acc-voltage
+ Usage: required if mem-acc-supply is specified for the CPR3 controller
+ containing this CPR3 regulator
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the mem-acc-supply
+ corner for each voltage corner in order from lowest to highest.
+
+ The list must contain qcom,cpr-fuse-combos number of tuples
+ in which case the tuples are matched to fuse combinations
+ 1-to-1 or qcom,cpr-speed-bins number of tuples in which case
+ the tuples are matched to speed bins 1-to-1 or exactly 1
+ tuple which is used regardless of the fuse combination and
+ speed bin found on a given chip.
+
+ Each tuple must be of the length defined in the
+ corresponding element of the qcom,cpr-corners property or
+ the qcom,cpr-speed-bins property. A single tuple may only
+ be specified if all of the corner counts in qcom,cpr-corners
+ are the same.
+
+- qcom,cpr-target-quotients
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: A grouping of integer tuple lists. Each tuple defines the
+ CPR target quotient for each ring oscillator (RO) for a
+ given corner. Since CPR3 supports exactly 16 ROs, each
+ tuple must contain 16 elements corresponding to RO0 through
+ RO15 in order. If a given RO is unused for a corner, then
+ its target quotient should be specified as 0.
+
+ Each tuple list in the grouping must meet the same size
+ requirements as those specified for qcom,mem-acc-voltage
+ above. The tuples in a given list are ordered from the
+ lowest corner to the highest corner.
+
+- qcom,cpr-ro-scaling-factor
+ Usage: required if qcom,cpr-closed-loop-voltage-adjustment is
+ specified
+ Value type: <prop-encoded-array>
+ Definition: The common definition of this property in cpr3-regulator.txt
+ is accurate for MMSS CPR3 controllers except for this
+ modification:
+
+ Each tuple list must contain the number of tuples defined in
+ the corresponding element of the qcom,cpr-corners property
+ or the qcom,cpr-speed-bins property as opposed to the value
+ of the qcom,cpr-fuse-corners property.
+
+- qcom,cpr-fused-closed-loop-voltage-adjustment-map
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the CPR fused
+ corner closed-loop offset adjustment fuse to utilize for
+ each voltage corner in order from lowest to highest.
+
+ The list must contain qcom,cpr-fuse-combos number of tuples
+ in which case the tuples are matched to fuse combinations
+ 1-to-1 or qcom,cpr-speed-bins number of tuples in which case
+ the tuples are matched to speed bins 1-to-1 or exactly 1
+ tuple which is used regardless of the fuse combination and
+ speed bin found on a given chip.
+
+ Each tuple must be of the length defined in the
+ corresponding element of the qcom,cpr-corners property or
+ the qcom,cpr-speed-bins property. A single tuple may only
+ be specified if all of the corner counts in qcom,cpr-corners
+ are the same.
+
+ Each tuple element must be either 0 or in the range 1 to
+ qcom,cpr-fuse-corners. A value of 0 signifies that no fuse
+ based adjustment should be applied to the fuse corner.
+ Values 1 to qcom,cpr-fuse-corners denote the specific fuse
+ corner that should be used by a given voltage corner.
+
+Note that the qcom,cpr-closed-loop-voltage-fuse-adjustment property is not
+meaningful for MMSS CPR3 regulator nodes since target quotients are not defined
+in fuses.
+
+=======
+Example
+=======
+
+gfx_cpr: cpr3-ctrl@838000 {
+ compatible = "qcom,cpr3-msm8996-mmss-regulator";
+ reg = <0x00838000 0x4000>, <0x00074000 0x1000>;
+ reg-names = "cpr_ctrl", "fuse_base";
+ clocks = <&clock_mmss clk_mmss_rbcpr_clk>,
+ <&clock_mmss clk_mmss_rbcpr_ahb_clk>,
+ <&clock_mmss clk_mmss_mmagic_ahb_clk>;
+ clock-names = "core_clk", "iface_clk", "bus_clk";
+ interrupts = <0 166 0>;
+ interrupt-names = "cpr";
+ qcom,cpr-ctrl-name = "gfx";
+
+ qcom,cpr-sensor-time = <1000>;
+ qcom,cpr-loop-time = <5000000>;
+ qcom,cpr-idle-cycles = <15>;
+ qcom,cpr-step-quot-init-min = <13>;
+ qcom,cpr-step-quot-init-max = <13>;
+ qcom,cpr-count-mode = <2>;
+
+ vdd-supply = <&pmi8994_s2>;
+ qcom,voltage-step = <5000>;
+
+ qcom,cpr-enable;
+
+ qcom,cpr-aging-ref-voltage = <905000>;
+
+ thread@0 {
+ qcom,cpr-thread-id = <0>;
+ qcom,cpr-consecutive-up = <0>;
+ qcom,cpr-consecutive-down = <2>;
+ qcom,cpr-up-threshold = <0>;
+ qcom,cpr-down-threshold = <2>;
+
+ gfx_vreg: regulator {
+ regulator-name = "gfx_corner";
+ regulator-min-microvolt = <1>;
+ regulator-max-microvolt = <4>;
+
+ qcom,cpr-fuse-corners = <4>;
+ qcom,cpr-fuse-combos = <1>;
+ qcom,cpr-corners = <4>;
+
+ qcom,cpr-corner-fmax-map = <1 2 3 4>;
+
+ qcom,cpr-voltage-ceiling =
+ <670000 745000 905000 1015000>;
+ qcom,cpr-voltage-floor =
+ <545000 625000 755000 855000>;
+
+ qcom,mem-acc-voltage = <1 1 2 2>;
+
+ qcom,corner-frequencies =
+ <120000000 205000000 360000000
+ 480000000>;
+
+ qcom,cpr-target-quotients =
+ < 0 0 0 0 249 232 0 394
+ 0 422 0 0 0 0 0 0>,
+ < 0 0 0 0 400 363 0 565
+ 0 603 0 0 0 0 0 0>,
+ < 0 0 0 0 669 601 0 851
+ 0 905 0 0 0 0 0 0>,
+ < 0 0 0 0 899 806 0 1084
+ 0 1149 0 0 0 0 0 0>;
+
+ qcom,cpr-ro-scaling-factor =
+ < 0 0 0 0 2268 2004 0 2408
+ 0 2539 0 0 0 0 0 0>,
+ < 0 0 0 0 2268 2004 0 2408
+ 0 2539 0 0 0 0 0 0>,
+ < 0 0 0 0 2268 2004 0 2408
+ 0 2539 0 0 0 0 0 0>,
+ < 0 0 0 0 2268 2004 0 2408
+ 0 2539 0 0 0 0 0 0>;
+
+ qcom,cpr-open-loop-voltage-fuse-adjustment =
+ <35000 0 0 0>;
+ qcom,cpr-closed-loop-voltage-adjustment =
+ <45000 0 0 0>;
+
+ qcom,cpr-fused-closed-loop-voltage-adjustment-map =
+ <2 2 0 4>;
+
+ qcom,allow-voltage-interpolation;
+ qcom,cpr-scaled-open-loop-voltage-as-ceiling;
+
+ qcom,cpr-aging-max-voltage-adjustment = <25000>;
+ qcom,cpr-aging-ref-corner = <3>;
+ qcom,cpr-aging-ro-scaling-factor = <2950>;
+ qcom,cpr-aging-derate =
+ <1000 1000 1000 1000>;
+ qcom,allow-aging-voltage-adjustment = <1>;
+ };
+ };
+};
diff --git a/Documentation/devicetree/bindings/regulator/cpr3-regulator.txt b/Documentation/devicetree/bindings/regulator/cpr3-regulator.txt
new file mode 100644
index 000000000000..71d3738d03a6
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/cpr3-regulator.txt
@@ -0,0 +1,575 @@
+Qualcomm Technologies, Inc. CPR3 Regulator - Platform Independent Bindings
+
+Core Power Reduction (CPR) version 3 controllers are used by some Qualcomm
+Technologies, Inc. (QTI) SoCs to manage important voltage regulators. CPR3
+controllers are capable of monitoring several ring oscillator sensing loops
+simultaneously. The CPR3 controller informs software when the silicon
+conditions require the supply voltage to be increased or decreased. On certain
+supply rails, the CPR3 controller is able to propagate the voltage increase
+or decrease requests all the way to the PMIC without software involvement.
+
+This document describes the common platform independent bindings that apply
+to all CPR3 controllers.
+
+=======================
+Required Node Structure
+=======================
+
+CPR3 regulators must be described in three levels of devices nodes. The first
+level describes the CPR3 controller. The second level describes one or more
+hardware threads managed by the controller. The third level describes one or
+more logical regulators handled by each CPR thread.
+
+====================================
+First Level Nodes - CPR3 Controllers
+====================================
+
+Platform independent properties:
+- compatible
+ Usage: required
+ Value type: <string>
+ Definition: The value to use for this property is defined in the
+ platform specific cpr3-regulator binding documentation
+ files.
+
+- reg
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: Addresses and sizes for the memory of the CPR3 controller
+ and the first fuse row
+
+- reg-names
+ Usage: required
+ Value type: <stringlist>
+ Definition: Address names. Must be "cpr_ctrl" and "fuse_base". Must be
+ specified in the same order as the corresponding addresses
+ are specified in the reg property.
+
+- qcom,cpr-ctrl-name
+ Usage: required
+ Value type: <string>
+ Definition: Name for this CPR controller
+
+- vdd-supply
+ Usage: required
+ Value type: <phandle>
+ Definition: phandle of the underlying regulator device that is managed
+ by this CPR controller.
+
+- system-supply
+ Usage: optional
+ Value type: <phandle>
+ Definition: phandle of the system-level regulator device which the
+ vdd-supply depends upon. Requests for this regulator must
+ be made before increasing the vdd-supply voltage and after
+ decreasing the vdd-supply voltage.
+
+- mem-acc-supply
+ Usage: optional
+ Value type: <phandle>
+ Definition: phandle of the mem-acc regulator device which is used to
+ configure memory array circuitry settings based upon
+ the performance operating point. Requests for this regulator
+ must be made before decreasing the vdd-supply voltage and
+ after increasing the vdd-supply voltage.
+
+- clocks
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: Array of clock tuples in which each tuple consists of a
+ phandle to a clock device and a clock ID number. The CPR3
+ core clock must be specified for some targets. See platform
+ specific cpr3-regulator binding documentation for additional
+ clocks that may also need to be specified.
+
+- clock-names
+ Usage: optional
+ Value type: <stringlist>
+ Definition: Clock names. This list must match up 1-to-1 with the clocks
+ specified in the 'clocks' property. "core_clk" must be
+ specified for some platforms. Other clocks may be required
+ for some platforms.
+
+- interrupts
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: CPR interrupt specifier and optionally a hardware
+ closed-loop ceiling interrupt specifier.
+
+- interrupt-names
+ Usage: required
+ Value type: <stringlist>
+ Definition: Interrupt names. This list must match up 1-to-1 with the
+ interrupts specified in the 'interrupts' property. "cpr"
+ must be specified. "ceiling" may be specified for some
+ platforms.
+
+- qcom,cpr-sensor-time
+ Usage: required
+ Value type: <u32>
+ Definition: The time in nanoseconds that each CPR sensor within the
+ sensing loop takes to perform a measurement.
+
+- qcom,cpr-loop-time
+ Usage: required
+ Value type: <u32>
+ Definition: The time in nanoseconds between consecutive CPR
+ measurements.
+
+- qcom,cpr-idle-cycles
+ Usage: required
+ Value type: <u32>
+ Definition: The number of CPR core clock cycles for the CPR controller
+ to wait in transitional states.
+ Supported values: 0 - 31.
+
+- qcom,voltage-step
+ Usage: required
+ Value type: <u32>
+ Definition: The voltage in microvolts of a single step of the VDD supply
+ regulator being controlled by CPR.
+
+- qcom,cpr-step-quot-init-min
+ Usage: required
+ Value type: <u32>
+ Definition: The default minimum CPR step quotient value. The step
+ quotient is the number of additional ring oscillator ticks
+ observed for each qcom,voltage-step increase in vdd-supply
+ output voltage. Supported values: 0 - 63.
+
+- qcom,cpr-step-quot-init-max
+ Usage: required
+ Value type: <u32>
+ Definition: The default maximum CPR step quotient value.
+ Supported values: 0 - 63.
+
+- qcom,cpr-count-mode
+ Usage: required
+ Value type: <u32>
+ Definition: The CPR counting mode to use during CPR measurements.
+ Supported values:
+ 0 - Read all sensors at once and use the minimum
+ quotient value observed in repeated measurements.
+ 1 - Read all sensors at once and use the maximum
+ quotient value observed in repeated measurements.
+ 2 - Read each sensor once in a sequential, staggered
+ fashion.
+
+- qcom,cpr-count-repeat
+ Usage: optional
+ Value type: <u32>
+ Definition: The number of times to read CPR sensors during a single CPR
+ measurement when using one of the all-at-once count modes.
+
+- qcom,cpr-enable
+ Usage: optional
+ Value type: <empty>
+ Definition: Boolean flag which indicates that the CPR3 controller
+ should operate in closed-loop mode (i.e. CPR sensing loop
+ enabled) as opposed to open-loop mode (i.e. CPR sensing loop
+ disabled) by default.
+
+- qcom,cpr-aging-ref-voltage
+ Usage: required if qcom,allow-aging-voltage-adjustment is specified
+ for any third level nodes
+ Value type: <u32>
+ Definition: Specifies the CPR aging reference voltage in microvolts.
+ This is the voltage that vdd-supply must be set to when
+ performing an aging measurement.
+
+=================================================
+Second Level Nodes - CPR Threads for a Controller
+=================================================
+
+Platform independent properties:
+- qcom,cpr-thread-id
+ Usage: required
+ Value type: <u32>
+ Definition: Specifies the hardware thread ID of this thread within the
+ CPR controller.
+
+- qcom,cpr-consecutive-up
+ Usage: required
+ Value type: <u32>
+ Definition: The number of consecutive CPR step up events needed to
+ to trigger an up interrupt. Supported values: 0 - 15.
+
+- qcom,cpr-consecutive-down
+ Usage: required
+ Value type: <u32>
+ Definition: The number of consecutive CPR step down events needed to
+ to trigger a down interrupt. Supported values: 0 - 15.
+
+- qcom,cpr-up-threshold
+ Usage: required
+ Value type: <u32>
+ Definition: The number CPR error steps required to generate an up event.
+ Supported values: 0 - 31.
+
+- qcom,cpr-down-threshold
+ Usage: required
+ Value type: <u32>
+ Definition: The number CPR error steps required to generate a down
+ event. Supported values: 0 - 31.
+
+===============================================
+Third Level Nodes - CPR Regulators for a Thread
+===============================================
+
+Platform independent properties:
+- regulator-name
+ Usage: required
+ Value type: <string>
+ Definition: Specifies the name for this CPR3 regulator.
+
+- regulator-min-microvolt
+ Usage: required
+ Value type: <u32>
+ Definition: Minimum corner value which should be 1 to represent the
+ lowest supported corner.
+
+- regulator-max-microvolt
+ Usage: required
+ Value type: <u32>
+ Definition: Maximum corner value which should be equal to largest value
+ listed in qcom,cpr-corners.
+
+- qcom,cpr-fuse-corners
+ Usage: required
+ Value type: <u32>
+ Definition: Specifies the number of fuse corners. See platform specific
+ binding files for further requirements.
+
+- qcom,cpr-fuse-combos
+ Usage: required
+ Value type: <u32>
+ Definition: Specifies the number of fuse combinations being supported by
+ the device. This value is utilized by several other
+ properties. Supported values are 1 up to the maximum
+ possible for a given regulator type. See platform specific
+ binding files for further details.
+
+- qcom,cpr-speed-bins
+ Usage: optional
+ Value type: <u32>
+ Definition: Specifies the number of speed bins being supported by the
+ device. This value is utilized by several other properties.
+ Supported values are 1 up to the maximum possible for a
+ given regulator type. See platform specific binding files
+ for further details.
+
+ This property can only be utilized if the number of corners
+ for all fuse combinations associated with a given speed bin
+ is the same.
+
+- qcom,cpr-corners
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: A list of integers which defines how many voltage corners
+ are to be used for each fuse combination. The list must
+ contain either qcom,cpr-fuse-combos number of elements in
+ which case the corner counts are applied to fuse
+ combinations 1-to-1 or the list must contain exactly 1
+ element which is used regardless of the fuse combination
+ found on a given chip.
+
+- qcom,cpr-speed-bin-corners
+ Usage: required if qcom,cpr-speed-bins is specified
+ Value type: <prop-encoded-array>
+ Definition: A list of integers which defines how many voltage corners
+ are to be used for each speed bin. The list must contain
+ qcom,cpr-speed-bins number of elements.
+
+- qcom,cpr-corner-fmax-map
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the highest
+ (i.e. maximum frequency) 1-based corner value associated
+ with each fuse-corner.
+
+ Each tuple must have a number of elements equal to the value
+ of the qcom,cpr-fuse-corners property. The elements of a
+ tuple are ordered from lowest to highest fuse corner.
+
+ The list must contain qcom,cpr-fuse-combos number of tuples
+ in which case the tuples are matched to fuse combinations
+ 1-to-1 or qcom,cpr-speed-bins number of tuples in which case
+ the tuples are matched to speed bins 1-to-1 or exactly 1
+ tuple which is used regardless of the fuse combination and
+ speed bin found on a given chip.
+
+- qcom,cpr-voltage-ceiling
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the CPR ceiling
+ voltage in microvolts for each voltage corner in order from
+ lowest to highest.
+
+ The list must contain qcom,cpr-fuse-combos number of tuples
+ in which case the tuples are matched to fuse combinations
+ 1-to-1 or qcom,cpr-speed-bins number of tuples in which case
+ the tuples are matched to speed bins 1-to-1 or exactly 1
+ tuple which is used regardless of the fuse combination and
+ speed bin found on a given chip.
+
+ Each tuple must be of the length defined in the
+ corresponding element of the qcom,cpr-corners property or
+ the qcom,cpr-speed-bins property. A single tuple may only
+ be specified if all of the corner counts in qcom,cpr-corners
+ are the same.
+
+- qcom,cpr-voltage-floor
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the CPR floor
+ voltage in microvolts for each voltage corner in order from
+ lowest to highest.
+
+ The list and tuples must meet the same size requirements as
+ those specified for qcom,cpr-voltage-ceiling above.
+
+- qcom,cpr-floor-to-ceiling-max-range
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the maximum
+ allowed difference between the final floor voltage and the
+ final ceiling voltage in microvolts for each voltage corner
+ in order from lowest to highest. A negative value may be
+ specified for an element to indicate that there is no
+ limitation of the floor to ceiling voltage range for the
+ corresponding corner.
+
+ In the case that the initial floor to ceiling voltage is
+ greater than the max range specified, the floor voltage will
+ be increased in order to satisfy the max range constraint.
+
+ The list and tuples must meet the same size requirements as
+ those specified for qcom,cpr-voltage-ceiling above.
+
+- qcom,system-voltage
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the system-supply
+ voltage in microvolts or corners or levels for each voltage
+ corner in order from lowest to highest.
+
+ The list and tuples must meet the same size requirements as
+ those specified for qcom,cpr-voltage-ceiling above.
+
+- qcom,corner-frequencies
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the CPU frequency
+ in Hertz corresponding to each voltage corner in order from
+ lowest to highest.
+
+ The list and tuples must meet the same size requirements as
+ those specified for qcom,cpr-voltage-ceiling above.
+
+- qcom,allow-voltage-interpolation
+ Usage: optional
+ Value type: <empty>
+ Definition: Boolean flag which indicates that it is acceptable to use
+ interpolated open-loop voltage values. These values are
+ interpolated between the open-loop voltage Fmax fuse values.
+
+- qcom,cpr-scaled-open-loop-voltage-as-ceiling
+ Usage: optional
+ Value type: <empty>
+ Definition: Boolean flag which indicates that it is acceptable to use
+ the interpolated open-loop voltage for each corner as the
+ CPR ceiling voltage for each corner.
+
+- qcom,cpr-open-loop-voltage-fuse-adjustment
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the open-loop
+ voltage adjustment in microvolts for each fused voltage
+ corner in order from lowest to highest. This adjustment is
+ applied to the values read from fuses before the values are
+ used in interpolation for intermediate corners.
+
+ The list and tuples must meet the same size requirements as
+ those specified for qcom,cpr-corner-fmax-map above.
+
+ The open-loop voltage for a given fuse corner corresponds to
+ the voltage that is safe to use under all circumstances.
+ It is used as a starting voltage for CPR and may also be
+ specified as a ceiling voltage for CPR scaling.
+
+- qcom,cpr-open-loop-voltage-adjustment
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the open-loop
+ voltage adjustment in microvolts for each voltage corner in
+ order from lowest to highest. This adjustment is applied to
+ the open-loop voltage values after they have been
+ interpolated for intermediate corners.
+
+ The list and tuples must meet the same size requirements as
+ those specified for qcom,cpr-voltage-ceiling above.
+
+- qcom,cpr-open-loop-voltage-min-diff
+ Usage: optional; only meaningful if the
+ qcom,cpr-open-loop-voltage-adjustment property is specified
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the minimum
+ allowed open-loop voltage difference in microvolts between
+ each voltage corner and the one immediately preceding it.
+ The elements in a tuple are ordered from the lowest to the
+ highest corner. The value specified for the first corner is
+ ignored since there is no corner before it.
+
+ Negative voltage values may be specified for this property.
+ A negative value means that the open-loop voltage of a
+ corner may be lower than that of the preceding corner.
+
+ The minimum difference is enforced after the open-loop
+ voltage values have been interpolated for intermediate
+ corners and after adjustments have been applied.
+
+ The list and tuples must meet the same size requirements as
+ those specified for qcom,cpr-voltage-ceiling above.
+
+ If this property is not specified, then the minimum
+ difference is assumed to be 0 uV for all corners.
+
+- qcom,cpr-closed-loop-voltage-fuse-adjustment
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the closed-loop
+ voltage adjustment in microvolts for each fused voltage
+ corner in order from lowest to highest. This adjustment is
+ applied to the values read from fuses before the values are
+ used in interpolation for intermediate corners.
+
+ The list and tuples must meet the same size requirements as
+ those specified for qcom,cpr-corner-fmax-map above.
+
+ The qcom,cpr-ro-scaling-factor property must be specified in
+ order to utilize this property.
+
+ The closed-loop voltage for a given fuse corner corresponds
+ to the voltage that the CPR controller settles the VDD
+ supply rail to based upon the programmed CPR target
+ quotients and the current silicon conditions.
+
+- qcom,cpr-closed-loop-voltage-adjustment
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the closed-loop
+ voltage adjustment in microvolts for each voltage corner in
+ order from lowest to highest. This adjustment is applied to
+ target quotient values after they have been interpolated
+ for intermediate corners.
+
+ The list and tuples must meet the same size requirements as
+ those specified for qcom,cpr-voltage-ceiling above.
+
+ The qcom,cpr-ro-scaling-factor property must be specified in
+ order to utilize this property.
+
+- qcom,cpr-ro-scaling-factor
+ Usage: required if qcom,cpr-closed-loop-voltage-fuse-adjustment,
+ qcom,cpr-closed-loop-voltage-adjustment, or
+ qcom,allow-aging-voltage-adjustment is specified
+ Value type: <prop-encoded-array>
+ Definition: A grouping of integer tuple lists. Each tuple defines the
+ CPR ring oscillator (RO) scaling factor with units of QUOT/V
+ for each RO for a given fuse corner. Since CPR3 supports
+ exactly 16 ROs, each tuple must contain 16 elements
+ corresponding to RO0 through RO15 in order. If a given RO
+ is unused for a fuse corner, then its scaling factor may be
+ specified as 0.
+
+ Each tuple list must contain the number of tuples defined in
+ the qcom,cpr-fuse-corners property. The tuples in a given
+ list are ordered from the lowest fuse corner to the highest
+ fuse corner.
+
+ The tuple list grouping must contain qcom,cpr-fuse-combos
+ number of tuple lists in which case the lists are matched to
+ fuse combinations 1-to-1 or qcom,cpr-speed-bins number of
+ tuple lists in which case the lists are matched to
+ speed bins 1-to-1 or exactly 1 list which is used regardless
+ of the fuse combination and speed bin found on a given chip.
+
+ The target quotient adjustment to apply for each RO of a
+ given corner is determined by multiplying the adjustment
+ value in qcom,cpr-closed-loop-voltage-fuse-adjustment or
+ qcom,cpr-closed-loop-voltage-adjustment by the relevant RO
+ scaling factor in this property.
+
+- qcom,allow-aging-voltage-adjustment
+ Usage: optional
+ Value type: <prop-encoded-array>
+ Definition: A list of integers which specifies if CPR aging adjustment
+ should be performed for each fuse combination.
+ Supported per-combo element values:
+ 0 - do not perform CPR aging adjustment
+ 1 - perform CPR aging adjustment
+
+ The list must contain qcom,cpr-fuse-combos number of
+ elements in which case the elements are matched to fuse
+ combinations 1-to-1 or qcom,cpr-speed-bins number of
+ elements in which case the elements are matched to
+ speed bins 1-to-1 or exactly 1 element which is used
+ regardless of the fuse combination and speed bin found
+ on a given chip.
+
+- qcom,cpr-aging-max-voltage-adjustment
+ Usage: required if qcom,allow-aging-voltage-adjustment is specified
+ Value type: <prop-encoded-array>
+ Definition: A list of integers which defines the maximum CPR aging
+ voltage margin adjustment in microvolts that may be added
+ for each fuse combination. If this property is specified
+ and the adjustment specified is greater than 0, then aging
+ adjustments are required for this regulator.
+
+ The list must meet the same size requirements as those
+ specified for qcom,allow-aging-voltage-adjustment above.
+
+- qcom,cpr-aging-ref-corner
+ Usage: required if qcom,allow-aging-voltage-adjustment is specified
+ Value type: <prop-encoded-array>
+ Definition: A list of integers which defines the CPR reference corner
+ for this regulator to use during aging measurements for each
+ fuse combination.
+
+ The list must meet the same size requirements as those
+ specified for qcom,allow-aging-voltage-adjustment above.
+
+- qcom,cpr-aging-ro-scaling-factor
+ Usage: required if qcom,allow-aging-voltage-adjustment is specified
+ Value type: <prop-encoded-array>
+ Definition: A list of integers which defines the CPR aging ring
+ oscillator (RO) scaling factor with units of QUOT/V to use
+ during aging measurements for each fuse combination.
+
+ The list must meet the same size requirements as those
+ specified for qcom,allow-aging-voltage-adjustment above.
+
+- qcom,cpr-aging-derate
+ Usage: optional, though only meaningful if
+ qcom,allow-aging-voltage-adjustment is specified
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the CPR aging
+ derating scaling factor to apply to the closed-loop voltage
+ margin adjustment for each corner. The individual scaling
+ factors have units of uV/mV and are ordered from lowest to
+ highest corner per tuple. For example, a value of 900
+ specifies that the voltage adjustment for the corner should
+ be 90% (900/1000) of that for the reference corner.
+
+ The list and tuples must meet the same size requirements as
+ those specified for qcom,cpr-voltage-ceiling above.
+
+ If this property is not specified, then it is assumed that
+ no corners require derating (i.e. the scaling factor would
+ be 1000).
+
+All properties specified within the core regulator framework can also be used in
+third level nodes. These bindings can be found in:
+Documentation/devicetree/bindings/regulator/regulator.txt.
+
+See platform specific cpr3-regulator binding documentation files for examples.
diff --git a/Documentation/devicetree/bindings/regulator/cpr4-apss-regulator.txt b/Documentation/devicetree/bindings/regulator/cpr4-apss-regulator.txt
new file mode 100644
index 000000000000..a2827ec2cfc4
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/cpr4-apss-regulator.txt
@@ -0,0 +1,258 @@
+Qualcomm Technologies, Inc. CPR4 Regulator - APSS Specific Bindings
+
+APSS CPR4 controllers each support one CPR thread that monitors the voltage of
+a pair of application processor (APSS) clusters that are powered by a shared
+regulator supply. They also have a hardware channel to use these requests to
+directly change the supply voltage at the PMIC via the SPM without software
+intervention.
+
+APSS CPR4 controllers also have to take into account the state of the memory
+array power mux (APM) when scaling voltage to ensure that memory always receives
+a sufficiently high voltage.
+
+Both CPR open-loop voltages and CPR target quotients are stored in hardware
+fuses for APSS CPR4 controllers.
+
+This document describes the APSS specific CPR4 bindings.
+
+=======================
+Required Node Structure
+=======================
+
+CPR4 regulators must be described in three levels of devices nodes. The first
+level describes the CPR4 controller. The second level describes one or more
+hardware threads managed by the controller. The third level describes one or
+more logical regulators handled by each CPR thread.
+
+All platform independent cpr3-regulator binding guidelines defined in
+cpr3-regulator.txt also apply to cpr4-apss-regulator devices.
+
+====================================
+First Level Nodes - CPR4 Controllers
+====================================
+
+APSS specific properties:
+- compatible
+ Usage: required
+ Value type: <string>
+ Definition: should be one of the following:
+ "qcom,cpr4-msmtitanium-apss-regulator";
+
+- interrupts
+ Usage: required
+ Value type: <prop-encoded-array>
+ Definition: CPR interrupt specifier and a hardware closed-loop ceiling
+ interrupt specifier.
+
+- interrupt-names
+ Usage: required
+ Value type: <stringlist>
+ Definition: Interrupt names. This list must match up 1-to-1 with the
+ interrupts specified in the 'interrupts' property. "cpr"
+ and "ceiling" must be specified.
+
+- qcom,apm-ctrl
+ Usage: required on systems that need APM management
+ Value type: <phandle>
+ Definition: phandle of memory array power mux (APM) controller device
+ node for the APM that is used by the APSS VDD supply
+
+- qcom,apm-threshold-voltage
+ Usage: required if qcom,apm-ctrl is specified
+ Value type: <u32>
+ Definition: Specifies the APM threshold voltage in microvolts. If the
+ vdd-supply voltage is greater than or equal to this level,
+ then the APM is switched to use the vdd-supply. If the
+ vdd-supply voltage is below this level, then the APM is
+ switched to use the system-supply.
+
+- qcom,apm-hysteresis-voltage
+ Usage: optional
+ Value type: <u32>
+ Definition: Specifies the voltage delta in microvolts between the APM
+ threshold voltage and the highest corner open-loop voltage
+ which may be used as the ceiling for the corner. If this
+ property is not specified, then a value of 0 is assumed.
+
+- qcom,cpr-hw-closed-loop
+ Usage: optional
+ Value type: <empty>
+ Definition: Boolean flag which indicates that the APSS CPR4 controller
+ should operate in hardware closed-loop mode as opposed to
+ software closed-loop mode.
+
+- vdd-limit-supply
+ Usage: required
+ Value type: <phandle>
+ Definition: phandle of the VDD supply limit regulator which controls the
+ CPR ceiling and floor voltages when operating in hardware
+ closed-loop mode.
+
+- qcom,cpr-down-error-step-limit
+ Usage: required
+ Value type: <u32>
+ Definition: CPR4 hardware closed-loop down error step limit which
+ defines the maximum number of vdd-supply regulator steps
+ that the voltage may be reduced as the result of a single
+ CPR measurement.
+
+- qcom,cpr-up-error-step-limit
+ Usage: required
+ Value type: <u32>
+ Definition: CPR4 hardware closed-loop up error step limit which defines
+ the maximum number of vdd-supply regulator steps that the
+ voltage may be increased as the result of a single
+ CPR measurement.
+
+- qcom,cpr-saw-use-unit-mV
+ Usage: optional
+ Value type: <empty>
+ Definition: Boolean flag which indicates that the unit used in SAW PVC
+ interface is mV. Use this for vdd-supply regulators which
+ do not use PMIC voltage control register LSBs per actually
+ unique PMIC regulator output voltage.
+
+=================================================
+Second Level Nodes - CPR Threads for a Controller
+=================================================
+
+APSS specific properties:
+N/A
+
+===============================================
+Third Level Nodes - CPR Regulators for a Thread
+===============================================
+
+APSS specific properties:
+- qcom,cpr-fuse-corners
+ Usage: required
+ Value type: <u32>
+ Definition: Specifies the number of fuse corners. This value must be 4
+ for APSS. These fuse corners are: LowSVS, SVS, Nominal,
+ and Turbo.
+
+- qcom,cpr-fuse-combos
+ Usage: required
+ Value type: <u32>
+ Definition: Specifies the number of fuse combinations being supported by
+ the device. This value is utilized by several other
+ properties. Supported values are 1 up to the maximum
+ possible for a given regulator type. For APSS the maximum
+ supported value is 64. The first 8 fuse combos correspond
+ to speed bin fuse value 0 along with CPR revision fuse
+ values 0 to 7. The second 8 fuse combos correspond to speed
+ bin fuse value 1 along with CPR revision fuse values 0 to 7.
+ The last 8 fuse combos correspond to speed bin fuse value 7
+ along with CPR revision fuse values 0 to 7.
+
+- qcom,cpr-speed-bins
+ Usage: optional
+ Value type: <u32>
+ Definition: Specifies the number of speed bins being supported by the
+ device. This value is utilized by several other properties.
+ Supported values are 1 up to the maximum possible for a
+ given regulator type. For APSS the maximum supported value
+ is 8.
+
+- qcom,mem-acc-voltage
+ Usage: required if mem-acc-supply is specified for the CPR4 controller
+ containing this regulator
+ Value type: <prop-encoded-array>
+ Definition: A list of integer tuples which each define the mem-acc-supply
+ corner for each voltage corner in order from lowest to highest.
+
+ The list must contain qcom,cpr-fuse-combos number of tuples
+ in which case the tuples are matched to fuse combinations
+ 1-to-1 or qcom,cpr-speed-bins number of tuples in which case
+ the tuples are matched to speed bins 1-to-1 or exactly 1
+ tuple which is used regardless of the fuse combination and
+ speed bin found on a given chip.
+
+ Each tuple must be of the length defined in the
+ corresponding element of the qcom,cpr-corners property or
+ the qcom,cpr-speed-bins property. A single tuple may only
+ be specified if all of the corner counts in qcom,cpr-corners
+ are the same.
+
+- qcom,allow-quotient-interpolation
+ Usage: optional
+ Value type: <empty>
+ Definition: Boolean flag which indicates that it is acceptable to use
+ interpolated CPR target quotient values. These values are
+ interpolated between the target quotient Fmax fuse values.
+
+=======
+Example
+=======
+
+apc_cpr: cpr4-ctrl@b018000 {
+ compatible = "qcom,cpr4-msmtitanium-apss-regulator";
+ reg = <0xb018000 0x4000>, <0xa4000 0x1000>;
+ reg-names = "cpr_ctrl", "fuse_base";
+ interrupts = <GIC_SPI 15 IRQ_TYPE_EDGE_RISING>,
+ <GIC_SPI 282 IRQ_TYPE_EDGE_RISING>;
+ interrupt-names = "cpr", "ceiling";
+
+ qcom,cpr-ctrl-name = "apc";
+
+ qcom,cpr-sensor-time = <1000>;
+ qcom,cpr-loop-time = <5000000>;
+ qcom,cpr-idle-cycles = <15>;
+ qcom,cpr-step-quot-init-min = <13>;
+ qcom,cpr-step-quot-init-max = <13>;
+ qcom,cpr-count-mode = <2>; /* Staggered */
+ qcom,cpr-down-error-step-limit = <1>;
+ qcom,cpr-up-error-step-limit = <1>;
+
+ qcom,apm-ctrl = <&apc_apm>;
+ qcom,apm-threshold-voltage = <848000>;
+ qcom,apm-hysteresis-voltage = <5000>;
+
+ vdd-supply = <&pmtitanium_s5>;
+ qcom,voltage-step = <5000>;
+ vdd-limit-supply = <&pmtitanium_s5_limit>;
+ mem-acc-supply = <&apc_mem_acc_vreg>;
+
+ qcom,cpr-enable;
+ qcom,cpr-hw-closed-loop;
+
+ thread@0 {
+ qcom,cpr-thread-id = <0>;
+ qcom,cpr-consecutive-up = <1>;
+ qcom,cpr-consecutive-down = <1>;
+ qcom,cpr-up-threshold = <1>;
+ qcom,cpr-down-threshold = <1>;
+
+ apc_vreg: regulator {
+ regulator-name = "apc_corner";
+ regulator-min-microvolt = <1>;
+ regulator-max-microvolt = <8>;
+
+ qcom,cpr-fuse-corners = <4>;
+ qcom,cpr-fuse-combos = <8>;
+ qcom,cpr-speed-bins = <1>;
+ qcom,cpr-corners = <8>;
+
+ qcom,cpr-corner-fmax-map = <1 2 4 8>;
+
+ qcom,cpr-voltage-ceiling =
+ <645000 720000 790000 865000 920000
+ 990000 1065000 1065000>;
+
+ qcom,cpr-voltage-floor =
+ <590000 625000 690000 755000 800000
+ 855000 920000 920000>;
+
+ qcom,mem-acc-voltage = <1 1 2 2 2 2 2 2>;
+
+ qcom,corner-frequencies =
+ <652800000 1036800000 1401600000
+ 1689600000 1843200000 1958400000
+ 2150400000 2208000000>;
+
+ qcom,allow-voltage-interpolation;
+ qcom,allow-quotient-interpolation;
+ qcom,cpr-scaled-open-loop-voltage-as-ceiling;
+ };
+ };
+};