From 69b2391ad8854f1103653b8473cd2aad5ddab099 Mon Sep 17 00:00:00 2001 From: Robert Lippert Date: Wed, 4 Oct 2017 16:53:37 -0700 Subject: 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 Change-Id: I2cc7f3054e0d58fa3e2d083005d0f4e05adf8d2f Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/48375 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Tested-by: Jenkins OP HW Reviewed-by: Richard J. Knight Reviewed-by: Daniel M. Crowell --- src/include/usr/ipmi/ipmiif.H | 4 ++++ src/include/usr/ipmi/ipmisel.H | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/usr/ipmi/ipmiif.H b/src/include/usr/ipmi/ipmiif.H index d94e5d4a2..55546d13e 100644 --- a/src/include/usr/ipmi/ipmiif.H +++ b/src/include/usr/ipmi/ipmiif.H @@ -6,6 +6,7 @@ /* OpenPOWER HostBoot Project */ /* */ /* Contributors Listed Below - COPYRIGHT 2012,2017 */ +/* [+] Google Inc. */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -245,6 +246,9 @@ namespace IPMI // Storage messages + inline const command_t get_sel_time(void) + { return std::make_pair(NETFUN_STORAGE, 0x48); } + inline const command_t set_sel_time(void) { return std::make_pair(NETFUN_STORAGE, 0x49); } diff --git a/src/include/usr/ipmi/ipmisel.H b/src/include/usr/ipmi/ipmisel.H index 4509130f4..caf62f6e4 100644 --- a/src/include/usr/ipmi/ipmisel.H +++ b/src/include/usr/ipmi/ipmisel.H @@ -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. */ /* */ /* */ @@ -312,6 +313,12 @@ namespace IPMISEL void send_esel(IPMISEL::eselInitData * i_data, errlHndl_t &o_err, IPMI::completion_code &o_cc); + /** + * @brief read the SEL time + * @return time from unix epoch or 0 on error + */ + uint32_t get_sel_time(); + } // namespace IPMISEL #ifndef __HOSTBOOT_RUNTIME -- cgit v1.2.1