From a094332bbe8807c8f24aeb79f34be063845cea10 Mon Sep 17 00:00:00 2001 From: Mike Baiocchi Date: Fri, 20 Sep 2013 14:47:15 -0500 Subject: Initial Support for Updating SBE SEEPROM This initial commit will be used to create the new SBE directories and files. It also supports the usr functions to find and copy SBE PNOR images. NOTE: It will not enable Updating SBE SEEPROMs in the IPL. Change-Id: I3f545a134493c7595ce50fd885478bbe606de472 RTC: 47032 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/6311 Tested-by: Jenkins Server Reviewed-by: ADAM R. MUHLE Reviewed-by: Daniel M. Crowell Reviewed-by: A. Patrick Williams III --- src/include/usr/sbe/sbeif.H | 72 +++++++++++++++++++++++++++++ src/include/usr/sbe/sbereasoncodes.H | 88 ++++++++++++++++++++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 src/include/usr/sbe/sbeif.H create mode 100644 src/include/usr/sbe/sbereasoncodes.H (limited to 'src/include/usr/sbe') diff --git a/src/include/usr/sbe/sbeif.H b/src/include/usr/sbe/sbeif.H new file mode 100644 index 000000000..4570aaf85 --- /dev/null +++ b/src/include/usr/sbe/sbeif.H @@ -0,0 +1,72 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/sbe/sbeif.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef _SBEIF_H +#define _SBEIF_H + +#include +#include + +namespace SBE +{ + // Each SBE Image stored in PNOR has a 64-byte version associated with it + // (like a SHA hash of the image) + const size_t SBE_IMAGE_VERSION_SIZE = 64; // 64 bytes + + typedef uint8_t sbe_image_version_t[SBE_IMAGE_VERSION_SIZE]; + + + /** + * @brief Gets a pointer to the proper SBE image in PNOR + * + * @param[in] i_target Target used to find right SBE Image in PNOR + * + * @param[out] o_imgPtr Pointer to SBE Image mapped in PNOR + * Note: Pointer moved past any header(s) + * + * @param[out] o_imgSize Size of the SBE Image in PNOR + * Note: Size does not include any header(s) + * + * @param[out] o_version Pointer to SBE Image Version Struct + * If Pointer is NULL, version not returned; + * Else sbe_image_version_t is filled in + * + * @return errlHndl_t Error log handle on failure. + */ + errlHndl_t findSBEInPnor(TARGETING::Target* i_target, + void*& o_imgPt, + size_t& o_imgSize, + sbe_image_version_t* o_version = NULL); + + + /** + * @brief Iterates through all the functional processors and updates + * the SBE Image in a SEEPROM, if necessary. + * + * @return errlHndl_t Error log handle on failure. + */ + errlHndl_t updateProcessorSbeSeeproms(); + + +} //end namespace SBE + +#endif /* _SBEIF_H */ diff --git a/src/include/usr/sbe/sbereasoncodes.H b/src/include/usr/sbe/sbereasoncodes.H new file mode 100644 index 000000000..44416aa95 --- /dev/null +++ b/src/include/usr/sbe/sbereasoncodes.H @@ -0,0 +1,88 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/include/usr/vpd/vpdreasoncodes.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2013 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ +#ifndef __SBEREASONCODES_H +#define __SBEREASONCODES_H + +// ----------------------------------------------- +// Includes +// ----------------------------------------------- +#include + +namespace SBE +{ + +/** +* @enum SbeModuleid +* +* @brief Module Ids used in created errorlogs. Indicates which +* functions an error log was created in. +* +*/ +enum sbeModuleId +{ + SBE_INVALID_MODULE = 0x00, + SBE_FIND_IN_PNOR = 0x01, + SBE_UPDATE_SEEPROMS = 0x02, + SBE_GETSET_MVPD_VERSION = 0x03, + SBE_READ_PNOR_VERSION = 0x04, + SBE_READ_SBE_FROM_PNOR = 0x05, + SBE_CREATE_TEST_SPACE = 0x06, + SBE_CLEANUP_TEST_SPACE = 0x07, + SBE_GET_TARGET_INFO_STATE = 0x08, + SBE_GET_SEEPROM_INFO = 0x09, +}; + +/** + * @enum sbeReasonCode + * + * @brief Reasoncodes used to describe what errors are being indicated. + * + */ +enum sbeReasonCode +{ + SBE_INVALID_REASONCODE = SBE_COMP_ID | 0x00, // Invalid RC + SBE_ALLOC_BLOCK_FAIL = SBE_COMP_ID | 0x01, + SBE_SET_PERMISSION_FAIL = SBE_COMP_ID | 0x02, + SBE_REMOVE_PAGES_FAIL = SBE_COMP_ID | 0x03, + SBE_REMOVE_PAGES_FOR_EC = SBE_COMP_ID | 0x04, + SBE_REMOVE_PAGES_CLEANUP = SBE_COMP_ID | 0x05, + SBE_UNSUPPORTED_TOC = SBE_COMP_ID | 0x06, + SBE_INVALID_EYECATCHER = SBE_COMP_ID | 0x07, + SBE_EC_NOT_FOUND = SBE_COMP_ID | 0x08, + SBE_XIP_IMG_SIZE_FAIL = SBE_COMP_ID | 0x09, + SBE_MVPD_LEN_INVALID = SBE_COMP_ID | 0x0A, + SBE_VERSION_NOT_FOUND = SBE_COMP_ID | 0x0B, + + // SBE_UPDATE_REQUEST_REIPL Must have one unique use + // for Shutdown path. FSP relies on it. + // termination_rc + SBE_UPDATE_REQUEST_REIPL = SBE_COMP_ID | 0x0C, + + SBE_INVALID_INPUT = SBE_COMP_ID | 0x0D, + SBE_INVALID_SEEPROM_SIDE = SBE_COMP_ID | 0x0E, + SBE_ECC_FAIL = SBE_COMP_ID | 0x0F, +}; + +}; // end SBE + +#endif -- cgit v1.2.3