aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc_prep.c
diff options
context:
space:
mode:
authorj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-19 01:48:12 +0000
committerj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-11-19 01:48:12 +0000
commit4018bae91649e8e38e371dc00cb5ac8f9e40089e (patch)
tree09a105b65ffd79a721d9f9583bdd34f66fe3f824 /hw/ppc_prep.c
parent265531154a05a26e9b79819ddd068c285e681cbc (diff)
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
Diffstat (limited to 'hw/ppc_prep.c')
-rw-r--r--hw/ppc_prep.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c
index 1d6634cde3..d33cf5d9ad 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;