diff options
author | Doug Gilbert <dgilbert@us.ibm.com> | 2016-06-08 11:18:28 -0500 |
---|---|---|
committer | Sachin Gupta <sgupta2m@in.ibm.com> | 2016-08-16 11:57:23 -0400 |
commit | 1f436b44b0c58881a31f9af999c3bee5b12e1d8d (patch) | |
tree | 6e1315e22c5aa9277470b9851017c71756948315 /import | |
parent | dca84fd1d7bed769373abd717b070e1d30ab44bf (diff) | |
download | talos-sbe-1f436b44b0c58881a31f9af999c3bee5b12e1d8d.tar.gz talos-sbe-1f436b44b0c58881a31f9af999c3bee5b12e1d8d.zip |
PK API for timebase reference update (SBE)
Change-Id: I1fe9813707b72873cc2fad146c6d64b96c1b25ee
RTC:154506
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/25516
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Reviewed-by: Gregory S. Still <stillgs@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/28288
Diffstat (limited to 'import')
-rw-r--r-- | import/chips/p9/procedures/ppe/pk/kernel/pk_api.h | 15 | ||||
-rw-r--r-- | import/chips/p9/procedures/ppe/pk/kernel/pk_init.c | 23 |
2 files changed, 32 insertions, 6 deletions
diff --git a/import/chips/p9/procedures/ppe/pk/kernel/pk_api.h b/import/chips/p9/procedures/ppe/pk/kernel/pk_api.h index 8d863562..dab66e0f 100644 --- a/import/chips/p9/procedures/ppe/pk/kernel/pk_api.h +++ b/import/chips/p9/procedures/ppe/pk/kernel/pk_api.h @@ -469,10 +469,10 @@ extern uint32_t __pk_timebase_frequency_hz; extern uint8_t __pk_timebase_rshift; /// The timebase frequency in KHz -extern uint32_t __pk_timebase_frequency_khz; +extern uint32_t __pk_timebase_frequency_khz; //never set or used. Delete? /// The timebase frequency in Mhz -extern uint32_t __pk_timebase_frequency_mhz; +extern uint32_t __pk_timebase_frequency_mhz; //never set or used. Delete? typedef unsigned long int PkAddress; @@ -702,6 +702,17 @@ pk_initialize(PkAddress kernel_stack, PkTimebase initial_timebase, uint32_t timebase_frequency_hz); +/** + * Set the timebase frequency. + * @param[in] The frequency in HZ + * @return PK_OK + * @pre pk_initialize + * @Note This interface is intended for SBE. The timebase frequency value is + * used by PK to calcate timed events. Any existing timeouts, + * sleeps, or time based pending semaphores are not recalculated. + */ +int +pk_timebase_freq_set(uint32_t timebase_frequency_hz); // Timebase APIs diff --git a/import/chips/p9/procedures/ppe/pk/kernel/pk_init.c b/import/chips/p9/procedures/ppe/pk/kernel/pk_init.c index 79669552..056bf270 100644 --- a/import/chips/p9/procedures/ppe/pk/kernel/pk_init.c +++ b/import/chips/p9/procedures/ppe/pk/kernel/pk_init.c @@ -130,6 +130,10 @@ pk_initialize(PkAddress kernel_stack, __pk_thread_machine_context_default = PK_THREAD_MACHINE_CONTEXT_DEFAULT; + //set the shift adjustment to get us closer to the true + //timebase frequency (versus what was hardcoded) + pk_set_timebase_rshift(timebase_frequency_hz); + rc = __pk_stack_init(&kernel_stack, &kernel_stack_size); if (rc) @@ -156,10 +160,6 @@ pk_initialize(PkAddress kernel_stack, //set the trace timebase HZ g_pk_trace_buf.hz = timebase_frequency_hz; - //set the shift adjustment to get us closer to the true - //timebase frequency (versus what was hardcoded) - pk_set_timebase_rshift(timebase_frequency_hz); - if(initial_timebase != PK_TIMEBASE_CONTINUES) { //set the timebase ajdustment for trace synchronization @@ -200,6 +200,21 @@ pk_initialize(PkAddress kernel_stack, } +// Set the timebase frequency. +int +pk_timebase_freq_set(uint32_t timebase_frequency_hz) +{ + __pk_timebase_frequency_hz = timebase_frequency_hz; + pk_set_timebase_rshift(timebase_frequency_hz); + +#if PK_TRACE_SUPPORT + g_pk_trace_buf.hz = timebase_frequency_hz; +#endif + // Does the initial_timebase need to be reset? + return PK_OK; +} + + /// Call the application main() /// /// __pk_main() is called from the bootloader. It's only purpose is to |