aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Smart <chris@distroguy.com>2016-07-21 17:10:48 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-07-22 17:09:52 +1000
commitd9160de47755bf7d4aa6eebcd8a73b827671375b (patch)
treeba8c5c47f4e4de1ff7135aeead868a99d710e976
parent3f3326d6b3afdba8e0fa10525f7152b75e51b7ac (diff)
downloadskiboot-d9160de47755bf7d4aa6eebcd8a73b827671375b.zip
skiboot-d9160de47755bf7d4aa6eebcd8a73b827671375b.tar.gz
skiboot-d9160de47755bf7d4aa6eebcd8a73b827671375b.tar.bz2
core/timer: Add support for platform specific heartbeat
The timer code currently has a default and a special check for FSP machines or those with SLW timer facility. This patch adds support for platform quirk to set the timer. Signed-off-by: Chris Smart <chris@distroguy.com> Acked-by: Michael Neuling <mikey@neuling.org> [stewart@linux.vnet.ibm.com: fix whitespace issue] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--core/timer.c16
-rw-r--r--include/platform.h4
2 files changed, 14 insertions, 6 deletions
diff --git a/core/timer.c b/core/timer.c
index 8bfba4a..210e2a0 100644
--- a/core/timer.c
+++ b/core/timer.c
@@ -245,22 +245,26 @@ void check_timers(bool from_interrupt)
void late_init_timers(void)
{
+ int heartbeat = HEARTBEAT_DEFAULT_MS;
+
/* Add a property requesting the OS to call opal_poll_event() at
* a specified interval in order for us to run our background
* low priority pollers.
*
+ * If a platform quirk exists, use that, else use the default.
+ *
* If we have an SLW timer facility, we run this 10 times slower,
* we could possibly completely get rid of it.
*
* We use a value in milliseconds, we don't want this to ever be
* faster than that.
*/
- if (slw_timer_ok() || fsp_present()) {
- dt_add_property_cells(opal_node, "ibm,heartbeat-ms",
- HEARTBEAT_DEFAULT_MS * 10);
- } else {
- dt_add_property_cells(opal_node, "ibm,heartbeat-ms",
- HEARTBEAT_DEFAULT_MS);
+ if (platform.heartbeat_time) {
+ heartbeat = platform.heartbeat_time();
+ } else if (slw_timer_ok() || fsp_present()) {
+ heartbeat = HEARTBEAT_DEFAULT_MS * 10;
}
+
+ dt_add_property_cells(opal_node, "ibm,heartbeat-ms", heartbeat);
}
#endif
diff --git a/include/platform.h b/include/platform.h
index d07994f..062a941 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -159,6 +159,10 @@ struct platform {
*/
int64_t (*sensor_read)(uint32_t sensor_hndl, int token,
uint32_t *sensor_data);
+ /*
+ * Return the heartbeat time
+ */
+ int (*heartbeat_time)(void);
/*
* OPAL terminate