Lines Matching +full:0 +full:xf0000

55 #if DT_NODE_HAS_PROP(DT_DRV_INST(0), vw_index_extend_set)
71 DT_FOREACH_PROP_ELEM(DT_DRV_INST(0), vw_index_extend_set, ESPI_NPCX_VW_EX_INFO)
80 #define NPCX_ESPI_CH_PC 0
88 #define NPCX_ESPI_MAXFREQ_20 0
99 #define NPCX_OOB_RX_PACKAGE_LEN(hdr) (((hdr & 0xff000000) >> 24) | \
100 ((hdr & 0xf0000) >> 8))
103 #define NPCX_ESPI_FLASH_MAX_RX_PAYLOAD DT_INST_PROP(0, rx_plsize)
104 #define NPCX_ESPI_FLASH_MAX_TX_PAYLOAD DT_INST_PROP(0, tx_plsize)
107 #define ESPI_FLASH_READ_CYCLE_TYPE 0x00
108 #define ESPI_FLASH_WRITE_CYCLE_TYPE 0x01
109 #define ESPI_FLASH_ERASE_CYCLE_TYPE 0x02
110 #define ESPI_FLASH_SUCCESS_WITH_DATA_CYCLE_TYPE 0x0f
111 #define ESPI_FLASH_SUCCESS_WITHOUT_DATA_CYCLE_TYPE 0x06
112 #define ESPI_FLASH_HEADER_PCKT_SIZE 0x07
114 #define ESPI_OOB_GET_CYCLE_TYPE 0x21
115 #define ESPI_OOB_TAG 0x00
285 espi_npcx_flash_prepare_tx_header(dev, ESPI_FLASH_READ_CYCLE_TYPE, 0, 16, 0); in espi_npcx_flash_fake_request()
295 .evt_details = 0, in espi_bus_cfg_update_isr()
296 .evt_data = 0 }; in espi_bus_cfg_update_isr()
303 LOG_DBG("ESPI CFG Change Updated! 0x%02X", chg_mask); in espi_bus_cfg_update_isr()
332 LOG_DBG("ESPI CFG EC Updated! 0x%02X", GET_FIELD(inst->ESPICFG, in espi_bus_cfg_update_isr()
363 .evt_details = 0, in espi_bus_oob_rx_isr()
364 .evt_data = 0, in espi_bus_oob_rx_isr()
368 evt.evt_details = NPCX_OOB_RX_PACKAGE_LEN(inst->OOBRXBUF[0]); in espi_bus_oob_rx_isr()
390 head_data = inst->FLASHRXBUF[0]; in espi_taf_parse()
394 taf_pckt.len = (((uint16_t)taf_head.tag_hlen & 0xF) << 8) | taf_head.llen; in espi_taf_parse()
397 if ((taf_pckt.len == 0) && (taf_pckt.type == NPCX_ESPI_TAF_REQ_READ)) { in espi_taf_parse()
410 for (i = 0; i < roundsize; i++) { in espi_taf_parse()
425 if ((inst->ESPICFG & BIT(NPCX_ESPICFG_FLCHANMODE)) == 0) { in espi_bus_flash_rx_isr()
431 pckt.buf = &pckt_buf[0]; in espi_bus_flash_rx_isr()
482 LOG_DBG("%s: 0x%08X", __func__, status); in espi_bus_generic_isr()
483 for (i = 0; i < ARRAY_SIZE(espi_bus_isr_tbl); i++) { in espi_bus_generic_isr()
509 LOG_DBG("VWEVMS%d 0x%08X", idx, inst->VWEVMS[idx]); in espi_vw_config_input()
527 SET_FIELD(inst->VWEVSM[idx], NPCX_VWEVSM_HW_WIRE, 0); in espi_vw_config_output()
529 LOG_DBG("VWEVSM%d 0x%08X", idx, inst->VWEVSM[idx]); in espi_vw_config_output()
555 LOG_DBG("VWEVSM%d 0x%08X", idx, inst->VWGPSM[idx]); in espi_vw_gpio_config_output()
562 struct espi_event evt = { ESPI_BUS_EVENT_VWIRE_RECEIVED, 0, 0 }; in espi_vw_notify_system_state()
563 uint8_t wire = 0; in espi_vw_notify_system_state()
612 ESPI_VWIRE_SIGNAL_PLTRST, 0 in espi_vw_notify_plt_rst()
614 uint8_t wire = 0; in espi_vw_notify_plt_rst()
653 for (idx = 0; idx < ARRAY_SIZE(vw_in_tbl); idx++) { in espi_vw_generic_isr()
693 struct espi_event evt = { ESPI_BUS_RESET, 0, 0 }; in espi_vw_espi_rst_isr()
708 uint8_t max_freq = 0; in espi_npcx_configure()
709 uint8_t cur_io_mode, io_mode = 0; in espi_npcx_configure()
763 LOG_DBG("%s: %d %d ESPICFG: 0x%08X", __func__, in espi_npcx_configure()
766 return 0; in espi_npcx_configure()
799 uint8_t reg_idx, bitmask, sig_idx, val = 0, vw_tbl_size; in espi_npcx_send_vwire()
821 for (sig_idx = 0; sig_idx < vw_tbl_size; sig_idx++) { in espi_npcx_send_vwire()
856 LOG_DBG("Send VW: %s%d 0x%08X", reg_name, reg_idx, reg_val); in espi_npcx_send_vwire()
858 return 0; in espi_npcx_send_vwire()
868 for (sig_idx = 0; sig_idx < ARRAY_SIZE(vw_in_tbl); sig_idx++) { in espi_npcx_receive_vwire()
882 return 0; in espi_npcx_receive_vwire()
887 for (sig_idx = 0; sig_idx < ARRAY_SIZE(vw_out_tbl); sig_idx++) { in espi_npcx_receive_vwire()
901 return 0; in espi_npcx_receive_vwire()
960 * [24:31] - LEN[0:7] Data length of GET_OOB request package in espi_npcx_send_oob()
964 * [0:7] - SZ_PACK Package size plus 3 bytes header. (Npcx only) in espi_npcx_send_oob()
966 inst->OOBTXBUF[0] = (sz_oob_tx + 3) in espi_npcx_send_oob()
972 for (idx_tx_buf = 0; idx_tx_buf < sz_oob_tx/4; idx_tx_buf++, in espi_npcx_send_oob()
974 inst->OOBTXBUF[idx_tx_buf + 1] = oob_buf[0] in espi_npcx_send_oob()
983 oob_data = 0; in espi_npcx_send_oob()
984 for (i = 0; i < sz_oob_tx % 4; i++) { in espi_npcx_send_oob()
1003 return 0; in espi_npcx_send_oob()
1016 LOG_ERR("%s: eSPI Bus Error: 0x%08X", __func__, inst->ESPIERR); in espi_npcx_receive_oob()
1035 * [24:31] - LEN[0:7] Data length of PUT_OOB request package in espi_npcx_receive_oob()
1039 * [0:7] - SZ_PACK Reserved. (Npcx only) in espi_npcx_receive_oob()
1041 oob_data = inst->OOBRXBUF[0]; in espi_npcx_receive_oob()
1055 for (idx_rx_buf = 0; idx_rx_buf < sz_oob_rx/4; idx_rx_buf++) { in espi_npcx_receive_oob()
1058 *(oob_buf++) = oob_data & 0xFF; in espi_npcx_receive_oob()
1059 *(oob_buf++) = (oob_data >> 8) & 0xFF; in espi_npcx_receive_oob()
1060 *(oob_buf++) = (oob_data >> 16) & 0xFF; in espi_npcx_receive_oob()
1061 *(oob_buf++) = (oob_data >> 24) & 0xFF; in espi_npcx_receive_oob()
1069 for (i = 0; i < sz_oob_rx % 4; i++) { in espi_npcx_receive_oob()
1070 *(oob_buf++) = (oob_data >> (8 * i)) & 0xFF; in espi_npcx_receive_oob()
1076 return 0; in espi_npcx_receive_oob()
1089 * [24:31] - LEN[0:7] = n Data length of flash cycle request in espi_npcx_flash_prepare_tx_header()
1090 * [16:23] - LEN[8:15] = 0 Ignore it since max buffer size is 64 bytes in espi_npcx_flash_prepare_tx_header()
1091 * [12:15] - TAG = 0 Tag of flash cycle command is always 0 here in espi_npcx_flash_prepare_tx_header()
1092 * [8:11] - CYCLE_TYPE = 0 Cycle type of flash command in espi_npcx_flash_prepare_tx_header()
1093 * [0:7] - SZ_PACK = 7 Overall tx package size. (Used internally.) in espi_npcx_flash_prepare_tx_header()
1095 inst->FLASHTXBUF[0] = (flash_len << 24) | in espi_npcx_flash_prepare_tx_header()
1102 * [24:31] - ADDR[0:7] Start address of flash cycle command request in espi_npcx_flash_prepare_tx_header()
1105 * [0:7] - ADDR[31:24] in espi_npcx_flash_prepare_tx_header()
1119 * [24:31] - LEN[0:7] Data length of flash cycle completion package in espi_npcx_flash_parse_completion()
1123 * [0:7] - Reserved in espi_npcx_flash_parse_completion()
1125 cycle_type = (inst->FLASHRXBUF[0] & 0xff00) >> 8; in espi_npcx_flash_parse_completion()
1127 return 0; in espi_npcx_flash_parse_completion()
1142 * [24:31] - LEN[0:7] Data length of flash cycle completion package in espi_npcx_flash_parse_completion_with_data()
1146 * [0:7] - Reserved in espi_npcx_flash_parse_completion_with_data()
1150 cycle_type = (inst->FLASHRXBUF[0] & 0xff00) >> 8; in espi_npcx_flash_parse_completion_with_data()
1151 sz_rx_payload = inst->FLASHRXBUF[0] >> 24; in espi_npcx_flash_parse_completion_with_data()
1158 for (int i = 0; i < sz_rx_payload / 4; i++, rx_buf++) { in espi_npcx_flash_parse_completion_with_data()
1160 for (int j = 0; j < 4; j++, buf++) { in espi_npcx_flash_parse_completion_with_data()
1161 *buf = data & 0xff; in espi_npcx_flash_parse_completion_with_data()
1169 for (int j = 0; j < sz_rx_payload % 4; j++, buf++) { in espi_npcx_flash_parse_completion_with_data()
1170 *buf = data & 0xff; in espi_npcx_flash_parse_completion_with_data()
1175 return 0; in espi_npcx_flash_parse_completion_with_data()
1205 0); in espi_npcx_flash_read()
1250 for (int i = 0; i < pckt->len / 4; i++, tx_buf++) { in espi_npcx_flash_write()
1251 tx_data = 0; in espi_npcx_flash_write()
1252 for (int j = 0; j < 4; j++, buf++) { in espi_npcx_flash_write()
1260 tx_data = 0; in espi_npcx_flash_write()
1261 for (int j = 0; j < pckt->len % 4; j++, buf++) { in espi_npcx_flash_write()
1299 0); in espi_npcx_flash_erase()
1322 irq_enable(DT_INST_IRQN(0)); in npcx_espi_enable_interrupts()
1325 for (int idx = 0; idx < ARRAY_SIZE(vw_in_tbl); idx++) { in npcx_espi_enable_interrupts()
1337 irq_disable(DT_INST_IRQN(0)); in npcx_espi_disable_interrupts()
1340 for (int idx = 0; idx < ARRAY_SIZE(vw_in_tbl); idx++) { in npcx_espi_disable_interrupts()
1371 PINCTRL_DT_INST_DEFINE(0);
1376 .base = DT_INST_REG_ADDR(0),
1377 .espi_rst_wui = NPCX_DT_WUI_ITEM_BY_NAME(0, espi_rst_wui),
1378 .clk_cfg = NPCX_DT_CLK_CFG_ITEM(0),
1379 .pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(0),
1382 DEVICE_DT_INST_DEFINE(0, &espi_npcx_init, NULL,
1403 if (ret < 0) { in espi_npcx_init()
1417 for (i = 0; i < ARRAY_SIZE(espi_bus_isr_tbl); i++) { in espi_npcx_init()
1423 k_sem_init(&data->oob_rx_lock, 0, 1); in espi_npcx_init()
1427 k_sem_init(&data->flash_rx_lock, 0, 1); in espi_npcx_init()
1431 for (i = 0; i < ARRAY_SIZE(vw_in_tbl); i++) { in espi_npcx_init()
1436 for (i = 0; i < ARRAY_SIZE(vw_out_tbl); i++) { in espi_npcx_init()
1441 for (i = 0; i < ARRAY_SIZE(vw_out_gpio_tbl1); i++) { in espi_npcx_init()
1446 for (i = 0; i < ARRAY_SIZE(vw_in_tbl); i++) { in espi_npcx_init()
1455 #if DT_NODE_HAS_PROP(DT_DRV_INST(0), vw_index_extend_set) in espi_npcx_init()
1459 for (i = 0; i < vw_ex_len; i++) { in espi_npcx_init()
1470 SET_FIELD(inst->VWEVMS[num], NPCX_VWEVMS_VALID, 0x0); in espi_npcx_init()
1478 SET_FIELD(inst->VWEVSM[num], NPCX_VWEVSM_VALID, 0x0); in espi_npcx_init()
1489 if (ret < 0) { in espi_npcx_init()
1502 IRQ_CONNECT(DT_INST_IRQN(0), in espi_npcx_init()
1503 DT_INST_IRQ(0, priority), in espi_npcx_init()
1505 DEVICE_DT_INST_GET(0), 0); in espi_npcx_init()
1508 irq_enable(DT_INST_IRQN(0)); in espi_npcx_init()
1510 return 0; in espi_npcx_init()