u-boot low-battery handling

Mike Montour mail at mmontour.net
Mon Aug 25 10:34:42 CEST 2008


I have been experimenting with deeply-discharged batteries on my 
Freerunner. When the battery was very low (but not low enough to trigger 
the battery's internal cutoff) I was not able to boot reliably when 
plugged into the wall charger. I was more successful when using a USB 
cable connected to my PC.

I found a problem in u-boot where wait_for_power() was not properly 
setting the 1000mA current limit - it would set it, but then immediately 
put the PMU into "USB suspend" mode based on the value of 
udc_usb_maxcurrent (at least I think that's what was happening).

The first attached patch improves this situation, but it is not yet 
ready to be applied to the stable tree. I changed the udc callback to 
set a udc_usb_maxcurrent of 100mA rather than 0 when connected to an 
unpowered usb hub, but I don't know if there are situations where 
udc_usb_maxcurrent is actually supposed to be 0mA. Also the patch is 
resetting a bit in PCF50633_REG_OOCSHDWN but I do not know yet why this 
is necessary.

The second patch is debugging code that flashes the power LEDs to 
indicate the status of the battery and the USB current limit. It may be 
useful to others who are investigating this problem.

Comments are welcome.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-lowbat-usb-power-levels.patch
Url: http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20080825/148781c0/attachment-0002.txt 


More information about the openmoko-kernel mailing list