Lines Matching +full:3 +full:- +full:wire
4 * SPDX-License-Identifier: Apache-2.0
14 #include <zephyr/dt-bindings/espi/npcx_espi.h>
31 /* mapping table between eSPI reset signal and wake-up input */
52 ((struct espi_reg *)((const struct espi_npcx_config *)(dev)->config)->base)
58 #define NPCX_ESPI_CH_FLASH 3
66 #define NPCX_ESPI_MAXFREQ_50 3
68 /* Minimum delay before acknowledging a virtual wire */
106 /* eSPI Virtual Wire Input (Master-to-Slave) signals configuration structure */
108 enum espi_vwire_signal sig; /* Virtual Wire signal */
110 uint8_t bitmask; /* VW signal bits-mask */
114 /* eSPI Virtual Wire Output (Slave-to-Master) signals configuration structure */
116 enum espi_vwire_signal sig; /* Virtual Wire signal */
118 uint8_t bitmask; /* VW signal bits-mask */
123 * npcxn-espi-vws-map.dtsi device tree file for more detail.
164 /* Virtual wire GPIOs for platform level usage (High at Reset state) */
181 /* Callbacks for eSPI bus reset and Virtual Wire signals. */
197 /* VW signal which has no wake-up input source */ in espi_init_wui_callback()
198 if (wui->table == NPCX_MIWU_TABLE_NONE) in espi_init_wui_callback()
214 uint32_t err = inst->ESPIERR; in espi_bus_err_isr()
218 inst->ESPIERR = err; in espi_bus_err_isr()
238 struct espi_npcx_data *const data = dev->data; in espi_bus_cfg_update_isr()
243 uint8_t chg_mask = GET_FIELD(inst->ESPICFG, NPCX_ESPICFG_HCHANS_FIELD) in espi_bus_cfg_update_isr()
244 ^ GET_FIELD(inst->ESPICFG, NPCX_ESPICFG_CHANS_FIELD); in espi_bus_cfg_update_isr()
257 evt.evt_data = IS_BIT_SET(inst->ESPICFG, in espi_bus_cfg_update_isr()
262 inst->ESPICFG |= BIT(chan); in espi_bus_cfg_update_isr()
264 inst->ESPICFG &= ~BIT(chan); in espi_bus_cfg_update_isr()
267 espi_send_callbacks(&data->callbacks, dev, evt); in espi_bus_cfg_update_isr()
270 LOG_DBG("ESPI CFG EC Updated! 0x%02X", GET_FIELD(inst->ESPICFG, in espi_bus_cfg_update_isr()
274 if ((chg_mask & BIT(NPCX_ESPI_CH_VW)) && IS_BIT_SET(inst->ESPICFG, in espi_bus_cfg_update_isr()
283 struct espi_npcx_data *const data = dev->data; in espi_bus_oob_rx_isr()
286 k_sem_give(&data->oob_rx_lock); in espi_bus_oob_rx_isr()
293 struct espi_npcx_data *const data = dev->data; in espi_bus_flash_rx_isr()
296 k_sem_give(&data->flash_rx_lock); in espi_bus_flash_rx_isr()
323 mask = inst->ESPIIE | (1 << NPCX_ESPISTS_VWUPDW); in espi_bus_generic_isr()
324 status = inst->ESPISTS & mask; in espi_bus_generic_isr()
327 inst->ESPISTS = status; in espi_bus_generic_isr()
341 /* eSPI local virtual-wire service functions */
346 int idx = config_in->reg_idx; in espi_vw_config_input()
349 if (IS_BIT_SET(inst->VWEVMS[idx], NPCX_VWEVMS_IE) && in espi_vw_config_input()
350 IS_BIT_SET(inst->VWEVMS[idx], NPCX_VWEVMS_WE)) in espi_vw_config_input()
354 inst->VWEVMS[idx] |= BIT(NPCX_VWEVMS_IE) | BIT(NPCX_VWEVMS_WE); in espi_vw_config_input()
355 LOG_DBG("VWEVMS%d 0x%08X", idx, inst->VWEVMS[idx]); in espi_vw_config_input()
362 int idx = config_out->reg_idx; in espi_vw_config_output()
363 uint8_t valid = GET_FIELD(inst->VWEVSM[idx], NPCX_VWEVSM_VALID); in espi_vw_config_output()
366 valid |= config_out->bitmask; in espi_vw_config_output()
367 SET_FIELD(inst->VWEVSM[idx], NPCX_VWEVSM_VALID, valid); in espi_vw_config_output()
370 * Turn off hardware-wire feature which generates VW events that in espi_vw_config_output()
373 SET_FIELD(inst->VWEVSM[idx], NPCX_VWEVSM_HW_WIRE, 0); in espi_vw_config_output()
375 LOG_DBG("VWEVSM%d 0x%08X", idx, inst->VWEVSM[idx]); in espi_vw_config_output()
383 int idx = config_out->reg_idx; in espi_vw_gpio_config_output()
384 uint8_t valid = GET_FIELD(inst->VWGPSM[idx], NPCX_VWEVSM_VALID); in espi_vw_gpio_config_output()
385 uint8_t val = GET_FIELD(inst->VWGPSM[idx], NPCX_VWEVSM_WIRE); in espi_vw_gpio_config_output()
388 valid |= config_out->bitmask; in espi_vw_gpio_config_output()
389 SET_FIELD(inst->VWGPSM[idx], NPCX_VWEVSM_VALID, valid); in espi_vw_gpio_config_output()
391 inst->VWGPSM[idx] |= BIT(NPCX_VWGPSM_INDEX_EN); in espi_vw_gpio_config_output()
394 val |= config_out->bitmask; in espi_vw_gpio_config_output()
396 val &= ~config_out->bitmask; in espi_vw_gpio_config_output()
399 SET_FIELD(inst->VWGPSM[idx], NPCX_VWEVSM_WIRE, val); in espi_vw_gpio_config_output()
401 LOG_DBG("VWEVSM%d 0x%08X", idx, inst->VWGPSM[idx]); in espi_vw_gpio_config_output()
407 struct espi_npcx_data *const data = dev->data; in espi_vw_notify_system_state()
409 uint8_t wire = 0; in espi_vw_notify_system_state() local
411 espi_npcx_receive_vwire(dev, signal, &wire); in espi_vw_notify_system_state()
412 if (!wire) { in espi_vw_notify_system_state()
413 data->sx_state = signal; in espi_vw_notify_system_state()
417 evt.evt_data = wire; in espi_vw_notify_system_state()
418 espi_send_callbacks(&data->callbacks, dev, evt); in espi_vw_notify_system_state()
424 uint8_t wire; in espi_vw_notify_host_warning() local
426 espi_npcx_receive_vwire(dev, signal, &wire); in espi_vw_notify_host_warning()
433 wire); in espi_vw_notify_host_warning()
437 wire); in espi_vw_notify_host_warning()
441 wire); in espi_vw_notify_host_warning()
450 struct espi_npcx_data *const data = dev->data; in espi_vw_notify_plt_rst()
455 uint8_t wire = 0; in espi_vw_notify_plt_rst() local
457 espi_npcx_receive_vwire(dev, ESPI_VWIRE_SIGNAL_PLTRST, &wire); in espi_vw_notify_plt_rst()
458 LOG_DBG("VW_PLT_RST is %d!", wire); in espi_vw_notify_plt_rst()
459 if (wire) { in espi_vw_notify_plt_rst()
460 /* Set Peripheral Channel ready when PLTRST is de-asserted */ in espi_vw_notify_plt_rst()
461 inst->ESPICFG |= BIT(NPCX_ESPICFG_PCHANEN); in espi_vw_notify_plt_rst()
462 /* Configure all host sub-modules in host domain */ in espi_vw_notify_plt_rst()
467 if (wire != data->plt_rst_asserted) { in espi_vw_notify_plt_rst()
468 data->plt_rst_asserted = wire; in espi_vw_notify_plt_rst()
469 evt.evt_data = wire; in espi_vw_notify_plt_rst()
470 espi_send_callbacks(&data->callbacks, dev, evt); in espi_vw_notify_plt_rst()
493 LOG_DBG("%s: WUI %d %d %d", __func__, wui->table, wui->group, wui->bit); in espi_vw_generic_isr()
495 if (wui->table == vw_in_tbl[idx].vw_wui.table && in espi_vw_generic_isr()
496 wui->group == vw_in_tbl[idx].vw_wui.group && in espi_vw_generic_isr()
497 wui->bit == vw_in_tbl[idx].vw_wui.bit) { in espi_vw_generic_isr()
503 LOG_ERR("Unknown VW event! %d %d %d", wui->table, in espi_vw_generic_isr()
504 wui->group, wui->bit); in espi_vw_generic_isr()
526 struct espi_npcx_data *const data = dev->data; in espi_vw_espi_rst_isr()
529 data->espi_rst_asserted = !IS_BIT_SET(inst->ESPISTS, in espi_vw_espi_rst_isr()
531 LOG_DBG("eSPI RST asserted is %d!", data->espi_rst_asserted); in espi_vw_espi_rst_isr()
533 evt.evt_data = data->espi_rst_asserted; in espi_vw_espi_rst_isr()
534 espi_send_callbacks(&data->callbacks, dev, evt); in espi_vw_espi_rst_isr()
546 switch (cfg->max_freq) { in espi_npcx_configure()
560 return -EINVAL; in espi_npcx_configure()
562 SET_FIELD(inst->ESPICFG, NPCX_ESPICFG_MAXFREQ_FIELD, max_freq); in espi_npcx_configure()
565 io_mode = (cfg->io_caps >> 1); in espi_npcx_configure()
566 if (io_mode > 3) { in espi_npcx_configure()
567 return -EINVAL; in espi_npcx_configure()
570 cur_io_mode = GET_FIELD(inst->ESPICFG, NPCX_ESPICFG_IOMODE_FIELD); in espi_npcx_configure()
572 SET_FIELD(inst->ESPICFG, NPCX_ESPICFG_IOMODE_FIELD, io_mode); in espi_npcx_configure()
576 if (cfg->channel_caps & ESPI_CHANNEL_PERIPHERAL) in espi_npcx_configure()
577 inst->ESPICFG |= BIT(NPCX_ESPICFG_PCCHN_SUPP); in espi_npcx_configure()
579 if (cfg->channel_caps & ESPI_CHANNEL_VWIRE) in espi_npcx_configure()
580 inst->ESPICFG |= BIT(NPCX_ESPICFG_VWCHN_SUPP); in espi_npcx_configure()
582 if (cfg->channel_caps & ESPI_CHANNEL_OOB) in espi_npcx_configure()
583 inst->ESPICFG |= BIT(NPCX_ESPICFG_OOBCHN_SUPP); in espi_npcx_configure()
585 if (cfg->channel_caps & ESPI_CHANNEL_FLASH) in espi_npcx_configure()
586 inst->ESPICFG |= BIT(NPCX_ESPICFG_FLASHCHN_SUPP); in espi_npcx_configure()
589 max_freq, io_mode, inst->ESPICFG); in espi_npcx_configure()
602 sts = IS_BIT_SET(inst->ESPICFG, NPCX_ESPICFG_PCHANEN); in espi_npcx_channel_ready()
605 sts = IS_BIT_SET(inst->ESPICFG, NPCX_ESPICFG_VWCHANEN); in espi_npcx_channel_ready()
608 sts = IS_BIT_SET(inst->ESPICFG, NPCX_ESPICFG_OOBCHANEN); in espi_npcx_channel_ready()
611 sts = IS_BIT_SET(inst->ESPICFG, NPCX_ESPICFG_FLASHCHANEN); in espi_npcx_channel_ready()
632 return -EINVAL; in espi_npcx_send_vwire()
652 return -EIO; in espi_npcx_send_vwire()
658 /* Get wire field and set/clear wire bit */ in espi_npcx_send_vwire()
660 val = GET_FIELD(inst->VWGPSM[reg_idx], NPCX_VWEVSM_WIRE); in espi_npcx_send_vwire()
662 val = GET_FIELD(inst->VWEVSM[reg_idx], NPCX_VWEVSM_WIRE); in espi_npcx_send_vwire()
672 SET_FIELD(inst->VWGPSM[reg_idx], NPCX_VWEVSM_WIRE, val); in espi_npcx_send_vwire()
673 reg_val = inst->VWGPSM[reg_idx]; in espi_npcx_send_vwire()
675 SET_FIELD(inst->VWEVSM[reg_idx], NPCX_VWEVSM_WIRE, val); in espi_npcx_send_vwire()
676 reg_val = inst->VWEVSM[reg_idx]; in espi_npcx_send_vwire()
696 val = GET_FIELD(inst->VWEVMS[reg_idx], in espi_npcx_receive_vwire()
698 val &= GET_FIELD(inst->VWEVMS[reg_idx], in espi_npcx_receive_vwire()
711 val = GET_FIELD(inst->VWEVSM[reg_idx], in espi_npcx_receive_vwire()
713 val &= GET_FIELD(inst->VWEVSM[reg_idx], in espi_npcx_receive_vwire()
720 return -EIO; in espi_npcx_receive_vwire()
726 struct espi_npcx_data *const data = dev->data; in espi_npcx_manage_callback()
728 return espi_manage_callback(&data->callbacks, callback, set); in espi_npcx_manage_callback()
754 uint8_t *oob_buf = pckt->buf; in espi_npcx_send_oob()
755 int sz_oob_tx = pckt->len; in espi_npcx_send_oob()
762 return -EINVAL; in espi_npcx_send_oob()
766 if (IS_BIT_SET(inst->OOBCTL, NPCX_OOBCTL_OOB_AVAIL)) { in espi_npcx_send_oob()
768 return -EBUSY; in espi_npcx_send_oob()
772 * GET_OOB header (first 4 bytes) in npcx 32-bits tx buffer in espi_npcx_send_oob()
774 * [24:31] - LEN[0:7] Data length of GET_OOB request package in espi_npcx_send_oob()
775 * [20:23] - TAG Tag of GET_OOB in espi_npcx_send_oob()
776 * [16:19] - LEN[8:11] Ignore it since max payload is 64 bytes in espi_npcx_send_oob()
777 * [8:15] - CYCLE_TYPE Cycle type of GET_OOB in espi_npcx_send_oob()
778 * [0:7] - SZ_PACK Package size plus 3 bytes header. (Npcx only) in espi_npcx_send_oob()
780 inst->OOBTXBUF[0] = (sz_oob_tx + 3) in espi_npcx_send_oob()
785 /* Write GET_OOB data into 32-bits tx buffer in little endian */ in espi_npcx_send_oob()
788 inst->OOBTXBUF[idx_tx_buf + 1] = oob_buf[0] in espi_npcx_send_oob()
791 | (oob_buf[3] << 24); in espi_npcx_send_oob()
800 inst->OOBTXBUF[idx_tx_buf + 1] = oob_data; in espi_npcx_send_oob()
807 oob_data = inst->OOBCTL & ~(BIT(NPCX_OOBCTL_OOB_FREE)); in espi_npcx_send_oob()
809 inst->OOBCTL = oob_data; in espi_npcx_send_oob()
811 while (IS_BIT_SET(inst->OOBCTL, NPCX_OOBCTL_OOB_AVAIL)) in espi_npcx_send_oob()
822 struct espi_npcx_data *const data = dev->data; in espi_npcx_receive_oob()
823 uint8_t *oob_buf = pckt->buf; in espi_npcx_receive_oob()
828 if (IS_BIT_SET(inst->ESPISTS, NPCX_ESPISTS_BERR)) { in espi_npcx_receive_oob()
829 LOG_ERR("%s: eSPI Bus Error: 0x%08X", __func__, inst->ESPIERR); in espi_npcx_receive_oob()
830 return -EIO; in espi_npcx_receive_oob()
834 inst->OOBCTL |= BIT(NPCX_OOBCTL_OOB_FREE); in espi_npcx_receive_oob()
837 ret = k_sem_take(&data->oob_rx_lock, K_MSEC(ESPI_OOB_MAX_TIMEOUT)); in espi_npcx_receive_oob()
838 if (ret == -EAGAIN) { in espi_npcx_receive_oob()
840 return -ETIMEDOUT; in espi_npcx_receive_oob()
844 * PUT_OOB header (first 4 bytes) in npcx 32-bits rx buffer in espi_npcx_receive_oob()
846 * [24:31] - LEN[0:7] Data length of PUT_OOB request package in espi_npcx_receive_oob()
847 * [20:23] - TAG Tag of PUT_OOB in espi_npcx_receive_oob()
848 * [16:19] - LEN[8:11] Data length of PUT_OOB request package in espi_npcx_receive_oob()
849 * [8:15] - CYCLE_TYPE Cycle type of PUT_OOB in espi_npcx_receive_oob()
850 * [0:7] - SZ_PACK Reserved. (Npcx only) in espi_npcx_receive_oob()
852 oob_data = inst->OOBRXBUF[0]; in espi_npcx_receive_oob()
859 return -EINVAL; in espi_npcx_receive_oob()
863 pckt->len = sz_oob_rx; in espi_npcx_receive_oob()
865 /* Read PUT_OOB data into 32-bits rx buffer in little endian */ in espi_npcx_receive_oob()
867 oob_data = inst->OOBRXBUF[idx_rx_buf + 1]; in espi_npcx_receive_oob()
879 oob_data = inst->OOBRXBUF[idx_rx_buf + 1]; in espi_npcx_receive_oob()
894 * First 3 bytes of flash cycle command header in tx buffer in espi_npcx_flash_prepare_tx_header()
896 * [24:31] - LEN[0:7] = n Data length of flash cycle request in espi_npcx_flash_prepare_tx_header()
897 * [16:23] - LEN[8:15] = 0 Ignore it since max buffer size is 64 bytes in espi_npcx_flash_prepare_tx_header()
898 * [12:15] - TAG = 0 Tag of flash cycle command is always 0 here in espi_npcx_flash_prepare_tx_header()
899 * [8:11] - CYCLE_TYPE = 0 Cycle type of flash command in espi_npcx_flash_prepare_tx_header()
900 * [0:7] - SZ_PACK = 7 Overall tx package size. (Used internally.) in espi_npcx_flash_prepare_tx_header()
902 inst->FLASHTXBUF[0] = (flash_len << 24) | in espi_npcx_flash_prepare_tx_header()
909 * [24:31] - ADDR[0:7] Start address of flash cycle command request in espi_npcx_flash_prepare_tx_header()
910 * [16:23] - ADDR[15:8] in espi_npcx_flash_prepare_tx_header()
911 * [8:15] - ADDR[23:16] in espi_npcx_flash_prepare_tx_header()
912 * [0:7] - ADDR[31:24] in espi_npcx_flash_prepare_tx_header()
914 inst->FLASHTXBUF[1] = sys_cpu_to_be32(flash_addr); in espi_npcx_flash_prepare_tx_header()
924 * First 3 bytes of flash cycle completion header in rx buffer in espi_npcx_flash_parse_completion()
926 * [24:31] - LEN[0:7] Data length of flash cycle completion package in espi_npcx_flash_parse_completion()
927 * [16:23] - LEN[8:15] Ignore it since rx bufer size is 64 bytes in espi_npcx_flash_parse_completion()
928 * [12:15] - TAG Tag of flash cycle completion package in espi_npcx_flash_parse_completion()
929 * [8:11] - CYCLE_TYPE Cycle type of flash completion in espi_npcx_flash_parse_completion()
930 * [0:7] - Reserved in espi_npcx_flash_parse_completion()
932 cycle_type = (inst->FLASHRXBUF[0] & 0xff00) >> 8; in espi_npcx_flash_parse_completion()
937 return -EIO; in espi_npcx_flash_parse_completion()
947 * First 3 bytes of flash cycle completion header in rx buffer in espi_npcx_flash_parse_completion_with_data()
949 * [24:31] - LEN[0:7] Data length of flash cycle completion package in espi_npcx_flash_parse_completion_with_data()
950 * [16:23] - LEN[8:15] Ignore it since rx bufer size is 64 bytes in espi_npcx_flash_parse_completion_with_data()
951 * [12:15] - TAG Tag of flash cycle completion package in espi_npcx_flash_parse_completion_with_data()
952 * [8:11] - CYCLE_TYPE Cycle type of flash completion in espi_npcx_flash_parse_completion_with_data()
953 * [0:7] - Reserved in espi_npcx_flash_parse_completion_with_data()
957 cycle_type = (inst->FLASHRXBUF[0] & 0xff00) >> 8; in espi_npcx_flash_parse_completion_with_data()
958 sz_rx_payload = inst->FLASHRXBUF[0] >> 24; in espi_npcx_flash_parse_completion_with_data()
960 volatile uint32_t *rx_buf = &inst->FLASHRXBUF[1]; in espi_npcx_flash_parse_completion_with_data()
961 uint8_t *buf = pckt->buf; in espi_npcx_flash_parse_completion_with_data()
985 return -EIO; in espi_npcx_flash_parse_completion_with_data()
993 struct espi_npcx_data *const data = dev->data; in espi_npcx_flash_read()
996 if (pckt->len > NPCX_ESPI_FLASH_MAX_RX_PAYLOAD) { in espi_npcx_flash_read()
997 LOG_ERR("Out of FLASH transmitted buffer: %d", pckt->len); in espi_npcx_flash_read()
998 return -EINVAL; in espi_npcx_flash_read()
1002 if (IS_BIT_SET(inst->FLASHCTL, NPCX_FLASHCTL_FLASH_TX_AVAIL)) { in espi_npcx_flash_read()
1004 return -EBUSY; in espi_npcx_flash_read()
1010 pckt->flash_addr, in espi_npcx_flash_read()
1011 pckt->len, in espi_npcx_flash_read()
1015 inst->FLASHCTL |= BIT(NPCX_FLASHCTL_FLASH_TX_AVAIL); in espi_npcx_flash_read()
1018 ret = k_sem_take(&data->flash_rx_lock, K_MSEC(ESPI_FLASH_MAX_TIMEOUT)); in espi_npcx_flash_read()
1019 if (ret == -EAGAIN) { in espi_npcx_flash_read()
1021 return -ETIMEDOUT; in espi_npcx_flash_read()
1033 struct espi_npcx_data *const data = dev->data; in espi_npcx_flash_write()
1034 volatile uint32_t *tx_buf = &inst->FLASHTXBUF[2]; in espi_npcx_flash_write()
1035 uint8_t *buf = pckt->buf; in espi_npcx_flash_write()
1038 if (pckt->len > NPCX_ESPI_FLASH_MAX_TX_PAYLOAD) { in espi_npcx_flash_write()
1039 LOG_ERR("Out of FLASH transmitted buffer: %d", pckt->len); in espi_npcx_flash_write()
1040 return -EINVAL; in espi_npcx_flash_write()
1044 if (IS_BIT_SET(inst->FLASHCTL, NPCX_FLASHCTL_FLASH_TX_AVAIL)) { in espi_npcx_flash_write()
1046 return -EBUSY; in espi_npcx_flash_write()
1052 pckt->flash_addr, in espi_npcx_flash_write()
1053 pckt->len, in espi_npcx_flash_write()
1054 pckt->len); in espi_npcx_flash_write()
1057 for (int i = 0; i < pckt->len / 4; i++, tx_buf++) { in espi_npcx_flash_write()
1066 if (pckt->len % 4) { in espi_npcx_flash_write()
1068 for (int j = 0; j < pckt->len % 4; j++, buf++) { in espi_npcx_flash_write()
1075 inst->FLASHCTL |= BIT(NPCX_FLASHCTL_FLASH_TX_AVAIL); in espi_npcx_flash_write()
1078 ret = k_sem_take(&data->flash_rx_lock, K_MSEC(ESPI_FLASH_MAX_TIMEOUT)); in espi_npcx_flash_write()
1079 if (ret == -EAGAIN) { in espi_npcx_flash_write()
1081 return -ETIMEDOUT; in espi_npcx_flash_write()
1093 struct espi_npcx_data *const data = dev->data; in espi_npcx_flash_erase()
1096 if (IS_BIT_SET(inst->FLASHCTL, NPCX_FLASHCTL_FLASH_TX_AVAIL)) { in espi_npcx_flash_erase()
1098 return -EBUSY; in espi_npcx_flash_erase()
1104 pckt->flash_addr, in espi_npcx_flash_erase()
1105 pckt->len, in espi_npcx_flash_erase()
1109 inst->FLASHCTL |= BIT(NPCX_FLASHCTL_FLASH_TX_AVAIL); in espi_npcx_flash_erase()
1112 ret = k_sem_take(&data->flash_rx_lock, K_MSEC(ESPI_FLASH_MAX_TIMEOUT)); in espi_npcx_flash_erase()
1113 if (ret == -EAGAIN) { in espi_npcx_flash_erase()
1115 return -ETIMEDOUT; in espi_npcx_flash_erase()
1126 const struct espi_npcx_config *const config = dev->config; in npcx_espi_enable_interrupts()
1136 npcx_miwu_irq_enable(&config->espi_rst_wui); in npcx_espi_enable_interrupts()
1141 const struct espi_npcx_config *const config = dev->config; in npcx_espi_disable_interrupts()
1151 npcx_miwu_irq_disable(&config->espi_rst_wui); in npcx_espi_disable_interrupts()
1196 const struct espi_npcx_config *const config = dev->config; in espi_npcx_init()
1197 struct espi_npcx_data *const data = dev->data; in espi_npcx_init()
1209 return -ENODEV; in espi_npcx_init()
1214 &config->clk_cfg); in espi_npcx_init()
1222 inst->NPCX_ONLY_ESPI_REG1 = NPCX_ONLY_ESPI_REG1_UNLOCK_REG2; in espi_npcx_init()
1223 inst->NPCX_ONLY_ESPI_REG2 &= ~BIT(NPCX_ONLY_ESPI_REG2_TRANS_END_CONFIG); in espi_npcx_init()
1225 inst->NPCX_ONLY_ESPI_REG1 = NPCX_ONLY_ESPI_REG1_LOCK_REG2; in espi_npcx_init()
1230 inst->ESPIIE |= BIT(espi_bus_isr_tbl[i].int_en_bit); in espi_npcx_init()
1231 inst->ESPIWE |= BIT(espi_bus_isr_tbl[i].wake_en_bit); in espi_npcx_init()
1235 k_sem_init(&data->oob_rx_lock, 0, 1); in espi_npcx_init()
1239 k_sem_init(&data->flash_rx_lock, 0, 1); in espi_npcx_init()
1242 /* Configure Virtual Wire input signals */ in espi_npcx_init()
1246 /* Configure Virtual Wire output signals */ in espi_npcx_init()
1250 /* Configure Virtual Wire GPIOs that are output high at reset state */ in espi_npcx_init()
1255 /* Configure wake-up input and callback for eSPI VW input signal */ in espi_npcx_init()
1260 /* Configure wake-up input and callback for ESPI_RST signal */ in espi_npcx_init()
1262 &config->espi_rst_wui, espi_vw_espi_rst_isr); in espi_npcx_init()
1264 /* Configure pin-mux for eSPI bus device */ in espi_npcx_init()
1265 ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT); in espi_npcx_init()
1271 /* Configure host sub-modules which HW blocks belong to core domain */ in espi_npcx_init()
1272 npcx_host_init_subs_core_domain(dev, &data->callbacks); in espi_npcx_init()