From 4018bae91649e8e38e371dc00cb5ac8f9e40089e Mon Sep 17 00:00:00 2001 From: j_mayer Date: Mon, 19 Nov 2007 01:48:12 +0000 Subject: New PowerPC CPU flag to define the decrementer and time-base source clock. Use it to properly initialize the clock for the PreP target. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3701 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/ppc_prep.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'hw/ppc_prep.c') diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c index 1d6634c..d33cf5d 100644 --- a/hw/ppc_prep.c +++ b/hw/ppc_prep.c @@ -564,8 +564,13 @@ static void ppc_prep_init (int ram_size, int vga_ram_size, fprintf(stderr, "Unable to find PowerPC CPU definition\n"); exit(1); } - /* Set time-base frequency to 100 Mhz */ - cpu_ppc_tb_init(env, 100UL * 1000UL * 1000UL); + if (env->flags & POWERPC_FLAG_RTC_CLK) { + /* POWER / PowerPC 601 RTC clock frequency is 7.8125 MHz */ + cpu_ppc_tb_init(env, 7812500UL); + } else { + /* Set time-base frequency to 100 Mhz */ + cpu_ppc_tb_init(env, 100UL * 1000UL * 1000UL); + } qemu_register_reset(&cpu_ppc_reset, env); register_savevm("cpu", 0, 3, cpu_save, cpu_load, env); envs[i] = env; -- cgit v1.1