Power leakage: save 40mW by turning GSM on
Rask Ingemann Lambertsen
rask at sygehus.dk
Sun Feb 15 13:00:33 CET 2009
On Fri, Jan 16, 2009 at 11:09:06PM -0200, Werner Almesberger wrote:
[...]
> I found one more funny today: activating GSM saves about 40mW.
[...]
Did you get any further with this?
Anyway, I'm now running the andy-tracking kernel, but still no dice.
After a reboot (using NOR u-boot), I'm logged in over USB which also
supplies power and I'm starting with a fully charged battery. I'm going to
take advantage of the recent kernel patch which allows you to set charging
current independently from USB current to set up a trap for devices which
take their power directly from the battery.
# cat /sys/class/i2c-adapter/i2c-0/0-0073/dump_regs >~rask/pmdumps/pcf50633-regs-0
# head /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-mbc/*_curlim
==> /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-mbc/chg_curlim <==
500
==> /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-mbc/usb_curlim <==
500
$ sleep 30 && cat /sys/class/power_supply/battery/{status,current_now,voltage_now}
Charging
0
4159000
# echo 0 > /sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-mbc/chg_curlim
# cat /sys/class/i2c-adapter/i2c-0/0-0073/dump_regs >~rask/pmdumps/pcf50633-regs-1
# lsof | grep -F -e /dev/ttySAC
Then I follow the instructions here:
https://wiki.openmoko.org/wiki/Neo_1973_and_Neo_FreeRunner_gsm_modem
# stty -F /dev/ttySAC0 -crtscts
# cat /sys/class/i2c-adapter/i2c-0/0-0073/dump_regs >~rask/pmdumps/pcf50633-regs-2
$ sleep 30 && cat /sys/class/power_supply/battery/{status,current_now,voltage_now}
Charging
0
4159000
# tail -f /dev/ttySAC0 &
[1] 1809
# echo "0" >/sys/bus/platform/devices/neo1973-pm-gsm.0/power_on
# cat /sys/class/i2c-adapter/i2c-0/0-0073/dump_regs >~rask/pmdumps/pcf50633-regs-3
$ sleep 30 && cat /sys/class/power_supply/battery/{status,current_now,voltage_now}
Charging
0
4159000
# stty -F /dev/ttySAC0 -echo
# cat /sys/class/i2c-adapter/i2c-0/0-0073/dump_regs >~rask/pmdumps/pcf50633-regs-4
$ sleep 30 && cat /sys/class/power_supply/battery/{status,current_now,voltage_now}
Charging
0
4159000
# echo "1" >/sys/bus/platform/devices/neo1973-pm-gsm.0/power_on
# cat /sys/class/i2c-adapter/i2c-0/0-0073/dump_regs >~rask/pmdumps/pcf50633-regs-5
$ sleep 30 && cat /sys/class/power_supply/battery/{status,current_now,voltage_now}
Charging
2062
4159000
# stty -F /dev/ttySAC0 crtscts
# cat /sys/class/i2c-adapter/i2c-0/0-0073/dump_regs >~rask/pmdumps/pcf50633-regs-6
$ sleep 30 && cat /sys/class/power_supply/battery/{status,current_now,voltage_now}
Charging
2250
4159000
# echo -e "AT at POFF\r" >/dev/ttySAC0
# cat /sys/class/i2c-adapter/i2c-0/0-0073/dump_regs >~rask/pmdumps/pcf50633-regs-7
$ sleep 30 && cat /sys/class/power_supply/battery/{status,current_now,voltage_now}
Charging
12000
4159000
$ sleep 30 && cat /sys/class/power_supply/battery/{status,current_now,voltage_now}
Charging
2062
4159000
$ sleep 30 && cat /sys/class/power_supply/battery/{status,current_now,voltage_now}
Charging
2062
4159000
# stty -F /dev/ttySAC0 -crtscts
# cat /sys/class/i2c-adapter/i2c-0/0-0073/dump_regs >~rask/pmdumps/pcf50633-regs-8
$ sleep 30 && cat /sys/class/power_supply/battery/{status,current_now,voltage_now}
Charging
2062
4159000
# echo "0" >/sys/bus/platform/devices/neo1973-pm-gsm.0/power_on
# cat /sys/class/i2c-adapter/i2c-0/0-0073/dump_regs >~rask/pmdumps/pcf50633-regs-9
$ sleep 30 && cat /sys/class/power_supply/battery/{status,current_now,voltage_now}
Charging
0
4159000
Which leaves me kind of puzzled as to the original current leak of around
19 mA. However, contrary to what the wiki leads you to believe, you _do_
turn off some sort of power to the modem by echoing 0 to
/sys/bus/platform/devices/neo1973-pm-gsm.0/power_on. I.e. it is not just
the GTA01 that needs it (to get back access to the console).
Yanking the USB cable doesn't reveal anything either, only 4.8 mA above
my current best of 49.0 mA on a fully charged battery:
# sleep 60 && cat /sys/class/i2c-adapter/i2c-0/0-0073/dump_regs >~rask/pmdumps/pcf50633-regs-a
$ sleep 130 && cat /sys/class/power_supply/battery/{status,current_now,voltage_now}
Discharging
53812
4148000
Given that power consumption was basicly the same 8,32 mW before and after
the AT at POFF command, what exactly is that command supposed to do?
--
Rask Ingemann Lambertsen
Danish law requires addresses in e-mail to be logged and stored for a year
More information about the hardware
mailing list