public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Christopher Eibel <mls@christopher-eibel.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] ARMv7 clock rate issue (U-Boot vs. X-Loader)
Date: Mon, 20 Jun 2011 01:35:41 +0200	[thread overview]
Message-ID: <4DFE87CD.6000607@christopher-eibel.de> (raw)

Hi,

I decided to post my questions on this list even though they also
concern the X-Loader. However, since the X-Loader is derived from
U-Boot, I thought they are placed well here.

I'm a bit confused about the clock rate which is set for the ARMv7
processor of the BeagleBoard-xM (Rev C; DM3730) by U-Boot and X-Loader.
As far as I understand it, the clock rate is only set to a "safe"
initial low value and not to the highest possible value the CPU is
actually able to run at.

According to the TI TRM [1] (p. 349), the ARM_CLK can be calculated as
follows:
    	I)      MPU_CLK = SYS_CLK * M / ([N+1] * M2)
    	II)     ARM_CLK = MPU_CLK
	
If I am correct, SYS_CLK equals to the oscillator frequency (26 MHz)
divided by 2, so SYS_CLK = 13 MHz. Therefore, ARM_CLK should be 600 MHz,
because M = 600, N = 12, and M2 = 1. (I got these values from the table
in <U-Boot-root>/arch/arm/cpu/armv7/omap3/lowlevel_init.S, but I also
verified them by some printfs after prcm_init().)

Now, what confuses me:
When I set exactly the same values for M, N, and M2 (SYS_CLK is also 13
MHz) in X-Loader (I used this version: [2]), then the CPU seems to
perform significantly slower than in U-Boot. To see the difference I ran
a simple standalone application with a constant number of instructions
in both X-Loader and U-Boot. The CR (Control Register [3]) was set to
the same value (0xC5087A -> instruction and data caches disabled).

I measured the execution time for both cases and got these values:

		     U-Boot:     35066 ms
		     X-Loader:   23389 ms

1) Is there anything initialized/activated in U-Boot -- but not in
X-Loader -- which could affect the performance in such a way?
2) Am I correct that the CPU is clocked at 600 MHz at all (at least in
U-Boot)?

Thank you.

Best regards,
Chris

[1] AM/DM37x Multimedia Device Silicon -- Technical Reference Manual
    http://focus.ti.com/lit/ug/sprugn4l/sprugn4l.pdf
[2] x-loader - Gitorius
    http://gitorious.org/x-loader
[3] Cortex-A8 Technical Reference Manual -- Control Register

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0344k/Bgbffjhh.html

                 reply	other threads:[~2011-06-19 23:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=4DFE87CD.6000607@christopher-eibel.de \
    --to=mls@christopher-eibel.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