[rtems commit] bsp/qoriq: Fix off by one error in clock init

Sebastian Huber sebh at rtems.org
Thu Apr 2 07:14:01 UTC 2020


Module:    rtems
Branch:    master
Commit:    299a82f45ede8915508deac8710e096766cf31b4
Changeset: http://git.rtems.org/rtems/commit/?id=299a82f45ede8915508deac8710e096766cf31b4

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Apr  2 09:01:43 2020 +0200

bsp/qoriq: Fix off by one error in clock init

Close #3921.

---

 bsps/powerpc/qoriq/clock/clock-config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bsps/powerpc/qoriq/clock/clock-config.c b/bsps/powerpc/qoriq/clock/clock-config.c
index be2dc7b..2966636 100644
--- a/bsps/powerpc/qoriq/clock/clock-config.c
+++ b/bsps/powerpc/qoriq/clock/clock-config.c
@@ -133,7 +133,7 @@ static void qoriq_clock_initialize(void)
   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_clock->bcr = GTBCR_COUNT(interval - 1);
 
   qoriq_timecounter->bcr = GTBCR_COUNT(0xffffffff);
 



More information about the vc mailing list