pandora.c: Set GPBR1 register so that charging starts early. old Release-2010-05/1
authorGrazvydas Ignotas <notasas@gmail.com>
Sun, 8 Nov 2009 17:03:54 +0000 (17:03 +0000)
committerDavid-John Willis <John.Willis@Distant-earth.com>
Sun, 8 Nov 2009 17:03:54 +0000 (17:03 +0000)
* This should allow booting with a drained battery and charger connected.

board/pandora/pandora.c

index 1fc7bd0..b11721e 100755 (executable)
@@ -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);