diff mbox series

[61/61] hw/chiptod: Abort if core frequency is not set

Message ID 20210719132012.150948-62-hegdevasant@linux.vnet.ibm.com
State Superseded
Headers show
Series P10 Enablement | expand

Commit Message

Vasant Hegde July 19, 2021, 1:20 p.m. UTC
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hw/chiptod.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/hw/chiptod.c b/hw/chiptod.c
index fd9414990..7c0a1ffc7 100644
--- a/hw/chiptod.c
+++ b/hw/chiptod.c
@@ -499,6 +499,12 @@  static void chiptod_setup_base_tfmr(void)
 		core_freq = dt_prop_get_u64(cpu, "ibm,extended-clock-frequency");
 	else
 		core_freq = dt_prop_get_u32(cpu, "clock-frequency");
+
+	if (!core_freq) {
+		prlog(PR_ERR, "CPU clock frequency is not set\n");
+		abort();
+	}
+
 	tod_freq = 32000000;
 
 	/* Calculate the "Max Cycles Between Steps" value according