/* Internal Function:Poll for status of interrupt received by the Controller.  */
static uint32_t lpddr4_pollctlirq(const lpddr4_privatedata *pd, lpddr4_ctlinterrupt irqbit, uint32_t delay)
/* Internal Function:Poll for status of interrupt received by the Controller.  */
static uint32_t lpddr4_pollctlirq(const lpddr4_privatedata *pd, lpddr4_ctlinterrupt irqbit, uint32_t delay)
{
	uint32_t result = 0U;
	uint32_t timeout = 0U;
	bool irqstatus = false;
	do {
		if (++timeout == delay) {
			result = EIO;
			break;
		}
		result = lpddr4_checkctlinterrupt(pd, irqbit, &irqstatus);
	} while ((irqstatus == false) && (result == (uint32_t) CDN_EOK));
	return result;
}