diff options
Diffstat (limited to 'board/snow/board.c')
-rw-r--r-- | board/snow/board.c | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/board/snow/board.c b/board/snow/board.c index ad951b4c37..d9a3d0cc20 100644 --- a/board/snow/board.c +++ b/board/snow/board.c @@ -261,30 +261,38 @@ void board_i2c_release(int port) */ void board_pmu_init(void) { - /** - * Explanation: - * - * 1. Timeout is by default 2hrs. This increases to 3hrs. At 1.8A - * charging, this should be long enough for the 4000mA-hr battery, - * assuming it spends about 30mins in the CC mode, but doesn't - * allow for much margin. - * 2. Change temp range T23 (0C-40C), to 1.8A max charge. This is - * currently set to 2.4A which is higher than the recommend charge - * current of 2A. - * 3. Change temp range T34 (40C-60C) to 1.8A max charge, and change - * charge voltage to 8.6V. This is currently set to 1.2A/8.49V. - * Because the NTC is on the board, this is quickly reached so - * slow charging may occur. The battery is rated for 2A charging - * up to 60C. - * 4. Set NOITERM bit. On a fully dead battery, the pack goes into a - * mode where it only lets in a very small current via there is a - * different charge path. This fools the charger into thinking - * the current vs voltage is bad. This bit corrects this. + int ver; + + /* + * Set fast charging timeout to 3hr. + * Enable gpio charge_en control. */ pmu_write(0x04, 0x06); - pmu_write(0x07, 0xbd); - pmu_write(0x08, 0xfd); - pmu_write(0x09, 0xe0); + + /* Set NOITERM bit */ + pmu_low_current_charging(1); + + /* + * High temperature charging + * termination voltage: 2.1V + * termination current: 100% + */ + pmu_set_term_voltage(RANGE_T34, TERM_V2100); + pmu_set_term_current(RANGE_T34, TERM_I1000); + /* + * Standard temperature charging + * termination voltage: 2.1V + * termination current: 100% + */ + pmu_set_term_voltage(RANGE_T23, TERM_V2100); + pmu_set_term_current(RANGE_T23, TERM_I1000); + + /* Workaround init values before ES3 */ + if (pmu_version(&ver) || ver < 3) { + /* Termination current: 75% */ + pmu_set_term_current(RANGE_T34, TERM_I0750); + pmu_set_term_current(RANGE_T23, TERM_I0750); + } } #endif /* CONFIG_BOARD_PMU_INIT */ |