[Gta04-owner] various powermanagement issues

H. Nikolaus Schaller hns at goldelico.com
Mon Oct 19 07:28:16 CEST 2015


Am 19.10.2015 um 06:50 schrieb H. Nikolaus Schaller <hns at goldelico.com>:

> HI,
> Am 19.10.2015 um 01:08 schrieb Neil Brown <neilb at suse.de>:
>> xdrudis at tinet.cat writes:
>>> On Sun, Oct 18, 2015 at 08:20:13AM +0200, H. Nikolaus Schaller wrote:
>>>> Yes, that is indeed a known problem for a long time. It could be solved by
>>>> modifying the MLO so that it turns on 500mA charging within the first 1-2 seconds.
>>>> Currently, Linux must boot up to a point to enable 500 mA charging. This takes
>>>> 30-60 seconds.
>>>> Now a discharged battery is charged by ~50mA (trickle charge) until the device
>>>> turns on as soon as the battery voltage reaches 3.3V. At that point it may be
>>>> charged for just 1%.
>>>> If this is not enough for booting to Linux (30-60 seconds @ 400 mA) full
>>>> charging will fail.
>>> I haven't refreshed my memory, but I assume the reason is linux has a
>>> complete enough USB stack to negotiate 500mA but MLO has a very more
>>> basic USB stack (or none).
>> The reality is much more prosaic (i.e. boring) than that.
>> People have hacked Linux to make it work reasonably without going too
>> far out of spec.  Nobody has hacked the MLO in the same say.  That's
>> really all there is to it.
>> One of my many frustrations is that the "correct" way to check if a
>> charger is attached is to send a signal down the D+ line and see if it
>> comes back along the D- line.  i.e. check if D+ and D- are shorted.
>> (I think that is a gross oversimplication, but it gives the idea).
>> I believe that the TWL4030 USB phy is able to perform this test, but I
>> cannot actually get it to work.
>> So the only sort of charger we can reliable detect is the Openmoko
>> charger that puts a resistor between the ID pin an Ground.
>> It would be quite easy to get MLO to test for that resistor and enable
>> high-current changing.  I'd really like to more general "USB standard
>> charger" test.  But I cannot make it work.
> Is it really necessary to detect a /charger/ from /non-charger/ compliant to
> some standard? Or is itn't it sufficient to enable a little more mA going into
> the battery to make Linux boot?
> Yes, it is more a hack than implementing a spec, but I would be more
> happy to have a hack that works than a spec that doesn't.
>> (I guess I should hack the MLO, because I mostly charge with the
>> openmoko charger...)
> Yes, I'd be happy if someone could simply make
> http://git.goldelico.com/?p=gta04-xloader.git;a=blob;f=board/omap3530gta04/omap3530gta04.c;h=1d490c94ad11f5fdba1b3660cce340bde7fb6fa2;hb=HEAD#l112
> work as intended, i.e. help debugging since I do not have the time (we are all
> volunteers!) to solve all such known problems myself.

It might even be simpler. No hack of MLO needed.

Approx. 3 seconds after the TPS autoboots with an empty battery, we have
U-Boot up and running. And hacking U-Boot is much simpler and more flexible.

It may be not well known that our U-Boot has some additional commands:


and there is: 

	• systest ch[arge] - enable battery charger and print mV levels

So the solution could be as simple as adding a "systest charge" command
(potentially slightly modified to better integrate into a script) to the boot.scr
to enable more power drawn from USB and unburden the battery.

I love simple solutions where all components are already on the table :)

In this case for ca. 4 years...
So we have to ask ourselves why nobody did solve it in that long time frame.

Are such things not known?

For me, it is simply not an urgent enough issue. Getting DT based Linux to work
is. Therefore I am investing my scarce time e.g. into display, power, touch screen
improvements in the kernel. 4.3-rc6 is being compiled while I write this message.


More information about the Gta04-owner mailing list