diff options
author | Marty Gloff <mgloff@us.ibm.com> | 2016-11-10 11:17:03 -0600 |
---|---|---|
committer | William G. Hoffa <wghoffa@us.ibm.com> | 2016-12-02 17:20:24 -0500 |
commit | 3782e264d06a4e546fe2298bbd1d53e2de38d062 (patch) | |
tree | 8f757168337f5b577a1d9131e6a2feeed4c76de8 | |
parent | 443df5a65730e3732f04c6e8ff86b367b1ca1aea (diff) | |
download | talos-hostboot-3782e264d06a4e546fe2298bbd1d53e2de38d062.tar.gz talos-hostboot-3782e264d06a4e546fe2298bbd1d53e2de38d062.zip |
SBE Update fixes and patches for Bring-up
Set NO_SBE_UPDATE in fsprelease.config.
Patch eepromdd.C to make write cycle time a minimum of 10 msec.
Find .hbbl section before attempting to append new HBBL to SBE image and
delete it if it already exists.
Use malloc rather than stack space for ring section buffer.
Fix i_maxImgSize value passed to procCustomizeSbeImg.
Fix SBE_ECC_IMG_MAX_SIZE calculation to include pad bytes.
Change-Id: I632e17851830acb1b365abc92438b0356232487c
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32487
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Matt Derksen <v2cibmd@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
Tested-by: William G. Hoffa <wghoffa@us.ibm.com>
-rw-r--r-- | src/build/configs/fsprelease.config | 1 | ||||
-rwxr-xr-x | src/usr/i2c/eepromdd.C | 5 | ||||
-rw-r--r-- | src/usr/sbe/sbe_update.C | 85 | ||||
-rw-r--r-- | src/usr/sbe/sbe_update.H | 3 |
4 files changed, 82 insertions, 12 deletions
diff --git a/src/build/configs/fsprelease.config b/src/build/configs/fsprelease.config index bcb33b116..899d5f719 100644 --- a/src/build/configs/fsprelease.config +++ b/src/build/configs/fsprelease.config @@ -26,3 +26,4 @@ config ENABLE_HDAT_IN_HOSTBOOT Enable Initialization of Hypervisor Memory Space +set NO_SBE_UPDATES diff --git a/src/usr/i2c/eepromdd.C b/src/usr/i2c/eepromdd.C index 5fb418ba4..993a56203 100755 --- a/src/usr/i2c/eepromdd.C +++ b/src/usr/i2c/eepromdd.C @@ -1589,6 +1589,11 @@ errlHndl_t eepromReadAttributes ( TARGETING::Target * i_target, o_i2cInfo.devSize_KB = eepromData.maxMemorySizeKB; o_i2cInfo.chipCount = eepromData.chipCount; o_i2cInfo.writeCycleTime = eepromData.writeCycleTime; + // @TODO RTC:164392 Adjust until MRW is corrected CMVC 1010449/SW371374 + if (o_i2cInfo.writeCycleTime < 10) + { + o_i2cInfo.writeCycleTime = 10; + } // Convert attribute info to eeprom_addr_size_t enum if ( eepromData.byteAddrOffset == 0x3 ) diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C index 221af2629..06863889c 100644 --- a/src/usr/sbe/sbe_update.C +++ b/src/usr/sbe/sbe_update.C @@ -57,6 +57,7 @@ // fapi support #include <fapi2.H> #include <fapi2/plat_hwp_invoker.H> +#include <fapi2/hwp_executor.H> //Procedures #include <p9_xip_customize.H> @@ -838,8 +839,9 @@ namespace SBE uint32_t& io_image_size) { errlHndl_t err = NULL; + P9XipItem l_xipItem; - TRACUCOMP( g_trac_sbe, + TRACFCOMP( g_trac_sbe, ENTER_MRK"appendHbblToSbe(): i_section=%p, " "i_section_size=0x%X, i_image=%p, " "io_image_size=0x%X", @@ -847,6 +849,66 @@ namespace SBE i_image, io_image_size); do{ + // Invoke p9_xip_find to find HBBL image in SBE image + fapi2::ReturnCode l_fapi_rc; + const char* l_sectionId = ".hbbl"; + FAPI_EXEC_HWP( l_fapi_rc, + p9_xip_find, + i_image, + l_sectionId, + &l_xipItem ); + + // Check the return code + if(l_fapi_rc.isRC(P9_XIP_ITEM_NOT_FOUND)) + { + TRACUCOMP( g_trac_sbe, "appendHbblToSbe(): " + "p9_xip_find received expected return code, item " + "not found, rc=0x%X", + l_fapi_rc ); + } + else if(l_fapi_rc.isRC(0) || + l_fapi_rc.isRC(P9_XIP_DATA_NOT_PRESENT)) + { + TRACFCOMP( g_trac_sbe, "appendHbblToSbe(): " + "p9_xip_find located %s, rc=0x%X", + (l_fapi_rc) ? "TOC only" : "TOC and section data", + int(l_fapi_rc) ); + + // Invoke p9_xip_delete_section to delete existing HBBL image + // from SBE image + void *l_imageBuf = malloc(io_image_size); + FAPI_INVOKE_HWP( err, + p9_xip_delete_section, + i_image, + l_imageBuf, + io_image_size, + P9_XIP_SECTION_SBE_HBBL ); + free(l_imageBuf); + + // Check for error + if(err) + { + TRACFCOMP( g_trac_sbe, "appendHbblToSbe(): " + "p9_xip_delete_section failed, rc=0x%X", + err->reasonCode() ); + + // exit loop + break; + } + } + else + { + TRACFCOMP( g_trac_sbe, "appendHbblToSbe(): p9_xip_find " + "received unexpected return code, rc=0x%X", + int(l_fapi_rc) ); + err = fapi2::rcToErrl(l_fapi_rc);\ + err->collectTrace(FAPI_IMP_TRACE_NAME,256); + err->collectTrace(FAPI_TRACE_NAME,384); + + // exit loop + break; + } + // Invoke p9_xip_section_append to append HBBL image to SBE image FAPI_INVOKE_HWP( err, p9_xip_section_append, @@ -859,7 +921,7 @@ namespace SBE // Check for error if(err) { - TRACUCOMP( g_trac_sbe, "appendHbblToSbe(): " + TRACFCOMP( g_trac_sbe, "appendHbblToSbe(): " "p9_xip_section_append failed, rc=0x%X", err->reasonCode() ); @@ -932,7 +994,7 @@ namespace SBE if ( l_err ) { TRACFCOMP( g_trac_sbe, - ERR_MRK"ringOvd(): FAPI_EXEC_HWP(" + ERR_MRK"ringOvd(): FAPI_INVOKE_HWP(" "p9_xip_section_append) failed, PLID=0x%x", l_err->plid()); @@ -1018,14 +1080,14 @@ namespace SBE procIOMask = coreMask; - uint8_t l_ringSectionBuf[MAX_SEEPROM_IMAGE_SIZE]; uint32_t l_ringSectionBufSize = MAX_SEEPROM_IMAGE_SIZE; + void* l_ringSectionBuf = malloc(l_ringSectionBufSize); FAPI_INVOKE_HWP( err, p9_xip_customize, l_fapiTarg, io_imgPtr, //image in/out tmpImgSize, - (void*)l_ringSectionBuf, + l_ringSectionBuf, l_ringSectionBufSize, SYSPHASE_HB_SBE, MODEBUILD_IPL, @@ -1034,9 +1096,10 @@ namespace SBE (void*)RING_BUF2_VADDR, (uint32_t)MAX_RING_BUF_SIZE, procIOMask ); // Bits(8:31) = EC00:EC23 + free(l_ringSectionBuf); - // Check for no error - if ( NULL == err ) + // Check for no error and use of input cores + if ( (NULL == err) && (procIOMask == coreMask)) { // Check if we have a valid ring override section and // append it in if so @@ -1084,7 +1147,7 @@ namespace SBE // a different procIOMask would work TRACFCOMP( g_trac_sbe, - ERR_MRK"procCustomizeSbeImg(): FAPI_EXEC_HWP(" + ERR_MRK"procCustomizeSbeImg(): FAPI_INVOKE_HWP(" "p9_xip_customize) returned rc=0x%X, " "XIPC_IMAGE_WOULD_OVERFLOW-Retry " "MaxCores=0x%.8X. HUID=0x%X. coreMask=0x%.8X, " @@ -1133,7 +1196,7 @@ namespace SBE { // Unexpected return code - create err and fail TRACFCOMP( g_trac_sbe, - ERR_MRK"procCustomizeSbeImg(): FAPI_EXEC_HWP(" + ERR_MRK"procCustomizeSbeImg(): FAPI_INVOKE_HWP(" "p9_xip_customize) failed with rc=0x%X, " "MaxCores=0x%X. HUID=0x%X. coreMask=0x%.8X, " "procIOMask=0x%.8X. coreCount=%d. Create " @@ -1805,7 +1868,7 @@ namespace SBE { err = procCustomizeSbeImg(io_sbeState.target, sbeHbblImgPtr, //SBE, HBBL in memory - FIXED_SEEPROM_WORK_SPACE, //max size + MAX_SEEPROM_IMAGE_SIZE, //max size reinterpret_cast<void*> (SBE_IMG_VADDR), //destination sbeImgSize); @@ -1829,7 +1892,7 @@ namespace SBE TRACUCOMP( g_trac_sbe, "getSbeInfoState() - procCustomizeSbeImg(): " "maxSize=0x%X, actSize=0x%X, crc=0x%X", - FIXED_SEEPROM_WORK_SPACE, sbeImgSize, + MAX_SEEPROM_IMAGE_SIZE, sbeImgSize, io_sbeState.customizedImage_crc); diff --git a/src/usr/sbe/sbe_update.H b/src/usr/sbe/sbe_update.H index 0a8a1b820..8f2f27912 100644 --- a/src/usr/sbe/sbe_update.H +++ b/src/usr/sbe/sbe_update.H @@ -145,7 +145,8 @@ namespace SBE //NOTE: recycling the same memory space for different //steps in the process. SBE_ECC_IMG_VADDR = VMM_VADDR_SBE_UPDATE + (VMM_SBE_UPDATE_SIZE / 2), - SBE_ECC_IMG_MAX_SIZE = (MAX_SEEPROM_IMAGE_SIZE * 9 / 8), + SBE_ECC_IMG_MAX_SIZE = (MAX_SEEPROM_IMAGE_SIZE * 9 / 8) + + (3 * SBE_SEEPROM_ECC_PAD), }; // Used for MVPD function |