diff options
author | Avi Kivity <avi@redhat.com> | 2011-10-09 13:11:50 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-10-09 13:11:50 +0200 |
commit | df2921d326d0903ff684759ac8508f87396b7018 (patch) | |
tree | b9f9d2a2a116413591362278b2dc9d148c7ee943 /hw/ppc440_bamboo.c | |
parent | 306f66b42f961e38442d1721523dbb4906b33afb (diff) | |
parent | 02d6516c8ba00bdd6d96b622f000cb28c3449f43 (diff) |
Merge remote-tracking branch 'upstream' into memory/batch
* upstream: (87 commits)
target-alpha: Fix compilation errors for 32 bit hosts
target-alpha: Add high-resolution access to wall clock and an alarm.
target-alpha: Implement HALT IPR.
target-alpha: Implement WAIT IPR.
target-alpha: Add CLIPPER emulation.
target-alpha: Add custom PALcode image for CLIPPER emulation.
target-alpha: Honor icount for RPCC instruction.
tcg/s390: Remove unused tcg_out_addi()
tcg/ia64: Remove unused tcg_out_addi()
ARM: fix segfault
ppc64: Fix linker script
pseries: Implement set-time-of-day RTAS function
pseries: Refactor spapr irq allocation
PPC: Clean up BookE timer code
PPC: booke timers
KVM: PPC: Use HIOR setting for -M pseries with PR KVM
KVM: Update kernel headers
KVM: Update kernel headers
PPC: Fix heathrow PIC to use little endian MMIO
PPC: Fix via-cuda memory registration
...
Conflicts:
hw/milkymist-uart.c
hw/ppce500_mpc8544ds.c
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/ppc440_bamboo.c')
-rw-r--r-- | hw/ppc440_bamboo.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/hw/ppc440_bamboo.c b/hw/ppc440_bamboo.c index 9228939b47..b734e3a56c 100644 --- a/hw/ppc440_bamboo.c +++ b/hw/ppc440_bamboo.c @@ -44,6 +44,8 @@ static int bamboo_load_device_tree(target_phys_addr_t addr, char *filename; int fdt_size; void *fdt; + uint32_t tb_freq = 400000000; + uint32_t clock_freq = 400000000; filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE); if (!filename) { @@ -77,8 +79,18 @@ static int bamboo_load_device_tree(target_phys_addr_t addr, if (ret < 0) fprintf(stderr, "couldn't set /chosen/bootargs\n"); - if (kvm_enabled()) - kvmppc_fdt_update(fdt); + /* Copy data from the host device tree into the guest. Since the guest can + * directly access the timebase without host involvement, we must expose + * the correct frequencies. */ + if (kvm_enabled()) { + tb_freq = kvmppc_get_tbfreq(); + clock_freq = kvmppc_get_clockfreq(); + } + + qemu_devtree_setprop_cell(fdt, "/cpus/cpu@0", "clock-frequency", + clock_freq); + qemu_devtree_setprop_cell(fdt, "/cpus/cpu@0", "timebase-frequency", + tb_freq); ret = rom_add_blob_fixed(BINARY_DEVICE_TREE_FILE, fdt, fdt_size, addr); g_free(fdt); |