static void qoriq_clock_initialize(void) { uint32_t timer_frequency = BSP_bus_frequency / 8; uint32_t interval = (uint32_t) (((uint64_t) timer_frequency * (uint64_t) rtems_configuration_get_microseconds_per_tick()) / 1000000); qoriq_clock->bcr = GTBCR_COUNT(interval); qoriq_timecounter->bcr = GTBCR_COUNT(0xffffffff); qoriq_clock_tc.tc_get_timecount = qoriq_clock_get_timecount; qoriq_clock_tc.tc_counter_mask = GTCCR_COUNT_GET(0xffffffff); qoriq_clock_tc.tc_frequency = timer_frequency; qoriq_clock_tc.tc_quality = RTEMS_TIMECOUNTER_QUALITY_CLOCK_DRIVER; rtems_timecounter_install(&qoriq_clock_tc); }
static void qoriq_clock_initialize(void) { uint32_t timer_frequency = BSP_bus_frequency / 8; uint32_t nanoseconds_per_second = 1000000000; uint32_t interval = (uint32_t) (((uint64_t) timer_frequency * (uint64_t) rtems_configuration_get_microseconds_per_tick()) / 1000000); qoriq_clock_nanoseconds_per_timer_tick = nanoseconds_per_second / timer_frequency; qoriq_clock->bcr = GTBCR_COUNT(interval); }