diff options
author | Jack Rosenthal <jrosenth@chromium.org> | 2020-11-11 14:15:14 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-20 23:57:56 +0000 |
commit | 24afe7306b8c35439831144bb67ddb3937e2c7f5 (patch) | |
tree | 56017e2da77ce29fa4235facf0f999cfb9105f29 /power | |
parent | 9b056a8aba7fd598f918b5356bf8d58645b78056 (diff) | |
download | chrome-ec-24afe7306b8c35439831144bb67ddb3937e2c7f5.tar.gz |
zephyr: shim in power sequencing
Enable shimming of power sequencing code.
BUG=b:171312361
BRANCH=none
TEST=With zephyr-chrome CL...
https://screenshot.googleplex.com/4m6N6vd2Nx5FpiD.png
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I8fb96019c8c636010d2cd136c0116df41fc9f148
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2548308
Diffstat (limited to 'power')
-rw-r--r-- | power/common.c | 8 | ||||
-rw-r--r-- | power/intel_x86.c | 7 |
2 files changed, 13 insertions, 2 deletions
diff --git a/power/common.c b/power/common.c index 054206519f..637a367854 100644 --- a/power/common.c +++ b/power/common.c @@ -1005,7 +1005,7 @@ __overridable void board_power_5v_enable(int enable) /* 5V enable request bitmask from various tasks. */ static uint32_t pwr_5v_en_req; -static struct mutex pwr_5v_ctl_mtx; +static mutex_t pwr_5v_ctl_mtx; void power_5v_enable(task_id_t tid, int enable) { @@ -1030,6 +1030,12 @@ static void restore_enable_5v_state(void) const uint32_t *state; int size; + /* + * Initialize the mutex for ZephyrOS. + * This does nothing for non-Zephyr builds. + */ + (void)k_mutex_init(&pwr_5v_ctl_mtx); + state = (const uint32_t *) system_get_jump_tag(P5_SYSJUMP_TAG, 0, &size); if (state && size == sizeof(pwr_5v_en_req)) { diff --git a/power/intel_x86.c b/power/intel_x86.c index 1fdf1b96ea..893e9fbf4e 100644 --- a/power/intel_x86.c +++ b/power/intel_x86.c @@ -388,7 +388,12 @@ enum power_state common_intel_x86_power_handle_state(enum power_state state) /* Enable wireless */ wireless_set_state(WIRELESS_ON); - lpc_s3_resume_clear_masks(); + /* + * TODO(b/172678200): this function hasn't been + * shimmed to Zephyr yet + */ + if (!IS_ENABLED(CONFIG_ZEPHYR)) + lpc_s3_resume_clear_masks(); /* Call hooks now that rails are up */ hook_notify(HOOK_CHIPSET_RESUME); |