qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: sundeep subbaraya <sundeep.lkml@gmail.com>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"QEMU Developers" <qemu-devel@nongnu.org>,
	qemu-arm <qemu-arm@nongnu.org>,
	"Peter Crosthwaite" <crosthwaite.peter@gmail.com>,
	"Alistair Francis" <alistair23@gmail.com>
Subject: Re: [Qemu-devel] [Qemu devel v5 PATCH 0/5] Add support for Smartfusion2 SoC
Date: Sun, 2 Jul 2017 22:00:40 +0100	[thread overview]
Message-ID: <CAFEAcA8zxjMJN0Uv4L+vM5S8yw93GDbAh9xQxmrOESAxeAS_Rg@mail.gmail.com> (raw)
In-Reply-To: <CALHRZuosbYEcBYgjRu+45RZD6e7VWL5hQErAB7rJNEQ7ZdPguA@mail.gmail.com>

On 2 July 2017 at 18:39, sundeep subbaraya <sundeep.lkml@gmail.com> wrote:
> I figured out that systick uses cpu clock as clock source and
> system_clock_scale
> need to be set in msf2-soc.c. There is a bug in u-boot where it uses cpu
> clock as
> systick input but configures systick in external clock mode. I have tested
> the modified
> u-boot on real hardware too and it works fine. I am calculating
> system_clock_scale
> as below:
> If CPU clock is X MHz then system_clock_scale = (1 / X) * 1000
>
> Tested with different frequencies and they are yielding same results.

If you calculate it like that you'll probably get rounding
errors. Better is
  system_clock_scale = NANOSECONDS_PER_SECOND / freq_in_hz;

(Our systick implementation hardwires the external clock
frequency at 1MHz, but this is not really correct, it
depends on the SoC.)

thanks
-- PMM

  reply	other threads:[~2017-07-02 21:01 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 15:38 [Qemu-devel] [Qemu devel v5 PATCH 0/5] Add support for Smartfusion2 SoC Subbaraya Sundeep
2017-05-16 15:38 ` [Qemu-devel] [Qemu devel v5 PATCH 1/5] msf2: Add Smartfusion2 System timer Subbaraya Sundeep
2017-05-30 12:43   ` Philippe Mathieu-Daudé
2017-06-24 12:25     ` sundeep subbaraya
2017-05-16 15:38 ` [Qemu-devel] [Qemu devel v5 PATCH 2/5] msf2: Microsemi Smartfusion2 System Register block Subbaraya Sundeep
2017-05-30 12:51   ` Philippe Mathieu-Daudé
2017-06-24 12:48     ` sundeep subbaraya
2017-05-16 15:38 ` [Qemu-devel] [Qemu devel v5 PATCH 3/5] msf2: Add Smartfusion2 SPI controller Subbaraya Sundeep
2017-05-30 13:15   ` Philippe Mathieu-Daudé
2017-06-24  7:42     ` sundeep subbaraya
2017-05-16 15:38 ` [Qemu-devel] [Qemu devel v5 PATCH 4/5] msf2: Add Smartfusion2 SoC Subbaraya Sundeep
2017-05-26 23:48   ` Alistair Francis
2017-05-29  5:17     ` sundeep subbaraya
2017-05-30 22:33       ` Alistair Francis
2017-06-06  7:33         ` sundeep subbaraya
2017-05-31  5:43   ` Philippe Mathieu-Daudé
2017-06-06  7:35     ` sundeep subbaraya
2017-05-16 15:38 ` [Qemu-devel] [Qemu devel v5 PATCH 5/5] msf2: Add Emcraft's Smartfusion2 SOM kit Subbaraya Sundeep
2017-05-27  0:00   ` Alistair Francis
2017-05-29  5:26     ` sundeep subbaraya
2017-05-30 22:32       ` Alistair Francis
2017-06-26 16:01         ` sundeep subbaraya
2017-06-26 22:49           ` Alistair Francis
2017-06-28  6:04             ` sundeep subbaraya
2017-05-31  6:04   ` Philippe Mathieu-Daudé
2017-06-06  7:31     ` sundeep subbaraya
2017-05-17  4:27 ` [Qemu-devel] [Qemu devel v5 PATCH 0/5] Add support for Smartfusion2 SoC Philippe Mathieu-Daudé
2017-05-17  9:39   ` sundeep subbaraya
2017-05-29  5:28     ` sundeep subbaraya
2017-05-31  5:36       ` Philippe Mathieu-Daudé
2017-06-09  7:21         ` sundeep subbaraya
2017-06-26 16:11           ` sundeep subbaraya
2017-07-02 17:39             ` sundeep subbaraya
2017-07-02 21:00               ` Peter Maydell [this message]
2017-07-03  4:46                 ` sundeep subbaraya

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=CAFEAcA8zxjMJN0Uv4L+vM5S8yw93GDbAh9xQxmrOESAxeAS_Rg@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=alistair23@gmail.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sundeep.lkml@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).