mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 18:41:11 +00:00
According npcx ec wake-up mechanism by espi VW events, the driver needs to make sure the IE/WE bits in VWEVMSn and the VWUPD bit in ESPIWE registers are both set. Or ec won't wakeup by VW signals until the other wake-up events occured. (WE bit of VWEVMSn is introduced on npcx7.) In this CL, we turn on IE/WE bit in VWEVMSn registers during espi driver initialization and toggle the bits of ESPIWE register for VW and general events such as ESPI_RST and so on when ec turn on/off host interface's interrupts to make sure ec can wake-up from deep idle by espi events in time. BRANCH=none BUG=none TEST=No build errors for npcx5/7 series. Using "suspend_stress_test -c 1000" to do stress test and no symptom occurred on poppy. Both warmboot and coldboot stress test for 5 hours and no symptom occurred on poppy. Change-Id: I853532508bf9da5f3abc39e20ab848e659ca5e26 Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/725559 Reviewed-by: Amit Maoz <amit.maoz@nuvoton.corp-partner.google.com> Reviewed-by: Shawn N <shawnn@chromium.org>