u-boot fix to charge empty battery

Werner Almesberger werner at openmoko.org
Thu Oct 9 18:15:32 CEST 2008

Johny Tenfinger wrote:
> I have GTA02v5 (from the first batch), and power usage of my leds is
> not that nice...

Thanks for the data ! So the bi-color LED got indeed fixed, but the
red LED is still bad, as I feared it would be. One more mystery
solved :-)

> Can power-hungry red led be fixed by software, as i read somewhere
> some time ago?

The software fixes we made for the GTA02v5 LEDs were all about making
use that they wouldn't interfere with each other, i.e., when setting
LED X and then LED Y, the typical instruction for setting LED Y would
look like this:

leds = led | Y;

Unfortunately, with the outputs basically shorted, the value read
wouldn't be "X" but 0, this disabling X when setting Y.

We fixed this by introducing shadow registers in u-boot and in the
kernel. But it doesn't do anything about the power consumption per

What we could do is use the blue or the orange LED for the
wait_for_power indication.

This would still leave the problem that we couldn't distinguish
between GTA02v5 with the bi-color LED fixed and GTA02v5 with the
bi-color LED still bad, thus breaking the pre-MP GTA02v5, of which
there should still be quite a number in the field. (I don't know
how many exactly.)

We could probably fix that problem in turn by setting the LED,
reading the GPIO back immediately, and if it's 0, disabling the

Yech ! A lot of complexity for a blinking LED :-(

- Werner

More information about the devel mailing list