New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 769503 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 11
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

ec: Enable deep sleep mode when the host is using stm32 rtc alarm.

Project Member Reported by philipchen@chromium.org, Sep 27 2017

Issue description

For boards using stm32 rtc, we disable deep sleep mode if the host is using RTC alarm:
https://chromium-review.googlesource.com/#/c/chromiumos/platform/ec/+/674054/3/chip/stm32/clock-stm32f0.c@318

As discussed in the CL, since we plan to use rtc for the host in lucid sleep mode, we should figure out how to enable deep sleep mode when the host is using stm32 rtc alarm.
 
Description: Show this description
Description: Show this description
Cc: amstan@chromium.org
Labels: OS-Chrome
That link doesn't work for me. This does:

https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/674054/3/chip/stm32/clock-stm32f0.c
Are you able to just keep track of both alarms and just program whichever one is sooner?
Cc: -philipchen@chromium.org
Owner: philipchen@chromium.org
Status: Started (was: Untriaged)
The CL looks like it got abandoned a while ago: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/706537

Not sure the reason, maybe it looks like a errata for the chip?

How accurate do we need our host rtc alarms to be? could we just make a task that wakes the EC every 1 second and check if the rtc alarm should have triggered? Sort of like a soft RTC alarm?

This way we don't have to mux the rtc hardware alarm for 2 things.
Components: OS>Kernel>Power
Project Member

Comment 8 by bugdroid1@chromium.org, Jan 5

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/edb881c3dded700075a7f0cda5465ccd4a96dcc4

commit edb881c3dded700075a7f0cda5465ccd4a96dcc4
Author: Philip Chen <philipchen@google.com>
Date: Sat Jan 05 22:52:12 2019

chip/stm32/clock: Cleanly clear pending RTC alarm IRQ

We want to reset RTC alarm and clear pending IRQ when EC wakes up
from deep sleep mode.

Unfortunately, RTC alarm IRQ is still latched and pending in NVIC unless
we explicitly clear the flag in ICPR register.

BUG= chromium:769503 
BRANCH=scarlet
TEST=confirm RTC alarm irq is not fired after EC exits deep sleep mode

Change-Id: If6b9815337fbd24a0337116ef9c5fa1521671a93
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1390947
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>

[modify] https://crrev.com/edb881c3dded700075a7f0cda5465ccd4a96dcc4/chip/stm32/clock-f.c

To support lucid sleep mode in the future, the work for this issue has resumed.
Please review the latest patch set:
https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/706537
Cc: drinkcat@chromium.org
Labels: -Pri-3 Pri-2
Project Member

Comment 11 by bugdroid1@chromium.org, Jan 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/2d4116498333af946497ef9445f721d8a3e82e9e

commit 2d4116498333af946497ef9445f721d8a3e82e9e
Author: Philip Chen <philipchen@google.com>
Date: Fri Jan 11 17:47:59 2019

chip/stm32/clock: Enable STOP mode when the host sets wake alarm

BUG= chromium:769503 
BRANCH=scarlet
TEST=make buildall -j
TEST=On scarlet:
1) 'powerd_dbus_suspend --wakeup_timeout=10' on AP console.
2) When AP is in S3, confirm ec enters STOP mode by 'idlestat'.
3) Confirm AP still wakes up at the right time.

Change-Id: I0ce60cc6c33cb475b3311de83c35fe73ff92641b
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/706537
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>

[modify] https://crrev.com/2d4116498333af946497ef9445f721d8a3e82e9e/chip/stm32/clock-stm32f0.c
[modify] https://crrev.com/2d4116498333af946497ef9445f721d8a3e82e9e/chip/stm32/clock-f.c
[modify] https://crrev.com/2d4116498333af946497ef9445f721d8a3e82e9e/board/zinger/runtime.c
[modify] https://crrev.com/2d4116498333af946497ef9445f721d8a3e82e9e/chip/stm32/clock-f.h

Project Member

Comment 12 by bugdroid1@chromium.org, Jan 11

Labels: merge-merged-firmware-scarlet-10388.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/72650f3577a040ee89fe31f2b23c34cd4d2fb95d

commit 72650f3577a040ee89fe31f2b23c34cd4d2fb95d
Author: Philip Chen <philipchen@google.com>
Date: Fri Jan 11 18:40:32 2019

chip/stm32/clock: Enable STOP mode when the host sets wake alarm

BUG= chromium:769503 
BRANCH=scarlet
TEST=make buildall -j
TEST=On scarlet:
1) 'powerd_dbus_suspend --wakeup_timeout=10' on AP console.
2) When AP is in S3, confirm ec enters STOP mode by 'idlestat'.
3) Confirm AP still wakes up at the right time.

Change-Id: I0ce60cc6c33cb475b3311de83c35fe73ff92641b
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/706537
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
(cherry picked from commit 2d4116498333af946497ef9445f721d8a3e82e9e)
Reviewed-on: https://chromium-review.googlesource.com/c/1407231
Reviewed-by: Philip Chen <philipchen@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Trybot-Ready: Philip Chen <philipchen@chromium.org>

[modify] https://crrev.com/72650f3577a040ee89fe31f2b23c34cd4d2fb95d/chip/stm32/clock-stm32f0.c
[modify] https://crrev.com/72650f3577a040ee89fe31f2b23c34cd4d2fb95d/chip/stm32/clock-f.c
[modify] https://crrev.com/72650f3577a040ee89fe31f2b23c34cd4d2fb95d/board/zinger/runtime.c
[modify] https://crrev.com/72650f3577a040ee89fe31f2b23c34cd4d2fb95d/chip/stm32/clock-f.h

Project Member

Comment 13 by bugdroid1@chromium.org, Jan 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/ec/+/f6805af8796784818697d4575fdf12000388e4af

commit f6805af8796784818697d4575fdf12000388e4af
Author: Philip Chen <philipchen@google.com>
Date: Fri Jan 11 18:40:34 2019

chip/stm32/clock: Cleanly clear pending RTC alarm IRQ

We want to reset RTC alarm and clear pending IRQ when EC wakes up
from deep sleep mode.

Unfortunately, RTC alarm IRQ is still latched and pending in NVIC unless
we explicitly clear the flag in ICPR register.

BUG= chromium:769503 
BRANCH=scarlet
TEST=confirm RTC alarm irq is not fired after EC exits deep sleep mode

Change-Id: If6b9815337fbd24a0337116ef9c5fa1521671a93
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/1392408
Reviewed-by: Philip Chen <philipchen@chromium.org>
Commit-Queue: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Trybot-Ready: Philip Chen <philipchen@chromium.org>

[modify] https://crrev.com/f6805af8796784818697d4575fdf12000388e4af/chip/stm32/clock-f.c

Status: Fixed (was: Started)

Sign in to add a comment