summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun Lin <CHLin56@nuvoton.com>2021-08-02 17:05:27 +0800
committerCommit Bot <commit-bot@chromium.org>2021-08-11 17:18:48 +0000
commitd8ea9049c7433e186dfbdc8e7e1fd42eae2e0503 (patch)
tree7cdd87b51afe67e14f3c1d164c8835103685199f
parent78556393c56bc04b166df341cd06f29e7902c405 (diff)
downloadchrome-ec-d8ea9049c7433e186dfbdc8e7e1fd42eae2e0503.tar.gz
zephyr: npcx: SHI: select the host interface to SHI explicitly
We use the property 'hif-type-auto' in the node /booter-variant to track if the booter of a NPCX chip series sets the host interface type or not. If it is not set, the SHI driver should set it explicitly. BRANCH=none BUG=none TEST=pass "zmake testall" TEST=verify the HIF_TYP_SEL field in DEVCNT register is set correctly. Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: Ic96d03a6eaf347638684f533ea8ff0e447f95b40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3067145 Tested-by: CH Lin <chlin56@nuvoton.com> Tested-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Keith Short <keithshort@chromium.org> Commit-Queue: Wai-Hong Tam <waihong@google.com>
-rw-r--r--zephyr/drivers/cros_shi/cros_shi_npcx.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/zephyr/drivers/cros_shi/cros_shi_npcx.c b/zephyr/drivers/cros_shi/cros_shi_npcx.c
index ebfa29c3e9..a290e320fc 100644
--- a/zephyr/drivers/cros_shi/cros_shi_npcx.c
+++ b/zephyr/drivers/cros_shi/cros_shi_npcx.c
@@ -814,10 +814,10 @@ static int shi_npcx_init(const struct device *dev)
return ret;
}
- /*
- * TODO: for npcx9, HIF_TYP_SEL in DEVCNT register should be set
- * by firmware because the BOOTER no longer touches it.
- */
+ /* If booter doesn't set the host interface type */
+ if (!NPCX_BOOTER_IS_HIF_TYPE_SET()) {
+ npcx_host_interface_sel(NPCX_HIF_TYPE_ESPI_SHI);
+ }
/*
* SHICFG1 (SHI Configuration 1) setting