diff mbox

[U-Boot,v2] mxs: fixed battery boot on imx233-olinuxino-micro

Message ID 1402837916-20054-1-git-send-email-peter.schumann@jeepxj.de
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Peter Schumann June 15, 2014, 1:11 p.m. UTC
This patch makes it possible to boot from battery on olinuxino Boards
from Olimex.

We should not set DOUBLE_FETS in HW_POWER_MINPWR, it makes my system
reset with in seconds while running on battery power.

Also  mxs_power_enable_4p2() should not be called if running from
battery. It switches VDDD and VDDA to LinReg mode and than turns off
the VDDIO DCDC supply. At this point the system resets.
If we run on battery this is no good idea because the LinRegs are
chained behind VDDIO and battery voltage seems not enough to power
the system from LinRegs.
Also is the power system already running on DCDC after BootROM hands
over to u-boot, so no sense in switching back to LinRegs.

Signed-off-by: Peter Schumann <peter.schumann@jeepxj.de>
---
 arch/arm/cpu/arm926ejs/mxs/spl_power_init.c |    6 ------
 1 file changed, 6 deletions(-)

Comments

Marek Vasut June 16, 2014, 10:18 p.m. UTC | #1
On Sunday, June 15, 2014 at 03:11:56 PM, Peter Schumann wrote:
> This patch makes it possible to boot from battery on olinuxino Boards
> from Olimex.
> 
> We should not set DOUBLE_FETS in HW_POWER_MINPWR, it makes my system
> reset with in seconds while running on battery power.
> 
> Also  mxs_power_enable_4p2() should not be called if running from
> battery. It switches VDDD and VDDA to LinReg mode and than turns off
> the VDDIO DCDC supply. At this point the system resets.
> If we run on battery this is no good idea because the LinRegs are
> chained behind VDDIO and battery voltage seems not enough to power
> the system from LinRegs.
> Also is the power system already running on DCDC after BootROM hands
> over to u-boot, so no sense in switching back to LinRegs.
> 
> Signed-off-by: Peter Schumann <peter.schumann@jeepxj.de>

+CC Fabio, I'd like to see his take on this too.

Best regards,
Marek Vasut
Marek Vasut June 16, 2014, 10:19 p.m. UTC | #2
On Tuesday, June 17, 2014 at 12:18:55 AM, Marek Vasut wrote:
> On Sunday, June 15, 2014 at 03:11:56 PM, Peter Schumann wrote:
> > This patch makes it possible to boot from battery on olinuxino Boards
> > from Olimex.
> > 
> > We should not set DOUBLE_FETS in HW_POWER_MINPWR, it makes my system
> > reset with in seconds while running on battery power.
> > 
> > Also  mxs_power_enable_4p2() should not be called if running from
> > battery. It switches VDDD and VDDA to LinReg mode and than turns off
> > the VDDIO DCDC supply. At this point the system resets.
> > If we run on battery this is no good idea because the LinRegs are
> > chained behind VDDIO and battery voltage seems not enough to power
> > the system from LinRegs.
> > Also is the power system already running on DCDC after BootROM hands
> > over to u-boot, so no sense in switching back to LinRegs.
> > 
> > Signed-off-by: Peter Schumann <peter.schumann@jeepxj.de>
> 
> +CC Fabio, I'd like to see his take on this too.

Reviewed-by: Marek Vasut <marex@denx.de>

I'd like to get this merged after 2014.07 though, so it can get some proper 
testing. We're too late in the -rc cycle anyway ...

Best regards,
Marek Vasut
Stefano Babic June 17, 2014, 4 p.m. UTC | #3
Hi peter,

On 17/06/2014 00:19, Marek Vasut wrote:
> On Tuesday, June 17, 2014 at 12:18:55 AM, Marek Vasut wrote:
>> On Sunday, June 15, 2014 at 03:11:56 PM, Peter Schumann wrote:
>>> This patch makes it possible to boot from battery on olinuxino Boards
>>> from Olimex.
>>>
>>> We should not set DOUBLE_FETS in HW_POWER_MINPWR, it makes my system
>>> reset with in seconds while running on battery power.
>>>
>>> Also  mxs_power_enable_4p2() should not be called if running from
>>> battery. It switches VDDD and VDDA to LinReg mode and than turns off
>>> the VDDIO DCDC supply. At this point the system resets.
>>> If we run on battery this is no good idea because the LinRegs are
>>> chained behind VDDIO and battery voltage seems not enough to power
>>> the system from LinRegs.
>>> Also is the power system already running on DCDC after BootROM hands
>>> over to u-boot, so no sense in switching back to LinRegs.
>>>
>>> Signed-off-by: Peter Schumann <peter.schumann@jeepxj.de>
>>
>> +CC Fabio, I'd like to see his take on this too.
> 
> Reviewed-by: Marek Vasut <marex@denx.de>
> 
> I'd like to get this merged after 2014.07 though, so it can get some proper 
> testing. We're too late in the -rc cycle anyway ...
> 

Agree. Reason is that this change is for all boards, and without a
proper testing I will avoid to merge it in the release.

Best regards,
Stefano Babic
Peter Schumann June 18, 2014, 6:17 p.m. UTC | #4
Am 17.06.2014 18:00, schrieb Stefano Babic:
> Hi peter,
> ...
> On 17/06/2014 00:19, Marek Vasut wrote:
> Agree. Reason is that this change is for all boards, and without a
> proper testing I will avoid to merge it in the release.
> 
> Best regards,
> Stefano Babic
> 
> 
> 

Hi Stefano,

I've only the imx233 olimex board for testing. The DOUBLE_FETS switch in
HW_POWER_MINPWR is some thing were maybe problems emerge.

