Add AM33XX regulators device tree data
v2 cover Add AM33XX regulators device tree data
This patch series add AM33XX regulators (tps65910/tps65217) device tree data to am335x-evm and am335x-bone dts files. These patches are based on Tony L "devel-dt" tree and tested on AM335x EVM and Bone devices.
Changes from v1:
- Incorporated all Mark Brown's review comments on v1 by
* moving all the regulator constraints to corresponding DTS file
* Regulator constraints are added according to board.
- regulator name is added.
AnilKumar Ch (4):
ARM: OMAP2+: AM33XX: Add tps65910 device tree data
ARM: OMAP2+: AM33XX: Add tps65217 device tree data arm/dts: Add tps65910 regulator DT data to am335x-evm.dts arm/dts: Add tps65217 regulator DT data to am335x-bone.dts
arch/arm/boot/dts/am335x-bone.dts | 28 ++++++++++++ arch/arm/boot/dts/am335x-evm.dts | 28 ++++++++++++ arch/arm/boot/dts/tps65217.dtsi | 56 ++++++++++++++++++++++++ arch/arm/boot/dts/tps65910.dtsi | 86 +++++++++++++++++++++++++++++++++++++ 4 files changed, 198 insertions(+) create mode 100644 arch/arm/boot/dts/tps65217.dtsi create mode 100644 arch/arm/boot/dts/tps65910.dtsi
Signature · 1 line
1.7.9.5
PATCH v2 1/4 ARM: OMAP2+: AM33XX: Add tps65910 device tree data
Add device tree data for tps65910 regulator by adding all tps65910 regulator nodes. Regulator is initialized based on compatible name provided in tps65910 DT file.
All tps65910 PMIC regulator device tree nodes are placed in a separate device tree include file (tps65910.dtsi). This patch was tested on AM335x-EVM.
--- arch/arm/boot/dts/tps65910.dtsi | 86 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 arch/arm/boot/dts/tps65910.dtsi
arch/arm/boot/dts/tps65910.dtsi new file +86 -0
@@ -0,0 +1,86 @@ +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/* + * Integrated Power Management Chip + * http://www.ti.com/lit/ds/symlink/tps65910.pdf + */ + +&tps { + compatible = "ti,tps65910"; + + regulators { + #address-cells = <1>; + #size-cells = <0>; + + vrtc_reg: regulator at 0 { + reg = <0>; + regulator-compatible = "vrtc"; + }; + + vio_reg: regulator at 1 { + reg = <1>; + regulator-compatible = "vio"; + }; + + vdd1_reg: regulator at 2 { + reg = <2>; + regulator-compatible = "vdd1"; + }; + + vdd2_reg: regulator at 3 { + reg = <3>; + regulator-compatible = "vdd2"; + }; + + vdd3_reg: regulator at 4 { + reg = <4>; + regulator-compatible = "vdd3"; + }; + + vdig1_reg: regulator at 5 { + reg = <5>; + regulator-compatible = "vdig1"; + }; + + vdig2_reg: regulator at 6 { + reg = <6>; + regulator-compatible = "vdig2"; + }; + + vpll_reg: regulator at 7 { + reg = <7>; + regulator-compatible = "vpll"; + }; + + vdac_reg: regulator at 8 { + reg = <8>; + regulator-compatible = "vdac"; + }; + + vaux1_reg: regulator at 9 { + reg = <9>; + regulator-compatible = "vaux1"; + }; + + vaux2_reg: regulator at 10 { + reg = <10>; + regulator-compatible = "vaux2"; + }; + + vaux33_reg: regulator at 11 { + reg = <11>; + regulator-compatible = "vaux33"; + }; + + vmmc_reg: regulator at 12 { + reg = <12>; + regulator-compatible = "vmmc"; + }; + }; +};
Signature · 1 line
1.7.9.5
PATCH v2 2/4 ARM: OMAP2+: AM33XX: Add tps65217 device tree data
In reply to AnilKumar ChAdd device tree data for tps65217 regulator by adding all tps65217 regulator nodes. Regulator is initialized based on compatible name provided in tps65217 DT file.
All tps65217 PMIC regulator device tree nodes are placed in a separate device tree include file (tps65217.dtsi). This patch was tested on AM335x-Bone.
--- arch/arm/boot/dts/tps65217.dtsi | 56 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 arch/arm/boot/dts/tps65217.dtsi
arch/arm/boot/dts/tps65217.dtsi new file +56 -0
@@ -0,0 +1,56 @@ +/* + * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/* + * Integrated Power Management Chip + * http://www.ti.com/lit/ds/symlink/tps65217.pdf + */ + +&tps { + compatible = "ti,tps65217"; + + regulators { + #address-cells = <1>; + #size-cells = <0>; + + dcdc1_reg: regulator at 0 { + reg = <0>; + regulator-compatible = "dcdc1"; + }; + + dcdc2_reg: regulator at 1 { + reg = <1>; + regulator-compatible = "dcdc2"; + }; + + dcdc3_reg: regulator at 2 { + reg = <2>; + regulator-compatible = "dcdc3"; + }; + + ldo1_reg: regulator at 3 { + reg = <3>; + regulator-compatible = "ldo1"; + }; + + ldo2_reg: regulator at 4 { + reg = <4>; + regulator-compatible = "ldo2"; + }; + + ldo3_reg: regulator at 5 { + reg = <5>; + regulator-compatible = "ldo3"; + }; + + ldo4_reg: regulator at 6 { + reg = <6>; + regulator-compatible = "ldo4"; + }; + }; +};
Signature · 1 line
1.7.9.5
PATCH v2 3/4 arm/dts: Add tps65910 regulator DT data to am335x-evm.dts
In reply to AnilKumar ChAdd tps65910 regulator device tree data to AM335x-EVM by adding regulator consumers with tightened constraints and regulator-name. TPS65910 regulator handle can be obtained by using this regulator name.
This patch also add I2C node with I2C frequency and tps65910 PMIC I2C slave address.
--- arch/arm/boot/dts/am335x-evm.dts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
arch/arm/boot/dts/am335x-evm.dts +28 -0
@@ -18,3 +18,31 @@ reg = <0x80000000 0x10000000>; /* 256 MB */ }; }; + +&i2c1 { + clock-frequency = <400000>; + + tps: tps at 2D { + reg = <0x2D>; + }; +}; + +/include/ "tps65910.dtsi" + +&vdd1_reg { + /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */ + regulator-name = "vdd_mpu"; + regulator-min-microvolt = <912500>; + regulator-max-microvolt = <1312500>; + regulator-boot-on; + regulator-always-on; +}; + +&vdd2_reg { + /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */ + regulator-name = "vdd_core"; + regulator-min-microvolt = <912500>; + regulator-max-microvolt = <1150000>; + regulator-boot-on; + regulator-always-on; +};
Signature · 1 line
1.7.9.5
PATCH v2 3/4 arm/dts: Add tps65910 regulator DT data to am335x-evm.dts
Hi Mark,
Quoted 30 lines · Chimata
Add tps65910 regulator device tree data to AM335x-EVM by adding regulator consumers with tightened constraints and regulator-name. TPS65910 regulator handle can be obtained by using this regulator name.
This patch also add I2C node with I2C frequency and tps65910 PMIC I2C slave address.
Signed-off-by AnilKumar Ch <[email protected]>--- arch/arm/boot/dts/am335x-evm.dts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)arch/arm/boot/dts/am335x-evm.dts +9
-0@@ -18,3 +18,31 @@ reg = <0x80000000 0x10000000>; /* 256 MB */ }; }; + +&i2c1 { + clock-frequency = <400000>; + + tps: tps at 2D { + reg = <0x2D>; + }; +}; +
arch/arm/boot/dts/am335x-evm.dts line 39
Quoted 10 lines
arch/arm/boot/dts/am335x-evm.dts +10
-0+/include/ "tps65910.dtsi" + +&vdd1_reg { + /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */ + regulator-name = "vdd_mpu"; + regulator-min-microvolt = <912500>; + regulator-max-microvolt = <1312500>; + regulator-boot-on; + regulator-always-on; +};
I want to understand how to add parent regulator nodes? Like input-supply node to regulators.
With "regulator: tps65910: add support for input supply" patch, regulator registration fails if we are not providing the input_supply node with proper input supply name.
AM335x EVM have one dedicated input supply which provide supplies to all the PMIC regulators. According to tps65910 "VDD1 regulator" input supply is from vcc1 so we have to create a dummy/parent/some node to handle this. Example below has the details.
In am335x-evm.dts file
vcc1_supply: fixedregulator at 0 {
compatible = "regulator-fixed";
regulator-name = "vcc1";
regulator-boot-on;
};/include/ "tps65910.dtsi"
&tps {
regulators {
vcc1-supply = <&vcc1_supply>;
...
};
};Similarly we have to add 7 more fixed regulators entries to provide input supply to different PMIC regulators.
Am I doing correct thing? Or is there any better way to handle this?
Regards
AnilKumar
PATCH v2 3/4 arm/dts: Add tps65910 regulator DT data to am335x-evm.dts
Quoted 4 lines · Chimata
AM335x EVM have one dedicated input supply which provide supplies to all the PMIC regulators. According to tps65910 "VDD1 regulator" input supply is from vcc1 so we have to create a dummy/parent/some node to handle this. Example below has the details.
Your device tree should accurately reflect the hardware.
Quoted 2 lines
Similarly we have to add 7 more fixed regulators entries to provide input supply to different PMIC regulators.
If you have all these unrelated supplies in the system then your device tree should accurately reflect that. However this would be a very unusual hardware design. Usually there would be a very small set of system supply rails, frequently only one.
PATCH v2 3/4 arm/dts: Add tps65910 regulator DT data to am335x-evm.dts
Hi Mark,
Quoted 7 lines · Mark Brown
Quoted 4 lines · Chimata
AM335x EVM have one dedicated input supply which provide supplies to all the PMIC regulators. According to tps65910 "VDD1 regulator" input supply is from vcc1 so we have to create a dummy/parent/some node to handle this. Example below has the details.
Quoted 7 lines
Your device tree should accurately reflect the hardware.
Quoted 2 lines
Similarly we have to add 7 more fixed regulators entries to provide input supply to different PMIC regulators.
If you have all these unrelated supplies in the system then your device tree should accurately reflect that. However this would be a very
In that case I have to add all these fixed regulators.
Quoted 2 lines
unusual hardware design. Usually there would be a very small set of system supply rails, frequently only one.
In case of AM335X-EVM one dedicated supply (5v) feeding to all the input supplies (vcc1-7 and vccio) of the regulators.
tps65910 PMIC have vcc1-7 and vccio input supplies which are feeding to all the regulators. (like one - one and one - many).
Tps65910 regulator drivers registration fails if we not providing the correct input supply with supply name. One option I can see is that fixed voltage regulators. If we do this then total 21 (8 input supply fixed regulators and others are out regulators) are present in the system.
If this is the correct approach then I will submit next version of patch.
Thanks
AnilKumar
PATCH v2 3/4 arm/dts: Add tps65910 regulator DT data to am335x-evm.dts
Quoted 6 lines · Chimata
Quoted 2 lines · Mark Brown
If you have all these unrelated supplies in the system then your device tree should accurately reflect that. However this would be a very
In that case I have to add all these fixed regulators.
Why? You then immediately go on to say...
Quoted 5 lines
Quoted 2 lines
unusual hardware design. Usually there would be a very small set of system supply rails, frequently only one.
In case of AM335X-EVM one dedicated supply (5v) feeding to all the input supplies (vcc1-7 and vccio) of the regulators.
...that they all map onto the same physical supply?
PATCH v2 3/4 arm/dts: Add tps65910 regulator DT data to am335x-evm.dts
Mark,
Quoted 9 lines · Mark Brown
Quoted 6 lines · Chimata
Quoted 2 lines · Mark Brown
If you have all these unrelated supplies in the system then your device tree should accurately reflect that. However this would be a very
In that case I have to add all these fixed regulators.
Why? You then immediately go on to say...
Because all the nodes/regulators should be provided/registered otherwise "regulator_dev_lookup" returns NULL if there are no regulator matches with the supply_name.
I have gone through this thread
http://patchwork.ozlabs.org/patch/166682/
But problem here is single input supply battery/main is not sufficient.
pmic->desc[i].supply_name = info->vin_name;
with this assignment regulator core searches for exact supply name vcc1 or vcc2 etc if there are no matches then it will not register any regulators.
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
unusual hardware design. Usually there would be a very small set of system supply rails, frequently only one.
In case of AM335X-EVM one dedicated supply (5v) feeding to all the input supplies (vcc1-7 and vccio) of the regulators.
...that they all map onto the same physical supply?
Yes single physical supply, if we want to add single fixed regulator node to feed all the regulators then driver have to modify to support this. Similar to revert of "regulator: tps65910: add support for input supply" Patch.
Thanks
AnilKumar
PATCH v2 3/4 arm/dts: Add tps65910 regulator DT data to am335x-evm.dts
Quoted 1 line · Chimata
But problem here is single input supply battery/main is not sufficient.
What makes you say this?
Quoted 3 lines
pmic->desc[i].supply_name =
info->vin_name;
with this assignment regulator core searches for exact supply name vcc1 or vcc2 etc if there are no matches then it will not register any regulators.
Why does this mean you need multiple regulators? A single regulator can of course supply multiple devices.
PATCH v2 3/4 arm/dts: Add tps65910 regulator DT data to am335x-evm.dts
Hi Mark,
Quoted 4 lines · Mark Brown
Quoted 1 line · Chimata
But problem here is single input supply battery/main is not sufficient.
Quoted 8 lines
What makes you say this?
Quoted 3 lines
pmic->desc[i].supply_name =
info->vin_name;
with this assignment regulator core searches for exact supply name vcc1 or vcc2 etc if there are no matches then it will not register any regulators.Why does this mean you need multiple regulators? A single regulator can of course supply multiple devices.
I got your point but tps65910 driver is failing if we add single fixed regulator. Solution is driver needs to change or add multiple fixed regulators.
Let's take this example
ocp {
vcc5v_supply: fixedregulator at 0 {
compatible = "regulator-fixed";
regulator-name = "vcc5v";
regulator-boot-on;
};
};/include/ "tps65910.dtsi"
&tps {
regulators {
vcc1-supply = <&vcc5v_supply>;
vcc2-supply = <&vcc5v_supply>;
vcc3-supply = <&vcc5v_supply>;
vcc4-supply = <&vcc5v_supply>;
vcc5-supply = <&vcc5v_supply>;
vcc6-supply = <&vcc5v_supply>;
vcc7-supply = <&vcc5v_supply>;
vccio-supply = <&vcc5v_supply>;
vrtc_reg: regulator at 0 { /* vrtc input is vcc7 */
regulator-always-on;
};
...
...
};
};These changes are added to am335x-evm.dts file after this change I am seeing below error.
vrtc:
tps65910 0-002d: Failed to find supply vcc7 tps65910 0-002d: failed to register tps65910-pmic regulator
To get rid of this error we have to change the driver like this
if (info->vin_name) {
snprintf(in_supply, 32, "%s-supply", info->vin_name);
if (of_find_property(np, in_supply, 0))
pmic_plat_data->input_supply[idx] = info->vin_name;
}And
pmic->desc[i].supply_name = pmic_plat_data->input_supply[i];
Regards
AnilKumar
PATCH v2 3/4 arm/dts: Add tps65910 regulator DT data to am335x-evm.dts
Quoted 8 lines · Chimata
Quoted 2 lines · Mark Brown
Why does this mean you need multiple regulators? A single regulator can of course supply multiple devices.
I got your point but tps65910 driver is failing if we add single fixed regulator. Solution is driver needs to change or add multiple fixed regulators.
No, really. One regulator can supply many things, not being a.
Quoted 3 lines
vrtc:
tps65910 0-002d: Failed to find supply vcc7 tps65910 0-002d: failed to register tps65910-pmic regulator
So you've specified a whole bunch of supplies and this one individual
supply is not matching (and it's not the first...). You should
investigate what's gone wrong there rather than bodging around the
problem. I can't immediately say anything much based on the information
you've given.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120820/4e98778b/attachment.sig>
PATCH v2 3/4 arm/dts: Add tps65910 regulator DT data to am335x-evm.dts
Hi Mark,
Quoted 16 lines · Mark Brown
Quoted 8 lines · Chimata
Quoted 2 lines · Mark Brown
Why does this mean you need multiple regulators? A single regulator can of course supply multiple devices.
I got your point but tps65910 driver is failing if we add single fixed regulator. Solution is driver needs to change or add multiple fixed regulators.
No, really. One regulator can supply many things, not being a.
Quoted 3 lines
vrtc:
tps65910 0-002d: Failed to find supply vcc7 tps65910 0-002d: failed to register tps65910-pmic regulator
Quoted 6 lines
So you've specified a whole bunch of supplies and this one individual supply is not matching (and it's not the first...). You should investigate what's gone wrong there rather than bodging around the problem. I can't immediately say anything much based on the information you've given.
Sorry for the noise in this issue, I found the root cause. I was defining the supply names like this which is wrong.
&tps {
regulators {
vcc1-supply = <&vcc5v_supply>;
vcc2-supply = <&vcc5v_supply>;
vcc3-supply = <&vcc5v_supply>;
vcc4-supply = <&vcc5v_supply>;
vcc5-supply = <&vcc5v_supply>;
vcc6-supply = <&vcc5v_supply>;
vcc7-supply = <&vcc5v_supply>;
vccio-supply = <&vcc5v_supply>;
vrtc_reg: regulator at 0 { /* vrtc input is vcc7 */
regulator-always-on;
};
...
...
};
};This was suppose to be
&tps {
vcc1-supply = <&vcc5v_supply>;
vcc2-supply = <&vcc5v_supply>;
vcc3-supply = <&vcc5v_supply>;
vcc4-supply = <&vcc5v_supply>;
vcc5-supply = <&vcc5v_supply>;
vcc6-supply = <&vcc5v_supply>;
vcc7-supply = <&vcc5v_supply>;
vccio-supply = <&vcc5v_supply>;
regulators {
vrtc_reg: regulator at 0 { /* vrtc input is vcc7 */
regulator-always-on;
};
...
...
};
};Thanks for your continuous feedback.
Thanks
AnilKumar
PATCH v2 3/4 arm/dts: Add tps65910 regulator DT data to am335x-evm.dts
In reply to Mark BrownMark,
Small correction
Quoted 33 lines · Chimata
Mark,
Quoted 9 lines · Mark Brown
Quoted 6 lines · Chimata
Quoted 2 lines · Mark Brown
If you have all these unrelated supplies in the system then your device tree should accurately reflect that. However this would be a very
In that case I have to add all these fixed regulators.
Why? You then immediately go on to say...
Because all the nodes/regulators should be provided/registered otherwise "
regulator_dev_lookup" returns NULL if there are no regulator matches with thesupply_name.I have gone through this thread
http://patchwork.ozlabs.org/patch/166682/But problem here is single input supply battery/main is not sufficient.
pmic->desc[i].supply_name =
info->vin_name;
with this assignment regulator core searches for exact supply name vcc1 or vcc2 etc if there are no matches then it will not register any regulators.Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
unusual hardware design. Usually there would be a very small set of system supply rails, frequently only one.
In case of AM335X-EVM one dedicated supply (5v) feeding to all the input supplies (vcc1-7 and vccio) of the regulators.
Quoted 6 lines
Quoted 2 lines
...that they all map onto the same physical supply?
Yes single physical supply, if we want to add single fixed regulator node to feed all the regulators then driver have to modify to support this. Similar to revert of "regulator: tps65910: add support for input supply"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Copy/paste error
Similar to revert of this patch "regulator: tps65910: set input_supply on desc unconditionally"
Thanks
AnilKumar
PATCH v2 4/4 arm/dts: Add tps65217 regulator DT data to am335x-bone.dts
In reply to AnilKumar ChAdd tps65217 regulator device tree data to AM335x-Bone by adding regulator consumers with tightened constraints and regulator-name. TPS65217 regulator handle can be obtained by using this regulator name.
This patch also add I2C node with I2C frequency and tps65217 PMIC I2C slave address.
--- arch/arm/boot/dts/am335x-bone.dts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
arch/arm/boot/dts/am335x-bone.dts +28 -0
@@ -18,3 +18,31 @@ reg = <0x80000000 0x10000000>; /* 256 MB */ }; }; + +&i2c1 { + clock-frequency = <400000>; + + tps: tps at 24 { + reg = <0x24>; + }; +}; + +/include/ "tps65217.dtsi" + +&dcdc2_reg { + /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */ + regulator-name = "vdd_mpu"; + regulator-min-microvolt = <925000>; + regulator-max-microvolt = <1325000>; + regulator-boot-on; + regulator-always-on; +}; + +&dcdc3_reg { + /* VDD_CORE voltage limits 0.95V - 1.1V with +/-4% tolerance */ + regulator-name = "vdd_core"; + regulator-min-microvolt = <925000>; + regulator-max-microvolt = <1150000>; + regulator-boot-on; + regulator-always-on; +};
Signature · 1 line
1.7.9.5
v2 cover Add AM33XX regulators device tree data
In reply to AnilKumar ChHi Mark,
Quoted 18 lines · Chimata
This patch series add AM33XX regulators (tps65910/tps65217) device tree data to am335x-evm and am335x-bone dts files. These patches are based on Tony L "devel-dt" tree and tested on AM335x EVM and Bone devices.
Changes from v1:
- Incorporated all Mark Brown's review comments on v1 by
* moving all the regulator constraints to corresponding DTS file
* Regulator constraints are added according to board.
- regulator name is added.AnilKumar Ch (4):
ARM: OMAP2+: AM33XX: Add tps65910 device tree data
ARM: OMAP2+: AM33XX: Add tps65217 device tree data arm/dts: Add tps65910 regulator DT data toam335x-evm.dtsarm/dts: Add tps65217 regulator DT data toam335x-bone.dts
Quoted 10 lines
arch/arm/boot/dts/am335x-bone.dts | 28 ++++++++++++ arch/arm/boot/dts/am335x-evm.dts | 28 ++++++++++++ arch/arm/boot/dts/tps65217.dtsi | 56 ++++++++++++++++++++++++ arch/arm/boot/dts/tps65910.dtsi | 86 +++++++++++++++++++++++++++++++++++++ 4 files changed, 198 insertions(+) create mode 100644 arch/arm/boot/dts/tps65217.dtsi create mode 100644 arch/arm/boot/dts/tps65910.dtsiSignature · 1 line
1.7.9.5
With the recent changes in the regulator core driver which disables all the regulators if always-on flag is not present. So I have to update these patch to add all the regulator nodes with always-on flag.
I will submit the updated version of patch series.
Regards
AnilKumar