From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 37/48] hw/ppc/e500: fix bus-frequency property hardcoded to zero in CPU FDT node
Date: Wed, 22 Apr 2026 21:57:35 +0200 [thread overview]
Message-ID: <20260422195746.88865-38-philmd@linaro.org> (raw)
In-Reply-To: <20260422195746.88865-1-philmd@linaro.org>
From: Vivien LEGER <vivien.leger@gmail.com>
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>
---
hw/ppc/e500.h | 1 +
hw/ppc/e500.c | 2 +-
hw/ppc/e500plat.c | 1 +
hw/ppc/mpc8544ds.c | 1 +
4 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/e500.h b/hw/ppc/e500.h
index 11f8ae53177..6d56c7b4cb2 100644
--- a/hw/ppc/e500.h
+++ b/hw/ppc/e500.h
@@ -40,6 +40,7 @@ struct PPCE500MachineClass {
hwaddr pci_mmio_bus_base;
hwaddr spin_base;
uint32_t clock_freq;
+ uint32_t bus_freq;
uint32_t tb_freq;
};
diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index d6ca2e8563a..5be2f2095f6 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -518,7 +518,7 @@ static int ppce500_load_device_tree(PPCE500MachineState *pms,
env->icache_line_size);
qemu_fdt_setprop_cell(fdt, cpu_name, "d-cache-size", 0x8000);
qemu_fdt_setprop_cell(fdt, cpu_name, "i-cache-size", 0x8000);
- qemu_fdt_setprop_cell(fdt, cpu_name, "bus-frequency", 0);
+ qemu_fdt_setprop_cell(fdt, cpu_name, "bus-frequency", pmc->bus_freq);
if (cpu->cpu_index) {
qemu_fdt_setprop_string(fdt, cpu_name, "status", "disabled");
qemu_fdt_setprop_string(fdt, cpu_name, "enable-method",
diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c
index ca5647284d0..85cec810d9a 100644
--- a/hw/ppc/e500plat.c
+++ b/hw/ppc/e500plat.c
@@ -94,6 +94,7 @@ static void e500plat_machine_class_init(ObjectClass *oc, const void *data)
pmc->pci_mmio_bus_base = 0xE0000000ULL;
pmc->spin_base = 0xFEF000000ULL;
pmc->clock_freq = PLATFORM_CLK_FREQ_HZ;
+ pmc->bus_freq = PLATFORM_CLK_FREQ_HZ;
pmc->tb_freq = PLATFORM_CLK_FREQ_HZ;
mc->desc = "generic paravirt e500 platform";
diff --git a/hw/ppc/mpc8544ds.c b/hw/ppc/mpc8544ds.c
index 6a5d3edc490..a5717a9cde4 100644
--- a/hw/ppc/mpc8544ds.c
+++ b/hw/ppc/mpc8544ds.c
@@ -56,6 +56,7 @@ static void mpc8544ds_machine_class_init(ObjectClass *oc, const void *data)
pmc->pci_pio_base = 0xE1000000ULL;
pmc->spin_base = 0xEF000000ULL;
pmc->clock_freq = PLATFORM_CLK_FREQ_HZ;
+ pmc->bus_freq = PLATFORM_CLK_FREQ_HZ;
pmc->tb_freq = PLATFORM_CLK_FREQ_HZ;
mc->desc = "mpc8544ds";
--
2.53.0
next prev parent reply other threads:[~2026-04-22 20:04 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 19:56 [PULL 00/49] Misc HW patches for 2026-04-22 Philippe Mathieu-Daudé
2026-04-22 19:56 ` [PULL 01/48] hw/avr: Build as common unit files Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 02/48] hw/misc/cpc: Include missing 'hw/core/cpu.h' header Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 03/48] hw/alpha: Include full path to target 'cpu.h' header Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 04/48] hw/arm: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 05/48] hw/avr: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 06/48] hw/hppa: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 07/48] hw/i386: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 08/48] hw/m68k: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 09/48] hw/microblaze: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 10/48] hw/mips: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 11/48] hw/or1k: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 12/48] hw/ppc: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 13/48] hw/riscv: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 14/48] hw/s390x: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 15/48] hw/sh4: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 16/48] hw/sparc: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 17/48] hw/tricore: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 18/48] hw/xtensa: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 19/48] hw/tpm: Factor tpm_ppi_enabled() out Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 20/48] hw/tpm: Add TPMIfClass::ppi_enabled field Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 21/48] hw/tpm: Remove CRBState::ppi_enabled field Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 22/48] hw/tpm: Propagate @ppi_enabled to tpm_tis_reset() and remove in TPMState Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 23/48] hw/tpm: Simplify tpm_ppi_enabled() Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 24/48] hw/ppc/spapr: Un-inline rtas_load/store() helpers Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 25/48] hw/hyperv: Replace legacy ld_phys() -> address_space_ld() Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 26/48] system/memory: Constify various AddressSpace arguments (flatview) Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 27/48] hw/core: Move compat_props_add() to 'hw/core/boards.h' Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 28/48] qom: Declare GlobalProperty structure in 'qom/compat-properties.h' Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 29/48] qom: Declare compat properties API " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 30/48] qom: Restrict compat properties API to system emulation Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 31/48] docs/specs/tpm: document PPI support on ARM64 virt Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 32/48] hw/acpi/tpm: parameterize PPI base address in tpm_build_ppi_acpi Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 33/48] hw/tpm: add PPI support to tpm-tis-device for ARM64 virt Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 34/48] physmem: Simplify dirty memory type checks with loop Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 35/48] hw/arm/smmuv3: Have smmuv3_accel_init() take an Error* parameter Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 36/48] hw/arm/smmuv3: Avoid including CONFIG_DEVICES in hw/ header Philippe Mathieu-Daudé
2026-04-22 19:57 ` Philippe Mathieu-Daudé [this message]
2026-04-22 19:57 ` [PULL 38/48] ati-vga: fix unsigned integer overflow in cursor bounds checks Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 39/48] ati-vga: mask out lock bit from CUR_OFFSET in cursor offset calculation Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 40/48] hw/virtio/virtio-iommu: remove duplicate include Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 41/48] hw/hyperv: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 42/48] hw/ppc/amigaone: " Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 43/48] hw/misc: Fix the valid access size to the avr-power device Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 44/48] hw/sh4/sh7750: Remove forgotten abort() in the MM_ITLB_DATA handler Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 45/48] MAINTAINERS: Remove my unused git tree locations Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 46/48] MAINTAINERS: Remove my disfunctional emails Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 47/48] MAINTAINERS: Remove PhilMD from NVMe Block Driver Philippe Mathieu-Daudé
2026-04-22 19:57 ` [PULL 48/48] MAINTAINERS: Transfer CI maintenance to Pierrick Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260422195746.88865-38-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.