Hi all,

        For all Timer modification a minimun of qualification is mandatory
        as it will impact a lots of part of u-boot.

        So for this purpose I'll propose you to use one of this two approche
        to report the precition of your timer or update

        1) Clock generation Mesurement

        Tools needed: Scope or Frequency metter

        In this approch you will use a gpio to generate a 1Khz and at 1Mhz or
        it's maximun generated clock frequency

        before generate one of this clock you will need to known your GPIO and
        system latency. For this purpose you will generate a clock at your
        maximum speed as this algo

        set_gpio_as_output(gpio);

        while(1) {
                set_gpio_value(gpio, 1);
                set_gpio_value(gpio, 0);
        }

        after measure the clock (hg_clock) you will it's latency

        now you will try to generate the 1Khz clock
        to known the precision of your timer at 1ms

        while(1) {
                set_gpio_value(gpio, 1);
                udelay(1000);
                set_gpio_value(gpio, 0);
        }

        now measure the frequency of the clock

        the last step is now calculate your precision

        hg_clock = measured max speed generated clock

        ms_clock = measured 1Khz generated clock

        p = (1 / 1000 - (1 / hg_clock + 1 / ms_clock)) * 1000

        depending on max generated clock you can known your precision
        as 1us or less

        2) Watch mesurement

        measured with stop-watch on 100s delay

        x = measured time

        p = (100 - x) / 100


Best Regards,
J.

_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to