summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Cprek <smcprek@us.ibm.com>2015-02-23 11:18:24 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2015-03-10 22:50:47 -0500
commit788ec2a6d01df562f38352443bacd68c9cb0c633 (patch)
treedfff993e6fe30c9d1605bffe442508bceaed71ee
parent2a1d6e44f9dee4b665978be5e0eb0ef47a9e0be0 (diff)
downloadtalos-hostboot-788ec2a6d01df562f38352443bacd68c9cb0c633.tar.gz
talos-hostboot-788ec2a6d01df562f38352443bacd68c9cb0c633.zip
Remove pnorsbe.C and move seeprom code back to SBE namespace
PNOR code no longer uses getSbeBootSeeprom() and it makes more sense to keep this function in the sbe component Change-Id: Ic984f1af35fcc7346242bee03c69d16796ef7c09 RTC: 123369 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/15912 Tested-by: Jenkins Server Reviewed-by: PRACHI GUPTA <pragupta@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Brian H. Horton <brianh@linux.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
-rw-r--r--src/include/usr/pnor/pnorif.H24
-rw-r--r--src/usr/pnor/makefile1
-rw-r--r--src/usr/pnor/pnorsbe.C87
-rw-r--r--src/usr/sbe/sbe_resolve_sides.C19
-rw-r--r--src/usr/sbe/sbe_resolve_sides.H23
-rw-r--r--src/usr/sbe/sbe_update.C99
-rw-r--r--src/usr/sbe/sbe_update.H30
-rw-r--r--src/usr/sbe/test/sbeupdatetest.H24
8 files changed, 129 insertions, 178 deletions
diff --git a/src/include/usr/pnor/pnorif.H b/src/include/usr/pnor/pnorif.H
index 0fc5a83dc..79a9a0f62 100644
--- a/src/include/usr/pnor/pnorif.H
+++ b/src/include/usr/pnor/pnorif.H
@@ -199,30 +199,6 @@ enum TestSectionOffset{
pnorTestSec_rt_readwrite_offset = 0x6000,
};
-////////////////////////////////////////////////////////////////////////////////
-// SBE functionality that lives in PNOR
-
-// Used to keep track of perm/temp, and cur/alt
-enum sbeSeepromSide_t
-{
- SBE_SEEPROM0 = 0x00, // corresponds to EEPROM::SBE_PRIMARY
- SBE_SEEPROM1 = 0x01, // corresponts to EEPROM::SBE_BACKUP
- SBE_SEEPROM_INVALID = 0xFF,
-};
-
-/**
- * @brief Determines which Seeprom was used to boot the SBE
- *
- * @param[in] i_target Target processor to customize
- *
- * @param[out] o_bootSide The Seeprom the SBE booted from
- *
- * @return errlHndl_t Error log handle on failure.
- */
-errlHndl_t getSbeBootSeeprom(TARGETING::Target* i_target,
- sbeSeepromSide_t& o_bootSide);
-
-
/** Information about PNOR Layout */
struct PnorInfo_t
{
diff --git a/src/usr/pnor/makefile b/src/usr/pnor/makefile
index 2f0a4e19b..31087a4b2 100644
--- a/src/usr/pnor/makefile
+++ b/src/usr/pnor/makefile
@@ -32,7 +32,6 @@ OBJS += pnor_common.o
OBJS += pnorvalid.o
OBJS += ecc.o
OBJS += sfcdd.o
-OBJS += pnorsbe.o
#SFC Implementations
OBJS += $(if $(CONFIG_SFC_IS_IBM_DPSS),sfc_ibm.o)
diff --git a/src/usr/pnor/pnorsbe.C b/src/usr/pnor/pnorsbe.C
deleted file mode 100644
index 0b6117313..000000000
--- a/src/usr/pnor/pnorsbe.C
+++ /dev/null
@@ -1,87 +0,0 @@
-/* IBM_PROLOG_BEGIN_TAG */
-/* This is an automatically generated prolog. */
-/* */
-/* $Source: src/usr/pnor/pnorsbe.C $ */
-/* */
-/* OpenPOWER HostBoot Project */
-/* */
-/* Contributors Listed Below - COPYRIGHT 2014,2015 */
-/* [+] International Business Machines Corp. */
-/* */
-/* */
-/* Licensed under the Apache License, Version 2.0 (the "License"); */
-/* you may not use this file except in compliance with the License. */
-/* You may obtain a copy of the License at */
-/* */
-/* http://www.apache.org/licenses/LICENSE-2.0 */
-/* */
-/* Unless required by applicable law or agreed to in writing, software */
-/* distributed under the License is distributed on an "AS IS" BASIS, */
-/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */
-/* implied. See the License for the specific language governing */
-/* permissions and limitations under the License. */
-/* */
-/* IBM_PROLOG_END_TAG */
-/**
- * @file pnorsbe.C
- *
- * @brief Implements PNOR::getSbeBootSeeprom(), which Determines which
- * Seeprom was used to boot the SB
- */
-
-#include <pnor/pnorif.H>
-#include <trace/interface.H>
-#include <errl/errlmanager.H>
-#include <errl/errlentry.H>
-#include <devicefw/userif.H>
-
-extern trace_desc_t* g_trac_pnor;
-
-namespace PNOR
-{
-
-//Used to read SBE Boot Side from processor
-const uint64_t SBE_VITAL_REG_0x0005001C = 0x005001C;
-const uint64_t SBE_BOOT_SELECT_MASK = 0x0080000000000000;
-
-errlHndl_t getSbeBootSeeprom(TARGETING::Target* i_target,
- sbeSeepromSide_t& o_bootSide)
-{
- TRACFCOMP( g_trac_pnor, ENTER_MRK"PNOR::getSbeBootSeeprom()" );
-
- errlHndl_t err = NULL;
- uint64_t scomData = 0x0;
-
- o_bootSide = SBE_SEEPROM0;
-
- do{
-
- size_t op_size = sizeof(scomData);
- err = deviceRead( i_target,
- &scomData,
- op_size,
- DEVICE_SCOM_ADDRESS(SBE_VITAL_REG_0x0005001C) );
- if( err )
- {
- TRACFCOMP( g_trac_pnor, ERR_MRK"PNOR::getSbeBootSeeprom() -Error "
- "reading SBE VITAL REG (0x%.8X) from Target :"
- "HUID=0x%.8X",
- SBE_VITAL_REG_0x0005001C,
- TARGETING::get_huid(i_target));
- break;
- }
- if(scomData & SBE_BOOT_SELECT_MASK)
- {
- o_bootSide = SBE_SEEPROM1;
- }
-
- }while(0);
-
- TRACFCOMP( g_trac_pnor,
- EXIT_MRK"PNOR::getSbeBootSeeprom(): o_bootSide=0x%X (reg=0x%X)",
- o_bootSide, scomData );
-
- return err;
-}
-
-} // end namespace \ No newline at end of file
diff --git a/src/usr/sbe/sbe_resolve_sides.C b/src/usr/sbe/sbe_resolve_sides.C
index 90217b6b0..49d2c2529 100644
--- a/src/usr/sbe/sbe_resolve_sides.C
+++ b/src/usr/sbe/sbe_resolve_sides.C
@@ -363,13 +363,13 @@ errlHndl_t getSideState(sbeResolveState_t& io_sideState)
/***********************************************/
/* Get Side This Processor did/will boot from */
/***********************************************/
- PNOR::sbeSeepromSide_t tmp_cur_side = PNOR::SBE_SEEPROM_INVALID;
- err = PNOR::getSbeBootSeeprom(io_sideState.tgt, tmp_cur_side);
+ sbeSeepromSide_t tmp_cur_side = SBE_SEEPROM_INVALID;
+ err = getSbeBootSeeprom(io_sideState.tgt, tmp_cur_side);
if ( err )
{
TRACFCOMP( g_trac_sbe, ERR_MRK
"resolveProcessorSbeSeeproms() - Error returned "
- "from PNOR::getSbeBootSeeprom() "
+ "from getSbeBootSeeprom() "
"rc=0x%.4X, Target UID=0x%X",
err->reasonCode(),
TARGETING::get_huid(io_sideState.tgt));
@@ -378,8 +378,8 @@ errlHndl_t getSideState(sbeResolveState_t& io_sideState)
io_sideState.cur_side = tmp_cur_side;
- io_sideState.alt_side = (tmp_cur_side == PNOR::SBE_SEEPROM0)
- ? PNOR::SBE_SEEPROM1 : PNOR::SBE_SEEPROM0;
+ io_sideState.alt_side = (tmp_cur_side == SBE_SEEPROM0)
+ ? SBE_SEEPROM1 : SBE_SEEPROM0;
/**********************************************/
/* Get PNOR Side Information */
@@ -640,7 +640,7 @@ errlHndl_t performSideActions(sbeResolveState_t& io_sideState)
/////////////////////////////////////////////////////////////////////
errlHndl_t readSbeImage(TARGETING::Target* i_target,
void* o_imgPtr,
- PNOR::sbeSeepromSide_t i_side,
+ sbeSeepromSide_t i_side,
size_t& o_image_size,
sbeSeepromVersionInfo_t& o_image_version)
{
@@ -859,10 +859,9 @@ errlHndl_t readSbeImage(TARGETING::Target* i_target,
/////////////////////////////////////////////////////////////////////
errlHndl_t writeSbeImage(TARGETING::Target* i_target,
void* i_imgPtr,
- PNOR::sbeSeepromSide_t i_side,
+ sbeSeepromSide_t i_side,
size_t i_image_size,
sbeSeepromVersionInfo_t& io_version)
-
{
TRACFCOMP( g_trac_sbe,
ENTER_MRK"writeSbeImage(): tgt=0x%X, i_side=%d "
@@ -1017,7 +1016,7 @@ errlHndl_t writeSbeImage(TARGETING::Target* i_target,
/////////////////////////////////////////////////////////////////////
errlHndl_t getSbeImageSize(TARGETING::Target* i_target,
void* i_imgPtr,
- PNOR::sbeSeepromSide_t i_side,
+ sbeSeepromSide_t i_side,
size_t& o_image_size)
{
TRACUCOMP( g_trac_sbe,
@@ -1149,7 +1148,7 @@ errlHndl_t getSbeImageSize(TARGETING::Target* i_target,
/////////////////////////////////////////////////////////////////////
errlHndl_t resolveImageHBBaddr(TARGETING::Target* i_target,
void* io_imgPtr,
- PNOR::sbeSeepromSide_t i_side,
+ sbeSeepromSide_t i_side,
PNOR::SideId i_pnorSideId,
bool& o_imageWasUpdated )
{
diff --git a/src/usr/sbe/sbe_resolve_sides.H b/src/usr/sbe/sbe_resolve_sides.H
index d7c1f7c56..9e116e001 100644
--- a/src/usr/sbe/sbe_resolve_sides.H
+++ b/src/usr/sbe/sbe_resolve_sides.H
@@ -43,7 +43,7 @@ namespace SBE
/******************************************/
// This seeprom is a candidate to be READ_ONLY (ie, not updated)
- const PNOR::sbeSeepromSide_t READ_ONLY_SEEPROM = PNOR::SBE_SEEPROM1;
+ const sbeSeepromSide_t READ_ONLY_SEEPROM = SBE_SEEPROM1;
// Used to keep SBE Seeproms in sync with EEPROM::eeprom_chip_types_t
const EEPROM::eeprom_chip_types_t sbe_side_sync[2] =
@@ -81,9 +81,9 @@ namespace SBE
// Target Information
TARGETING::Target* tgt;
- PNOR::sbeSeepromSide_t cur_side; // aka 'booted' side
- PNOR::sbeSeepromSide_t alt_side; // non-booted/non-cur side
- PNOR::sbeSeepromSide_t update_side; // side to be updated
+ sbeSeepromSide_t cur_side; // aka 'booted' side
+ sbeSeepromSide_t alt_side; // non-booted/non-cur side
+ sbeSeepromSide_t update_side; // side to be updated
// Info from PNOR
PNOR::SideId pnor_sideId;
@@ -95,9 +95,9 @@ namespace SBE
// Constructor to default certain values
sbeResolveState_t() :
- tgt(NULL), cur_side(PNOR::SBE_SEEPROM_INVALID),
- alt_side(PNOR::SBE_SEEPROM_INVALID),
- update_side(PNOR::SBE_SEEPROM_INVALID),
+ tgt(NULL), cur_side(SBE_SEEPROM_INVALID),
+ alt_side(SBE_SEEPROM_INVALID),
+ update_side(SBE_SEEPROM_INVALID),
pnor_sideId(PNOR::WORKING),
pnor_side(NULL),
pnor_isGolden(false), pnor_hasOtherSide(false),
@@ -166,7 +166,7 @@ namespace SBE
*/
errlHndl_t readSbeImage(TARGETING::Target* i_target,
void* o_imgPtr,
- PNOR::sbeSeepromSide_t i_side,
+ sbeSeepromSide_t i_side,
size_t& o_image_size,
sbeSeepromVersionInfo_t& o_version);
@@ -192,11 +192,10 @@ namespace SBE
*/
errlHndl_t writeSbeImage(TARGETING::Target* i_target,
void* i_imgPtr,
- PNOR::sbeSeepromSide_t i_side,
+ sbeSeepromSide_t i_side,
size_t i_image_size,
sbeSeepromVersionInfo_t& io_version);
-
/**
* @brief Read SBE Image Header from SBE Seeprom and gets the
* Image size from the heaser
@@ -214,7 +213,7 @@ namespace SBE
*/
errlHndl_t getSbeImageSize(TARGETING::Target* i_target,
void* i_imgPtr,
- PNOR::sbeSeepromSide_t i_side,
+ sbeSeepromSide_t i_side,
size_t& o_image_size);
@@ -245,7 +244,7 @@ namespace SBE
*/
errlHndl_t resolveImageHBBaddr(TARGETING::Target* i_target,
void* io_imgPtr,
- PNOR::sbeSeepromSide_t i_side,
+ sbeSeepromSide_t i_side,
PNOR::SideId i_pnorSideId,
bool& o_imageWasUpdated);
diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C
index a20c1a869..a559229c9 100644
--- a/src/usr/sbe/sbe_update.C
+++ b/src/usr/sbe/sbe_update.C
@@ -509,13 +509,13 @@ namespace SBE
}
// Get SBE PNOR section info from PNOR RP
- err = PNOR::getSectionInfo( pnorSectionId,
+ err = getSectionInfo( pnorSectionId,
pnorInfo );
if(err)
{
TRACFCOMP( g_trac_sbe, ERR_MRK"findSBEInPnor: Error calling "
- "PNOR::getSectionInfo() rc=0x%.4X",
+ "getSectionInfo() rc=0x%.4X",
err->reasonCode() );
break;
}
@@ -1248,6 +1248,47 @@ namespace SBE
}
/////////////////////////////////////////////////////////////////////
+ errlHndl_t getSbeBootSeeprom(TARGETING::Target* i_target,
+ sbeSeepromSide_t& o_bootSide)
+ {
+ TRACFCOMP( g_trac_sbe, ENTER_MRK"getSbeBootSeeprom()" );
+
+ errlHndl_t err = NULL;
+ uint64_t scomData = 0x0;
+
+ o_bootSide = SBE_SEEPROM0;
+
+ do{
+
+ size_t op_size = sizeof(scomData);
+ err = deviceRead( i_target,
+ &scomData,
+ op_size,
+ DEVICE_SCOM_ADDRESS(SBE_VITAL_REG_0x0005001C) );
+ if( err )
+ {
+ TRACFCOMP( g_trac_sbe, ERR_MRK"getSbeBootSeeprom() -Error "
+ "reading SBE VITAL REG (0x%.8X) from Target :"
+ "HUID=0x%.8X",
+ SBE_VITAL_REG_0x0005001C,
+ TARGETING::get_huid(i_target));
+ break;
+ }
+ if(scomData & SBE_BOOT_SELECT_MASK)
+ {
+ o_bootSide = SBE_SEEPROM1;
+ }
+
+ }while(0);
+
+ TRACFCOMP( g_trac_sbe,
+ EXIT_MRK"getSbeBootSeeprom(): o_bootSide=0x%X (reg=0x%X)",
+ o_bootSide, scomData );
+
+ return err;
+ }
+
+/////////////////////////////////////////////////////////////////////
errlHndl_t getSbeInfoState(sbeTargetState_t& io_sbeState)
{
@@ -1342,11 +1383,11 @@ namespace SBE
if(SEEPROM_0_PERMANENT_VALUE ==
(io_sbeState.mvpdSbKeyword.flags & PERMANENT_FLAG_MASK))
{
- io_sbeState.permanent_seeprom_side = PNOR::SBE_SEEPROM0;
+ io_sbeState.permanent_seeprom_side = SBE_SEEPROM0;
}
else // Side 1 must be permanent
{
- io_sbeState.permanent_seeprom_side = PNOR::SBE_SEEPROM1;
+ io_sbeState.permanent_seeprom_side = SBE_SEEPROM1;
}
@@ -1395,21 +1436,21 @@ namespace SBE
/* Determine which SEEPROM System Booted On */
/***********************************************/
//Get Current (boot) Side
- PNOR::sbeSeepromSide_t tmp_cur_side = PNOR::SBE_SEEPROM_INVALID;
- err = PNOR::getSbeBootSeeprom(io_sbeState.target, tmp_cur_side);
+ sbeSeepromSide_t tmp_cur_side = SBE_SEEPROM_INVALID;
+ err = getSbeBootSeeprom(io_sbeState.target, tmp_cur_side);
if(err)
{
TRACFCOMP( g_trac_sbe, ERR_MRK"getSbeInfoState() - Error returned from getSbeBootSeeprom()");
break;
}
io_sbeState.cur_seeprom_side = tmp_cur_side;
- if (io_sbeState.cur_seeprom_side == PNOR::SBE_SEEPROM0)
+ if (io_sbeState.cur_seeprom_side == SBE_SEEPROM0)
{
- io_sbeState.alt_seeprom_side = PNOR::SBE_SEEPROM1;
+ io_sbeState.alt_seeprom_side = SBE_SEEPROM1;
}
- else if ( io_sbeState.cur_seeprom_side == PNOR::SBE_SEEPROM1)
+ else if ( io_sbeState.cur_seeprom_side == SBE_SEEPROM1)
{
- io_sbeState.alt_seeprom_side = PNOR::SBE_SEEPROM0;
+ io_sbeState.alt_seeprom_side = SBE_SEEPROM0;
}
else
{
@@ -2064,7 +2105,7 @@ namespace SBE
/* Determine what side to update */
/**************************************************************/
// Set cur and alt isDirty values
- if( io_sbeState.cur_seeprom_side == PNOR::SBE_SEEPROM0 )
+ if( io_sbeState.cur_seeprom_side == SBE_SEEPROM0 )
{
current_side_isDirty = seeprom_0_isDirty;
alt_side_isDirty = seeprom_1_isDirty;
@@ -2279,7 +2320,7 @@ namespace SBE
// Set Update side to cur
io_sbeState.seeprom_side_to_update =
( io_sbeState.cur_seeprom_side ==
- PNOR::SBE_SEEPROM0 )
+ SBE_SEEPROM0 )
? EEPROM::SBE_PRIMARY : EEPROM::SBE_BACKUP;
TRACFCOMP( g_trac_sbe, INFO_MRK"SBE Update tgt=0x%X: "
@@ -2323,14 +2364,14 @@ namespace SBE
io_sbeState.seeprom_side_to_update = EEPROM::SBE_PRIMARY;
// Update MVPD PERMANENT flag: make cur=perm
- ( io_sbeState.cur_seeprom_side == PNOR::SBE_SEEPROM0 ) ?
+ ( io_sbeState.cur_seeprom_side == SBE_SEEPROM0 ) ?
// clear bit 0
io_sbeState.mvpdSbKeyword.flags &= ~PERMANENT_FLAG_MASK
: //set bit 0
io_sbeState.mvpdSbKeyword.flags |= PERMANENT_FLAG_MASK;
// Update MVPD RE-IPL SEEPROM flag: re-IPL on ALT:
- ( io_sbeState.alt_seeprom_side == PNOR::SBE_SEEPROM0 ) ?
+ ( io_sbeState.alt_seeprom_side == SBE_SEEPROM0 ) ?
// clear bit 1
io_sbeState.mvpdSbKeyword.flags &= ~REIPL_SEEPROM_MASK
: //set bit 1
@@ -2397,18 +2438,18 @@ namespace SBE
// Set Update side to alt
io_sbeState.seeprom_side_to_update =
( io_sbeState.alt_seeprom_side ==
- PNOR::SBE_SEEPROM0 )
+ SBE_SEEPROM0 )
? EEPROM::SBE_PRIMARY : EEPROM::SBE_BACKUP ;
// Update MVPD PERMANENT flag: make cur=perm
- ( io_sbeState.cur_seeprom_side == PNOR::SBE_SEEPROM0 ) ?
+ ( io_sbeState.cur_seeprom_side == SBE_SEEPROM0 ) ?
// clear bit 0
io_sbeState.mvpdSbKeyword.flags &= ~PERMANENT_FLAG_MASK
: //set bit 0
io_sbeState.mvpdSbKeyword.flags |= PERMANENT_FLAG_MASK;
// Update MVPD RE-IPL SEEPROM flag: re-IPL on ALT:
- ( io_sbeState.alt_seeprom_side == PNOR::SBE_SEEPROM0 ) ?
+ ( io_sbeState.alt_seeprom_side == SBE_SEEPROM0 ) ?
// clear bit 1
io_sbeState.mvpdSbKeyword.flags &= ~REIPL_SEEPROM_MASK
: //set bit 1
@@ -2444,13 +2485,13 @@ namespace SBE
// Set Update side to alt
io_sbeState.seeprom_side_to_update =
( io_sbeState.alt_seeprom_side ==
- PNOR::SBE_SEEPROM0 )
+ SBE_SEEPROM0 )
? EEPROM::SBE_PRIMARY : EEPROM::SBE_BACKUP ;
// MVPD flag Update
// Update MVPD flag make cur=perm
- ( io_sbeState.cur_seeprom_side == PNOR::SBE_SEEPROM0 ) ?
+ ( io_sbeState.cur_seeprom_side == SBE_SEEPROM0 ) ?
// clear bit 0
io_sbeState.mvpdSbKeyword.flags &= ~PERMANENT_FLAG_MASK
: // set bit 0
@@ -2505,11 +2546,11 @@ namespace SBE
// Set Update side to alt
io_sbeState.seeprom_side_to_update =
( io_sbeState.alt_seeprom_side ==
- PNOR::SBE_SEEPROM0 )
+ SBE_SEEPROM0 )
? EEPROM::SBE_PRIMARY : EEPROM::SBE_BACKUP ;
// Update MVPD RE-IPL SEEPROM flag: re-IPL on ALT:
- ( io_sbeState.alt_seeprom_side == PNOR::SBE_SEEPROM0 ) ?
+ ( io_sbeState.alt_seeprom_side == SBE_SEEPROM0 ) ?
// clear bit 1
io_sbeState.mvpdSbKeyword.flags &= ~REIPL_SEEPROM_MASK
: // set bit 1
@@ -2520,7 +2561,7 @@ namespace SBE
if ( g_istep_mode )
{
// Update MVPD PERMANENT flag: make alt=perm
- (io_sbeState.alt_seeprom_side == PNOR::SBE_SEEPROM0 ) ?
+ (io_sbeState.alt_seeprom_side == SBE_SEEPROM0 ) ?
// clear bit 0
io_sbeState.mvpdSbKeyword.flags &= ~PERMANENT_FLAG_MASK
: //set bit 0
@@ -2603,11 +2644,11 @@ namespace SBE
// Set Update side to alt
io_sbeState.seeprom_side_to_update =
( io_sbeState.alt_seeprom_side ==
- PNOR::SBE_SEEPROM0 )
+ SBE_SEEPROM0 )
? EEPROM::SBE_PRIMARY : EEPROM::SBE_BACKUP ;
// Update MVPD RE-IPL SEEPROM flag: re-IPL on ALT:
- ( io_sbeState.alt_seeprom_side == PNOR::SBE_SEEPROM0 ) ?
+ ( io_sbeState.alt_seeprom_side == SBE_SEEPROM0 ) ?
// clear bit 1
io_sbeState.mvpdSbKeyword.flags &= ~REIPL_SEEPROM_MASK
: // set bit 1
@@ -2640,7 +2681,7 @@ namespace SBE
// Set Update side to alt
io_sbeState.seeprom_side_to_update =
( io_sbeState.alt_seeprom_side ==
- PNOR::SBE_SEEPROM0 )
+ SBE_SEEPROM0 )
? EEPROM::SBE_PRIMARY : EEPROM::SBE_BACKUP ;
TRACFCOMP( g_trac_sbe, INFO_MRK"SBE Update tgt=0x%X: "
@@ -3351,12 +3392,12 @@ namespace SBE
// Compare against 'current' Master side in case there is
// an issue with the other side
if (io_sbeStates_v[i].cur_seeprom_side ==
- PNOR::SBE_SEEPROM0)
+ SBE_SEEPROM0)
{
ver_ptr =
&(io_sbeStates_v[i].seeprom_0_ver.image_version);
}
- else // PNOR::SBE_SEEPROM1
+ else // SBE_SEEPROM1
{
ver_ptr =
&(io_sbeStates_v[i].seeprom_1_ver.image_version);
@@ -3500,12 +3541,12 @@ namespace SBE
{
// Not Master, so get 'current' version
if (io_sbeStates_v[i].cur_seeprom_side ==
- PNOR::SBE_SEEPROM0)
+ SBE_SEEPROM0)
{
ver_ptr =
&(io_sbeStates_v[i].seeprom_0_ver.image_version);
}
- else // PNOR::SBE_SEEPROM1
+ else // SBE_SEEPROM1
{
ver_ptr =
&(io_sbeStates_v[i].seeprom_1_ver.image_version);
diff --git a/src/usr/sbe/sbe_update.H b/src/usr/sbe/sbe_update.H
index e49c58289..e3f052fe9 100644
--- a/src/usr/sbe/sbe_update.H
+++ b/src/usr/sbe/sbe_update.H
@@ -55,6 +55,10 @@ namespace SBE
const uint64_t SBE_IMAGE_SEEPROM_ADDRESS = 0x400; // 1KB
const uint64_t SBE_VERSION_SEEPROM_ADDRESS = 0x300; // 1KB - 256B
+ //Used to read SBE Boot Side from processor
+ const uint64_t SBE_VITAL_REG_0x0005001C = 0x005001C;
+ const uint64_t SBE_BOOT_SELECT_MASK = 0x0080000000000000;
+
// PNOR SBE and SBEC Partition constants
const uint32_t MAX_SBE_ENTRIES = 9;
const uint32_t SBETOC_EYECATCH = 0x53424500; //'SBE\0'
@@ -104,6 +108,14 @@ namespace SBE
MVPDOP_WRITE, // Write version data to MVPD
};
+ // Used to keep track of perm/temp, and cur/alt
+ enum sbeSeepromSide_t
+ {
+ SBE_SEEPROM0 = 0x00, // corresponds to EEPROM::SBE_PRIMARY
+ SBE_SEEPROM1 = 0x01, // corresponts to EEPROM::SBE_BACKUP
+ SBE_SEEPROM_INVALID = 0xFF,
+ };
+
// Actions can be combined
enum sbeUpdateActions_t
{
@@ -196,9 +208,9 @@ namespace SBE
bool seeprom_0_ver_ECC_fail;
bool seeprom_1_ver_ECC_fail;
- PNOR::sbeSeepromSide_t cur_seeprom_side; // aka 'booted' side
- PNOR::sbeSeepromSide_t alt_seeprom_side;
- PNOR::sbeSeepromSide_t permanent_seeprom_side;
+ sbeSeepromSide_t cur_seeprom_side; // aka 'booted' side
+ sbeSeepromSide_t alt_seeprom_side;
+ sbeSeepromSide_t permanent_seeprom_side;
// Customized Image Information for this Target
size_t customizedImage_size;
@@ -319,6 +331,18 @@ namespace SBE
size_t& o_actImgSize);
/**
+ * @brief Determines which Seeprom was used to boot the SBE
+ *
+ * @param[in] i_target Target processor to customize
+ *
+ * @param[out] o_bootSide The Seeprom the SBE booted from
+ *
+ * @return errlHndl_t Error log handle on failure.
+ */
+ errlHndl_t getSbeBootSeeprom(TARGETING::Target* i_target,
+ sbeSeepromSide_t& o_bootSide);
+
+ /**
* @brief Collects Version information from a specific SEEPROM
*
* @param[in] i_target Target processor to customize
diff --git a/src/usr/sbe/test/sbeupdatetest.H b/src/usr/sbe/test/sbeupdatetest.H
index 5e2570631..c5a3dd56e 100644
--- a/src/usr/sbe/test/sbeupdatetest.H
+++ b/src/usr/sbe/test/sbeupdatetest.H
@@ -580,7 +580,7 @@ class SBEUpdateTest: public CxxTest::TestSuite
{
// Inputs
uint8_t i_situation;
- PNOR::sbeSeepromSide_t i_cur; // current_seeprom_side
+ SBE::sbeSeepromSide_t i_cur; // current_seeprom_side
uint8_t i_flags; // mvpdSbKeyword.flags
// Expected Output
@@ -596,7 +596,7 @@ class SBEUpdateTest: public CxxTest::TestSuite
// - update alt=1
// - make cur=perm
// - re-IPL
- { 0xE0, PNOR::SBE_SEEPROM0, 0x80,
+ { 0xE0, SBE::SBE_SEEPROM0, 0x80,
static_cast<sbeUpdateActions_t>
(DO_UPDATE|IPL_RESTART|UPDATE_MVPD|UPDATE_SBE),
EEPROM::SBE_BACKUP, 0x40 },
@@ -606,7 +606,7 @@ class SBEUpdateTest: public CxxTest::TestSuite
// - update alt=0
// - make cur=perm
// - re-IPL
- { 0xC0, PNOR::SBE_SEEPROM1, 0x00,
+ { 0xC0, SBE::SBE_SEEPROM1, 0x00,
static_cast<sbeUpdateActions_t>
(DO_UPDATE|IPL_RESTART|UPDATE_MVPD|UPDATE_SBE),
EEPROM::SBE_PRIMARY, 0x80 },
@@ -616,7 +616,7 @@ class SBEUpdateTest: public CxxTest::TestSuite
// - update alt=0
// - make cur=perm
// - Continue IPL
- { 0xA0, PNOR::SBE_SEEPROM1, 0x00,
+ { 0xA0, SBE::SBE_SEEPROM1, 0x00,
static_cast<sbeUpdateActions_t>
(DO_UPDATE|UPDATE_MVPD|UPDATE_SBE),
EEPROM::SBE_PRIMARY, 0x80 },
@@ -625,7 +625,7 @@ class SBEUpdateTest: public CxxTest::TestSuite
// Arbitrarily set cur side to 1 (therefore perm set to 0)
// - No updates
// - Continue IPL
- { 0x80, PNOR::SBE_SEEPROM1, 0x00,
+ { 0x80, SBE::SBE_SEEPROM1, 0x00,
static_cast<sbeUpdateActions_t>(CLEAR_ACTIONS),
EEPROM::LAST_CHIP_TYPE, 0x00 },
@@ -633,7 +633,7 @@ class SBEUpdateTest: public CxxTest::TestSuite
// Arbitrarily set cur side to 0 (therefore perm set to 0)
// - update alt=1
// - re-IPL
- { 0x60, PNOR::SBE_SEEPROM0, 0x00,
+ { 0x60, SBE::SBE_SEEPROM0, 0x00,
static_cast<sbeUpdateActions_t>
(DO_UPDATE|IPL_RESTART|UPDATE_MVPD|UPDATE_SBE),
EEPROM::SBE_BACKUP, 0x40 },
@@ -644,14 +644,14 @@ class SBEUpdateTest: public CxxTest::TestSuite
// Arbitrarily set cur side to 1 (therefore perm set to 1)
// - update alt=0
// - re-IPL
- { 0x40, PNOR::SBE_SEEPROM1, 0x80,
+ { 0x40, SBE::SBE_SEEPROM1, 0x80,
static_cast<sbeUpdateActions_t>
(DO_UPDATE|IPL_RESTART|UPDATE_MVPD|UPDATE_SBE),
EEPROM::SBE_PRIMARY, 0x80 },
// Repeat previous case to make sure global variables are used
// correctly to save MBOX value
- { 0x40, PNOR::SBE_SEEPROM1, 0x80,
+ { 0x40, SBE::SBE_SEEPROM1, 0x80,
static_cast<sbeUpdateActions_t>
(DO_UPDATE|IPL_RESTART|UPDATE_MVPD|UPDATE_SBE),
EEPROM::SBE_PRIMARY, 0x80 },
@@ -660,7 +660,7 @@ class SBEUpdateTest: public CxxTest::TestSuite
// Arbitrarily set cur side to 0 (therefore perm set to 0)
// - update alt=1
// - Continue IPL
- { 0x20, PNOR::SBE_SEEPROM0, 0x00,
+ { 0x20, SBE::SBE_SEEPROM0, 0x00,
static_cast<sbeUpdateActions_t>(DO_UPDATE|UPDATE_SBE),
EEPROM::SBE_BACKUP, 0x00 },
@@ -670,7 +670,7 @@ class SBEUpdateTest: public CxxTest::TestSuite
// - Continue IPL
// NOTE: this will test that right-most-bit is ignored:
// so techincally case 0x01, which should be = case 0x00
- { 0x01, PNOR::SBE_SEEPROM0, 0x00,
+ { 0x01, SBE::SBE_SEEPROM0, 0x00,
static_cast<sbeUpdateActions_t>(CLEAR_ACTIONS),
EEPROM::LAST_CHIP_TYPE, 0x00 },
#endif // SBE_UPDATE_SEQUENTIAL
@@ -708,8 +708,8 @@ class SBEUpdateTest: public CxxTest::TestSuite
sbeState.cur_seeprom_side = testData[i].i_cur;
sbeState.alt_seeprom_side =
- ( ( testData[i].i_cur == PNOR::SBE_SEEPROM0 )
- ? PNOR::SBE_SEEPROM1 : PNOR::SBE_SEEPROM0 );
+ ( ( testData[i].i_cur == SBE::SBE_SEEPROM0 )
+ ? SBE::SBE_SEEPROM1 : SBE::SBE_SEEPROM0 );
sbeState.mvpdSbKeyword.flags = testData[i].i_flags;
OpenPOWER on IntegriCloud