@samitouri / QOSamiQemu / commits / 774e6f5c15

hw/ppc/e500: fix bus-frequency property hardcoded to zero in CPU FDT node

The bus-frequency property in the CPU FDT node was hardcoded to 0. This is incorrect - it should reflect the actual platform bus clock frequency, as firmware and RTOSes use it to derive peripheral clock rates. Notably, the RTEMS QorIQ BSP uses bus-frequency to program the MPIC global timer interval. With bus-frequency=0, the timer interval overflows to ~85 seconds, preventing any clock interrupts from firing. Fix by adding a bus_freq field to PPCE500MachineClass and using it in the FDT generator. Set bus_freq = PLATFORM_CLK_FREQ_HZ (400MHz) for existing machines, matching the existing clock_freq value. Signed-off-by: Vivien LEGER <vivien.leger@gmail.com> Reviewed-by: Bernhard Beschow <shentey@gmail.com> Message-ID: <20260411154535.1451361-1-vivien.leger@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Vivien LEGER committed Apr 11, 2026 at 17:45 UTC 774e6f5c1533aba9e04f95cb8cfba64d8329fcb0
4 files changed +4 -1
hw/ppc/e500.c
+1 -1
@@ -518,7 +518,7 @@ static int ppce500_load_device_tree(PPCE500MachineState *pms,
518 env->icache_line_size);
519 qemu_fdt_setprop_cell(fdt, cpu_name, "d-cache-size", 0x8000);
520 qemu_fdt_setprop_cell(fdt, cpu_name, "i-cache-size", 0x8000);
521 - qemu_fdt_setprop_cell(fdt, cpu_name, "bus-frequency", 0);
521 + qemu_fdt_setprop_cell(fdt, cpu_name, "bus-frequency", pmc->bus_freq);
522 if (cpu->cpu_index) {
523 qemu_fdt_setprop_string(fdt, cpu_name, "status", "disabled");
524 qemu_fdt_setprop_string(fdt, cpu_name, "enable-method",
hw/ppc/e500.h
+1
@@ -40,6 +40,7 @@ struct PPCE500MachineClass {
40 hwaddr pci_mmio_bus_base;
41 hwaddr spin_base;
42 uint32_t clock_freq;
43 + uint32_t bus_freq;
44 uint32_t tb_freq;
45 };
46
hw/ppc/e500plat.c
+1
@@ -94,6 +94,7 @@ static void e500plat_machine_class_init(ObjectClass *oc, const void *data)
94 pmc->pci_mmio_bus_base = 0xE0000000ULL;
95 pmc->spin_base = 0xFEF000000ULL;
96 pmc->clock_freq = PLATFORM_CLK_FREQ_HZ;
97 + pmc->bus_freq = PLATFORM_CLK_FREQ_HZ;
98 pmc->tb_freq = PLATFORM_CLK_FREQ_HZ;
99
100 mc->desc = "generic paravirt e500 platform";
hw/ppc/mpc8544ds.c
+1
@@ -56,6 +56,7 @@ static void mpc8544ds_machine_class_init(ObjectClass *oc, const void *data)
56 pmc->pci_pio_base = 0xE1000000ULL;
57 pmc->spin_base = 0xEF000000ULL;
58 pmc->clock_freq = PLATFORM_CLK_FREQ_HZ;
59 + pmc->bus_freq = PLATFORM_CLK_FREQ_HZ;
60 pmc->tb_freq = PLATFORM_CLK_FREQ_HZ;
61
62 mc->desc = "mpc8544ds";