> +#ifdef CONFIG_ARCH_OMAP3 > +unsigned long (*_omap3_sram_delay)(unsigned long); > +unsigned int measure_sram_delay(unsigned int loop) > +{ > + static struct omap_dm_timer *gpt; > + unsigned long flags, diff = 0, gt_rate, mpurate; > + unsigned int delay_sram, error_gain; > + > + omap_dm_timer_init(); > + gpt = omap_dm_timer_request_specific(10); > + if (!gpt) > + pr_err("Could not get the gptimer\n"); > + omap_dm_timer_set_source(gpt, OMAP_TIMER_SRC_SYS_CLK); > + > + gt_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt)); > + omap_dm_timer_set_load_start(gpt, 0, 0); > + > + local_irq_save(flags); > + diff = _omap3_sram_delay(loop); > + local_irq_restore(flags); > + > + omap_dm_timer_stop(gpt); > + omap_dm_timer_free(gpt); > + > + mpurate = clk_get_rate(clk_get(NULL, "arm_fck")); > + > + /* calculate the sram delay */ > + delay_sram = ((((mpurate/1000000) / (gt_rate/1000000)) * diff) / 20000); Can remove the 1000000 from the denominators as they cancel out. > + > + error_gain = ((mpurate/1000000) / (gt_rate/1000000)); Same as before. > + delay_sram = delay_sram + error_gain; > + > + return delay_sram; > +} -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html