[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 7/9] sam460ex.c: use CPU_FREQ if unable to read DT clock
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH 7/9] sam460ex.c: use CPU_FREQ if unable to read DT clock |
Date: |
Thu, 30 Jun 2022 16:42:47 -0300 |
Fallback 'clock_freq' to CPU_FREQ if kvmppc_get_clockfreq() fails to
read the clock from the DT.
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
hw/ppc/sam460ex.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
index 4d25cb2c2e..0b3ce0cb17 100644
--- a/hw/ppc/sam460ex.c
+++ b/hw/ppc/sam460ex.c
@@ -178,8 +178,14 @@ static int sam460ex_load_device_tree(hwaddr addr,
* directly access the timebase without host involvement, we must expose
* the correct frequencies. */
if (kvm_enabled()) {
+ Error *local_err = NULL;
+
tb_freq = kvmppc_get_tbfreq();
- clock_freq = kvmppc_get_clockfreq(NULL);
+ clock_freq = kvmppc_get_clockfreq(&local_err);
+
+ if (local_err) {
+ clock_freq = CPU_FREQ;
+ }
}
qemu_fdt_setprop_cell(fdt, "/cpus/cpu@0", "clock-frequency",
--
2.36.1
- [PATCH 0/9] cleanup error handling in kvmppc_read_int_cpu_dt(), Daniel Henrique Barboza, 2022/06/30
- [PATCH 1/9] target/ppc/kvm.c: do not return -1 on uint64_t return, Daniel Henrique Barboza, 2022/06/30
- [PATCH 4/9] target/ppc: use g_autofree in kvmppc_read_int_cpu_dt(), Daniel Henrique Barboza, 2022/06/30
- [PATCH 2/9] target/ppc: add errp to kvmppc_read_int_cpu_dt(), Daniel Henrique Barboza, 2022/06/30
- [PATCH 9/9] spapr.c: handle clock freq read errors in spapr_dt_cpu(), Daniel Henrique Barboza, 2022/06/30
- [PATCH 6/9] ppc440_bamboo.c: handle clock freq read error in load_device_tree, Daniel Henrique Barboza, 2022/06/30
- [PATCH 3/9] target/ppc: Add error reporting when opening file fails, Daniel Henrique Barboza, 2022/06/30
- [PATCH 5/9] target/ppc: use Error pointer in kvmppc_get_clockfreq(), Daniel Henrique Barboza, 2022/06/30
- [PATCH 7/9] sam460ex.c: use CPU_FREQ if unable to read DT clock,
Daniel Henrique Barboza <=
- [PATCH 8/9] e500.c: use PLATFORM_CLK_FREQ_HZ if unable to read clock freq from DT, Daniel Henrique Barboza, 2022/06/30