diff options
-rw-r--r-- | src/include/usr/initservice/mboxRegs.H | 11 | ||||
-rw-r--r-- | src/usr/isteps/istep08/call_host_slave_sbe_config.C | 37 | ||||
-rw-r--r-- | src/usr/sbe/sbe_update.C | 85 | ||||
-rw-r--r-- | src/usr/targeting/common/xmltohb/attribute_types_hb.xml | 17 | ||||
-rwxr-xr-x | src/usr/targeting/common/xmltohb/target_types_hb.xml | 1 | ||||
-rwxr-xr-x | src/usr/targeting/targetservicestart.C | 16 |
6 files changed, 73 insertions, 94 deletions
diff --git a/src/include/usr/initservice/mboxRegs.H b/src/include/usr/initservice/mboxRegs.H index 6adbb546e..716311385 100644 --- a/src/include/usr/initservice/mboxRegs.H +++ b/src/include/usr/initservice/mboxRegs.H @@ -38,6 +38,17 @@ namespace SPLESS const uint32_t MBOX_SCRATCH_REG7 = 0x0005003e; //CFAM 283E const uint32_t MBOX_SCRATCH_REG8 = 0x0005003f; //CFAM 283F + enum + { + SCRATCH_1 = 0x0, //Location in array is reg num -1 + SCRATCH_2 = 0x1, + SCRATCH_3 = 0x2, + SCRATCH_4 = 0x3, + SCRATCH_5 = 0x4, + SCRATCH_6 = 0x5, + SCRATCH_7 = 0x6, + SCRATCH_8 = 0x7, + }; // Mailbox Scratch Register 3 union MboxScratch3_t diff --git a/src/usr/isteps/istep08/call_host_slave_sbe_config.C b/src/usr/isteps/istep08/call_host_slave_sbe_config.C index 868f3e742..536d5200e 100644 --- a/src/usr/isteps/istep08/call_host_slave_sbe_config.C +++ b/src/usr/isteps/istep08/call_host_slave_sbe_config.C @@ -90,38 +90,15 @@ void* call_host_slave_sbe_config(void *io_pArgs) // Setup the boot flags attribute for the slaves based on the data // from the master proc INITSERVICE::SPLESS::MboxScratch3_t l_scratch3; - uint64_t l_scratch3scom = 0; - size_t scomsize = sizeof(l_scratch3scom); - l_errl = deviceRead( l_pMasterProcTarget, - &l_scratch3scom, - scomsize, - DEVICE_SCOM_ADDRESS( - INITSERVICE::SPLESS::MBOX_SCRATCH_REG3 ) ); - if( l_errl ) - { - // Create IStep error log and cross reference error that occurred - l_stepError.addErrorDetails( l_errl ); - - // Commit Error - errlCommit( l_errl, ISTEP_COMP_ID ); + TARGETING::ATTR_MASTER_MBOX_SCRATCH_type l_scratchRegs; + assert(l_sys->tryGetAttr + <TARGETING::ATTR_MASTER_MBOX_SCRATCH>(l_scratchRegs), + "call_host_slave_sbe_config() failed to get MASTER_MBOX_SCRATCH"); + l_scratch3.data32 = l_scratchRegs[INITSERVICE::SPLESS::SCRATCH_3]; - // Just make some reasonable guesses... - TRACFCOMP( ISTEPS_TRACE::g_trac_isteps_trace, - "Failed to read MBOX Scratch3" ); + // turn off the istep bit + l_scratch3.istepMode = 0; - l_scratch3.data32 = 0; - l_scratch3.fspAttached = INITSERVICE::spBaseServicesEnabled(); - l_scratch3.sbeFFDC = 0; - l_scratch3.sbeInternalFFDC = 1; - } - else - { - // data is in bits 0:31 - l_scratch3.data32 = static_cast<uint32_t>(l_scratch3scom >> 32); - - // turn off the istep bit - l_scratch3.istepMode = 0; - } // write the attribute l_sys->setAttr<ATTR_BOOT_FLAGS>(l_scratch3.data32); diff --git a/src/usr/sbe/sbe_update.C b/src/usr/sbe/sbe_update.C index 3307fd5ae..4e85e886f 100644 --- a/src/usr/sbe/sbe_update.C +++ b/src/usr/sbe/sbe_update.C @@ -3344,11 +3344,7 @@ namespace SBE ///////////////////////////////////////////////////////////////////// void setNestFreqAttributes(uint32_t i_nestFreq) { - - errlHndl_t l_err = nullptr; - uint64_t l_mboxScratchReg4 = 0; INITSERVICE::SPLESS::MboxScratch4_t l_scratch4; - size_t l_indexSize = sizeof(l_mboxScratchReg4); uint32_t l_i2cBusDiv = 0; // Call targeting function to update NEST_FREQ @@ -3364,21 +3360,11 @@ namespace SBE "Master Proc target is NULL"); // Get the i2c bus divisor - l_err = deviceRead( l_masterProc, - &l_mboxScratchReg4, - l_indexSize, - DEVICE_SCOM_ADDRESS( - INITSERVICE::SPLESS::MBOX_SCRATCH_REG4) ); - - if( l_err ) - { - TRACFCOMP( g_trac_sbe, - "setNestFreqAttributes::" - "Failed to get the bucket index from scom address"); - errlCommit( l_err, SBE_COMP_ID ); - } - - l_scratch4.data32 = static_cast<uint32_t>(l_mboxScratchReg4 >> 32); + TARGETING::ATTR_MASTER_MBOX_SCRATCH_type l_scratchRegs; + assert(l_sys->tryGetAttr + <TARGETING::ATTR_MASTER_MBOX_SCRATCH>(l_scratchRegs), + "setNestFreqAttributes() failed to get MASTER_MBOX_SCRATCH"); + l_scratch4.data32 = l_scratchRegs[INITSERVICE::SPLESS::SCRATCH_4]; // The Nest PLL Bucket ID ranges 1-5. Subtract 1 for zero-based indexing l_i2cBusDiv = NEST_PLL_FREQ_I2CDIV_LIST[l_scratch4.nestPllBucket-1]; @@ -4534,35 +4520,26 @@ namespace SBE errlHndl_t getBootNestFreq( uint32_t & o_bootNestFreq ) { errlHndl_t l_err = nullptr; - uint64_t l_mboxScratchReg4 = 0; INITSERVICE::SPLESS::MboxScratch4_t l_scratch4; - size_t l_indexSize = sizeof(l_mboxScratchReg4); TARGETING::Target * l_masterProcTarget = NULL; TARGETING::targetService() .masterProcChipTargetHandle( l_masterProcTarget ); + TARGETING::Target * l_sys = nullptr; + (void) TARGETING::targetService().getTopLevelTarget( l_sys ); + assert( l_sys, "getBootNestFreq() system target is NULL"); + + TRACFCOMP( g_trac_sbe, ENTER_MRK"Enter getBootNestFreq()"); do { - l_err = deviceRead( l_masterProcTarget, - &l_mboxScratchReg4, - l_indexSize, - DEVICE_SCOM_ADDRESS( - INITSERVICE::SPLESS::MBOX_SCRATCH_REG4) ); - - if( l_err ) - { - TRACFCOMP(g_trac_sbe, - "getBootNestFreq::" - "Failed to get the bucket index from scom address"); - errlCommit(l_err, SBE_COMP_ID); - break; - } - - l_scratch4.data32 = static_cast<uint32_t>(l_mboxScratchReg4 >> 32); - + TARGETING::ATTR_MASTER_MBOX_SCRATCH_type l_scratchRegs; + assert(l_sys->tryGetAttr + <TARGETING::ATTR_MASTER_MBOX_SCRATCH>(l_scratchRegs), + "getBootNestFreq() failed to get MASTER_MBOX_SCRATCH"); + l_scratch4.data32 = l_scratchRegs[INITSERVICE::SPLESS::SCRATCH_4]; TRACFCOMP(g_trac_sbe, "The nest PLL bucket id is %d", @@ -4877,35 +4854,21 @@ namespace SBE errlHndl_t getBootMcSyncMode( uint8_t& o_mcSyncMode ) { errlHndl_t l_err = nullptr; - uint64_t l_mboxScratchReg5 = 0; INITSERVICE::SPLESS::MboxScratch5_t l_scratch5; - size_t l_indexSize = sizeof(l_mboxScratchReg5); - - TARGETING::Target * l_masterProcTarget = NULL; - TARGETING::targetService() - .masterProcChipTargetHandle( l_masterProcTarget ); TRACFCOMP( g_trac_sbe, ENTER_MRK"Enter getBootMcSyncMode()"); do { - l_err = deviceRead( l_masterProcTarget, - &l_mboxScratchReg5, - l_indexSize, - DEVICE_SCOM_ADDRESS( - INITSERVICE::SPLESS::MBOX_SCRATCH_REG5) ); - - if( l_err ) - { - TRACFCOMP(g_trac_sbe, - "getBootMcSyncMode::" - "Failed to get the bucket index from scom address"); - errlCommit(l_err, SBE_COMP_ID); - break; - } - - l_scratch5.data32 = static_cast<uint32_t>(l_mboxScratchReg5 >> 32); - + TARGETING::Target * l_sys = nullptr; + (void) TARGETING::targetService().getTopLevelTarget( l_sys ); + assert( l_sys, "getBootMcSyncMode() system target is NULL"); + + TARGETING::ATTR_MASTER_MBOX_SCRATCH_type l_scratchRegs; + assert(l_sys->tryGetAttr + <TARGETING::ATTR_MASTER_MBOX_SCRATCH>(l_scratchRegs), + "getBootMcSyncMode() failed to get MASTER_MBOX_SCRATCH"); + l_scratch5.data32 = l_scratchRegs[INITSERVICE::SPLESS::SCRATCH_5]; TRACFCOMP(g_trac_sbe, "The MC Sync Bit is %d", diff --git a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml index 6cc3fd09a..86278c68d 100644 --- a/src/usr/targeting/common/xmltohb/attribute_types_hb.xml +++ b/src/usr/targeting/common/xmltohb/attribute_types_hb.xml @@ -1723,4 +1723,21 @@ ID for the sensor number returned with the elog. --> <writeable/> </attribute> +<attribute> + <id>MASTER_MBOX_SCRATCH</id> + <description> + Value of the master mailbox scratch regs + at the beginning of the boot. Need to save these + away since HB uses some of them for communication purposes. + </description> + <simpleType> + <uint32_t></uint32_t> + <array>8</array> + </simpleType> + <persistency>volatile-zeroed</persistency> + <readable/> + <writeable/> + <hbOnly/> +</attribute> + </attributes> diff --git a/src/usr/targeting/common/xmltohb/target_types_hb.xml b/src/usr/targeting/common/xmltohb/target_types_hb.xml index a68f458e6..211cd9db7 100755 --- a/src/usr/targeting/common/xmltohb/target_types_hb.xml +++ b/src/usr/targeting/common/xmltohb/target_types_hb.xml @@ -80,6 +80,7 @@ <attribute><id>CLEAR_DIMM_SPD_ENABLE</id></attribute> <attribute><id>OCC_COMMON_AREA_PHYS_ADDR</id> </attribute> <attribute><id>ATTN_CHK_ALL_PROCS</id> </attribute> + <attribute><id>MASTER_MBOX_SCRATCH</id> </attribute> </targetTypeExtension> <targetTypeExtension> diff --git a/src/usr/targeting/targetservicestart.C b/src/usr/targeting/targetservicestart.C index c1f23a1f8..073f70eb5 100755 --- a/src/usr/targeting/targetservicestart.C +++ b/src/usr/targeting/targetservicestart.C @@ -57,7 +57,7 @@ #include <config.h> - +using namespace INITSERVICE::SPLESS; //****************************************************************************** // targetService //****************************************************************************** @@ -244,11 +244,21 @@ static void initializeAttributes(TargetService& i_targetService) l_pMasterProcChip->setAttr<ATTR_I2C_SWITCHES>(l_i2c_switches); + //Need to stash away the master mbox regs as they will + //be overwritten + ATTR_MASTER_MBOX_SCRATCH_type l_scratch; + for(size_t i=0; i< sizeof(l_scratch)/sizeof(l_scratch[0]); i++) + { + l_scratch[i] = + Util::readScratchReg(MBOX_SCRATCH_REG1+i); + } + + l_pTopLevel->setAttr<ATTR_MASTER_MBOX_SCRATCH>(l_scratch); + // Check mbox scratch reg 3 for IPL boot options // Specifically istep mode (bit 0) and MPIPL (bit 2) INITSERVICE::SPLESS::MboxScratch3_t l_scratch3; - l_scratch3.data32 = - Util::readScratchReg(INITSERVICE::SPLESS::MBOX_SCRATCH_REG3); + l_scratch3.data32 = l_scratch[SCRATCH_3]; // Targeting data defaults to non istep, only turn "on" if bit // is set so we don't tromp default setting |