qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [Qemu devel v5 PATCH 0/5] Add support for Smartfusion2 So


From: sundeep subbaraya
Subject: Re: [Qemu-arm] [Qemu devel v5 PATCH 0/5] Add support for Smartfusion2 SoC
Date: Mon, 3 Jul 2017 10:16:48 +0530

Hi Peter,

On Mon, Jul 3, 2017 at 2:30 AM, Peter Maydell <address@hidden> wrote:
On 2 July 2017 at 18:39, sundeep subbaraya <address@hidden> 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.)

Ok. Modified as per your comment.

Thanks,
Sundeep

thanks
-- PMM


reply via email to

[Prev in Thread] Current Thread [Next in Thread]