All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Greg Ungerer <gerg@uclinux.org>, Thomas Huth <huth@tuxfamily.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] m68k: change default system clock for m5208evb
Date: Tue, 27 Sep 2016 15:27:43 +0200	[thread overview]
Message-ID: <a82788f8-ea6d-a2c1-9aeb-7bf75270af28@vivier.eu> (raw)
In-Reply-To: <ddf32200-6e4f-b9c2-f88f-0b94b70a9f0e@uclinux.org>



Le 27/09/2016 à 15:22, Greg Ungerer a écrit :
> Hi Laurent,
> 
> On 27/09/16 18:11, Laurent Vivier wrote:
>> Le 27/09/2016 à 09:33, Thomas Huth a écrit :
>>> On 27.09.2016 03:29, Greg Ungerer wrote:
>>>> The shipping default setting for the Freescale M5208EVB board is to run
>>>> the CPU at 166MHz. The current qemu emulation code for this board is
>>>> defaulting to 66MHz. This results in time appearing to run way to
>>>> slowly.
>>>> So a "sleep 5" in a standard ColdFire Linux build takes almost 15
>>>> seconds in real time to actually complete.
>>>>
>>>> Change the hard coded default to match the default hardware setting.
>>>>
>>>> Signed-off-by: Greg Ungerer <gerg@uclinux.org>
>>>> ---
>>>>  hw/m68k/mcf5208.c | 2 +-
>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c
>>>> index 9240ebf..2d0b464 100644
>>>> --- a/hw/m68k/mcf5208.c
>>>> +++ b/hw/m68k/mcf5208.c
>>>> @@ -21,7 +21,7 @@
>>>>  #include "elf.h"
>>>>  #include "exec/address-spaces.h"
>>>>
>>>> -#define SYS_FREQ 66000000
>>>> +#define SYS_FREQ 166000000
>>>
>>> Good catch. But actually, the M5208EVB User's Manual talks about 166.67
>>> MHz, so while you're at it, maybe you should change it to 166666666
>>> instead?
>>
>> In this case, it should be better to use a period of 6000000 ns (and
>> ptimer_set_period() instead of ptimer_set_freq()).
> 
> Why is that better in this case?
> All the documentation lists it as 166.67MHz, even on the PCB.
> Isn't it clearer to define it based on the actual value documented?

It is better because 166.67 MHZ is clearly a rounded value computed from
the period: 1000000000/6000000 = 166.666666666666666666666666...

And internally QEMU uses the period, not the frequency.

Laurent

  reply	other threads:[~2016-09-27 13:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-27  1:29 [Qemu-devel] [PATCH] m68k: change default system clock for m5208evb Greg Ungerer
2016-09-27  7:33 ` Thomas Huth
2016-09-27  8:11   ` Laurent Vivier
2016-09-27 13:22     ` Greg Ungerer
2016-09-27 13:27       ` Laurent Vivier [this message]
2016-09-27 23:49         ` Greg Ungerer
2016-09-28  0:22           ` Peter Maydell
2016-09-28  1:35             ` Greg Ungerer
2016-09-27 13:19   ` Greg Ungerer

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=a82788f8-ea6d-a2c1-9aeb-7bf75270af28@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=gerg@uclinux.org \
    --cc=huth@tuxfamily.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.