/* Wait for a specific thread in the Cadence controller to complete. */
static int cdns_wait_for_thread(uintptr_t base_address, uint8_t thread)
/* Wait for a specific thread in the Cadence controller to complete. */
static int cdns_wait_for_thread(uintptr_t base_address, uint8_t thread)
{
	if (!WAIT_FOR((sys_read32((base_address) + THR_STATUS) & BIT(thread)) == 0U,
		      THREAD_IDLE_TIME_OUT, k_msleep(1))) {
		LOG_ERR("Timed out waiting for thread response");
		return -ETIMEDOUT;
	}
	return 0;
}