summaryrefslogtreecommitdiff
path: root/board/cr50
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2017-07-19 14:19:04 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-07-21 21:24:12 -0700
commit94896eaae6791df63eae6e0bfc6161a660d1abe6 (patch)
treeb6383a59d5a92a4e6436eacdbe86c3a03250127b /board/cr50
parenta6c34e183a70aabcef1cd4362303df475afc173e (diff)
downloadchrome-ec-94896eaae6791df63eae6e0bfc6161a660d1abe6.tar.gz
g: hwtimer: Improve accuracy of hwtimer and ensure minimum udelay() wait
hwtimer ticks at 8 * 32768 Hz rather than 250 KHz, so adjust our timing appropriately. Also ensure that udelay() will delay for at least the requested time, taking into account our timer precision. BUG=b:63858553 TEST=Generate square wave with 1000us udelay between GPIO edge toggle, verify period is 1000us + code overhead. Also verify timer behavior on overflow with 'forcetime' command. Also verify accuracy of system clock to 0.2% with `timerinfo` and a stopwatch. BRANCH=None Change-Id: I5da41bd7250db87de5143cc54ebd0bb750fb7003 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/578551 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'board/cr50')
-rw-r--r--board/cr50/board.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/board/cr50/board.h b/board/cr50/board.h
index 758d8cdc3c..c6bc33987c 100644
--- a/board/cr50/board.h
+++ b/board/cr50/board.h
@@ -144,6 +144,9 @@
#define CONFIG_DCRYPTO
#define CONFIG_UPTO_SHA512
+/* Implement custom udelay, due to usec hwtimer imprecision. */
+#define CONFIG_HW_SPECIFIC_UDELAY
+
#ifndef __ASSEMBLER__
#include "gpio_signal.h"