/* If an imprecise data rate is too high due to rounding error propagation, compute a suitably rounded mclk_ps to compute a working memory controller configuration.  */
unsigned int get_memory_clk_period_ps(const unsigned int ctrl_num)
/* If an imprecise data rate is too high due to rounding error propagation, compute a suitably rounded mclk_ps to compute a working memory controller configuration.  */
unsigned int get_memory_clk_period_ps(const unsigned int ctrl_num)
{
	unsigned int data_rate = get_ddr_freq(ctrl_num);
	unsigned int result;
	unsigned long long rem, mclk_ps = ULL_2E12;
	rem = do_div(mclk_ps, data_rate);
	result = (rem >= (data_rate >> 1)) ? mclk_ps + 1 : mclk_ps;
	return result;
}