summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2021-01-26 15:36:03 +0100
committerCommit Bot <commit-bot@chromium.org>2021-01-27 18:28:29 +0000
commitfe3d7e9f602bc52949738ec5ecbf417e8e5bb03e (patch)
tree6130d0080bd459302e28d9c6459a130f849236f0
parent7f020a152bbec17cae13a2ce8245d3c19e9929a2 (diff)
downloadchrome-ec-fe3d7e9f602bc52949738ec5ecbf417e8e5bb03e.tar.gz
zephyr: Add missing charger configs
There are 3 battery configs missing for Zephyr: -CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON -CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC -CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT -CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON Add them to the Kconfig.usbc BUG=b:177604307 BRANCH=none TEST=Build Volteer board with the configs enabled Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I0700138a74f9879caf1c6f259377a376bde45364 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2648487 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--zephyr/Kconfig.usbc53
-rw-r--r--zephyr/shim/include/config_chip.h24
2 files changed, 77 insertions, 0 deletions
diff --git a/zephyr/Kconfig.usbc b/zephyr/Kconfig.usbc
index cf7c6bf50b..2b31a16395 100644
--- a/zephyr/Kconfig.usbc
+++ b/zephyr/Kconfig.usbc
@@ -64,6 +64,59 @@ config PLATFORM_EC_CHARGER_INPUT_CURRENT
chargers, this should be set to 512 mA in order to not brown-out
low-current USB charge ports in accordance with USB-PD r3.0 Sec. 7.3
+menuconfig PLATFORM_EC_BOOT_AP_POWER_REQUIREMENTS
+ bool "Power requirements to boot AP"
+ default y
+ help
+ Power thresholds for AP boot.
+ If one of the following conditions is met, EC boots AP:
+ 1. Battery charge >= CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON.
+ 2. AC power >= CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON.
+ 3. Battery charge >= CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC
+ and
+ AC power >= CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT.
+
+if PLATFORM_EC_BOOT_AP_POWER_REQUIREMENTS
+
+config PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON
+ int "Minimal battery level to boot AP without AC"
+ depends on PLATFORM_EC_BATTERY
+ default 3
+ help
+ Sets the minimum battery capacity, as a percentage, needed to boot
+ the AP when AC power is not supplied.
+
+config PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC
+ int "Minimal battery level to boot AP with AC"
+ depends on PLATFORM_EC_BATTERY && PLATFORM_EC_CHARGE_MANAGER
+ default 1
+ help
+ Sets the minimum battery capacity, as a percentage, needed to boot
+ the AP when AC power is supplied. The AC power supplied must also
+ be greater than CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT.
+
+config PLATFORM_EC_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT
+ int "Minimal AC power to boot AP with battery"
+ depends on PLATFORM_EC_BATTERY && PLATFORM_EC_CHARGE_MANAGER
+ default 15000
+ help
+ Sets the minimum power, in milliwatts, supplied by an external
+ charger required to boot the AP when the battery capacity is also
+ above CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC.
+
+config PLATFORM_EC_CHARGER_MIN_POWER_MW_FOR_POWER_ON
+ int "Minimal AC power to boot AP without battery"
+ depends on PLATFORM_EC_CHARGE_MANAGER
+ default 15000
+ help
+ Sets the minimum power, in milliwatts, supplied by an external
+ charger requires to boot the AP when no battery is present or
+ under dead battery conditions. If the AP requires greater than
+ 15W to boot, check the
+ CONFIG_PLATFORM_EC_CHARGER_LIMIT_POWER_THRESH_CHG_MW setting.
+
+endif # PLATFORM_EC_BOOT_AP_POWER_REQUIREMENTS
+
config PLATFORM_EC_USBC_OCP
bool
help
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index a2e3b63d86..2716eace4e 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -312,6 +312,30 @@ enum battery_type {
#define CONFIG_CHARGER_INPUT_CURRENT CONFIG_PLATFORM_EC_CHARGER_INPUT_CURRENT
#endif
+#undef CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON
+#ifdef CONFIG_PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON
+#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON \
+ CONFIG_PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON
+#endif
+
+#undef CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC
+#ifdef CONFIG_PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC
+#define CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC \
+ CONFIG_PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON_WITH_AC
+#endif
+
+#undef CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT
+#ifdef CONFIG_PLATFORM_EC_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT
+#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT \
+ CONFIG_PLATFORM_EC_CHARGER_MIN_POWER_MW_FOR_POWER_ON_WITH_BATT
+#endif
+
+#undef CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON
+#ifdef CONFIG_PLATFORM_EC_CHARGER_MIN_POWER_MW_FOR_POWER_ON
+#define CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON \
+ CONFIG_PLATFORM_EC_CHARGER_MIN_POWER_MW_FOR_POWER_ON
+#endif
+
#undef CONFIG_CHARGE_RAMP_SW
#ifdef CONFIG_PLATFORM_EC_CHARGE_RAMP_SW
#define CONFIG_CHARGE_RAMP_SW