I have very little load on the powerrails (imx233 + DRAM), so maybe with
more current demand DOUBLE_FETS is working OK and even more may require
it to be set.

The DOUBLE_FETS and HALF_FETS switches control the switching MOSFET size
in the DCDC Converter. My assumption is that if we have a to big FET
setting and to low current demand we trigger some failsafe mechanism.
Because the required "on time" of the FET is smaller than the minimum
possible "on time" of then DCDC FET control logic.

I don't have an easy way to test this assumption without an adjustable load.

The other change regarding mxs_power_enable_4p2() should be relatively
safe to apply.

If I can help with some testing let me know.

Best regards,
Peter Schumann
Marek Vasut June 19, 2014, 7:12 a.m. UTC | #5
On Wednesday, June 18, 2014 at 08:17:05 PM, Peter Schumann wrote:
> Am 17.06.2014 18:00, schrieb Stefano Babic:
> > Hi peter,
> > ...
> > On 17/06/2014 00:19, Marek Vasut wrote:
> > Agree. Reason is that this change is for all boards, and without a
> > proper testing I will avoid to merge it in the release.
> > 
> > Best regards,
> > Stefano Babic
> 
> Hi Stefano,
> 
> I've only the imx233 olimex board for testing. The DOUBLE_FETS switch in
> HW_POWER_MINPWR is some thing were maybe problems emerge.
> 
> I have very little load on the powerrails (imx233 + DRAM), so maybe with
> more current demand DOUBLE_FETS is working OK and even more may require
> it to be set.

If that was the case, the problem would manifest even when _not_ booting from 
battery-only supply, correct?

> The DOUBLE_FETS and HALF_FETS switches control the switching MOSFET size
> in the DCDC Converter. My assumption is that if we have a to big FET
> setting and to low current demand we trigger some failsafe mechanism.
> Because the required "on time" of the FET is smaller than the minimum
> possible "on time" of then DCDC FET control logic.
> 
> I don't have an easy way to test this assumption without an adjustable
> load.
> 
> The other change regarding mxs_power_enable_4p2() should be relatively
> safe to apply.

This breaks booting from battery on MX28 for some reason. The DC converter is 
not enabled at that point.

Best regards,
Marek Vasut
Stefano Babic Aug. 20, 2014, 10:30 a.m. UTC | #6
Hi Peter, hi Marek,

On 19/06/2014 09:12, Marek Vasut wrote:
> On Wednesday, June 18, 2014 at 08:17:05 PM, Peter Schumann wrote:
>> Am 17.06.2014 18:00, schrieb Stefano Babic:
>>> Hi peter,
>>> ...
>>> On 17/06/2014 00:19, Marek Vasut wrote:
>>> Agree. Reason is that this change is for all boards, and without a
>>> proper testing I will avoid to merge it in the release.
>>>
>>> Best regards,
>>> Stefano Babic
>>
>> Hi Stefano,
>>
>> I've only the imx233 olimex board for testing. The DOUBLE_FETS switch in
>> HW_POWER_MINPWR is some thing were maybe problems emerge.
>>
>> I have very little load on the powerrails (imx233 + DRAM), so maybe with
>> more current demand DOUBLE_FETS is working OK and even more may require
>> it to be set.
> 
> If that was the case, the problem would manifest even when _not_ booting from 
> battery-only supply, correct?
> 
>> The DOUBLE_FETS and HALF_FETS switches control the switching MOSFET size
>> in the DCDC Converter. My assumption is that if we have a to big FET
>> setting and to low current demand we trigger some failsafe mechanism.
>> Because the required "on time" of the FET is smaller than the minimum
>> possible "on time" of then DCDC FET control logic.
>>
>> I don't have an easy way to test this assumption without an adjustable
>> load.
>>
>> The other change regarding mxs_power_enable_4p2() should be relatively
>> safe to apply.
> 
> This breaks booting from battery on MX28 for some reason. The DC converter is 
> not enabled at that point.

As I have not (yet) forgotten this patch: current status is that mx28 is
broken after applying this patch. I set the status as "Changes
requested" and it will be not applied.

Best regards,
Stefano Babic
diff mbox

Patch

diff --git a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
index d25019a..0cbb6c4 100644
--- a/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
+++ b/arch/arm/cpu/arm926ejs/mxs/spl_power_init.c
@@ -237,9 +237,6 @@  static void mxs_src_power_init(void)
 			POWER_LOOPCTRL_RCSCALE_THRESH |
 			POWER_LOOPCTRL_EN_RCSCALE_8X);
 
-	clrsetbits_le32(&power_regs->hw_power_minpwr,
-			POWER_MINPWR_HALFFETS, POWER_MINPWR_DOUBLE_FETS);
-
 	/* 5V to battery handoff ... FIXME */
 	setbits_le32(&power_regs->hw_power_5vctrl, POWER_5VCTRL_DCDC_XFER);
 	early_delay(30);
@@ -631,8 +628,6 @@  static void mxs_batt_boot(void)
 
 	writel(POWER_CTRL_ENIRQ_DCDC4P2_BO, &power_regs->hw_power_ctrl_clr);
 
-	clrsetbits_le32(&power_regs->hw_power_minpwr,
-			POWER_MINPWR_HALFFETS, POWER_MINPWR_DOUBLE_FETS);
 
 	mxs_power_set_linreg();
 
@@ -655,7 +650,6 @@  static void mxs_batt_boot(void)
 		POWER_5VCTRL_CHARGE_4P2_ILIMIT_MASK,
 		0x8 << POWER_5VCTRL_CHARGE_4P2_ILIMIT_OFFSET);
 
-	mxs_power_enable_4p2();
 }
 
 /**