My Gta02s wont charge / chgena = 0 by default

Werner Almesberger werner at openmoko.org
Tue Jun 24 07:03:41 CEST 2008


Andy Green wrote:
> It could be that chgena = 0 means no system power but it seems a bit
> insane (especially as chgena is 0 from the get-go as we now know).

I does, indeed. I poked around some more, and the PMU is sane when it
comes to that. However, I'm not sure you'll like all my results ...

The general setup is a GTA02v5 connected to a real battery, with a
modified u-boot that goes into an endless loop after initializing
the PMU. In this loop, I can toggle one setting. Also, the red LED
blinks at 0.5 Hz. This is what the typical code change looks like:

http://people.openmoko.org/werner/experiment-usb-100.patch

In all the tests below, I start with only the battery, then add USB,
and then disconnect the battery. Interrupts are disabled, so there
is no USB signaling.

The experiments and their results:


Use USB-SYS path to power the system
http://people.openmoko.org/werner/usb-sys.ps

  Hardware setup:
  - battery charged to about 4.2V

  Software setup:
  - regular u-boot PMU setup (we intercept u-boot at wait_for_power)
  - disable charger (MBCC1.chgena = 0)
  - set USB to "suspend" (MBCC7.usbdevstat = 3)
  - enable USB-SYS path (MBCC8.usbenasus = 1)
  - red LED blinks at 1Hz, using wait_for_power logic

  Actions:
  - t=~2s: power up from battery
  - t=~20-30: temporarily enable charger (MBCC1.chgena = 1)
  - t=~32: connect USB (without signaling)
  - t=~45-55: temporarily enable charger
  - t=~60: disconnect battery
  - t=~70-80: temporarily enable charger

  Observations:
  - the USB-SYS path works as documented
  - the charger does not need to be enabled for USB-SYS to work
  - system runs from battery alone, USB alone, and both combined
  - enabling the charger when running from battery slightly reduces
    battery current (duh !)


Examine charger on/off with USB current limit set to 500mA
http://people.openmoko.org/werner/usb-500.ps

  Hardware setup:
  - battery charged to about 4.1V

  Software setup:
  - regular u-boot PMU setup (we intercept u-boot at wait_for_power)
  - disable charger (MBCC1.chgena = 0)
  - set USB current limit at 500mA (MBCC7.usbdevstat = 1)
  - disable USB-SYS path (MBCC8.usbenasus = 0)
  - red LED blinks at 1Hz, using wait_for_power logic

  Actions:
  - t=~2s: power up from battery
  - t=~20-32: temporarily enable charger (MBCC1.chgena = 1)
  - t=~33: connect USB (without signaling)
  - t=~48-58: temporarily enable charger
  - t=~60: remove battery
  - t=~69: temporarily enable charger

  Observations:
  - we don't need to enable the charger to power the system (!!!)
  - if there is no battery and we try to enable the charger, the
    system turns off instantly (!!!)
  - again, enabling the charger while running only from battery
    slightly improves power consumption


Alternate between 100mA and 500mA current limit (charger disabled)
http://people.openmoko.org/werner/usb-100.ps

  Hardware setup:
  - battery charged to about 4.2V

  Software setup:
  - regular u-boot PMU setup (we intercept u-boot at wait_for_power)
  - disable charger (MBCC1.chgena = 0)
  - set USB current limit at 100mA (MBCC7.usbdevstat = 0)
  - disable USB-SYS path (MBCC8.usbenasus = 0)
  - red LED blinks at 1Hz, using wait_for_power logic

  Actions:
  - t=~2s: power up from battery
  - t=~22-32: temporarily switch to 500mA (MBCC7.usbdevstat = 1)
  - t=~33: connect USB (without signaling)
  - t=~44-57: temporarily switch to 500mA
  - t=~58: remove battery

  Observations:
  - again, we don't need to enable the charger to power the system
  - the current limit is properly observed
  - when removing the battery, 100mA from USB are not enough to run
    the system, thus it shuts down


The good news is that we don't need to enable the charger to get power
to Vsys. The not so joyful news is that, if the charger is enabled but
there's no battery, something kills the system immediately. Gotta find
out what, and how to defang it.

We also draw more than 100mA even before reaching the wait_for_power
loop (and there, blinking the LED makes things even worse, but this
is expected). So we need to save a bit of power in the early system
bringup.

There's also the mystery result that enabling the charger while running
only from battery reduces battery current. That must be some of that
Dark Energy everybody's talking about.

- Werner




More information about the openmoko-kernel mailing list