diff options
author | matt_wang <matt_wang@compal.corp-partner.google.com> | 2019-02-27 13:51:55 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-02-28 11:02:14 -0800 |
commit | 90349be2d089d6b85559ee31e744ee864df4b9ed (patch) | |
tree | 3dcaead8caf76cdc82bc125974c210a21bd79c4b /board | |
parent | 8ac4bf045cf7033c82379f61f1f347c9998c25ed (diff) | |
download | chrome-ec-90349be2d089d6b85559ee31e744ee864df4b9ed.tar.gz |
Fleex: Implement new polymer battery parameter
Fleex support BYD/LGC/SIMPLO/SWD new polymer battery
This patch makes EC configure battery parameters differently based
on manufacturer name.
BUG=b:122944526
BRANCH=octopus
TEST=Verify BYD/LGC/SIMPLO/SWD polymer battery can charge/discharge
and can do battery-cutoff via ectool "batterycutoff" and can wake up from
drain battery/battery-cutoff
Change-Id: Id5db1653cb4d2c36143b45abfa2472fe20c1edfb
Signed-off-by: matt_wang <matt_wang@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/1490797
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Matt Wang <matt_wang@compal.corp-partner.google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Matt Wang <matt_wang@compal.corp-partner.google.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/fleex/battery.c | 171 | ||||
-rw-r--r-- | board/fleex/board.h | 6 |
2 files changed, 177 insertions, 0 deletions
diff --git a/board/fleex/battery.c b/board/fleex/battery.c index ca13f1689d..e42c0a1a17 100644 --- a/board/fleex/battery.c +++ b/board/fleex/battery.c @@ -60,6 +60,34 @@ const struct board_batt_params board_battery_info[] = { }, }, + /* BYD 16DPHYMD Battery Information */ + [BATTERY_BYD16] = { + .fuel_gauge = { + .manuf_name = "BYD-BYD3.685", + .ship_mode = { + .reg_addr = 0x00, + .reg_data = { 0x0010, 0x0010 }, + }, + .fet = { + .reg_addr = 0x043, + .reg_mask = 0x0001, + .disconnect_val = 0x000, + } + }, + .batt_info = { + .voltage_max = 13200, /* mV */ + .voltage_normal = 11400, /* mV */ + .voltage_min = 9000, /* mV */ + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 50, + .charging_min_c = 0, + .charging_max_c = 60, + .discharging_min_c = 0, + .discharging_max_c = 70, + }, + }, + /* LGC Battery Information */ [BATTERY_LGC] = { .fuel_gauge = { @@ -88,6 +116,35 @@ const struct board_batt_params board_battery_info[] = { }, }, + /* LGC JPFMRYMD Battery Information */ + [BATTERY_LGC3] = { + .fuel_gauge = { + .manuf_name = "LGC-LGC3.685", + .ship_mode = { + .wb_support = 1, + .reg_addr = 0x44, + .reg_data = { 0x0010, 0x0010 }, + }, + .fet = { + .reg_addr = 0x0, + .reg_mask = 0x2000, + .disconnect_val = 0x2000, + } + }, + .batt_info = { + .voltage_max = 13200, /* mV */ + .voltage_normal = 11400, /* mV */ + .voltage_min = 9000, /* mV */ + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 50, + .charging_min_c = 0, + .charging_max_c = 60, + .discharging_min_c = 0, + .discharging_max_c = 70, + }, + }, + /* SIMPLO Battery Information */ [BATTERY_SIMPLO] = { .fuel_gauge = { @@ -115,6 +172,120 @@ const struct board_batt_params board_battery_info[] = { .discharging_max_c = 70, }, }, + + /* SIMPLO-ATL 7T0D3YMD Battery Information */ + [BATTERY_SIMPLO_ATL] = { + .fuel_gauge = { + .manuf_name = "SMP-ATL3.61", + .ship_mode = { + .reg_addr = 0x0, + .reg_data = { 0x0010, 0x0010 }, + }, + .fet = { + .reg_addr = 0x043, + .reg_mask = 0x0001, + .disconnect_val = 0x000, + } + }, + .batt_info = { + .voltage_max = 13200, /* mV */ + .voltage_normal = 11400, /* mV */ + .voltage_min = 9000, /* mV */ + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 50, + .charging_min_c = 0, + .charging_max_c = 60, + .discharging_min_c = 0, + .discharging_max_c = 70, + }, + }, + + /* SIMPLO-LISHEN 7T0D3YMD Battery Information */ + [BATTERY_SIMPLO_LS] = { + .fuel_gauge = { + .manuf_name = "SMP-LS3.66", + .ship_mode = { + .reg_addr = 0x0, + .reg_data = { 0x0010, 0x0010 }, + }, + .fet = { + .reg_addr = 0x043, + .reg_mask = 0x0001, + .disconnect_val = 0x000, + } + }, + .batt_info = { + .voltage_max = 13200, /* mV */ + .voltage_normal = 11400, /* mV */ + .voltage_min = 9000, /* mV */ + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 50, + .charging_min_c = 0, + .charging_max_c = 60, + .discharging_min_c = 0, + .discharging_max_c = 70, + }, + }, + + /* SWD-ATL 65N6HYMD Battery Information */ + [BATTERY_SWD_ATL] = { + .fuel_gauge = { + .manuf_name = "SWD-ATL3.618", + .ship_mode = { + .wb_support = 1, + .reg_addr = 0x44, + .reg_data = { 0x0010, 0x0010 }, + }, + .fet = { + .reg_addr = 0x0, + .reg_mask = 0x2000, + .disconnect_val = 0x2000, + } + }, + .batt_info = { + .voltage_max = 13200, /* mV */ + .voltage_normal = 11400, /* mV */ + .voltage_min = 9000, /* mV */ + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 50, + .charging_min_c = 0, + .charging_max_c = 60, + .discharging_min_c = 0, + .discharging_max_c = 70, + }, + }, + + /* SWD-COSLIGHT 65N6HYMD Battery Information */ + [BATTERY_SWD_COS] = { + .fuel_gauge = { + .manuf_name = "SWD-COS3.634", + .ship_mode = { + .wb_support = 1, + .reg_addr = 0x44, + .reg_data = { 0x0010, 0x0010 }, + }, + .fet = { + .reg_addr = 0x0, + .reg_mask = 0x2000, + .disconnect_val = 0x2000, + } + }, + .batt_info = { + .voltage_max = 13200, /* mV */ + .voltage_normal = 11400, /* mV */ + .voltage_min = 9000, /* mV */ + .precharge_current = 256, /* mA */ + .start_charging_min_c = 0, + .start_charging_max_c = 50, + .charging_min_c = 0, + .charging_max_c = 60, + .discharging_min_c = 0, + .discharging_max_c = 70, + }, + }, }; BUILD_ASSERT(ARRAY_SIZE(board_battery_info) == BATTERY_TYPE_COUNT); diff --git a/board/fleex/board.h b/board/fleex/board.h index 669f1466aa..2d57b48fd9 100644 --- a/board/fleex/board.h +++ b/board/fleex/board.h @@ -79,8 +79,14 @@ enum sensor_id { /* List of possible batteries */ enum battery_type { BATTERY_BYD, + BATTERY_BYD16, BATTERY_LGC, + BATTERY_LGC3, BATTERY_SIMPLO, + BATTERY_SIMPLO_ATL, + BATTERY_SIMPLO_LS, + BATTERY_SWD_ATL, + BATTERY_SWD_COS, BATTERY_TYPE_COUNT, }; |