Lines Matching +full:mhz +full:- +full:delay +full:- +full:count

4  * SPDX-License-Identifier: Apache-2.0
222 spi_cfg.cs.delay = 0; in spi_saf_init()
231 tx_bufs.count = 1U; in spi_saf_init()
237 rx_bufs.count = 1U; in spi_saf_init()
249 return -1; in spi_saf_init()
260 tx_bufs.count = 1U; in spi_saf_init()
266 rx_bufs.count = 1U; in spi_saf_init()
291 tx_bufs.count = 1U; in spi_saf_init()
294 rx_bufs.count = 0U; in spi_saf_init()
313 tx_bufs.count = 1U; in spi_saf_init()
316 rx_bufs.count = 0U; in spi_saf_init()
336 tx_bufs.count = 1U; in spi_saf_init()
343 rx_bufs.count = 1U; in spi_saf_init()
371 tx_bufs.count = 1U; in spi_saf_init()
378 rx_bufs.count = 1U; in spi_saf_init()
395 return -1; in spi_saf_init()
427 limit = pr->start + pr->size - 1U; in pr_check_range()
430 if (regs->SAF_PROT_RG[pr->pr_num].START != (pr->start >> 12)) { in pr_check_range()
431 return -1; in pr_check_range()
434 if (regs->SAF_PROT_RG[pr->pr_num].LIMIT != (limit >> 12)) { in pr_check_range()
435 return -1; in pr_check_range()
443 if (pr->flags & MCHP_SAF_PR_FLAG_ENABLE) { in pr_check_enable()
444 if (regs->SAF_PROT_RG[pr->pr_num].LIMIT > regs->SAF_PROT_RG[pr->pr_num].START) { in pr_check_enable()
448 if (regs->SAF_PROT_RG[pr->pr_num].START > regs->SAF_PROT_RG[pr->pr_num].LIMIT) { in pr_check_enable()
453 return -2; in pr_check_enable()
458 if (pr->flags & MCHP_SAF_PR_FLAG_LOCK) { in pr_check_lock()
459 if (regs->SAF_PROT_LOCK & BIT(pr->pr_num)) { in pr_check_lock()
463 if (!(regs->SAF_PROT_LOCK & BIT(pr->pr_num))) { in pr_check_lock()
468 return -3; in pr_check_lock()
472 * NOTE: bit[0] of bit map registers is read-only = 1
476 if (regs->SAF_PROT_RG[pr->pr_num].WEBM != (pr->master_bm_we | BIT(0))) { in pr_check_master_bm()
477 return -4; in pr_check_master_bm()
480 if (regs->SAF_PROT_RG[pr->pr_num].RDBM != (pr->master_bm_rd | BIT(0))) { in pr_check_master_bm()
481 return -4; in pr_check_master_bm()
500 pr = spr->pregions; in espi_saf_test_pr1()
502 for (size_t n = 0U; n < spr->nregions; n++) { in espi_saf_test_pr1()
505 LOG_INF("SAF Protection region %u range fail", pr->pr_num); in espi_saf_test_pr1()
511 LOG_INF("SAF Protection region %u enable fail", pr->pr_num); in espi_saf_test_pr1()
517 LOG_INF("SAF Protection region %u lock check fail", pr->pr_num); in espi_saf_test_pr1()
523 LOG_INF("SAF Protection region %u Master select fail", pr->pr_num); in espi_saf_test_pr1()
542 return -EINVAL; in saf_read()
567 n -= chunk_len; in saf_read()
586 spi_addr &= ~(4096U - 1U); in saf_erase_block()
590 spi_addr &= ~((32U * 1024U) - 1U); in saf_erase_block()
594 spi_addr &= ~((64U * 1024U) - 1U); in saf_erase_block()
597 return -EINVAL; in saf_erase_block()
620 return -EINVAL; in saf_page_prog()
648 n -= chunk_len; in saf_page_prog()
665 spi_addr &= ~(4096U - 1U); in espi_saf_test1()
674 while (!erased && (retries-- > 0)) { in espi_saf_test1()
686 rc = -1; in espi_saf_test1()
712 return -1; in espi_saf_test1()
864 * 20MHz frequency and only logical channel 0 and 1 are supported in espi_init()
891 LOG_INF("eSPI test - callbacks initialization... "); in espi_init()
901 LOG_INF("eSPI test - callbacks registration... "); in espi_init()
923 LOG_ERR("Failed to read %x %d", gpio->pin, level); in wait_for_pin()
924 return -EIO; in wait_for_pin()
928 LOG_DBG("PIN %x = %x", gpio->pin, exp_level); in wait_for_pin()
933 loop_cnt--; in wait_for_pin()
937 LOG_ERR("Timeout for %x %x", gpio->pin, level); in wait_for_pin()
938 return -ETIMEDOUT; in wait_for_pin()
956 return -EIO; in wait_for_vwire()
964 loop_cnt--; in wait_for_vwire()
969 return -ETIMEDOUT; in wait_for_vwire()
984 loop_cnt--; in wait_for_espi_reset()
988 return -ETIMEDOUT; in wait_for_espi_reset()
998 LOG_INF("eSPI test - Handshake with eSPI master..."); in espi_handshake()
1177 LOG_ERR("%s: device not ready.", pwrgd_gpio.port->name); in espi_test()
1178 return -ENODEV; in espi_test()
1181 LOG_ERR("%s: device not ready.", rsm_gpio.port->name); in espi_test()
1182 return -ENODEV; in espi_test()
1186 LOG_ERR("%s: device not ready.", espi_dev->name); in espi_test()
1187 return -ENODEV; in espi_test()
1192 LOG_ERR("%s: device not ready.", qspi_dev->name); in espi_test()
1193 return -ENODEV; in espi_test()
1197 LOG_ERR("%s: device not ready.", espi_saf_dev->name); in espi_test()
1198 return -ENODEV; in espi_test()
1220 return -1; in espi_test()
1230 * Host de-asserts ESPI_RESET#. in espi_test()
1234 LOG_ERR("Unable to configure %d:%s", ret, qspi_dev->name); in espi_test()
1240 LOG_ERR("Unable to configure %d:%s", ret, espi_saf_dev->name); in espi_test()
1322 /* System without host-initiated OOB Rx traffic */ in espi_test()
1325 /* System with host-initiated OOB Rx traffic */ in espi_test()