Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2876a34e authored by Abhimanyu Kapur's avatar Abhimanyu Kapur Committed by Matt Wagantall
Browse files

regulator: msm: Add snapshot of regulator drivers for MSM8996



This is a snapshot of all regulator drivers as of
msm-3.14 commit:

3bc54cf86bdc7affa7cd4bf7faa3c57fe8f8819d (Merge "msm:
camera: Add dummy sub module in sensor pipeline")

Signed-off-by: default avatarOsvaldo Banuelos <osvaldob@codeaurora.org>
Signed-off-by: default avatarAbhimanyu Kapur <abhimany@codeaurora.org>
parent 733dbd6e
Loading
Loading
Loading
Loading
+165 −0
Original line number Diff line number Diff line
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 two levels of devices nodes.  The first
level describes the CPR3 controller.  The second level describes one or more
hardware threads managed by the controller.

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 "qcom,cpr3-msm8996-hmss-regulator"

- 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_APCC supply voltage is above this level, then the APM is
		    switched to use VDD_APCC.  If VDD_APCC is below this level,
		    then the APM is switched to use VDD_MX.

- 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.

=================================================
Second Level Nodes - CPR Threads for a Controller
=================================================

HMSS specific properties:
- qcom,cpr-fuse-corners
	Usage:      required
	Value type: <u32>
	Definition: Specifies the number of fuse corners.  This value must be 4
		    for HMSS.

- 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 1.

=======
Example
=======

apcc_cpr: cpr3-ctrl@99e8000 {
	compatible = "qcom,cpr3-msm8996-hmss-regulator";
	reg = <0x099e8000 0x4000>, <0x00074000 0x1000>;
	reg-names = "cpr_ctrl", "fuse_base";
	qcom,cpr-ctrl-name = "apcc";

	qcom,apm-ctrl = <&apc_apm>;
	qcom,apm-threshold-voltage = <850000>;
	qcom,apm-hysteresis-voltage = <5000>;

	vdd-supply = <&pm8994_s11>;

	apc0_vreg: regulator@0 {
		qcom,cpr-thread-id = <0>;
		regulator-name = "apc0_corner";
		regulator-min-microvolt = <1>;
		regulator-max-microvolt = <19>;

		qcom,voltage-step = <5000>;

		qcom,cpr-fuse-corners = <4>;
		qcom,cpr-fuse-combos = <1>;
		qcom,cpr-corners = <19>;

		qcom,cpr-corner-fmax-map = <1 6 11 19>;

		qcom,cpr-voltage-ceiling =
			<605000  670000  745000  745000  745000  745000
			 905000  905000  905000  905000  905000 1015000
			1015000 1015000 1015000 1015000 1015000 1015000
			1015000>;
		qcom,cpr-voltage-floor =
			<520000  545000  625000  625000  625000  625000
			 755000  755000  755000  755000  755000  855000
			 855000  855000  855000  855000  855000  855000
			 855000>;

		qcom,corner-frequencies =
			<192000000  268800000  300000000  345600000
			 403200000  480000000  576000000  633600000
			 729600000  806400000  883200000  960000000
			1017600000 1113600000 1190400000 1267200000
			1344000000 1420800000 1459200000>;

		qcom,allow-voltage-interpolation;
	};

	apc1_vreg: regulator@1 {
		qcom,cpr-thread-id = <1>;
		regulator-name = "apc1_corner";
		regulator-min-microvolt = <1>;
		regulator-max-microvolt = <18>;

		qcom,voltage-step = <5000>;

		qcom,cpr-fuse-corners = <4>;
		qcom,cpr-fuse-combos = <1>;
		qcom,cpr-corners = <18>;

		qcom,cpr-corner-fmax-map = <1 5 11 18>;

		qcom,cpr-voltage-ceiling =
			<605000  670000  670000  745000  745000  905000
			 905000  905000  905000  905000  905000 1015000
			1015000 1015000 1015000 1015000 1015000 1015000>;
		qcom,cpr-voltage-floor =
			<520000  545000  545000  625000  625000  755000
			 755000  755000  755000  755000  755000  855000
			 855000  855000  855000  855000  855000  940000>;

		qcom,corner-frequencies =
			<300000000  345600000  403200000  480000000
			 576000000  633600000  729600000  806400000
			 883200000  960000000 1017600000 1113600000
			1190400000 1267200000 1344000000 1420800000
			1497600000 1593600000>;

		qcom,allow-voltage-interpolation;
	};
};
+85 −0
Original line number Diff line number Diff line
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 two levels of devices nodes.  The first
level describes the CPR3 controller.  The second level describes one or more
hardware threads managed by the controller.

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"

=================================================
Second Level Nodes - CPR Threads for a Controller
=================================================

HMSS 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 1.

=======
Example
=======

gfx_cpr: cpr3-ctrl@838000 {
	compatible = "qcom,cpr3-msm8996-mmss-regulator";
	reg = <0x00838000 0x4000>, <0x00074000 0x1000>;
	reg-names = "cpr_ctrl", "fuse_base";
	qcom,cpr-ctrl-name = "gfx";

	vdd-supply = <&pmi8994_s2>;

	gfx_vreg: regulator@0 {
		qcom,cpr-thread-id = <0>;
		regulator-name = "gfx_corner";
		regulator-min-microvolt = <1>;
		regulator-max-microvolt = <4>;

		qcom,voltage-step = <5000>;

		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,corner-frequencies =
			<120000000 205000000 360000000 480000000>;

		qcom,allow-voltage-interpolation;
	};
};
+181 −0
Original line number Diff line number Diff line
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 two levels of devices nodes.  The first
level describes the CPR3 controller.  The second level describes one or more
hardware threads managed by the controller.

====================================
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.

=================================================
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.

- regulator-name
	Usage:      required
	Value type: <string>
	Definition: Specifies the name for this thread of the CPR controller.

- 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,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-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-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-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 either
		    qcom,cpr-fuse-combos number of tuples in which case the
		    tuple mappings are applied to fuse combinations 1-to-1 or
		    the list must contain exactly 1 tuple which is used
		    regardless of the fuse combination 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 either qcom,cpr-fuse-combos number of
		    tuples in which case the tuples are matched to fuse
		    combinations 1-to-1 or the list must contain exactly 1 tuple
		    which is used regardless of the fuse combination found on a
		    given chip.

		    Each tuple must be of the length defined in the
		    corresponding element of the qcom,cpr-corners 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,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.

All properties specified within the core regulator framework can also be used in
second level nodes.  These bindings can be found in:
Documentation/devicetree/bindings/regulator/regulator.txt.

See platform specific cpr3-regulator binding documentation files for examples.
+151 −0
Original line number Diff line number Diff line
Qualcomm Technologies Memory Accelerator

Memory accelerator configures the power-mode (corner) for the
accelerator.

Required properties:
- compatible:			Must be "qcom,mem-acc-regulator"
- regulator-name:		A string used to describe the regulator
- regulator-min-microvolt:	Minimum corner value as min constraint, which
				should be 1 for SVS corner
- regulator-max-microvolt:	Maximum corner value as max constraint, which
				should be 4 for SUPER_TURBO or 3 for TURBO
- qcom,corner-acc-map		Array which maps the APC (application processor)
				corner value to the accelerator corner.
				[0] maps APC SVS corner (1) to accelerator SVS corner
				[1] maps APC NOMINAL corner (2) to accelerator NOMINAL corner
				[2] maps APC TURBO corner (3) to accelerator TURBO corner

Optional properties:
- reg:				Register addresses for acc-sel-l1, acc-sel-l2 control, acc-en,
				MEM ACC eFuse address, acc-l1-custom , acc-l2-custom,
				mem-acc-type1, mem-acc-type2, mem-acc-type3, mem-acc-type4,
				mem-acc-type5 and mem-acc-type6.
- reg-names:			Register names. Must be "acc-sel-l1",
				"acc-sel-l2", "acc-en", "efuse_addr",
				"acc-l1-custom", "acc-l2-custom", "mem-acc-type1",
				"mem-acc-type2", "mem-acc-type3", "mem-acc-type4",
				"mem-acc-type5", "mem-acc-type6".
				A given mem-acc-regulator driver must have "acc-sel-l1" or
				"acc-sel-l2" or "mem-acc-type*" reg-names property and
				related register address property.
- qcom,acc-en-bit-pos		Array which specifies bit positions in the
				'acc-en' register. Setting these bits forces the
				the acclerator to use the corner value specified
				in the 'acc-sel-l1' and 'acc-sel-l2' register.
- qcom,acc-sel-l1-bit-size	Integer which specifies the number of bits in
				the 'acc-sel-l1' register which define each L1
				select parameter.  If this property is not
				specified, then a default value of 2 is assumed.
- qcom,acc-sel-l1-bit-pos	Array which specifies bit positions in the
				'acc-sel-l1' register. Each element in this array
				is the LSB of an N-bit value where 'N' is
				defined by the qcom,acc-sel-l1-bit-size
				property.  This N-bit value specifies the corner
				value used by the accelerator for the L1 cache.
- qcom,acc-sel-l2-bit-size	Integer which specifies the number of bits in
				the 'acc-sel-l2' register which define each L2
				select parameter.  If this property is not
				specified, then a default value of 2 is assumed.
- qcom,acc-sel-l2-bit-pos	Array which specifies bit positions in the
				'acc-sel-l2' register. Each element in this array
				is the LSB of an N-bit value where 'N' is
				defined by the qcom,acc-sel-l2-bit-size
				property.  This N-bit value specifies the corner
				value used by the accelerator for the L2 cache.
- qcom,l1-config-skip-fuse-sel:	Array of 5 elements to indicate where to read the bits, what value to
				compare with in order to decide whether to
				skip configuring the L1 accelerator or not while changing the APC corner
				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 select skip L1 config logic
				  [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, L1 accelerator
				configuration logic is skipped. Otherwise, the original configuration sent
				from corner map should be applied. If the 5th element is 0, read the fuse row
				from register directly. Otherwise, read it through SCM.
- qcom,l1-acc-custom-data:	Array which maps APC corner values to L1 ACC custom data values.
				The corresponding custom data is written into the custom register
				while switching between APC corners. The custom register address
				is specified by "acc-11-custom" reg-property. The length of the array
				should be equal to number of APC corners.
- qcom,l2-acc-custom-data:	Array which maps APC corner values to L2 ACC custom data values.
				The corresponding custom data is written into the custom register
				while switching between APC corners. The custom register address
				is specified by "acc-l2-custom" reg-property. The length of the array
				should be equal to number of APC corners.
- qcom,override-acc-fuse-sel:	Array of 5 elements to indicate where to read the bits, what value to
				compare with in order to decide whether to
				apply override acc-map and custom data or not
				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 select override ACC configuration
				  [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, overridden accelerator configuration logic is applied.
				Otherwise, the original configuration should be applied. If the 5th element is 0,
				read the fuse row from register directly. Otherwise, read it through SCM.
- qcom,override-corner-acc-map:	Array which overrides the existing acc-corner map (specified by qcom,corner-acc-map)
				with corner values specified in this property.
				[0] maps APC SVS corner (1) to accelerator SVS corner
				[1] maps APC NOMINAL corner (2) to accelerator NOMINAL corner
				[2] maps APC TURBO corner (3) to accelerator TURBO corner
- qcom,override-l1-acc-custom-data:	Array which overrides the existing l1-acc-custom data
				(specified by qcom,l1-acc-custom-data), with values specified in this property.
				The corresponding custom data is written into the custom register
				while switching between APC corners. The custom register address
				is specified by "acc-11-custom" reg-property. The length of the array
				should be equal to number of APC corners.
				This property can only be specified if the "qcom,l1-acc-custom-data" is already defined.
- qcom,override-l2-acc-custom-data:	Array which overrides the existing l2-acc-custom data
				(specified by qcom,l2-acc-custom-data) with values specified in this property.
				The corresponding custom data is written into the custom register
				while switching between APC corners. The custom register address
				is specified by "acc-l2-custom" reg-property. The length of the array
				should be equal to number of APC corners.
				This property can only be specified if the " qcom,l2-acc-custom-data" is already defined.
- qcom,mem-acc-type1:		Array which specifies the value to be written to the mem acc type1 register for each fuse
				corner, from the lowest fuse corner to the highest fuse corner. The length of the array
				must be equal to the number of APC fuse corners. This property must be present if reg names
				specifies mem-acc-type1.
- qcom,mem-acc-type2:		Same as qcom,mem-acc-type1 except for mem acc type2 register.
- qcom,mem-acc-type3:		Same as qcom,mem-acc-type1 except for mem acc type3 register.
- qcom,mem-acc-type4:		Same as qcom,mem-acc-type1 except for mem acc type4 register.
- qcom,mem-acc-type5:		Same as qcom,mem-acc-type1 except for mem acc type5 register.
- qcom,mem-acc-type6:		Same as qcom,mem-acc-type1 except for mem acc type6 register.

mem_acc_vreg_corner: regulator@fd4aa044 {
	compatible = "qcom,mem-acc-regulator";
	reg = <0xfd4aa048 0x1>, <0xfd4aa044 0x1>, <0xfd4af000 0x1>,
		<0x58000 0x1000>, <0x01942124 0x4>, <0xf900d084 1>,
		<0xf900d088 1>, <0xf900d08c 1>, <0xf900d090 1>;
	reg-names = "acc-en", "acc-sel-l1" , "acc-sel-l2",
		"efuse_addr", "acc-l2-custom", "mem-acc-type1",
		"mem-acc-type2", "mem-acc-type3", "mem-acc-type4";
	regulator-name = "mem_acc_corner";
	regulator-min-microvolt = <1>;
	regulator-max-microvolt = <3>;

	qcom,acc-en-bit-pos = <0>;
	qcom,acc-sel-l1-bit-pos = <0>;
	qcom,acc-sel-l2-bit-pos = <0>;
	qcom,acc-sel-l1-bit-size = <2>;
	qcom,acc-sel-l2-bit-size = <2>;
	qcom,corner-acc-map = <0 1 3>;
	qcom,l1-config-skip-fuse-sel = <0 52 1 1 0>;
	qcom,l2-acc-custom-data = <0x0 0x3000 0x3000>;
	qcom,override-acc-fuse-sel = <0 52 1 1 0>;
	qcom,override-corner-acc-map = <0 0 1>;
	qcom,overide-l2-acc-custom-data = <0x0 0x0 0x3000>;
	qcom,mem-acc-type1 = <0x02 0x02 0x00>;
	qcom,mem-acc-type2 = <0x02 0x02 0x00>;
	qcom,mem-acc-type3 = <0x02 0x02 0x00>;
	qcom,mem-acc-type4 = <0x02 0x02 0x00>;
};
+162 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading