hw/mips/mipssim: Correct CPU frequency
The MIPSsim machine CPU frequency is too fast running at 200 MHz, while it should be 12 MHz for the 24K and 6 MHz for the 5K core. Ref: Linux commit c78cbf49c4ed ("Support for MIPSsim, the cycle accurate MIPS simulator.") Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20201012095804.3335117-16-f4bug@amsat.org>
This commit is contained in:
parent
3ca7639ff0
commit
8543a80691
|
@ -29,6 +29,7 @@
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
#include "qemu-common.h"
|
#include "qemu-common.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
#include "hw/clock.h"
|
||||||
#include "hw/mips/mips.h"
|
#include "hw/mips/mips.h"
|
||||||
#include "hw/mips/cpudevs.h"
|
#include "hw/mips/cpudevs.h"
|
||||||
#include "hw/char/serial.h"
|
#include "hw/char/serial.h"
|
||||||
|
@ -150,13 +151,21 @@ mips_mipssim_init(MachineState *machine)
|
||||||
MemoryRegion *address_space_mem = get_system_memory();
|
MemoryRegion *address_space_mem = get_system_memory();
|
||||||
MemoryRegion *isa = g_new(MemoryRegion, 1);
|
MemoryRegion *isa = g_new(MemoryRegion, 1);
|
||||||
MemoryRegion *bios = g_new(MemoryRegion, 1);
|
MemoryRegion *bios = g_new(MemoryRegion, 1);
|
||||||
|
Clock *cpuclk;
|
||||||
MIPSCPU *cpu;
|
MIPSCPU *cpu;
|
||||||
CPUMIPSState *env;
|
CPUMIPSState *env;
|
||||||
ResetData *reset_info;
|
ResetData *reset_info;
|
||||||
int bios_size;
|
int bios_size;
|
||||||
|
|
||||||
|
cpuclk = clock_new(OBJECT(machine), "cpu-refclk");
|
||||||
|
#ifdef TARGET_MIPS64
|
||||||
|
clock_set_hz(cpuclk, 6000000); /* 6 MHz */
|
||||||
|
#else
|
||||||
|
clock_set_hz(cpuclk, 12000000); /* 12 MHz */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Init CPUs. */
|
/* Init CPUs. */
|
||||||
cpu = MIPS_CPU(cpu_create(machine->cpu_type));
|
cpu = mips_cpu_create_with_clock(machine->cpu_type, cpuclk);
|
||||||
env = &cpu->env;
|
env = &cpu->env;
|
||||||
|
|
||||||
reset_info = g_malloc0(sizeof(ResetData));
|
reset_info = g_malloc0(sizeof(ResetData));
|
||||||
|
|
Loading…
Reference in a new issue