summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2021-06-22 21:24:06 -0700
committerCommit Bot <commit-bot@chromium.org>2021-06-23 20:47:18 +0000
commit3aa4dd2c4a695152dd17aaec601d3a79bc5ab1c4 (patch)
tree0f08d695a03d2ca88092b7ae82429cd38143928e /baseboard
parent87f59b57817d5800fd929938b2dca914bad14d2c (diff)
downloadchrome-ec-3aa4dd2c4a695152dd17aaec601d3a79bc5ab1c4.tar.gz
chgstv2: Unify power-on and shutdown battery thresholds
Currently, power-on battery SoC and shutdown battery SoC are independently configured by each board. This patch will unify the setting as follows: CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON = 2 (don't boot if soc < 2%) CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE = 2 (shutdown if soc <= 2%) BATTERY_LEVEL_SHUTDOWN = 3 (shutdown if soc < 3%) CONFIG_BATTERY_EXPORT_DISPLAY_SOC = Y (removed) CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC = 1 This allows us to show the low battery alert whenever we can because EC doesn't inhibit power-on even if it knows the host would immediately shut down. With CONFIG_BATTERY_EXPORT_DISPLAY_SOC, boards will start using the CONFIG_BATT_HOST_SHUTDOWN_PERCENTAGE = 2% as the low battery threshold (and the SoC will be agreed between the EC and Powerd). Boards with CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON = 1 will keep the same threshold. This is for avoiding degrading the UX by increasing the power-on threshold (even though a question that 1% may not be enough for soft sync to finish consistently remains to be answered). Boards with CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON > 2 will have a lower threshold but we think 2% is enough to finish the software sync. A lower threshold also improves the UX by showing the low battery alert in the situation where otherwise the system would leave the user uninformed by not responding to a power button press. BUG=b:191837893 BRANCH=None TEST=buildall Change-Id: If6ff733bc181f929561a3fffb8a84e760668ce37 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2981468 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/asurada/baseboard.h1
-rw-r--r--baseboard/brya/baseboard.h2
-rw-r--r--baseboard/dedede/baseboard.h1
-rw-r--r--baseboard/dragonegg/baseboard.h1
-rw-r--r--baseboard/grunt/baseboard.h7
-rw-r--r--baseboard/guybrush/baseboard.h3
-rw-r--r--baseboard/hatch/baseboard.h2
-rw-r--r--baseboard/intelrvp/baseboard.h2
-rw-r--r--baseboard/kukui/baseboard.h1
-rw-r--r--baseboard/octopus/baseboard.h1
-rw-r--r--baseboard/trogdor/baseboard.h1
-rw-r--r--baseboard/volteer/baseboard.h2
-rw-r--r--baseboard/zork/baseboard.h1
13 files changed, 2 insertions, 23 deletions
diff --git a/baseboard/asurada/baseboard.h b/baseboard/asurada/baseboard.h
index 52461d8822..97576a32ef 100644
--- a/baseboard/asurada/baseboard.h
+++ b/baseboard/asurada/baseboard.h
@@ -64,7 +64,6 @@
#define CONFIG_CHARGER_INPUT_CURRENT 512
#define CONFIG_CHARGER_ISL9238C
#define CONFIG_CHARGER_MAINTAIN_VBAT
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1
#define CONFIG_CHARGER_OTG
#define CONFIG_CHARGER_PSYS
#define CONFIG_CHARGER_PSYS_READ
diff --git a/baseboard/brya/baseboard.h b/baseboard/brya/baseboard.h
index 6ebc5b06e7..547349469d 100644
--- a/baseboard/brya/baseboard.h
+++ b/baseboard/brya/baseboard.h
@@ -73,8 +73,6 @@
* communicate on locked systems (which haven't PD negotiated)
*/
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT 15000
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 3
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC 1
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON 15001
/* Common battery defines */
diff --git a/baseboard/dedede/baseboard.h b/baseboard/dedede/baseboard.h
index 933512548b..1b16e5dd35 100644
--- a/baseboard/dedede/baseboard.h
+++ b/baseboard/dedede/baseboard.h
@@ -149,7 +149,6 @@
#define CONFIG_CHARGER
#define CONFIG_CHARGER_DISCHARGE_ON_AC
#define CONFIG_CHARGER_INPUT_CURRENT 256
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1
#define CONFIG_USB_CHARGER
#define CONFIG_TRICKLE_CHARGING
diff --git a/baseboard/dragonegg/baseboard.h b/baseboard/dragonegg/baseboard.h
index 60b2d07241..a22ad924e9 100644
--- a/baseboard/dragonegg/baseboard.h
+++ b/baseboard/dragonegg/baseboard.h
@@ -56,7 +56,6 @@
#define CONFIG_CHARGER_BQ25710
#define CONFIG_CHARGER_DISCHARGE_ON_AC
#define CONFIG_CHARGER_INPUT_CURRENT 512 /* Allow low-current USB charging */
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 10
diff --git a/baseboard/grunt/baseboard.h b/baseboard/grunt/baseboard.h
index 2621bcdbdb..7f22d92d17 100644
--- a/baseboard/grunt/baseboard.h
+++ b/baseboard/grunt/baseboard.h
@@ -149,13 +149,6 @@
#define PD_MAX_VOLTAGE_MV 20000
/*
- * Minimum conditions to start AP and perform swsync. Note that when the
- * charger is connected via USB-PD analog signaling, the boot will proceed
- * regardless.
- */
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 3
-
-/*
* Require PD negotiation to be complete when we are in a low-battery condition
* prior to releasing depthcharge to the kernel.
*/
diff --git a/baseboard/guybrush/baseboard.h b/baseboard/guybrush/baseboard.h
index 016d36b503..77e22c433b 100644
--- a/baseboard/guybrush/baseboard.h
+++ b/baseboard/guybrush/baseboard.h
@@ -135,11 +135,10 @@
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20
/*
- * EC will boot AP to depthcharge if: (BAT >= 4%) || (AC >= 50W)
+ * EC will boot AP to depthcharge if: (BAT >= 2%) || (AC >= 50W)
* CONFIG_CHARGER_LIMIT_* is not set, so there is no additional restriction on
* Depthcharge to boot OS.
*/
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 4
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON 50000
/*
diff --git a/baseboard/hatch/baseboard.h b/baseboard/hatch/baseboard.h
index 2cbe91221f..bf9140b33f 100644
--- a/baseboard/hatch/baseboard.h
+++ b/baseboard/hatch/baseboard.h
@@ -97,6 +97,7 @@
#define CONFIG_CHARGER_BQ25710
#define CONFIG_CHARGER_DISCHARGE_ON_AC
#define CONFIG_CHARGER_INPUT_CURRENT 512 /* Allow low-current USB charging */
+#undef CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON
#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1
#define CONFIG_CHARGE_RAMP_HW
#define CONFIG_CHARGER_SENSE_RESISTOR 10
@@ -106,7 +107,6 @@
* communicate on locked systems (which haven't PD negotiated)
*/
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT 15000
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC 1
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON 15001
/* Common battery defines */
diff --git a/baseboard/intelrvp/baseboard.h b/baseboard/intelrvp/baseboard.h
index 563be4199f..d57de6e3cd 100644
--- a/baseboard/intelrvp/baseboard.h
+++ b/baseboard/intelrvp/baseboard.h
@@ -73,8 +73,6 @@
* communicate on locked systems (which haven't PD negotiated)
*/
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT 15000
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 3
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC 1
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON 15001
/* Keyboard */
diff --git a/baseboard/kukui/baseboard.h b/baseboard/kukui/baseboard.h
index 9b16c9d5e6..9ba11111e8 100644
--- a/baseboard/kukui/baseboard.h
+++ b/baseboard/kukui/baseboard.h
@@ -181,7 +181,6 @@
#define CONFIG_CHARGER
#define CONFIG_CHARGER_INPUT_CURRENT 512
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 2
#define CONFIG_CHARGER_LIMIT_POWER_THRESH_BAT_PCT 2
#define CONFIG_CHARGER_LIMIT_POWER_THRESH_CHG_MW 15000
#define CONFIG_CHARGER_DISCHARGE_ON_AC
diff --git a/baseboard/octopus/baseboard.h b/baseboard/octopus/baseboard.h
index e07fa9166e..059dec29d9 100644
--- a/baseboard/octopus/baseboard.h
+++ b/baseboard/octopus/baseboard.h
@@ -142,7 +142,6 @@
#define CONFIG_CHARGE_RAMP_HW
#define CONFIG_CHARGER
#define CONFIG_CHARGER_INPUT_CURRENT 512 /* Allow low-current USB charging */
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 1
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_CHARGER_DISCHARGE_ON_AC
#define CONFIG_USB_CHARGER
diff --git a/baseboard/trogdor/baseboard.h b/baseboard/trogdor/baseboard.h
index 570bf16f83..398c9cf912 100644
--- a/baseboard/trogdor/baseboard.h
+++ b/baseboard/trogdor/baseboard.h
@@ -86,7 +86,6 @@
#define CONFIG_CHARGER_DISCHARGE_ON_AC
#define CONFIG_CHARGER_INPUT_CURRENT 512
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 2
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON 10000
#define CONFIG_CHARGER_SENSE_RESISTOR 10
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 20
diff --git a/baseboard/volteer/baseboard.h b/baseboard/volteer/baseboard.h
index b3bb89f91d..4ea3d81676 100644
--- a/baseboard/volteer/baseboard.h
+++ b/baseboard/volteer/baseboard.h
@@ -122,8 +122,6 @@
* communicate on locked systems (which haven't PD negotiated)
*/
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT 15000
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 3
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC 1
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON 15001
/* Common battery defines */
diff --git a/baseboard/zork/baseboard.h b/baseboard/zork/baseboard.h
index ea1e19945d..60db6e1cb2 100644
--- a/baseboard/zork/baseboard.h
+++ b/baseboard/zork/baseboard.h
@@ -225,7 +225,6 @@
* CONFIG_CHARGER_LIMIT_* is not set, so there is no additional restriction on
* Depthcharge to boot OS.
*/
-#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON 4
#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON 50000
/* Increase length of history buffer for port80 messages. */