diff options
author | Mike Baiocchi <mbaiocch@us.ibm.com> | 2018-05-18 15:48:24 -0500 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2018-05-24 09:33:07 -0400 |
commit | a1e236a422182e81f7877de85f3cb46dff6fc0cd (patch) | |
tree | 93f5eff5e3a8df10c7ad3cdb137f2afd320f7e43 /src/usr/secureboot/common/errlud_secure.C | |
parent | 3ad299af08fd1ed6a14c72a9d3fe4b89a5af5eec (diff) | |
download | talos-hostboot-a1e236a422182e81f7877de85f3cb46dff6fc0cd.tar.gz talos-hostboot-a1e236a422182e81f7877de85f3cb46dff6fc0cd.zip |
Improve FFDC for new Node Comm Device Driver
This commit adds a new custom Node Comm Device Driver error log
user details section and its parser code. It also adds a function
to add the target and important HW registers to an error log.
Change-Id: I11893af06b7a097b43106117d648e9a431c4f3ea
RTC:191008
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/59079
Reviewed-by: ILYA SMIRNOV <ismirno@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Diffstat (limited to 'src/usr/secureboot/common/errlud_secure.C')
-rw-r--r-- | src/usr/secureboot/common/errlud_secure.C | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/src/usr/secureboot/common/errlud_secure.C b/src/usr/secureboot/common/errlud_secure.C index a6b9b3d1d..c40172609 100644 --- a/src/usr/secureboot/common/errlud_secure.C +++ b/src/usr/secureboot/common/errlud_secure.C @@ -34,6 +34,8 @@ #include <securerom/ROM.H> #include <errl/errlentry.H> #include <errl/errlmanager.H> +#include <devicefw/driverif.H> +#include <secureboot/nodecommif.H> namespace SECUREBOOT { @@ -43,6 +45,7 @@ namespace SECUREBOOT //------------------------------------------------------------------------------ enum { PARSER_SIZEOF_SHA512_t = 64, + PARSER_SIZEOF_UINT64_t = 8, PARSER_SIZEOF_UINT32_t = 4, PARSER_SIZEOF_UINT8_t = 1, PARSER_SIZEOF_TARGET_HKH_SECTION = 69, @@ -219,5 +222,78 @@ UdVerifyInfo::UdVerifyInfo(const char* i_compId, l_pBuf+=PARSER_SIZEOF_SHA512_t; } + +//------------------------------------------------------------------------------ +// SECURE Node Communications Info User Details +//------------------------------------------------------------------------------ +UdNodeCommInfo::UdNodeCommInfo(const uint8_t i_opType, + const uint64_t i_buflen, + const int64_t i_accessType, + const NODECOMM::node_comm_args_t i_args ) + +{ + // Set up Ud instance variables + iv_CompId = SECURE_COMP_ID; + iv_Version = SECURE_UDT_VERSION_1; + iv_SubSection = SECURE_UDT_NODECOMM_INFO; + + //***** Node Comm SECURE_UDT_VERSION_1 Memory Layout ***** + // 4 bytes : Target HUID + // 8 bytes : Length of In/Out Buffer + // 8 bytes : Access Type (DeviceFW::AccessType) + // 1 byte : Op Type (DeviceFW::OperationType) + // 1 byte : Mode (XBUS or ABUS) + // 1 byte : LinkId + // 1 byte : MboxId + + static_assert(sizeof(uint64_t)==PARSER_SIZEOF_UINT64_t, + "Expected sizeof(uint64_t) is 8"); + + // These are necessary to keep the parsing in errludP_secure.H correct + static_assert(DeviceFW::READ==0, "Expected opType READ == 0"); + static_assert(DeviceFW::WRITE==1, "Expected opType WRITE == 1"); + static_assert(SECUREBOOT::NODECOMM::NCDD_MODE_XBUS==0, + "Expected NCDD_MODE_XBUS==0"); + static_assert(SECUREBOOT::NODECOMM::NCDD_MODE_ABUS==1, + "Expected NCDD_MODE_ABUS==1"); + + char * l_pBuf = reinterpret_cast<char *>( + reallocUsrBuf(sizeof(uint32_t) + +sizeof(uint64_t)*2 + +sizeof(uint8_t)*4 ) ); + uint64_t tmp64 = 0; + uint32_t tmp32 = 0; + uint8_t tmp8 = 0; + + tmp32 = i_args.tgt_huid; + memcpy(l_pBuf, &tmp32, sizeof(tmp32)); + l_pBuf += sizeof(tmp32); + + tmp64 = i_buflen; + memcpy(l_pBuf, &tmp64, sizeof(tmp64)); + l_pBuf += sizeof(tmp64); + + tmp64 = i_accessType; + memcpy(l_pBuf, &tmp64, sizeof(tmp64)); + l_pBuf += sizeof(tmp64); + + tmp8 = i_opType; + memcpy(l_pBuf, &tmp8, sizeof(tmp8)); + l_pBuf += sizeof(tmp8); + + tmp8 = i_args.mode; + memcpy(l_pBuf, &tmp8, sizeof(tmp8)); + l_pBuf += sizeof(tmp8); + + tmp8 = i_args.linkId; + memcpy(l_pBuf, &tmp8, sizeof(tmp8)); + l_pBuf += sizeof(tmp8); + + tmp8 = i_args.mboxId; + memcpy(l_pBuf, &tmp8, sizeof(tmp8)); + l_pBuf += sizeof(tmp8); + +}; + } // end SECUREBOOT namespace |