From 492bd396192a4cdcd9ef53502066836c34e83c0b Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Wed, 2 Dec 2015 15:34:00 +0100 Subject: [PATCH] epit timer: raise precision Previously we used a pretty slow external clock source for the timer. This resulted in such a low TICS_PER_MS value that the granularity wasn't sufficient to find a setup with a precision better than 1 second error per minute. Now we use the so-called High Frequency Reference Clock as input with TICS_PER_MS=33333 and the timer precision is significantly < 1 second per minute. Fixes #1805 --- repos/base/include/spec/epit/drivers/timer_base.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/repos/base/include/spec/epit/drivers/timer_base.h b/repos/base/include/spec/epit/drivers/timer_base.h index 78d40882c3..4154c928c1 100644 --- a/repos/base/include/spec/epit/drivers/timer_base.h +++ b/repos/base/include/spec/epit/drivers/timer_base.h @@ -29,7 +29,7 @@ class Genode::Epit_base : public Mmio { protected: - enum { TICS_PER_MS = 32 }; + enum { TICS_PER_MS = 33333 }; /** * Control register @@ -69,7 +69,7 @@ class Genode::Epit_base : public Mmio struct Clk_src : Bitfield<24, 2> /* select clock input */ { - enum { IPG_CLK_32K = 3 }; + enum { HIGH_FREQ_REF_CLK = 2 }; }; /** @@ -89,7 +89,7 @@ class Genode::Epit_base : public Mmio Doz_en::bits(0) | Stop_en::bits(0) | Om::bits(Om::DISCONNECTED) | - Clk_src::bits(Clk_src::IPG_CLK_32K); + Clk_src::bits(Clk_src::HIGH_FREQ_REF_CLK); } };