diff options
-rw-r--r-- | chip/g/hwtimer.c | 6 | ||||
-rw-r--r-- | chip/g/watchdog.c | 5 |
2 files changed, 5 insertions, 6 deletions
diff --git a/chip/g/hwtimer.c b/chip/g/hwtimer.c index 3c1ef73759..7f5b87ee94 100644 --- a/chip/g/hwtimer.c +++ b/chip/g/hwtimer.c @@ -54,11 +54,9 @@ static void update_prescaler(void) GC_TIMEHS_TIMER1CONTROL_PRE_LSB, 0); /* - * We're not yet doing anything to detect the current frequency, we're - * just hard-coding it. We're also assuming the clock rate is an - * integer multiple of MHz. + * Assume the clock rate is an integer multiple of MHz. */ - clock_mul_factor = 30; /* NOTE: prototype board */ + clock_mul_factor = GC_CONST_FPGA_TIMER_FIXED_FREQ; clock_div_factor = 0xffffffff / clock_mul_factor; } DECLARE_HOOK(HOOK_FREQ_CHANGE, update_prescaler, HOOK_PRIO_DEFAULT); diff --git a/chip/g/watchdog.c b/chip/g/watchdog.c index 0568e27161..84ef15cd76 100644 --- a/chip/g/watchdog.c +++ b/chip/g/watchdog.c @@ -16,8 +16,9 @@ /* magic value to unlock the watchdog registers */ #define WATCHDOG_MAGIC_WORD 0x1ACCE551 -/* Watchdog expiration : assume 30 Mhz clock for now */ -#define WATCHDOG_PERIOD (CONFIG_WATCHDOG_PERIOD_MS * (30000000 / 1000)) +/* Watchdog expiration */ +#define WATCHDOG_PERIOD (CONFIG_WATCHDOG_PERIOD_MS * \ + ((GC_CONST_FPGA_JITTER_FIXED_FREQ * 1000000) / 1000)) void trace_and_reset(uint32_t excep_lr, uint32_t excep_sp) { |