[Gta04-owner] stop boot attempts with flat battery while charging

Dr. H. Nikolaus Schaller hns at goldelico.com
Sun Feb 17 20:35:15 CET 2013

Am 16.02.2013 um 22:00 schrieb NeilBrown:

>>> so:
>>> - is there a way/are there plans to implement a way to prevent booting unless a level of power is reached that actually allows a complete boot?
>> Unfortunately we do not know how to implement that. Powering on is attempted by the TPS65950 if battery voltage reaches 3.2V through trickle charge.
>> And then only the X-Loader starts. We had tried to add preliminary charging control to X-Loader but that failed (you can only poke some bytes into the control registers).
>> The key problem is battery protection and power management (e.g. if the device is connected to a PC). Without running the full USB stack the PC may limit the total charging current to 100 mA without violating the USB specs.
>>> - is it possible/planned to somehow prevent booting at all when on charger? that is, booting absolutely and only when pushing the PWR button?
>> That can't be implemented at all because active charging must be controlled to some extent.
> If I we to try to address this (which I don't really think is a big issue,
> but might be nice to fix anyway), I would look at getting u-boot to help out.
> All it would need to do is measure the battery status via HDQ, and the status
> of the USB ID pin via the PMIC.
> If ID pin is grounded, switch battery charger to full current.
> If the battery charge is below (say) 2%, power off immediately.
> ??

Reading such things in U-Boot and adding a full HDQ protocol isn't easy.

The really best approach would be to find a way to enable charging with 500 mA right
in X-Loader (and ignore the ID pin and real battery status).

This should charge a lot of more energy into the battery until Linux has booted far enough
to reset the TWL charger and provide its own drivers. Since U-Boot (usually) does not turn
on WLAN, GPS or UMTS the total power consumption remains below 500 mA (more typical
is 250 mA) and therefore some charging current will flow into the battery while the Tux is

With the default power-on-reset setup of the TPS charger, the current provided by USB
is limited to approx. 100 mA ("trickle charge"). As long as the OMAP is off, this charges
the battery. As soon as the OMAP boots, the battery will be discharged by approx. 150 mA.

There is already a code fragment in our X-Loader source but it is not tested//integrated yet (line 96ff):


If someone wants to work on this, please let me know.


More information about the Gta04-owner mailing list