summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2011-07-21 03:01:11 +0200
committerAlexander Graf <agraf@suse.de>2011-10-06 09:43:35 +0200
commit621d05e3011bb369a6d48881ceaabb4ecf1a8790 (patch)
tree8c4e220ba6508a704faed4206a3540d60a129c2d /hw
parent921e28db8dac945af8ae065b862c46393b259374 (diff)
downloadhqemu-621d05e3011bb369a6d48881ceaabb4ecf1a8790.zip
hqemu-621d05e3011bb369a6d48881ceaabb4ecf1a8790.tar.gz
PPC: E500: Update freqs for all CPUs
Now that we can so nicely find out the host's frequencies, we should also make sure that we get them into all virtual CPUs' device tree nodes. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw')
-rw-r--r--hw/ppce500_mpc8544ds.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c
index 2c7c677..0791e27 100644
--- a/hw/ppce500_mpc8544ds.c
+++ b/hw/ppce500_mpc8544ds.c
@@ -70,9 +70,9 @@ static int mpc8544_load_device_tree(CPUState *env,
int fdt_size;
void *fdt;
uint8_t hypercall[16];
- char cpu_name[128] = "/cpus/PowerPC,8544@0";
uint32_t clock_freq = 400000000;
uint32_t tb_freq = 400000000;
+ int i;
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
if (!filename) {
@@ -122,8 +122,12 @@ static int mpc8544_load_device_tree(CPUState *env,
hypercall, sizeof(hypercall));
}
- qemu_devtree_setprop_cell(fdt, cpu_name, "clock-frequency", clock_freq);
- qemu_devtree_setprop_cell(fdt, cpu_name, "timebase-frequency", tb_freq);
+ for (i = 0; i < smp_cpus; i++) {
+ char cpu_name[128];
+ snprintf(cpu_name, sizeof(cpu_name), "/cpus/PowerPC,8544@%x", i);
+ qemu_devtree_setprop_cell(fdt, cpu_name, "clock-frequency", clock_freq);
+ qemu_devtree_setprop_cell(fdt, cpu_name, "timebase-frequency", tb_freq);
+ }
ret = rom_add_blob_fixed(BINARY_DEVICE_TREE_FILE, fdt, fdt_size, addr);
g_free(fdt);
OpenPOWER on IntegriCloud