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 <CHLin56@nuvoton.com>
This commit is contained in:
Jun Lin 2021-07-30 17:48:07 +08:00 committed by Carles Cufí
parent c3cde54303
commit 2b1841ef3e

View file

@ -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);