From 2b1841ef3e30937eb8577d155be061624beddebf Mon Sep 17 00:00:00 2001 From: Jun Lin Date: Fri, 30 Jul 2021 17:48:07 +0800 Subject: [PATCH] driver: eSPI: npcx: select the host interface to eSPI explicitly Set the host interface type to eSPI if it is not configured by the booter. Signed-off-by: Jun Lin --- drivers/espi/espi_npcx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/espi/espi_npcx.c b/drivers/espi/espi_npcx.c index eabf13d9592..d373ae8ee25 100644 --- a/drivers/espi/espi_npcx.c +++ b/drivers/espi/espi_npcx.c @@ -856,6 +856,11 @@ static int espi_npcx_init(const struct device *dev) const struct device *const clk_dev = DEVICE_DT_GET(NPCX_CLK_CTRL_NODE); int i, ret; + /* 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); + } + /* Turn on eSPI device clock first */ ret = clock_control_on(clk_dev, (clock_control_subsys_t *) &config->clk_cfg);