From: Grazvydas Ignotas Date: Sun, 8 Nov 2009 17:03:54 +0000 (+0000) Subject: pandora.c: Set GPBR1 register so that charging starts early. X-Git-Tag: Release-2010-05/1^0 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3646a83f9e67ec9a2de3182fd254557fd6ad9aa;p=pandora-x-loader.git pandora.c: Set GPBR1 register so that charging starts early. * This should allow booting with a drained battery and charger connected. --- diff --git a/board/pandora/pandora.c b/board/pandora/pandora.c index 1fc7bd0..b11721e 100755 --- a/board/pandora/pandora.c +++ b/board/pandora/pandora.c @@ -85,21 +85,25 @@ int board_init(void) /* do additional init to prevent trash being output on startup */ serial_init(); -#ifdef CONFIG_PANDORA_FINAL - /*VAUX3 = 2.8V (AV connector)*/ - byte = 0x20; - i2c_write(0x4B, 0x7A, 1, &byte, 1); - byte = 0x03; - i2c_write(0x4B, 0x7D, 1, &byte, 1); -#else - /*VAUX4 = 2.8V (TOUCH,NUBS,RS-232 TRANSCEIVER)*/ - byte = 0x20; - i2c_write(0x4B, 0x7E, 1, &byte, 1); - byte = 0x0A; - i2c_write(0x4B, 0x81, 1, &byte, 1); -#endif + #ifdef CONFIG_PANDORA_FINAL + /* restore GPBR1 for charging to work - + * boot ROM or something clears it before us */ + byte = 0x90; + i2c_write(0x49, 0x91, 1, &byte, 1); + + /*VAUX3 = 2.8V (AV connector)*/ + byte = 0x20; + i2c_write(0x4B, 0x7A, 1, &byte, 1); + byte = 0x03; + i2c_write(0x4B, 0x7D, 1, &byte, 1); + #else + /*VAUX4 = 2.8V (TOUCH,NUBS,RS-232 TRANSCEIVER)*/ + byte = 0x20; + i2c_write(0x4B, 0x7E, 1, &byte, 1); + byte = 0x0A; + i2c_write(0x4B, 0x81, 1, &byte, 1); + #endif - delay(10000); /* give time to power up */ #endif return 0; @@ -567,7 +571,7 @@ void s_init(void) int misc_init_r(void) { #ifdef CFG_PRINTF - printf("OpenPandora X-Loader \n"); + printf("OpenPandora System \n"); #endif return (0);