diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-04-02 11:32:11 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-04-02 13:40:15 +0200 |
commit | 8bb00ace5090804804f6011a02e097176fa63bb8 (patch) | |
tree | 53efdb2189daab1802eb62a11f879ce787ddf03c /c/src/lib/libbsp/powerpc/tqm8xx | |
parent | bsp/gen83xx: Support cache BSP options (diff) | |
download | rtems-8bb00ace5090804804f6011a02e097176fa63bb8.tar.bz2 |
bsps: More accurate PowerPC clock driver
The clock driver used previously the bsp_clicks_per_usec value. For a
33333333Hz time base frequency this leads to a relative error of one per
cent for example due to integer truncation.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/tqm8xx')
-rw-r--r-- | c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c b/c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c index cfd99e2fa2..9eba18839e 100644 --- a/c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c +++ b/c/src/lib/libbsp/powerpc/tqm8xx/startup/bspstart.c @@ -40,8 +40,12 @@ /* Configuration parameters for console driver, ... */ uint32_t BSP_bus_frequency; -/* Configuration parameters for clock driver, ... */ +/* Configuration parameter for clock driver */ +uint32_t bsp_time_base_frequency; + +/* Legacy */ uint32_t bsp_clicks_per_usec; /* for PIT driver: OSCCLK */ + /* for timer: */ uint32_t bsp_timer_average_overhead; /* Average overhead of timer in ticks */ uint32_t bsp_timer_least_valid; /* Least valid number from timer */ @@ -173,7 +177,8 @@ void bsp_start( void) BSP_panic("Cannot determine BUS frequency\n"); } - bsp_clicks_per_usec = BSP_bus_frequency/1000000/16; + bsp_time_base_frequency = BSP_bus_frequency / 16; + bsp_clicks_per_usec = bsp_time_base_frequency / 1000000; bsp_timer_least_valid = 3; bsp_timer_average_overhead = 3; |