summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspashabk-in <shakeebbk@in.ibm.com>2018-01-14 23:41:54 -0600
committerSachin Gupta <sgupta2m@in.ibm.com>2018-01-22 03:32:56 -0500
commit3f49215b05faad977abce306fc607f06c1d8c528 (patch)
treebec19a8948a5baefe9506545370eed25caa33d0c
parent93aa36ba8134af8a1d7ccd16bb6b6f85644c9219 (diff)
downloadtalos-sbe-3f49215b05faad977abce306fc607f06c1d8c528.tar.gz
talos-sbe-3f49215b05faad977abce306fc607f06c1d8c528.zip
Update timer chipop support
Send response on PSU chipops everytime Increase resolution of timer to us Implement support for update timer Change-Id: I497265010d346fc65d14680e356473c019864194 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/51933 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: RAJA DAS <rajadas2@in.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
-rw-r--r--src/sbefw/core/sbeHostUtils.C39
-rw-r--r--src/sbefw/core/sbeTimerSvc.C5
-rw-r--r--src/sbefw/core/sbeTimerSvc.H5
-rw-r--r--src/sbefw/core/sbecmdCntrlTimer.C14
-rw-r--r--src/sbefw/core/sbecmdcntrldmt.C5
-rw-r--r--src/test/testcases/testExecutorCntrlTimer.py7
-rw-r--r--src/test/testcases/testExecutorStopTimer.py9
7 files changed, 50 insertions, 34 deletions
diff --git a/src/sbefw/core/sbeHostUtils.C b/src/sbefw/core/sbeHostUtils.C
index ea0605a3..eb2990f1 100644
--- a/src/sbefw/core/sbeHostUtils.C
+++ b/src/sbefw/core/sbeHostUtils.C
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -150,28 +151,28 @@ uint32_t sbeWriteSbe2PsuMbxReg (uint32_t i_addr,
assert( (SBE_HOST_PSU_MBOX_REG4 <= i_addr) &&
(SBE_HOST_PSU_MBOX_REG7 >= (i_addr + i_count - 1)) )
- if( SBE_GLOBAL->sbePsu2SbeCmdReqHdr.flags & SBE_PSU_FLAGS_RESP_REQUIRED )
+ while (l_count < i_count)
{
- while (l_count < i_count)
- {
- SBE_DEBUG(SBE_FUNC"l_data=[0x%08X%08X]",
- SBE::higher32BWord(*(i_pData+l_count)),
- SBE::lower32BWord(*(i_pData+l_count)));
+ SBE_DEBUG(SBE_FUNC"l_data=[0x%08X%08X]",
+ SBE::higher32BWord(*(i_pData+l_count)),
+ SBE::lower32BWord(*(i_pData+l_count)));
- l_rc = putscom_abs ( i_addr, *(i_pData+l_count) );
- if (l_rc)
- {
- // Error while reading from PSU->SBE mbx register
- SBE_ERROR(SBE_FUNC"putscom_abs failed,"
- "l_rc=[0x%08X], i_addr=[0x%08X]",
- l_rc, i_addr);
- break;
- }
-
- ++l_count;
- ++i_addr;
+ l_rc = putscom_abs ( i_addr, *(i_pData+l_count) );
+ if (l_rc)
+ {
+ // Error while reading from PSU->SBE mbx register
+ SBE_ERROR(SBE_FUNC"putscom_abs failed,"
+ "l_rc=[0x%08X], i_addr=[0x%08X]",
+ l_rc, i_addr);
+ break;
}
+ ++l_count;
+ ++i_addr;
+ }
+
+ if( SBE_GLOBAL->sbePsu2SbeCmdReqHdr.flags & SBE_PSU_FLAGS_RESP_REQUIRED )
+ {
if( (i_setBit0ToIntrHB) && (SBE_SEC_OPERATION_SUCCESSFUL == l_rc) )
{
// indicate the Host via Bit SBE_SBE2PSU_DOORBELL_SET_BIT0
diff --git a/src/sbefw/core/sbeTimerSvc.C b/src/sbefw/core/sbeTimerSvc.C
index eea43b17..8983df1e 100644
--- a/src/sbefw/core/sbeTimerSvc.C
+++ b/src/sbefw/core/sbeTimerSvc.C
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -59,7 +60,7 @@ uint32_t timerService::startTimer(uint32_t i_time, PkTimerCallback i_callBack )
}
// Schedule the timer
l_pkRc = pk_timer_schedule(&fixedTimer,
- PK_MILLISECONDS((uint32_t)i_time));
+ PK_MICROSECONDS((uint32_t)i_time));
if(l_pkRc)
{
SBE_ERROR(SBE_FUNC" Pk Timer Schedule failed, RC=[%d]", l_pkRc);
diff --git a/src/sbefw/core/sbeTimerSvc.H b/src/sbefw/core/sbeTimerSvc.H
index 39ac046d..ed57b361 100644
--- a/src/sbefw/core/sbeTimerSvc.H
+++ b/src/sbefw/core/sbeTimerSvc.H
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -42,7 +43,7 @@ struct timerService
/**
* @brief start timer
*
- * @param[in] i_time time in ms
+ * @param[in] i_time time in us
* @param[in] i_callBack callback function on timer expiry
*
* @return error code as per sbe secondary errors
diff --git a/src/sbefw/core/sbecmdCntrlTimer.C b/src/sbefw/core/sbecmdCntrlTimer.C
index e24698ae..d2921b7c 100644
--- a/src/sbefw/core/sbecmdCntrlTimer.C
+++ b/src/sbefw/core/sbecmdCntrlTimer.C
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -91,9 +92,18 @@ uint32_t sbeCntrlTimer( uint8_t *i_pArg )
break;
}
- SBE_INFO(SBE_FUNC "Start Timer. Time: [%08X]",
+ SBE_INFO(SBE_FUNC "Start Timer. Time: [%08X]us",
SBE::lower32BWord(time));
+ l_rc = g_hostTimerSvc.stopTimer( );
+ if(SBE_SEC_OPERATION_SUCCESSFUL != l_rc)
+ {
+ SBE_GLOBAL->sbeSbe2PsuRespHdr.setStatus(SBE_PRI_INTERNAL_ERROR, l_rc);
+ SBE_ERROR(SBE_FUNC" g_hostTimerSvc.stopTimer failed");
+ l_rc = SBE_SEC_OPERATION_SUCCESSFUL;
+ break;
+ }
+
l_rc = g_hostTimerSvc.startTimer( (uint32_t )time,
(PkTimerCallback)&sbeTimerExpiryCallback);
if(SBE_SEC_OPERATION_SUCCESSFUL != l_rc)
diff --git a/src/sbefw/core/sbecmdcntrldmt.C b/src/sbefw/core/sbecmdcntrldmt.C
index 4fac1d59..6b3ea511 100644
--- a/src/sbefw/core/sbecmdcntrldmt.C
+++ b/src/sbefw/core/sbecmdcntrldmt.C
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016,2017 */
+/* Contributors Listed Below - COPYRIGHT 2016,2018 */
+/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
@@ -139,7 +140,7 @@ uint32_t sbeStartCntlDmt()
break;
}
- l_rc = g_sbe_pk_dmt_timer.startTimer( (uint32_t )l_timerVal,
+ l_rc = g_sbe_pk_dmt_timer.startTimer( (uint32_t )l_timerVal*1000,
(PkTimerCallback)&sbeDmtPkExpiryCallback);
if(SBE_SEC_OPERATION_SUCCESSFUL != l_rc)
{
diff --git a/src/test/testcases/testExecutorCntrlTimer.py b/src/test/testcases/testExecutorCntrlTimer.py
index 9bdd68c3..fae474d7 100644
--- a/src/test/testcases/testExecutorCntrlTimer.py
+++ b/src/test/testcases/testExecutorCntrlTimer.py
@@ -6,7 +6,8 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2016,2017
+# Contributors Listed Below - COPYRIGHT 2016,2018
+# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,7 +35,7 @@ This data are the values or strings that needs to be validated for the test.
'''
'''
#------------------------------------------------------------------------------------------------------------------------------
-# SBE side test data - 20 ms timer
+# SBE side test data - 32000us timer
#------------------------------------------------------------------------------------------------------------------------------
'''
sbe_test_startTimer = (
@@ -42,7 +43,7 @@ sbe_test_startTimer = (
# OP Reg ValueToWrite size Test Expected Data Description
#-----------------------------------------------------------------------------------------------------
["write", reg.REG_MBOX0, "0000010100F0D401", 8, "None", "Writing to MBOX0 address"],
- ["write", reg.REG_MBOX1, "0000000000000020", 8, "None", "Writing to MBOX1 address"],
+ ["write", reg.REG_MBOX1, "0000000000007D00", 8, "None", "Writing to MBOX1 address"],
["write", reg.PSU_SBE_DOORBELL_REG_WO_OR, "8000000000000000", 8, "None", "Update SBE Doorbell register to interrupt SBE"],
)
'''
diff --git a/src/test/testcases/testExecutorStopTimer.py b/src/test/testcases/testExecutorStopTimer.py
index 6305d443..9d0b1384 100644
--- a/src/test/testcases/testExecutorStopTimer.py
+++ b/src/test/testcases/testExecutorStopTimer.py
@@ -6,7 +6,8 @@
#
# OpenPOWER sbe Project
#
-# Contributors Listed Below - COPYRIGHT 2016,2017
+# Contributors Listed Below - COPYRIGHT 2016,2018
+# [+] International Business Machines Corp.
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,7 +35,7 @@ This data are the values or strings that needs to be validated for the test.
'''
'''
#------------------------------------------------------------------------------------------------------------------------------
-# SBE side test data - 200 ms timer
+# SBE side test data - 512000us timer
#------------------------------------------------------------------------------------------------------------------------------
'''
sbe_test_startTimer = (
@@ -42,7 +43,7 @@ sbe_test_startTimer = (
# OP Reg ValueToWrite size Test Expected Data Description
#-----------------------------------------------------------------------------------------------------
["write", reg.REG_MBOX0, "0000010100F0D401", 8, "None", "Writing to MBOX0 address"],
- ["write", reg.REG_MBOX1, "0000000000000200", 8, "None", "Writing to MBOX1 address"],
+ ["write", reg.REG_MBOX1, "000000000007D000", 8, "None", "Writing to MBOX1 address"],
["write", reg.PSU_SBE_DOORBELL_REG_WO_OR, "8000000000000000", 8, "None", "Update SBE Doorbell register to interrupt SBE"],
)
'''
@@ -129,7 +130,7 @@ def main():
regObj.pollingOn( testPSUUtil.simSbeObj, timer_polling_data, 20 )
except:
isTimerFired = False
-
+
if isTimerFired:
print "\n Problem. Timer not cancelled\n"
raise Exception('Timer Not cancelled ');
OpenPOWER on IntegriCloud