Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1677463 > unrolled thread
| Started by | Waldemar Rymarkiewicz <waldemar.rymarkiewicz@gmail.com> |
|---|---|
| First post | 2017-06-29 09:20 +0200 |
| Last post | 2017-06-30 17:30 +0200 |
| Articles | 6 — 3 participants |
Back to article view | Back to linux.kernel
Where to update regulator register with initial voltage set by HW Waldemar Rymarkiewicz <waldemar.rymarkiewicz@gmail.com> - 2017-06-29 09:20 +0200
Re: Where to update regulator register with initial voltage set by HW Mark Brown <broonie@kernel.org> - 2017-06-30 12:50 +0200
Re: Where to update regulator register with initial voltage set by HW Waldemar Rymarkiewicz <waldemar.rymarkiewicz@gmail.com> - 2017-06-30 13:40 +0200
Re: Where to update regulator register with initial voltage set by HW Mark Brown <broonie@kernel.org> - 2017-06-30 14:20 +0200
RE: Where to update regulator register with initial voltage set by HW "Bartholomae, Thomas" <t.bartholomae@intel.com> - 2017-06-30 14:30 +0200
Re: Where to update regulator register with initial voltage set by HW Waldemar Rymarkiewicz <waldemar.rymarkiewicz@gmail.com> - 2017-06-30 17:30 +0200
| From | Waldemar Rymarkiewicz <waldemar.rymarkiewicz@gmail.com> |
|---|---|
| Date | 2017-06-29 09:20 +0200 |
| Subject | Where to update regulator register with initial voltage set by HW |
| Message-ID | <tXBU7-4BD-23@gated-at.bofh.it> |
Hi, I do a power regulator driver and I have faced an issue with an initial voltage value set (or rather not set) in regulator register. Initially, on boot, the voltage is set by HW (sensing resistors). When OS starts and the reg driver registers regulator with the specific constraints uV_min and uV_max, regulator core will apply uV_min or uV_max if current (in regulator register) setting is not in the range. Normally, by default register holds min(voltage_table) which is different than the value set by HW (sensing resistors). So, it results in uV_min set by regulator core which is not expected as I start my board with max cpu freq which needs relevant voltage (the power reg supplies CPU) in order CPU to be stable. I believe this issue is not specific just to my HW, so wondering where in the system the actual voltage set by HW is typically also put into the register, so probing regulator we can read the real value? bootloader seems to be a good candidate? platform code? Will appreciate any hints. Thanks /Waldek
[toc] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2017-06-30 12:50 +0200 |
| Message-ID | <tY1ER-4os-9@gated-at.bofh.it> |
| In reply to | #1677463 |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Jun 29, 2017 at 09:18:09AM +0200, Waldemar Rymarkiewicz wrote: > Initially, on boot, the voltage is set by HW (sensing resistors). When > OS starts and the reg driver registers regulator with the specific > constraints uV_min and uV_max, regulator core will apply uV_min or > uV_max if current (in regulator register) setting is not in the range. > Normally, by default register holds min(voltage_table) which is > different than the value set by HW (sensing resistors). You shoudn't be specfiying a default value for the register, clearly there is none as it is determined dynamically by the hardware when the system boots.
[toc] | [prev] | [next] | [standalone]
| From | Waldemar Rymarkiewicz <waldemar.rymarkiewicz@gmail.com> |
|---|---|
| Date | 2017-06-30 13:40 +0200 |
| Message-ID | <tY2rh-4Tg-23@gated-at.bofh.it> |
| In reply to | #1678691 |
On 30 June 2017 at 12:41, Mark Brown <broonie@kernel.org> wrote: > On Thu, Jun 29, 2017 at 09:18:09AM +0200, Waldemar Rymarkiewicz wrote: > >> Initially, on boot, the voltage is set by HW (sensing resistors). When >> OS starts and the reg driver registers regulator with the specific >> constraints uV_min and uV_max, regulator core will apply uV_min or >> uV_max if current (in regulator register) setting is not in the range. >> Normally, by default register holds min(voltage_table) which is >> different than the value set by HW (sensing resistors). > > You shoudn't be specfiying a default value for the register, clearly > there is none as it is determined dynamically by the hardware when the > system boots. Thanks Mark for your feedback. I am not sure if I understand. Do you mean, a regulator should determine a voltage and update a register with a right selector when system boots, so the regulator framework reading reg register knows actual voltage? BTW, I work with TPS65273 regulator. /Waldek
[toc] | [prev] | [next] | [standalone]
| From | Mark Brown <broonie@kernel.org> |
|---|---|
| Date | 2017-06-30 14:20 +0200 |
| Message-ID | <tY33Y-5nU-13@gated-at.bofh.it> |
| In reply to | #1678721 |
[Multipart message — attachments visible in raw view] — view raw
On Fri, Jun 30, 2017 at 01:37:32PM +0200, Waldemar Rymarkiewicz wrote: > I am not sure if I understand. Do you mean, a regulator should > determine a voltage and update a register with a right selector when > system boots, so the regulator framework reading reg register knows > actual voltage? Just don't provide a default value for the cache, regmap will do a physical read if there's nothing in the cache for that register and everything will work transparently.
[toc] | [prev] | [next] | [standalone]
| From | "Bartholomae, Thomas" <t.bartholomae@intel.com> |
|---|---|
| Date | 2017-06-30 14:30 +0200 |
| Subject | RE: Where to update regulator register with initial voltage set by HW |
| Message-ID | <tY3dE-5r3-3@gated-at.bofh.it> |
| In reply to | #1678757 |
Hi Mark, The problem is that our used regulator TPS65273V from TI do not have the possibility to read the current voltage defined by the HW, means by the circuit of the regulator. In this case the register holding the voltage to be set later by software has a reset value which is normally the min value the regulator can support. This value can be out of the range of the supported rail. Therefore before the regulator gets registered this register needs to be set with a 'good' value. I assume the only practicable solution will be that we initialize this voltage register in the boot code where we also set the CPU frequency. BR Thomas -----Original Message----- From: Mark Brown [mailto:broonie@kernel.org] Sent: Friday, June 30, 2017 14:15 To: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@gmail.com> Cc: linux-kernel@vger.kernel.org; Liam Girdwood <lgirdwood@gmail.com>; Bartholomae, Thomas <t.bartholomae@intel.com> Subject: Re: Where to update regulator register with initial voltage set by HW On Fri, Jun 30, 2017 at 01:37:32PM +0200, Waldemar Rymarkiewicz wrote: > I am not sure if I understand. Do you mean, a regulator should > determine a voltage and update a register with a right selector when > system boots, so the regulator framework reading reg register knows > actual voltage? Just don't provide a default value for the cache, regmap will do a physical read if there's nothing in the cache for that register and everything will work transparently.
[toc] | [prev] | [next] | [standalone]
| From | Waldemar Rymarkiewicz <waldemar.rymarkiewicz@gmail.com> |
|---|---|
| Date | 2017-06-30 17:30 +0200 |
| Message-ID | <tY61Q-7aE-9@gated-at.bofh.it> |
| In reply to | #1678757 |
On 30 June 2017 at 14:14, Mark Brown <broonie@kernel.org> wrote: > On Fri, Jun 30, 2017 at 01:37:32PM +0200, Waldemar Rymarkiewicz wrote: > >> I am not sure if I understand. Do you mean, a regulator should >> determine a voltage and update a register with a right selector when >> system boots, so the regulator framework reading reg register knows >> actual voltage? > > Just don't provide a default value for the cache, regmap will do a > physical read if there's nothing in the cache for that register and > everything will work transparently. Just want to understand well. "Physical read" means to read a register value? or determine actual value another way? As Thomas mentioned in previous email TPS65275 does not have a circuit to determine startup voltage at least I cannot see this in the datasheet. Data sheet: http://www.ti.com/lit/gpn/tps65273v /Waldek
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web