From: Scott McNutt <smcnutt@psyent.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] nios2: Set CONFIG_SYS_HZ to 1000 all nios2 boards.
Date: Wed, 31 Mar 2010 00:14:51 -0400 [thread overview]
Message-ID: <4BB2CC3B.4030102@psyent.com> (raw)
In-Reply-To: <4BB2BBBB.4000702@wytron.com.tw>
Hi Thomas,
Thomas Chou wrote:
> On 03/31/2010 10:09 AM, Scott McNutt wrote:
>>> So it might be cleaner to let user define the HZ as the actual tick rate
>>> and increase the tick count by one in the tmr_isr.
>>>
>> This was discussed/debated thoroughly over the past year:
>> CONFIG_SYS_HZ at 1000 is mandatory.
>>
>>
>>> - timestamp += CONFIG_SYS_NIOS_TMRMS;
>>> + timestamp++;
>>>
>> This means that each interrupt is exactly 1 msec. That's not what
>> was intended and not what was implemented Forcing the interrupt
>> period to 1 msec is an unnecessary constraint. If you want the isr
>> to increment the timestamp by 1, then set CONFIG_SYS_NIOS_TMRMS to 1
>> ... and set your timer accordingly.
> I tried to follow your patch "nios2: Set CONFIG_SYS_HZ to 1000 all nios2
> boards". But got cfi flash buffer write timeout on EP2C35 board. If I
> set TMRMS to 1, it works with HZ at 100, 1000 and 2000.
The patch should not affect your EP2C35 board configuration since it
hasn't been added yet. So I'm not sure I understand the scenario you
are describing. If your TMRMS is set to 1 and your TMRCNT is set to
match, then you should be ticking at 1000 Hz. And if CONFIG_SYS_HZ
is set to 1000, we should achieve oneness with u-boot ;-)
In any case, for the benefit of the nios2 folks who might be
following this thread:
CONFIG_SYS_TMRMS -- this is the _actual_ period (in msec) of the
timer interrupt that is added to the timestamp on every interrupt.
It's what board developers choose based on their requirements. It's
intended to be cpu clock and timer configuration agnostic.
CONFIG_SYS_NIOS_TMRCNT -- this is what (optionally) gets loaded into
the timer period registers. If the default configuration of the timer
matches TMRMS, then there's no need to define this value. However,
if for some reason you want to slow down the interrupt frequency,
you can do so by defining an appropriate value.
How to calculate these values is up to the board developer. For the
Altera EP1xxx boards, we start with a desired period of 10 ms, so
TMRMS is set to 10. Then TMRCNT is calculated based on the system
clock frequency.
And none of the above has anything to do with CONFIG_SYS_HZ ... which
for the most part is just a synonym for the value 1000. If you set
CONFIG_SYS_HZ to anything less than 1000 you end up with a timeout
of zero in cfi_flash ... at least until we rebase to the mothership
to get the latest cfi patches ... at which point it should be 1.
A timeout of zero is probably not what we want. ;-)
In any case, I'll try to fire up my 2C35 board and have a look.
Best Regards,
--Scott
next prev parent reply other threads:[~2010-03-31 4:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-31 2:09 [U-Boot] [PATCH] nios2: Set CONFIG_SYS_HZ to 1000 all nios2 boards Scott McNutt
2010-03-31 3:04 ` Thomas Chou
2010-03-31 4:14 ` Scott McNutt [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-03-31 1:00 Scott McNutt
2010-04-01 7:23 ` Michal Simek
2010-04-01 11:46 ` Scott McNutt
2010-04-01 16:59 ` Michal Simek
2010-04-02 1:15 ` Scott McNutt
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=4BB2CC3B.4030102@psyent.com \
--to=smcnutt@psyent.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