diff options
author | wen zhang <zhangwen6@huaqin.corp-partner.google.com> | 2020-10-27 17:17:07 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-02 11:24:50 +0000 |
commit | 1172759baa40708ed96de90bc2d541cba1ef3438 (patch) | |
tree | 70cd36a5b3879d5f62d9c6fe75a73e6b35d55c65 /baseboard/kukui | |
parent | 71069893536962157b3b25330851a1c2c7cd6da5 (diff) | |
download | chrome-ec-1172759baa40708ed96de90bc2d541cba1ef3438.tar.gz |
Kukui: initial a new models kakadu of ec.
Copy from krane, which is a model from Kukui.
Modified for building pass.
It will need to be revised later.
BUG=b:171763111
BRANCH=master
TEST=make -j BOARD=kakadu
Change-Id: I87fcf8c8e3bd4fa669e0bcb7fbb9d125a9926cdb
Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2501801
Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org>
Diffstat (limited to 'baseboard/kukui')
-rw-r--r-- | baseboard/kukui/battery_max17055.c | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/baseboard/kukui/battery_max17055.c b/baseboard/kukui/battery_max17055.c index 972bd13700..6247f665aa 100644 --- a/baseboard/kukui/battery_max17055.c +++ b/baseboard/kukui/battery_max17055.c @@ -15,23 +15,15 @@ #define TEMP_OUT_OF_RANGE TEMP_ZONE_COUNT -#ifdef BOARD_KAKADU -#define BATT_ID 1 -#else #define BATT_ID 0 -#endif #define BATTERY_SIMPLO_CHARGE_MIN_TEMP 0 #define BATTERY_SIMPLO_CHARGE_MAX_TEMP 60 -#define BATTERY_ATL_CHARGE_MIN_TEMP -20 -#define BATTERY_ATL_CHARGE_MAX_TEMP 60 - #define CPRINTS(format, args...) cprints(CC_CHARGER, format, ## args) enum battery_type { BATTERY_SIMPLO = 0, - BATTERY_ATL, BATTERY_COUNT }; @@ -48,18 +40,6 @@ static const struct battery_info info[] = { .discharging_min_c = -20, .discharging_max_c = 60, }, - [BATTERY_ATL] = { - .voltage_max = 4370, - .voltage_normal = 3860, - .voltage_min = 3150, - .precharge_current = 256, - .start_charging_min_c = 0, - .start_charging_max_c = 45, - .charging_min_c = 0, - .charging_max_c = 60, - .discharging_min_c = -20, - .discharging_max_c = 60, - }, }; static const struct max17055_batt_profile batt_profile[] = { @@ -69,12 +49,6 @@ static const struct max17055_batt_profile batt_profile[] = { .ichg_term = MAX17055_ICHGTERM_REG(235), .v_empty_detect = MAX17055_VEMPTY_REG(3000, 3600), }, - [BATTERY_ATL] = { - .is_ez_config = 1, - .design_cap = MAX17055_DESIGNCAP_REG(7270), - .ichg_term = MAX17055_ICHGTERM_REG(500), - .v_empty_detect = MAX17055_VEMPTY_REG(3000, 3600), - }, }; static const struct max17055_alert_profile alert_profile[] = { @@ -86,14 +60,6 @@ static const struct max17055_alert_profile alert_profile[] = { .s_alert_mxmn = SALRT_DISABLE, .i_alert_mxmn = IALRT_DISABLE, }, - [BATTERY_ATL] = { - .v_alert_mxmn = VALRT_DISABLE, - .t_alert_mxmn = MAX17055_TALRTTH_REG( - BATTERY_ATL_CHARGE_MAX_TEMP, - BATTERY_ATL_CHARGE_MIN_TEMP), - .s_alert_mxmn = SALRT_DISABLE, - .i_alert_mxmn = IALRT_DISABLE, - }, }; const struct max17055_batt_profile *max17055_get_batt_profile(void) @@ -120,11 +86,6 @@ enum battery_disconnect_state battery_get_disconnect_state(void) int charger_profile_override(struct charge_state_data *curr) { -#ifdef BOARD_KAKADU - static timestamp_t deadline_48; - static timestamp_t deadline_2; - int cycle_count = 0, rv, val; -#endif /* battery temp in 0.1 deg C */ int bat_temp_c = curr->batt.temperature - 2731; @@ -160,16 +121,6 @@ int charger_profile_override(struct charge_state_data *curr) /* TEMP_ZONE_3 */ {450, BATTERY_SIMPLO_CHARGE_MAX_TEMP * 10, 3350, 4300}, }, - [BATTERY_ATL] = { - /* TEMP_ZONE_0 */ - {BATTERY_ATL_CHARGE_MIN_TEMP * 10, 50, 719, 4370}, - /* TEMP_ZONE_1 */ - {50, 100, 2157, 4370}, - /* TEMP_ZONE_2 */ - {100, 450, 3595, 4370}, - /* TEMP_ZONE_3 */ - {450, BATTERY_ATL_CHARGE_MAX_TEMP * 10, 2516, 4100}, - }, }; BUILD_ASSERT(ARRAY_SIZE(temp_zones[BATT_ID]) == TEMP_ZONE_COUNT); BUILD_ASSERT(ARRAY_SIZE(temp_zones) == BATTERY_COUNT); @@ -206,53 +157,6 @@ int charger_profile_override(struct charge_state_data *curr) break; } -#ifdef BOARD_KAKADU - /* Check cycle count to decrease charging voltage. */ - rv = battery_cycle_count(&val); - if (!rv) - cycle_count = val; - if (cycle_count > 300 && cycle_count <= 600) - curr->requested_voltage = 4320; - else if (cycle_count > 600 && cycle_count <= 1000) - curr->requested_voltage = 4300; - else if (cycle_count > 1000) - curr->requested_voltage = 4250; - /* Should not keep charging voltage > 4250mV for 48hrs. */ - if ((curr->state == ST_DISCHARGE) || - curr->chg.voltage < 4250) { - deadline_48.val = 0; - /* Starting count 48hours */ - } else if (curr->state == ST_CHARGE || - curr->state == ST_PRECHARGE) { - if (deadline_48.val == 0) - deadline_48.val = get_time().val + - CHARGER_LIMIT_TIMEOUT_HOURS * HOUR; - /* If charging voltage keep > 4250 for 48hrs, - set charging voltage = 4250 */ - else if (timestamp_expired(deadline_48, NULL)) - curr->requested_voltage = 4250; - } - /* Should not keeep battery voltage > 4100mV and - battery temperature > 45C for two hour */ - if (curr->state == ST_DISCHARGE || - curr->batt.voltage < 4100 || - bat_temp_c < 450) { - deadline_2.val = 0; - } else if (curr->state == ST_CHARGE || - curr->state == ST_PRECHARGE) { - if (deadline_2.val == 0) - deadline_2.val = get_time().val + - CHARGER_LIMIT_TIMEOUT_HOURS_TEMP * HOUR; - else if (timestamp_expired(deadline_2, NULL)) { - /* Set discharge and charging voltage = 4100mV */ - if (curr->batt.voltage >= 4100) { - curr->requested_current = 0; - curr->requested_voltage = 4100; - } - } - } -#endif - #ifdef VARIANT_KUKUI_CHARGER_MT6370 mt6370_charger_profile_override(curr); #endif /* CONFIG_CHARGER_MT6370 */ @@ -276,7 +180,6 @@ int get_battery_manufacturer_name(char *dest, int size) { static const char * const name[] = { [BATTERY_SIMPLO] = "SIMPLO", - [BATTERY_ATL] = "Celxpert", }; ASSERT(dest); strzcpy(dest, name[BATT_ID], size); |