summaryrefslogtreecommitdiffstats
path: root/src/usr/ipmi/ipmisel.C
diff options
context:
space:
mode:
authorRobert Lippert <rlippert@google.com>2017-10-04 16:53:37 -0700
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-10-30 23:42:26 -0400
commit69b2391ad8854f1103653b8473cd2aad5ddab099 (patch)
treeb81cb1e1ab05f9cbf9190072a373f5433a48b9ac /src/usr/ipmi/ipmisel.C
parent20b179f938d42961ad31b4660c86717a02f06739 (diff)
downloadtalos-hostboot-69b2391ad8854f1103653b8473cd2aad5ddab099.tar.gz
talos-hostboot-69b2391ad8854f1103653b8473cd2aad5ddab099.zip
ipmi: add support for reading SEL time from BMC
The SEL time is used as the equivalent of the RTC on OpenPOWER platforms and can be used to timestamp events. Resolves #116 Signed-off-by: Robert Lippert <rlippert@google.com> Change-Id: I2cc7f3054e0d58fa3e2d083005d0f4e05adf8d2f Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48375 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Richard J. Knight <rjknight@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/ipmi/ipmisel.C')
-rw-r--r--src/usr/ipmi/ipmisel.C23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/usr/ipmi/ipmisel.C b/src/usr/ipmi/ipmisel.C
index 5d2d6afce..de7feec18 100644
--- a/src/usr/ipmi/ipmisel.C
+++ b/src/usr/ipmi/ipmisel.C
@@ -5,7 +5,8 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2016 */
+/* Contributors Listed Below - COPYRIGHT 2014,2017 */
+/* [+] Google Inc. */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -468,6 +469,26 @@ void send_esel(eselInitData * i_data,
return;
} // send_esel
+uint32_t get_sel_time()
+{
+ uint8_t *data = NULL;
+ size_t len = 0;
+ errlHndl_t l_err;
+ IPMI::completion_code l_cc = IPMI::CC_UNKBAD;
+
+ l_err = IPMI::sendrecv( IPMI::get_sel_time(), l_cc, len, data );
+ if( l_err || l_cc != IPMI::CC_OK || len != sizeof(uint32_t) )
+ {
+ delete l_err;
+ delete [] data;
+ return 0;
+ }
+
+ uint32_t timet = le32toh(*reinterpret_cast<uint32_t*>(data));
+ delete [] data;
+ return timet;
+}
+
} // IPMISEL
#ifndef __HOSTBOOT_RUNTIME
OpenPOWER on IntegriCloud