diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2017-01-27 11:45:09 +0100 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-01-27 20:52:08 +0000 |
commit | 19fee64128330e8d9c10e4bd0152f152a80ffc85 (patch) | |
tree | 4fb5c06947f05f85be22877c851c32738447af91 | |
parent | e46a33121b289a4e164fb6f25c2ff3aebb1ef2ad (diff) | |
download | chrome-ec-19fee64128330e8d9c10e4bd0152f152a80ffc85.tar.gz |
caroline: do not boot with 15W in read-only firmware
Increase the minimum charger power to boot with the battery ensuring a
minimum buffer to 25W.
And add a new CONFIG_CHARGER_LIMIT_POWER_ENFORCE_RO_THRESH parameter to
even forbid it to boot in RO to do the EC software-sync if this 25W
threshold is not reached.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=glados
BUG=chrome-os-partner:58657
TEST=Discharge caroline battery down to 5400mV.
Plug AC and try repeatedly to boot the system.
See it won't boot until battery state of charge is 1%.
Change-Id: I0ff0dc9bced1eb9309f13b35943ffb675aebafae
Reviewed-on: https://chromium-review.googlesource.com/433760
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/caroline/board.h | 3 | ||||
-rw-r--r-- | common/charge_state_v2.c | 4 | ||||
-rw-r--r-- | include/config.h | 6 |
3 files changed, 12 insertions, 1 deletions
diff --git a/board/caroline/board.h b/board/caroline/board.h index 0910be94ac..70b02ba4c2 100644 --- a/board/caroline/board.h +++ b/board/caroline/board.h @@ -43,7 +43,8 @@ #define CONFIG_CHARGER_ILIM_PIN_DISABLED #define CONFIG_CHARGER_INPUT_CURRENT 512 #define CONFIG_CHARGER_LIMIT_POWER_THRESH_BAT_PCT BATTERY_LEVEL_SHUTDOWN -#define CONFIG_CHARGER_LIMIT_POWER_THRESH_CHG_MW 15000 +#define CONFIG_CHARGER_LIMIT_POWER_THRESH_CHG_MW 25000 +#define CONFIG_CHARGER_LIMIT_POWER_ENFORCE_RO_THRESH #define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1 #define CONFIG_CHARGER_NARROW_VDC #define CONFIG_CHARGER_SENSE_RESISTOR 10 diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index 23b3135cdc..c1801c5c8a 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -35,7 +35,11 @@ #define LFCC_EVENT_THRESH 5 /* Full-capacity change reqd for host event */ /* Prior to negotiating PD, most PD chargers advertise 15W */ +#ifndef CONFIG_CHARGER_LIMIT_POWER_ENFORCE_RO_THRESH #define LIKELY_PD_USBC_POWER_MW 15000 +#else +#define LIKELY_PD_USBC_POWER_MW CONFIG_CHARGER_LIMIT_POWER_THRESH_CHG_MW +#endif /* * State for charger_task(). Here so we can reset it on a HOOK_INIT, and diff --git a/include/config.h b/include/config.h index c1433a223d..5fe899a183 100644 --- a/include/config.h +++ b/include/config.h @@ -445,6 +445,12 @@ */ #undef CONFIG_CHARGER_LIMIT_POWER_THRESH_BAT_PCT #undef CONFIG_CHARGER_LIMIT_POWER_THRESH_CHG_MW +/* + * Enforce the above CONFIG_CHARGER_LIMIT_POWER_THRESH_CHG_MW threshold, + * rather than booting to do soft-sync in RO even if a possibly-PD 15W + * charger is present. + */ +#undef CONFIG_CHARGER_LIMIT_POWER_ENFORCE_RO_THRESH /* * Equivalent of CONFIG_BATTERY_OVERRIDE_PARAMS for use with |