[Gta04-owner] various powermanagement issues
H. Nikolaus Schaller
hns at goldelico.com
Sun Oct 25 08:41:40 CET 2015
Hi,
Am 25.10.2015 um 01:28 schrieb Andreas Kemnade <andreas at kemnade.info>:
> On Mon, 19 Oct 2015 10:24:17 +0200
> "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
>
>>
>> All this is very fine. What we discuss with MLO/U-Boot is to help
>> for the first 30 seconds after a depleted battery is starting something
>> and before kernel (and scripts in initrd or whereever) take over
>> control.
>>
> Hmm, my main kernel takes < 12s form uboot lcd on to initrd.
> And I have an extra sleep 3 in boot.scr for giving me extra time for the aux button.
> But recent kernels have twl4030 stuff as modules, so that may take longer.
Well, the 30 seconds are just a rule of thumb figure, not measurements :)
And I include mlo+u-boot time.
>
>> But with most batteries it works with the current situation, so that
>> it is an improvement for old batteries.
>>
>> When I find time (sigh... I assume people are still waiting for GTA04A5
>> news...), I can look into the U-Boot systest approach.
>>
> I managed to hang uboot with systest ch...
Yes, for me it hangs as well. So there might be another bug.
> I tried to insert these lines into boot.scr
>
> i2c dev 0
> i2c mw 0x4b 0x3d 0x30 1
> i2c mw 0x4a 0x75 0x26 1
> i2c mw 0x4a 0x95 0xf3 1
>
> That starts charging for me.
Great!
> I found this line in board/goldelico/gta04/twl4030-additions.h:
> #define BCIAUTOWEN (TWL4030_BASEADD_PM_MASTER + 0x020)
>
> That looks wrong for a *bit* definition.
Indeed!
I have looked around and it appears to come from some TI / WindRiver source
code from 2009 or so. E.g.
https://github.com/CMNookTablet/acclaim_cyanoboot/blob/master/include/twl4030.h
This may indeed be buggy.
In Linux it was suggested (today's code is very different) as a bit value:
https://lwn.net/Articles/364310/
#define BCIAUTOWEN 0x20
So I think someone did take the (TI) Linux header file, and add some register offsets
where appropriate - and wrongly thought this is a register. As long as nobody uses this
constant it remains unnoticed for years.
> But I am too tired now, I'll enjoy the extra hour.
Yes, that was really enjoyable :)
>
> BTW: for checking whether charging is working it is best to look at your external power supply display.
:)
I will experiment a little with fixing the BCIAUTOWEN - when I find time.
GTA04A5 hardware production is still not progressing as expected, but this helps the GTA04A5 as well.
And I am working on kernel fixes for the touchscreen (good upstream compatible dejitter) are almost done.
BR,
Nikolaus
More information about the Gta04-owner
mailing list