soc: npcx: scfg: select host interface type in global
The Host Interface Type in the DEVCNT register sets the HIF type (either eSPI or LPC). Currently, it is configured in the host-interface-related drivers like eSPI or SHI. However, some I/O pads sourced from VHIF in the other modules such as GPIO and I3C also rely on this field. It might be problematic when using those I/Os without enabling eSPI or SHI drivers. This commit moves the setting from the specific drivers to the global system initialization function scfg_init(). Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
This commit is contained in:
parent
2bdc874e3b
commit
1aff275642
3 changed files with 5 additions and 10 deletions
|
@ -145,6 +145,11 @@ void npcx_dbg_freeze_enable(bool enable)
|
|||
/* Pin-control driver registration */
|
||||
static int npcx_scfg_init(void)
|
||||
{
|
||||
/* 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);
|
||||
}
|
||||
|
||||
/* Change all pads whose default functionality isn't IO to GPIO */
|
||||
for (int i = 0; i < ARRAY_SIZE(def_alts); i++) {
|
||||
npcx_pinctrl_alt_sel(&def_alts[i], 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue