From: Jens Gehrlein <sew_s@tqs.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 3/7 v6] ARM: Add arm1176 core with S3C6400 SoC
Date: Thu, 07 Aug 2008 13:12:44 +0200 [thread overview]
Message-ID: <489AD8AC.2010309@tqs.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0808071209510.502@axis700.grange>
Hi Guennadi,
Guennadi Liakhovetski schrieb:
> On Thu, 7 Aug 2008, Jens Gehrlein wrote:
>
>> Hi Guennadi,
>>
>> Guennadi Liakhovetski schrieb:
>>
>>> diff --git a/cpu/arm1176/s3c64xx/interrupts.c
>>> b/cpu/arm1176/s3c64xx/interrupts.c
>> [snip]
>>> +void udelay(unsigned long usec)
>>> +{
>>> + unsigned long long tmp;
>>> + ulong tmo;
>>> +
>>> + tmo = (usec + 9) / 10;
>>> + tmp = get_ticks() + tmo; /* get current timestamp */
>>> +
>>> + while (get_ticks() < tmp)/* loop till event */
>>> + /*NOP*/;
>>> +}
>> I tried to follow the interrupt init function, but it's difficult.
>> What is the least possible delay with the udelay function?
>> I remember that i.mx31 udelay cannot currently be below 30 microsseconds due
>> to the low input clock. If someone uses udelay(1) in polling loops with
>> timeout, the actual duration is much more longer than assumed.
>
> Actually, the "/ 10" and this comment
>
> /*
> * We use the following scheme for the timer:
> * Prescaler is hard fixed at 167, divider at 1/4.
> * This gives at PCLK frequency 66MHz approx. 10us ticks
> * The timer is set to wrap after 100s, at 66MHz this obviously
> * happens after 10,000,000 ticks. A long variable can thus
> * keep values up to 40,000s, i.e., 11 hours. This should be
> * enough for most uses:-) Possible optimizations: select a
> * binary-friendly frequency, e.g., 1ms / 128. Also calculate
> * the prescaler automatically for other PCLK frequencies.
> */
>
> shall make it clear, that the timer resolution is configured to 10us,
> which is also the minimum udelay. The timer could also do better, but then
> we get other disadvantages, e.g., shorter wrap-around time.
Okay. Thank you.
I think, it's very useful for a developer to know the limits of high
resolution timers and to see it immediately, so he can consider it in
his code.
Kind regards,
Jens
next prev parent reply other threads:[~2008-08-07 11:12 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-06 19:41 [U-Boot-Users] [PATCH 0/7 v6] SMDK6400 support Guennadi Liakhovetski
2008-08-06 19:42 ` [U-Boot-Users] [PATCH 2/7 v6] nand_spl: Support page-aligned read in nand_load, use chipselect Guennadi Liakhovetski
2008-08-06 22:54 ` Scott Wood
2008-08-07 6:36 ` Guennadi Liakhovetski
2008-08-06 19:42 ` [U-Boot-Users] [PATCH 3/7 v6] ARM: Add arm1176 core with S3C6400 SoC Guennadi Liakhovetski
2008-08-07 6:28 ` Andreas Engel
2008-08-07 6:55 ` Guennadi Liakhovetski
2008-08-07 9:33 ` Jens Gehrlein
2008-08-07 9:51 ` Wolfgang Denk
2008-08-07 10:03 ` Jens Gehrlein
2008-08-07 10:17 ` Wolfgang Denk
2008-08-07 11:03 ` Jens Gehrlein
2008-08-07 11:07 ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-07 10:00 ` Jens Gehrlein
2008-08-07 10:12 ` Guennadi Liakhovetski
2008-08-07 11:12 ` Jens Gehrlein [this message]
2008-08-09 9:11 ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-09 9:58 ` [U-Boot] " Wolfgang Denk
2008-08-09 10:07 ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-11 8:17 ` [U-Boot-Users] " Guennadi Liakhovetski
2008-08-06 19:42 ` [U-Boot-Users] [PATCH 4/7 v6] USB: Add support for OHCI controller on S3C6400 Guennadi Liakhovetski
2008-08-07 15:56 ` Markus Klotzbücher
2008-08-07 15:53 ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-08 9:16 ` Markus Klotzbücher
2008-08-06 19:42 ` [U-Boot-Users] [PATCH 5/7 v6] serial: add S3C64XX serial driver Guennadi Liakhovetski
2008-08-09 9:13 ` Jean-Christophe PLAGNIOL-VILLARD
2008-08-11 8:44 ` Guennadi Liakhovetski
2008-08-11 10:06 ` [U-Boot] " Wolfgang Denk
2008-08-11 10:53 ` Guennadi Liakhovetski
2008-08-11 12:12 ` Wolfgang Denk
2008-08-11 12:43 ` Guennadi Liakhovetski
2008-08-06 19:42 ` [U-Boot-Users] [PATCH 6/7 v6] NAND: add NAND driver for S3C64XX Guennadi Liakhovetski
2008-08-07 22:15 ` Scott Wood
2008-08-06 19:42 ` [U-Boot-Users] [PATCH 7/7 v6] ARM: Add support for S3C6400 based SMDK6400 board Guennadi Liakhovetski
2008-08-09 9:32 ` Jean-Christophe PLAGNIOL-VILLARD
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=489AD8AC.2010309@tqs.de \
--to=sew_s@tqs.de \
--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