summaryrefslogtreecommitdiffstats
path: root/src/usr/sbe
diff options
context:
space:
mode:
authorClaus Michael Olsen <cmolsen@us.ibm.com>2017-05-16 15:16:00 -0500
committerDean Sanner <dsanner@us.ibm.com>2017-07-14 08:28:11 -0400
commit609e5f15df6d123ec762c3174013d1a3ec953146 (patch)
treeaeecacdff2b5c8374ed9aaec566641c889644c32 /src/usr/sbe
parent1e7e41d6f38c44956764e2871d8f0a85df28b4be (diff)
downloadtalos-hostboot-609e5f15df6d123ec762c3174013d1a3ec953146.tar.gz
talos-hostboot-609e5f15df6d123ec762c3174013d1a3ec953146.zip
xip_customize: GPTR/overlays stage 1 support
Updated to poll Nimbus DD level and whether there's support for overlays in the XIP interface. Further, updated to add three extra args in xip_customize API, two of which are to support a third ring work buffer for the overlays handling. This has necessitated making changes to hcode_image_build (HIB) API as well. Note that the calling codes of xip_customize and HIB need to be updated to supply the additional args in their APIs. Note that this code stage 1 will work for Nimbus DD2 with Gptr rings in Mvpd, and no Gptr rings in the HW image. It will, however, not work if there's content in .overlays or if there's Gptr rings already in the .rings section. Thus, the stage 1 code here will work with a DD2 image (i.e., that does NOT have Gptr rings in .rings in HW image) as long as noone has put any real Gptr initfiles in for processing (which would result in ring content in .overlays). We must ensure that the stage 2 code of xip_customize gets merged on the HB side to enable processing of .overlays content before we actually add any Gptr initfiles for the .overlays section into EKB. Change-Id: I3d6ab8a9add239c92819613dcae21ef5faf0a1c5 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40591 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com> Reviewed-by: Sumit Kumar <sumit_kumar@in.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40898 Reviewed-by: Dean Sanner <dsanner@us.ibm.com> Tested-by: Dean Sanner <dsanner@us.ibm.com>
Diffstat (limited to 'src/usr/sbe')
-rw-r--r--src/usr/sbe/sbe_update.C69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C
index 5c4068631..b3366adf0 100644
--- a/src/usr/sbe/sbe_update.C
+++ b/src/usr/sbe/sbe_update.C
@@ -962,6 +962,7 @@ namespace SBE
/////////////////////////////////////////////////////////////////////
errlHndl_t procCustomizeSbeImg(TARGETING::Target* i_target,
+ void* i_hwImgPtr,
void* i_sbeImgPtr,
size_t i_maxImgSize,
void* io_imgPtr,
@@ -1035,6 +1036,7 @@ namespace SBE
FAPI_INVOKE_HWP( err,
p9_xip_customize,
l_fapiTarg,
+ i_hwImgPtr,
io_imgPtr, //image in/out
tmpImgSize,
(void*)RING_SEC_VADDR,
@@ -1045,6 +1047,8 @@ namespace SBE
(uint32_t)MAX_RING_BUF_SIZE,
(void*)RING_BUF2_VADDR,
(uint32_t)MAX_RING_BUF_SIZE,
+ (void*)RING_BUF3_VADDR,
+ (uint32_t)MAX_RING_BUF_SIZE,
procIOMask ); // Bits(8:31) = EC00:EC23
// Check for no error and use of input cores
@@ -1705,6 +1709,36 @@ namespace SBE
}
/////////////////////////////////////////////////////////////////////
+ errlHndl_t sbeLoadHcode(char*& o_hcodeAddr)
+ {
+ errlHndl_t l_errl = NULL;
+ PNOR::SectionInfo_t l_info;
+
+ do
+ {
+
+ // Get HCODE PNOR section info from PNOR RP
+ l_errl = PNOR::getSectionInfo( PNOR::HCODE, l_info );
+ if( l_errl )
+ {
+ //No need to commit error here, it gets handled later
+ //just break out to escape this function
+ break;
+ }
+
+ o_hcodeAddr = reinterpret_cast<char*>(l_info.vaddr);
+
+ TRACUCOMP( g_trac_sbe,
+ ERR_MRK"sbeLoadHcode() - Error from "
+ "HCODE addr = 0x%p ",
+ o_hcodeAddr);
+
+ } while ( 0 );
+
+ return l_errl;
+ }
+
+ /////////////////////////////////////////////////////////////////////
errlHndl_t getSbeInfoState(sbeTargetState_t& io_sbeState)
{
@@ -1965,7 +1999,25 @@ namespace SBE
/* Calculate CRC of the image */
/*******************************************/
size_t sbeImgSize = 0;
+
+
+ // get a pointer to the hcode for the .overlays
+ char* l_hCodeAddr = NULL;
+
+ err = sbeLoadHcode(l_hCodeAddr);
+
+ if(err)
+ {
+ TRACFCOMP( g_trac_sbe, ERR_MRK"ge() - "
+ "Error from sbeLoadHcode(), "
+ "RC=0x%X, PLID=0x%lX",
+ ERRL_GETRC_SAFE(err),
+ ERRL_GETPLID_SAFE(err));
+ break;
+ }
+
err = procCustomizeSbeImg(io_sbeState.target,
+ l_hCodeAddr, // HCODE in memory
sbeHbblImgPtr, //SBE, HBBL in memory
sbeHbblImgSize,
reinterpret_cast<void*>
@@ -1982,6 +2034,8 @@ namespace SBE
break;
}
+
+
// Verify that HW Key Hash is included in customized image
SHA512_t hash = {0};
err = getHwKeyHashFromSbeImage(io_sbeState.target, // ignored
@@ -3800,6 +3854,14 @@ namespace SBE
TRACFCOMP( g_trac_sbe, ERR_MRK,"createSbeImageVmmSpace() - Error from loadSecureSection(PNOR::HB_BOOTLOADER)");
break;
}
+
+ err = loadSecureSection(PNOR::HCODE);
+
+ if (err)
+ {
+ TRACFCOMP( g_trac_sbe, ERR_MRK,"createSbeImageVmmSpace() - Error from loadSecureSection(PNOR::HCODE)");
+ break;
+ }
#endif
}while(0);
@@ -3911,6 +3973,13 @@ namespace SBE
TRACFCOMP( g_trac_sbe, ERR_MRK,"cleanupSbeImageVmmSpace() - Error from unloadSecureSection(PNOR::HB_BOOTLOADER)");
break;
}
+ err = unloadSecureSection(PNOR::HCODE);
+ if (err)
+ {
+ TRACFCOMP( g_trac_sbe, ERR_MRK,"cleanupSbeImageVmmSpace() - Error from unloadSecureSection(PNOR::HCODE)");
+ break;
+ }
+
#endif
}while(0);
OpenPOWER on IntegriCloud