diff options
author | Peter Marheine <pmarheine@chromium.org> | 2022-05-26 17:16:46 +1000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-06-15 20:24:30 +0000 |
commit | d97acfefaa24708ba699dd1bc316ea2f9f44ec6c (patch) | |
tree | 15cffbfde20a5b15e988addcf93f87d9c3d5c776 /zephyr/shim | |
parent | 8df3ccb897b109609c23859f8128ecc2ea4a23a8 (diff) | |
download | chrome-ec-d97acfefaa24708ba699dd1bc316ea2f9f44ec6c.tar.gz |
chipset: introduce CONFIG_AP_POWER_CONTROL
Because the new Zephyr power sequencing support is gated on a different
config option than HAS_TASK_CHIPSET which code has historically assumed
implies there is an AP present, it is now easy to introduce bugs when
code that applies in both configurations uses the old option test.
This change decouples the presence of an AP from HAS_TASK_CHIPSET,
introducing a new CONFIG_AP_POWER_CONTROL symbol that is derived from
the power sequencing config options. All existing applicable users of
HAS_TASK_CHIPSET are changed to use the new symbol, fixing several
callers which would not behave correctly under Zephyr with the new
power sequencing code.
The duplicate stub implementations of functions provided by Zephyr's
chipset_api are removed, because they already appear in the header
that declares those functions.
BUG=b:233681784
TEST=make buildall, zmake testall
BRANCH=none
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Change-Id: I282da30839ca52fcc88c6f9dea2bd00d4811b976
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3670735
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr/shim')
-rw-r--r-- | zephyr/shim/src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | zephyr/shim/src/chipset_api.c | 32 |
2 files changed, 1 insertions, 33 deletions
diff --git a/zephyr/shim/src/CMakeLists.txt b/zephyr/shim/src/CMakeLists.txt index 9273a41fde..dee8d0af71 100644 --- a/zephyr/shim/src/CMakeLists.txt +++ b/zephyr/shim/src/CMakeLists.txt @@ -2,7 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -zephyr_library_sources(chipset_api.c) zephyr_library_sources(console.c) zephyr_library_sources(crc.c) zephyr_library_sources(gpio.c) @@ -27,6 +26,7 @@ zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_BATTERY zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER_RT9490 bc12_rt9490.c) zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_CHARGER charger.c) +zephyr_library_sources_ifdef(CONFIG_AP_PWRSEQ chipset_api.c) zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_HOST_INTERFACE_ESPI espi.c) zephyr_library_sources_ifdef(CONFIG_PLATFORM_EC_FAN fan.c) diff --git a/zephyr/shim/src/chipset_api.c b/zephyr/shim/src/chipset_api.c index 2804de8e78..3bfa420980 100644 --- a/zephyr/shim/src/chipset_api.c +++ b/zephyr/shim/src/chipset_api.c @@ -7,7 +7,6 @@ #include "common.h" -#if defined(CONFIG_AP_PWRSEQ) #include "ap_power/ap_power_interface.h" #include "chipset_state_check.h" @@ -45,34 +44,3 @@ void init_reset_log(void) { ap_power_init_reset_log(); } - -#else - -#if !defined(HAS_TASK_CHIPSET) -#include "chipset.h" - -/* When no chipset is present, assume it is always off. */ -int chipset_in_state(int state_mask) -{ - return state_mask & CHIPSET_STATE_ANY_OFF; -} -int chipset_in_or_transitioning_to_state(int state_mask) -{ - return state_mask & CHIPSET_STATE_ANY_OFF; -} -void chipset_exit_hard_off(void) { } -void chipset_throttle_cpu(int throttle) { } -void chipset_force_shutdown(enum chipset_shutdown_reason reason) { } -void chipset_reset(enum chipset_shutdown_reason reason) { } -void power_interrupt(enum gpio_signal signal) { } -void chipset_handle_espi_reset_assert(void) { } -void chipset_handle_reboot(void) { } -void chipset_reset_request_interrupt(enum gpio_signal signal) { } -void chipset_warm_reset_interrupt(enum gpio_signal signal) { } -void chipset_ap_rst_interrupt(enum gpio_signal signal) { } -void chipset_power_good_interrupt(enum gpio_signal signal) { } -void chipset_watchdog_interrupt(enum gpio_signal signal) { } -void init_reset_log(void) { } - -#endif /* !defined(HAS_TASK_CHIPSET) */ -#endif /*defined(CONFIG_AP_PWRSEQ) */ |