qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] m68k: change default system clock for m5208evb


From: Greg Ungerer
Subject: Re: [Qemu-devel] [PATCH] m68k: change default system clock for m5208evb
Date: Wed, 28 Sep 2016 09:49:40 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0

On 27/09/16 23:27, Laurent Vivier wrote:
> 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 <address@hidden>
>>>>> ---
>>>>>  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...

Perhaps it is, but again it is not documented that way.
All the 5208 documentation talks in terms of frequency.
Would it not be clearer to define it in the same way that
the documentation lists?

Prime example from the M5208 Reference Manual regarding
the PLL settings:

. Voltage controlled oscillator range from 350 MHz to 540 MHz, resulting in a 
core frequency
  (fvco ÷ 3 (or fvco ÷ 4)) of 87.5 MHz to 166.67 MHz (maximum rated for device)


> And internally QEMU uses the period, not the frequency.

Ultimately I don't mind doing it in any way that results in
the patch being accepted :-)

Regards
Greg





reply via email to

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