[Fwd: Re: Charging a Neo battery in a Nokia charger or phone]

Andy Green andy at openmoko.com
Fri Oct 3 00:36:54 CEST 2008

Hash: SHA1

Michael Shiloh wrote:

> To further understand this, and to make sense of all the suggestions on
> the community list about how to charge a dead battery, I'd like to
> understand the PMU activity better.
> At what point does the PMU start charging? I.e., if the phone is turned
> off and USB power is applied, will the PMU start charging? Or does it
> require some running code to enable the PMU?

The short answer is the PMU powers up from cold with charger disabled,
and something has to send it word down i2c that it should charge at all.
 U-Boot and the kernel are both willing to do that.

The longer answer revolves around PMU private state, one of

NOPOWER -- really no power in battery or backup bat or from USB
SAVE    -- using backup battery or low battery
STANDBY -- using battery or USB power while "OFF"
ACTIVE  -  we're "ON"

- From really cold, NOPOWER, all the registers controlling operation of
PMU are forced to known states, some of them are set according to the
variant of the PMU we use.  For our variant, charger is disabled when
you visit NOPOWER.  Certain registers get reset to defaults additionally
if you leave ACTIVE for STANDBY, making it necessary to closely consult
the datasheet to figure out what the thing will do.

In the case of the charger registers, they only get reset to defaults in
NOPOWER.  It means that you can powerup, the charger is enabled, you can
go "OFF" -- to PMU STANDBY -- and the charger stays enabled.  So that's
how you can charge while "OFF".  The complication is, if you really ran
out of power completely and hit NOPOWER, you can't charge any more
because it reset the charger enable register to 0 in NOPOWER.  That is
why there are varying results reported for charging while OFF, and why
it doesn't work when you need it the most (A5 with dead battery).

> If the latter, is this code in u-boot? Is the PMU enabled in either/both
> u-boot in NOR FLASH and NAND FLASH (depending on u-boot version, of
> course)?

The PMU as a whole is definitively enabled if the CPU is up.  The
charger part is enabled by default in both NOR and NAND U-Boot, but the
age of those and the code in this area are different ---->

> Is it true that while in u-boot (version dependent?), the FR consumes
> less than 100mA, so that if powered by any USB source (prior to any USB
> negotiation for higher current), the FR can sit in u-boot and charge the
> battery with whatever current is left over after keeping the phone running?

Later NAND U-Boot tries to take care about 100mA limit IF it feels the
battery is dangerously low.  If the level of the battery seems high, it
just goes ahead and brings up backlight, boots, etc.

IIRC the charger is always enabled in U-Boot, but the amount left over
for charge from USB at 100mA limit would take a long time to fill the
battery.  Happily --->

> Does any USB high current (500mA) negotiation take place in u-boot?

Yes, NOR and NAND U-Boot is aware if it gets enumerated by a host PC and
that it means it can use 500mA limit giving much more left over for

> Do we sense the ID resistor in u-boot?

Later NAND one tries to, not sure about NOR offhand.

> I presume that these two negotiations only occur after we boot into
> Linux, so that in u-boot the best we can do is draw 100mA, and charge
> with whatever is leftover.

It's a reasonable thought but in fact U-Boot has enough USB stack (for
DFU for example) that it has to handle enumeration, and therefore it can
know that 500mA was accepted by host.

> I think you see what I'm trying to understand here. On the community
> list are various suggestions of sequences to get a dead battery charged.
> I want to understand the underlying process, so that I can document the
> correct sequence.

Hope this helps towards that goal!  What it boils down to is if you can
get into U-Boot, you will be able to recover OK.  But there is case with
A5 that you cannot get into U-Boot and PMU has been in NOPOWER and
battery is dead.  Then you need to shout "clear!" and apply the paddles
like on ER.

- -Andy
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org


More information about the openmoko-kernel mailing list