/* This function will return the amount of WCMD delay on the given channel as an absolute PI count.  */
uint32_t get_wcmd(uint8_t channel)
/* This function will return the amount of WCMD delay on the given channel as an absolute PI count.  */
uint32_t get_wcmd(uint8_t channel)
{
	uint32_t reg;
	uint32_t temp;
	uint32_t pi_count;
	ENTERFN();
	reg = CMDPTRREG + channel * DDRIOCCC_CH_OFFSET;
	temp = msg_port_alt_read(DDRPHY, reg);
	temp >>= 8;
	temp &= 0xf;
	pi_count = temp * HALF_CLK;
	reg = CMDDLLPICODER1 + channel * DDRIOCCC_CH_OFFSET;
	temp = msg_port_alt_read(DDRPHY, reg);
	temp >>= 16;
	temp &= 0x3f;
	pi_count += temp;
	LEAVEFN();
	return pi_count;
}