summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/watchdog.c
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: Add watchdog reinstall mechanismWealian Liao2021-09-281-0/+7
| | | | | | | | | | | | | | | | | After the sysjump, the watchdog has been installed by the last image. The watchdog install function return -EBUSY while the watchdog has already been set up. This CL adds watchdog running check & reinstall watchdog for sysjump. BUG=none BRANCH=none TEST=RO/RW use the different timeout setting & test the timeout. Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Ibe36d50c030afcfe79eb804ca05c7b426468cb07 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3180705 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zephyr: use DEVICE_DT_GET for various shim modulesFabio Baltieri2021-06-281-8/+6
| | | | | | | | | | | | | | | | Convert various device_get_binding to DEVICE_DT_GET, which is processed at link time and more efficient. Same pattern on different modules where the output is checked using device_is_ready. BRANCH=none BUG=none TEST=zmake configure -b -B ~/build-volteer/ zephyr/projects/volteer/volteer TEST=zmake configure -b -B ~/build-it8xxx2_evb/ zephyr/projects/it8xxx2_evb Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: If426420da2c61b3bc02eb77e122469a1a40799f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2985463 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: Adjust watchdog warning timer value and delay timeMulin Chao2021-04-141-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adjusts the watchdog warning timer value and its delay time definitions to meet original chromium ec behavior. The system handles the warning event at CONFIG_AUX_TIMER_PERIOD_MS & issues the watchdog reset event at CONFIG_WATCHDOG_PERIOD_MS. Zephyr NPCX watchdog provides a config WDT_NPCX_DELAY_CYCLES for watchdog timeout delay. Set the zephyr timeout to CONFIG_AUX_TIMER_PERIOD_MS as warning time. So the NPCX watchdog hardware issue reset event at CONFIG_AUX_TIMER_PERIOD_MS + WDT_NPCX_DELAY_CYCLES. BUG=b:184683548 BRANCH=none TEST=Build & boot ec on volteer. TEST= `waitms 1000` warning doesn't issue & ec doesn't reboot `waitms 1200` warning issue & ec doesn't reboot `waitms 1500` warning issue & ec doesn't reboot `waitms 1700` warning issue & ec reboot Cq-Depend: chromium:2813911 Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Ibee9c18cd9d2bae6d34ee9366755dec99687c3d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2814728 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: add watchdogWealian Liao2021-02-221-0/+74
In npcx7 series, the Timer and Watchdog module (TWD) generates the clocks and interrupts used for timing periodic functions in the system. It also provides watchdog reset signal generation in response to a failure detection. This CL enables the watchdog functionality in zephyr system. BUG=b:176523207, b:177604307 BRANCH=None. TEST=add stall function to check the system can reset by the watchdog Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Iee0312dd6132ce76e622178b3a666aa415bc735a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2659135 Reviewed-by: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>