[Letux-kernel] letux-4.7-rc7: charging & ethernet gadget

Andreas Kemnade andreas at kemnade.info
Thu Jul 21 20:36:42 CEST 2016


On Wed, 20 Jul 2016 21:36:08 +0200
"H. Nikolaus Schaller" <hns at goldelico.com> wrote:

> 
> > Am 20.07.2016 um 20:46 schrieb Andreas Kemnade
> > <andreas at kemnade.info>:
> > 
> > Hi,
> > 
> > On Wed, 20 Jul 2016 10:59:55 +0200
> > "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> > 
> >> Hi,
> >> 
> >>> Am 19.07.2016 um 23:37 schrieb Andreas Kemnade
> >>> <andreas at kemnade.info>:
> >>> 
> >>> On Tue, 19 Jul 2016 22:50:44 +0200
> >>> "H. Nikolaus Schaller" <hns at goldelico.com> wrote:
> >>> 
> >>>>> I think I have to study the twl4030 data sheet if there is a
> >>>>> common factor.
> >>>> 
> >>>> First interesting finding:
> >>>> 
> >>>> Nobody does and can call twl4030_madc_set_current_generator() for
> >>>> channel=1, i.e. the BATTEMP channel / ADCIN1.
> >>>> 
> >>>> Therefore, ITHEN is not touched by the kernel and either U-Boot
> >>>> must take care of. Or (I hope) automatic charging enabled by
> >>>> hardware does set this bit. Anyways this means ITHEN is off if we
> >>>> boot w/o external power.
> >>>> 
> >>>> The same is true for the current source strength (ITHSENS). So we
> >>>> are lucky that 10kOhm at 10µA translates into 100mV. Unless our
> >>>> U-Boot modifies these values.
> >>>> 
> >>>> I remember that I stumbled over a similar thing when developing
> >>>> the gpadc driver for the Palmas (twl6037). There we have made it
> >>>> a config through DT:
> >>>> http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/iio/adc/palmas-gpadc.txt#L26
> >>>> 
> >>>> This could explain why we sometimes read 56°C. I think this
> >>>> always happens if the ITHEN bit becomes reset (why?) and
> >>>> therefore the current source is off. Pretending a missing
> >>>> battery. This of course will disable automatic charging.
> >>>> 
> >>>> But it does not explain why we sometimes get more or less random
> >>>> values.
> >>>> 
> >>>> Hm. Wait. Who is powering the current source for ITHEN? What if
> >>>> that LDO is broken? Something to keep in mind for another test.
> >>>> Although I could not find any reference where the current source
> >>>> is powered from.
> >>>> 
> >>> Well, ITHEN is normally enabled during automatic charge.
> >>> If I enable it manually
> >>> i2cset -f 0 0x4a 0x97 0x1f 
> >>> (BCICTL1)
> >>> Temperature shows sane values, so no additional regulator needed
> >>> for that. But there are regulators needed for automatic
> >>> charging...
> >> 
> >> I have booted with USB cable connected. Which means automatic
> >> charging should have been enabled by hardware and U-Boot...
> >> 
> > if there is a charge on command in boot.scr...
> 
> Well, we have a BCIAUTO resistor connected and that should also
> enable automatic charging even before power-on. But stuck in the
> 100mA limitation. Anyways it should at least trickle charge.
> 
I have never seen such a behavior (only that 70mA precharge on empty
battery). And AFAIK 100mA means 100mA USB total, not charging current.
So if the device consumes some current... We would not have all the
discussions about booting with low/old batteries if that would work
that way.

> > Now I made a quite interesting observation:
> > My never-touch 3.7 kernel does not do automatic charging anymore.
> > So what do I have
> >       a bad dream
> > or/and a bad device
> > or/and a bad kernel
> 
> > 
> > or a combination thereof?!
> > ?????
> 
> hardware virus... Spread through git...
> 
> I had indeed similar experiences when it suddently stopped to charge.
> Only with 4.3 kernel it simply works:
> 
> http://download.goldelico.com/letux-kernel/4.3/
> 
> What could be is that a modern kernel programs something into some
> eeprom / nvram on the tps65950 chip which makes it fail afterwards.
> Until the backup supercap is empty.
> 
> Can you wait until the backup battery is discharged? And check if it
> starts to work again?
> 
works again. But I have some found some anomalities in logfiles
from my trip e.g. bq27000-battery/charge_now from
480mAh->30mAh in 1/2h (gap in logfiles in between). Vbus change
seems to reflect that. Some bugs were cooking their lunch inside the
gta04 (came in through missing aux-key)? ;-) 

I will first double check hw status with known-good kernel. 

Regards,
Andreas


More information about the Letux-kernel mailing list