/* LOCAL_CSR_STATUS=1 after a read or write to a microengine's CSR space means that the microengine we tried to access was also trying to access its own CSR space on the same clock cycle as we did. When this happens, we lose the arbitration process by default, and the read or write we tried to do was not actually performed, so we try again until it succeeds.  */
u32 ixp2000_uengine_csr_read(int uengine, int offset)
/* LOCAL_CSR_STATUS=1 after a read or write to a microengine's CSR space means that the microengine we tried to access was also trying to access its own CSR space on the same clock cycle as we did. When this happens, we lose the arbitration process by default, and the read or write we tried to do was not actually performed, so we try again until it succeeds.  */
u32 ixp2000_uengine_csr_read(int uengine, int offset)
{
	void *uebase;
	u32 *local_csr_status;
	u32 *reg;
	u32 value;
	uebase = ixp2000_uengine_csr_area(uengine);
	local_csr_status = (u32 *)(uebase + LOCAL_CSR_STATUS);
	reg = (u32 *)(uebase + offset);
	do {
		value = ixp2000_reg_read(reg);
	} while (ixp2000_reg_read(local_csr_status) & 1);
	return value;
}