[PATCH] U-Boot GTA02: Always enable charger on startup

Rask Ingemann Lambertsen ccc94453 at vip.cybercity.dk
Wed Aug 26 12:00:07 CEST 2009


On Tue, Aug 25, 2009 at 08:03:29AM -0300, Werner Almesberger wrote:
> Rask Ingemann Lambertsen wrote:
> >    This patch changes U-Boot to always enable the charger on startup.
> 
> Did you try to boot without battery ?

   No, but I did now and it works.

> If there's no battery and you
> enable charging, Vsys will ramp up instantly, which fools the test
> in battery_is_good.

   So as to try booting with only 100 mA external power available and no
battery? I suppose wait_for_power() expects to be called with the charger
disabled, but it can be changed to do that itself.

> > diff --git a/board/neo1973/gta02/gta02.c b/board/neo1973/gta02/gta02.c
> > index a59a513..df41f5a 100644
> > --- a/board/neo1973/gta02/gta02.c
> > +++ b/board/neo1973/gta02/gta02.c
> > @@ -467,6 +467,8 @@ static int wait_for_power(void)
> >                  pcf50633_reg_write(PCF50633_REG_OOCSHDWN, 4);
> >  	}
> >  
> > +	pcf50633_reg_set_bit_mask(PCF50633_REG_MBCC1, 1, 1); /* charge ! */
> > +
> >  	/* switch off the AUX LED */
> >  	neo1973_led(GTA02_LED_AUX_RED, 0);
> >  
> > @@ -490,8 +492,6 @@ static void pcf50633_late_init(void)
> >  	pcf50633_reg_write(PCF50633_REG_LDO6ENA, recent);
> >  
> >  	pcf50633_reg_write(PCF50633_REG_MBCC5, 0xff); /* 1A USB fast charge */
> > -
> > -	pcf50633_reg_set_bit_mask(PCF50633_REG_MBCC1, 1, 1); /* charge ! */
> >  }
> >  
> >  int board_late_init(void)
> 
> Hmm, what does this change accomplish ?

   The first hunk ensures that we exit wait_for_power() with the charger
enabled. The second hunk removes a piece of code that is now a no op because
the charger is already enabled at that point.

-- 
Rask Ingemann Lambertsen
Danish law requires addresses in e-mail to be logged and stored for a year



More information about the openmoko-kernel mailing list