soc: npcx: scfg: add a new function to select the host interface type
The host interface type (eSPI/SHI) is selected via HIF_TYP_SEL field in DEVCNT register. This commit adds a function to set it. Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
This commit is contained in:
parent
b804956a7d
commit
c3cde54303
3 changed files with 21 additions and 0 deletions
|
@ -226,6 +226,13 @@ static inline uint32_t npcx_lv_gpio_ctl_offset(uint32_t ctl_no)
|
||||||
#define NPCX_DEVPU0_I2C3_0_PUE 6
|
#define NPCX_DEVPU0_I2C3_0_PUE 6
|
||||||
#define NPCX_DEVPU1_F_SPI_PUD_EN 7
|
#define NPCX_DEVPU1_F_SPI_PUD_EN 7
|
||||||
|
|
||||||
|
/* Supported host interface type for HIF_TYP_SEL FILED in DEVCNT register. */
|
||||||
|
enum npcx_hif_type {
|
||||||
|
NPCX_HIF_TYPE_NONE,
|
||||||
|
NPCX_HIF_TYPE_LPC,
|
||||||
|
NPCX_HIF_TYPE_ESPI_SHI,
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* System Glue (GLUE) device registers
|
* System Glue (GLUE) device registers
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -209,6 +209,13 @@ void npcx_pinctrl_psl_input_configure(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void npcx_host_interface_sel(enum npcx_hif_type hif_type)
|
||||||
|
{
|
||||||
|
struct scfg_reg *inst_scfg = HAL_SFCG_INST();
|
||||||
|
|
||||||
|
SET_FIELD(inst_scfg->DEVCNT, NPCX_DEVCNT_HIF_TYP_SEL_FIELD, hif_type);
|
||||||
|
}
|
||||||
|
|
||||||
/* Pin-control driver registration */
|
/* Pin-control driver registration */
|
||||||
static int npcx_scfg_init(const struct device *dev)
|
static int npcx_scfg_init(const struct device *dev)
|
||||||
{
|
{
|
||||||
|
|
|
@ -168,6 +168,13 @@ void npcx_lvol_suspend_io_pads(void);
|
||||||
*/
|
*/
|
||||||
bool npcx_lvol_is_enabled(int port, int pin);
|
bool npcx_lvol_is_enabled(int port, int pin);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Select the host interface type
|
||||||
|
*
|
||||||
|
* @param hif_type host interface type
|
||||||
|
*/
|
||||||
|
void npcx_host_interface_sel(enum npcx_hif_type hif_type);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue