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

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Mon Jul 19 23:20:12 AEST 2021


Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
Signed-off-by: Reza Arbab <arbab at linux.ibm.com>
Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
---
 hw/chiptod.c | 6 ++++++
 1 file changed, 6 insertions(+)

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
-- 
2.31.1



More information about the Skiboot mailing list