diff options
author | Jun Lin <CHLin56@nuvoton.com> | 2021-04-21 11:09:54 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-21 07:11:18 +0000 |
commit | a82fafebccb3d2829af0699a5018adcab0a3ac23 (patch) | |
tree | 6f7141d666eb6a1b3a24d0df3b467342ee13f1bf | |
parent | 095e63ea517f2b7a2c9468f3fc89393a94b79c12 (diff) | |
download | chrome-ec-a82fafebccb3d2829af0699a5018adcab0a3ac23.tar.gz |
zephyr: shi: npcx: Fix rx deadline checking
NPCX shi rx uses k_uptime_get() to check deadline time. However,
k_uptime_get() return in 'ms' and SHI_CMD_RX_TIMEOUT set in 'us'.
Change SHI_CMD_RX_TIMEOUT to 'ms' to fix the unit.
BRANCH=none
BUG=b:182600858
TEST=zmake testall
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Change-Id: I9824d3b710dc0af076153e1f8479503fe836900c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842707
Tested-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
Reviewed-by: Wai-Hong Tam <waihong@google.com>
Commit-Queue: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
-rw-r--r-- | zephyr/drivers/cros_shi/cros_shi_npcx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/zephyr/drivers/cros_shi/cros_shi_npcx.c b/zephyr/drivers/cros_shi/cros_shi_npcx.c index 4c05d1381a..4bf86eab73 100644 --- a/zephyr/drivers/cros_shi/cros_shi_npcx.c +++ b/zephyr/drivers/cros_shi/cros_shi_npcx.c @@ -54,7 +54,7 @@ LOG_MODULE_REGISTER(cros_shi, LOG_LEVEL_DBG); * practically want to run the SHI interface, since running it slower * significantly impacts firmware update times. */ -#define SHI_CMD_RX_TIMEOUT_US 8192 +#define SHI_CMD_RX_TIMEOUT_MS 9 /* * The AP blindly clocks back bytes over the SPI interface looking for a @@ -442,7 +442,7 @@ static void shi_parse_header(struct shi_reg *const inst) DEBUG_CPRINTF("RV-"); /* Setup deadline time for receiving */ - shi_params.rx_deadline = k_uptime_get() + SHI_CMD_RX_TIMEOUT_US; + shi_params.rx_deadline = k_uptime_get() + SHI_CMD_RX_TIMEOUT_MS; /* Wait for version, command, length bytes */ if (!shi_read_inbuf_wait(inst, 3)) |