diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2017-07-19 14:19:04 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-07-21 21:24:12 -0700 |
commit | 94896eaae6791df63eae6e0bfc6161a660d1abe6 (patch) | |
tree | b6383a59d5a92a4e6436eacdbe86c3a03250127b /board/cr50 | |
parent | a6c34e183a70aabcef1cd4362303df475afc173e (diff) | |
download | chrome-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.h | 3 |
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" |