X-Git-Url: https://git.kernelconcepts.de/?a=blobdiff_plain;f=arch%2Fnds32%2Fcpu%2Fn1213%2Fag101%2Ftimer.c;fp=arch%2Fnds32%2Fcpu%2Fn1213%2Fag101%2Ftimer.c;h=926091f744308ac7345da56c4a9d8eac0e419710;hb=4fc967051396e8e82138c65fd65a353f73e51b89;hp=caa36b8be83881bf7b17222527a547330d4f6c3a;hpb=e3c58b029255f5acf5471e5992efd7f84b77ebad;p=karo-tx-uboot.git diff --git a/arch/nds32/cpu/n1213/ag101/timer.c b/arch/nds32/cpu/n1213/ag101/timer.c index caa36b8be8..926091f744 100644 --- a/arch/nds32/cpu/n1213/ag101/timer.c +++ b/arch/nds32/cpu/n1213/ag101/timer.c @@ -86,7 +86,8 @@ void reset_timer_masked(void) #ifdef CONFIG_FTTMR010_EXT_CLK lastdec = readl(&tmr->timer3_counter) / (TIMER_CLOCK / CONFIG_SYS_HZ); #else - lastdec = readl(&tmr->timer3_counter) / (CONFIG_SYS_CLK_FREQ / 2); + lastdec = readl(&tmr->timer3_counter) / + (CONFIG_SYS_CLK_FREQ / 2 / CONFIG_SYS_HZ); #endif timestamp = 0; /* start "advancing" time stamp from 0 */ @@ -110,8 +111,8 @@ ulong get_timer_masked(void) #ifdef CONFIG_FTTMR010_EXT_CLK ulong now = readl(&tmr->timer3_counter) / (TIMER_CLOCK / CONFIG_SYS_HZ); #else - ulong now = readl(&tmr->timer3_counter) / \ - (CONFIG_SYS_CLK_FREQ / 2 / 1024); + ulong now = readl(&tmr->timer3_counter) / + (CONFIG_SYS_CLK_FREQ / 2 / CONFIG_SYS_HZ); #endif debug("%s(): now = %lx, lastdec = %lx\n", __func__, now, lastdec);