summaryrefslogtreecommitdiffstats
path: root/src/occ_gpe0
diff options
context:
space:
mode:
authorWilliam Bryan <wilbryan@us.ibm.com>2017-07-21 12:35:45 -0500
committerWilliam A. Bryan <wilbryan@us.ibm.com>2017-07-21 17:07:27 -0400
commitcf1a6cc0ab4e6b5203129925b1e9bb38cd0ae9aa (patch)
treecf649f181f92cea7856642b962e94eafe549893e /src/occ_gpe0
parentcbedccff001c94de84fdc01d1ea8a38a8264598e (diff)
downloadtalos-occ-cf1a6cc0ab4e6b5203129925b1e9bb38cd0ae9aa.tar.gz
talos-occ-cf1a6cc0ab4e6b5203129925b1e9bb38cd0ae9aa.zip
busy_wait fix
Change-Id: If6c3ef7ca8a0cdb9331b95c8b37e45f092879a58 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43442 Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: William A. Bryan <wilbryan@us.ibm.com>
Diffstat (limited to 'src/occ_gpe0')
-rw-r--r--src/occ_gpe0/gpe_util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/occ_gpe0/gpe_util.c b/src/occ_gpe0/gpe_util.c
index b2540de..61ee5e9 100644
--- a/src/occ_gpe0/gpe_util.c
+++ b/src/occ_gpe0/gpe_util.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -151,8 +151,9 @@ void busy_wait(uint32_t i_microseconds)
MFDEC(start_decrementer_value); // get the decrementer register value at the beginning
current_decrementer_value = start_decrementer_value;
- // multiply the delay time by the external clock frequency.
- duration = i_microseconds * (G_gpe_shared_data->nest_freq_div / 1000000);
+ // multiply the delay time by the external clock frequency (~37.5 MHz)
+ duration = (i_microseconds * 37);
+ duration += (i_microseconds >> 1);
// Calculate the decrementer register value at the end of the busy wait period
end_decrementer_value = start_decrementer_value - duration;
OpenPOWER on IntegriCloud