Message ID | 1491962327-12477-6-git-send-email-aisheng.dong@nxp.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Apr 12, 2017 at 09:58:47AM +0800, Dong Aisheng wrote: > Set the initial voltage selector for vddpcie in case it's disabled > by default. Why is this the only anatop regulator which can have this problem and how do we know this is a good value?
On Thu, Apr 13, 2017 at 03:41:03PM +0800, Dong Aisheng wrote: > On Tue, Apr 11, 2017 at 09:40:03PM +0100, Mark Brown wrote: > > Why is this the only anatop regulator which can have this problem and > > how do we know this is a good value? > Anatop regulator has no separate gate bit. > e.g. > 00000 Power gated off > 00001 Target core voltage = 0.725V > ... > So it may have no valid default voltage in case it's disabled in > bootloader. > e.g. regulator_enable() may not work. That doesn't answer my question. What I'm asking is why another anatop regulator might not end up disabled like this one. > The default voltage 1.100v this patch sets is defined in reference > manual. For the SoC you're currently looking at... might another have a different value?
On Wed, Apr 12, 2017 at 11:49 PM, Mark Brown <broonie@kernel.org> wrote: > On Thu, Apr 13, 2017 at 03:41:03PM +0800, Dong Aisheng wrote: >> On Tue, Apr 11, 2017 at 09:40:03PM +0100, Mark Brown wrote: > >> > Why is this the only anatop regulator which can have this problem and >> > how do we know this is a good value? > >> Anatop regulator has no separate gate bit. >> e.g. >> 00000 Power gated off >> 00001 Target core voltage = 0.725V >> ... >> So it may have no valid default voltage in case it's disabled in >> bootloader. >> e.g. regulator_enable() may not work. > > That doesn't answer my question. What I'm asking is why another anatop > regulator might not end up disabled like this one. > Well, that's true and i once thought of it. Currently it is probably a quick fix and we did not see any others up till now for all MX6&7 platforms based on NXP internal tree. If we do see it in the future, then probably a better solution is constructing a staticly defined default voltage table in anatop driver and do dynamically check. >> The default voltage 1.100v this patch sets is defined in reference >> manual. > > For the SoC you're currently looking at... might another have a > different value? No, only MX6SX has it currently. Regards Dong Aisheng
Am Donnerstag, den 13.04.2017, 15:41 +0800 schrieb Dong Aisheng: > On Tue, Apr 11, 2017 at 09:40:03PM +0100, Mark Brown wrote: > > On Wed, Apr 12, 2017 at 09:58:47AM +0800, Dong Aisheng wrote: > > > Set the initial voltage selector for vddpcie in case it's disabled > > > by default. > > > > Why is this the only anatop regulator which can have this problem and > > how do we know this is a good value? > > Anatop regulator has no separate gate bit. > e.g. > 00000 Power gated off > 00001 Target core voltage = 0.725V > ... > So it may have no valid default voltage in case it's disabled in > bootloader. > e.g. regulator_enable() may not work. > > The default voltage 1.100v this patch sets is defined in reference > manual. Huh? Shouldn't regulator_enable bring the voltage in a range defined by the constraints in the DT? Regards, Lucas
On Wed, Apr 12, 2017 at 06:11:54PM +0200, Lucas Stach wrote: > Am Donnerstag, den 13.04.2017, 15:41 +0800 schrieb Dong Aisheng: > > The default voltage 1.100v this patch sets is defined in reference > > manual. > Huh? Shouldn't regulator_enable bring the voltage in a range defined by > the constraints in the DT? As part of that process it checks what the current voltage is but with this regulator you can't read the voltage if the regulator is powered off and we don't just ignore that error.
On Tue, Apr 11, 2017 at 09:40:03PM +0100, Mark Brown wrote: > On Wed, Apr 12, 2017 at 09:58:47AM +0800, Dong Aisheng wrote: > > Set the initial voltage selector for vddpcie in case it's disabled > > by default. > > Why is this the only anatop regulator which can have this problem and > how do we know this is a good value? Anatop regulator has no separate gate bit. e.g. 00000 Power gated off 00001 Target core voltage = 0.725V ... So it may have no valid default voltage in case it's disabled in bootloader. e.g. regulator_enable() may not work. The default voltage 1.100v this patch sets is defined in reference manual. Regards Dong Aisheng
diff --git a/drivers/regulator/anatop-regulator.c b/drivers/regulator/anatop-regulator.c index 6da0b20..910adfd 100644 --- a/drivers/regulator/anatop-regulator.c +++ b/drivers/regulator/anatop-regulator.c @@ -301,6 +301,11 @@ static int anatop_regulator_probe(struct platform_device *pdev) if (!sreg->sel && rdesc->name && !strcmp(rdesc->name, "vddpu")) sreg->sel = 22; + /* set the default voltage of the pcie phy to be 1.100v */ + if (!sreg->sel && rdesc->name && + !strcmp(rdesc->name, "vddpcie")) + sreg->sel = 0x10; + if (!sreg->bypass && !sreg->sel) { dev_err(&pdev->dev, "Failed to read a valid default voltage selector.\n"); return -EINVAL;