/* Wait for the Cadence NAND controller to become idle. */
static int32_t cdns_nand_wait_idle(uintptr_t base_address)
/* Wait for the Cadence NAND controller to become idle. */
static int32_t cdns_nand_wait_idle(uintptr_t base_address)
{
	if (!WAIT_FOR(CNF_GET_CTRL_BUSY(sys_read32(CNF_CMDREG(base_address, CTRL_STATUS))) == 0U,
		      IDLE_TIME_OUT, k_msleep(1))) {
		LOG_ERR("Timed out waiting for wait idle response");
		return -ETIMEDOUT;
	}
	return 0;
}