From be386fb62ef93ecfb0f369867bfe9c193b178f90 Mon Sep 17 00:00:00 2001 From: Devin Lu Date: Mon, 19 Oct 2020 16:26:27 +0800 Subject: elemi: Add batteries configuration Add batteries configuration as following: 1. Simplo 996QA193H 2. Cosmx CA407792G BUG=b:169409487 BRANCH=firmware-volteer-13521.B-master TEST=make sure battery charging, battery cutoff works. Signed-off-by: Devin Lu Change-Id: I637b3bf1ea3faa5a7283de80ab9cffb196264c04 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2484114 Reviewed-by: Keith Short --- board/elemi/battery.c | 72 +++++++++++++++++++++++++++++++++++---------------- board/elemi/board.h | 3 ++- 2 files changed, 51 insertions(+), 24 deletions(-) diff --git a/board/elemi/battery.c b/board/elemi/battery.c index 9b356a8efd..602176b718 100644 --- a/board/elemi/battery.c +++ b/board/elemi/battery.c @@ -10,7 +10,7 @@ #include "util.h" /* - * Battery info for all Volteer battery types. Note that the fields + * Battery info for all Elemi battery types. Note that the fields * start_charging_min/max and charging_min/max are not used for the charger. * The effective temperature limits are given by discharging_min/max_c. * @@ -32,37 +32,63 @@ * address, mask, and disconnect value need to be provided. */ const struct board_batt_params board_battery_info[] = { - /* LGC\011 L17L3PB0 Battery Information */ - /* - * Battery info provided by ODM on b/143477210, comment #11 - */ - [BATTERY_LGC011] = { + /* SMP 996QA193H Battery Information */ + [BATTERY_SIMPLO_HIGHPOWER] = { .fuel_gauge = { - .manuf_name = "LGC", + .manuf_name = "333-1D-11-A", .ship_mode = { - .reg_addr = 0x00, - .reg_data = { 0x10, 0x10 }, + .reg_addr = 0x0, + .reg_data = { 0x0010, 0x0010 }, }, .fet = { + .mfgacc_support = 1, .reg_addr = 0x0, - .reg_mask = 0x6000, - .disconnect_val = 0x6000, - } + .reg_mask = 0x0006, + .disconnect_val = 0x0, + }, + }, + .batt_info = { + .voltage_max = 13200, /* mV */ + .voltage_normal = 11550, /* mV */ + .voltage_min = 9000, /* mV */ + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 45, + .charging_min_c = 0, + .charging_max_c = 45, + .discharging_min_c = -20, + .discharging_max_c = 60, + }, + }, + /* Cosmx CA407792G Battery Information */ + [BATTERY_COSMX] = { + .fuel_gauge = { + .manuf_name = "333-AC-11-A", + .ship_mode = { + .reg_addr = 0x0, + .reg_data = { 0x0010, 0x0010 }, + }, + .fet = { + .mfgacc_support = 1, + .reg_addr = 0x0, + .reg_mask = 0x0006, + .disconnect_val = 0x0, + }, }, .batt_info = { - .voltage_max = TARGET_WITH_MARGIN(13200, 5), - .voltage_normal = 11550, /* mV */ - .voltage_min = 9000, /* mV */ - .precharge_current = 256, /* mA */ - .start_charging_min_c = 0, - .start_charging_max_c = 45, - .charging_min_c = 0, - .charging_max_c = 60, - .discharging_min_c = 0, - .discharging_max_c = 75, + .voltage_max = 13200, /* mV */ + .voltage_normal = 11550, /* mV */ + .voltage_min = 9000, /* mV */ + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 45, + .charging_min_c = 0, + .charging_max_c = 45, + .discharging_min_c = -10, + .discharging_max_c = 60, }, }, }; BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT); -const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_LGC011; +const enum battery_type DEFAULT_BATTERY_TYPE = BATTERY_SIMPLO_HIGHPOWER; diff --git a/board/elemi/board.h b/board/elemi/board.h index 236b64a174..69a1e3cb35 100644 --- a/board/elemi/board.h +++ b/board/elemi/board.h @@ -157,7 +157,8 @@ #include "registers.h" enum battery_type { - BATTERY_LGC011, + BATTERY_SIMPLO_HIGHPOWER, + BATTERY_COSMX, BATTERY_TYPE_COUNT, }; -- cgit v1.2.1