public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@ingics.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] nds32: ag101/ag102: Inconsistent timer3 counter unit?
Date: Wed, 03 Jul 2013 23:17:32 +0800	[thread overview]
Message-ID: <1372864652.4800.3.camel@phoenix> (raw)

Hi Macpaul,

For the case CONFIG_FTTMR010_EXT_CLK is not defined:

In reset_timer_masked():
lastdec = readl(&tmr->timer3_counter) / (CONFIG_SYS_CLK_FREQ / 2);

In get_timer_masked():
ulong now = readl(&tmr->timer3_counter) / (CONFIG_SYS_CLK_FREQ / 2 / 1024);

The code looks strange. 
(Why one needs to be divided by 1024 and the other one does not?)
I'm not sure which one is correct.

Regards,
Axel

             reply	other threads:[~2013-07-03 15:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03 15:17 Axel Lin [this message]
2013-07-08  3:02 ` [U-Boot] nds32: ag101/ag102: Inconsistent timer3 counter unit? Kuan-Yu Kuo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372864652.4800.3.camel@phoenix \
    --to=axel.lin@ingics.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox