/* As get_timer is used in the u-boot only for timeouts this should be sufficient  */
ulong get_timer(ulong base)
/* As get_timer is used in the u-boot only for timeouts this should be sufficient  */
ulong get_timer(ulong base)
{
	ulong milisec;
	ulong clocks = (MAX_TIM_LOAD - bfin_read_TCOUNT());
	if (clocks < last_time)
		timestamp++;
	last_time = clocks;
	milisec = clocks / (CONFIG_CCLK_HZ / 1000);
	milisec += timestamp * (MAX_TIM_LOAD / (CONFIG_CCLK_HZ / 1000));
	return (milisec - base);
}