hw/mips/jazz: Correct CPU frequencies
The Magnum 4000PC CPU runs at 100 MHz, and the Acer PICA-61 CPU at ~134 MHz. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20201012095804.3335117-17-f4bug@amsat.org>
This commit is contained in:
parent
8543a80691
commit
79b99fe3f0
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include "qemu-common.h"
|
#include "qemu-common.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/intc/i8259.h"
|
#include "hw/intc/i8259.h"
|
||||||
|
@ -142,6 +143,7 @@ static void mips_jazz_init(MachineState *machine,
|
||||||
MemoryRegion *address_space = get_system_memory();
|
MemoryRegion *address_space = get_system_memory();
|
||||||
char *filename;
|
char *filename;
|
||||||
int bios_size, n;
|
int bios_size, n;
|
||||||
|
Clock *cpuclk;
|
||||||
MIPSCPU *cpu;
|
MIPSCPU *cpu;
|
||||||
CPUClass *cc;
|
CPUClass *cc;
|
||||||
CPUMIPSState *env;
|
CPUMIPSState *env;
|
||||||
|
@ -163,14 +165,25 @@ static void mips_jazz_init(MachineState *machine,
|
||||||
MemoryRegion *bios2 = g_new(MemoryRegion, 1);
|
MemoryRegion *bios2 = g_new(MemoryRegion, 1);
|
||||||
SysBusESPState *sysbus_esp;
|
SysBusESPState *sysbus_esp;
|
||||||
ESPState *esp;
|
ESPState *esp;
|
||||||
|
static const struct {
|
||||||
|
unsigned freq_hz;
|
||||||
|
unsigned pll_mult;
|
||||||
|
} ext_clk[] = {
|
||||||
|
[JAZZ_MAGNUM] = {50000000, 2},
|
||||||
|
[JAZZ_PICA61] = {33333333, 4},
|
||||||
|
};
|
||||||
|
|
||||||
if (machine->ram_size > 256 * MiB) {
|
if (machine->ram_size > 256 * MiB) {
|
||||||
error_report("RAM size more than 256Mb is not supported");
|
error_report("RAM size more than 256Mb is not supported");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cpuclk = clock_new(OBJECT(machine), "cpu-refclk");
|
||||||
|
clock_set_hz(cpuclk, ext_clk[jazz_model].freq_hz
|
||||||
|
* ext_clk[jazz_model].pll_mult);
|
||||||
|
|
||||||
/* 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;
|
||||||
qemu_register_reset(main_cpu_reset, cpu);
|
qemu_register_reset(main_cpu_reset, cpu);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue