summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorcrgeddes <crgeddes@us.ibm.com>2016-11-04 10:47:33 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2016-11-14 11:43:54 -0500
commit5eeea6b14a4b2e0d1d908f238d02699e1e0e86fa (patch)
tree58cd5bf2bf7fd28534ef3fd41ced66bb537a9e72 /src/usr
parent79365796a27a6de1d7b55cd41201480b3dd45194 (diff)
downloadtalos-hostboot-5eeea6b14a4b2e0d1d908f238d02699e1e0e86fa.tar.gz
talos-hostboot-5eeea6b14a4b2e0d1d908f238d02699e1e0e86fa.zip
Save Attribute Data in real memory in case of MPIPL
As an initial step towards our goal of booting from previous attr data and not re-finding out targeting/attr data from PNOR, this commit saves the targ/attr data that we put into HDAT to a memory address that HB owns (phyp shouldn't ever touch) so that we can use the info on the MPIPL path. Ideally this info would be coming from RT but that is the next step. This just proves that it can be done and outlines how we should do it. Change-Id: I664a8742eb35bcef011b6c274bf44e71ebf84d5d RTC: 157652 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32259 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/isteps/istep06/host_discover_targets.C15
-rw-r--r--src/usr/runtime/hdatservice.C16
-rw-r--r--src/usr/runtime/populate_hbruntime.C66
-rwxr-xr-xsrc/usr/targeting/attrrp.C143
-rwxr-xr-xsrc/usr/targeting/attrrp_common.C6
-rw-r--r--src/usr/targeting/runtime/attrrp_rt.C4
-rwxr-xr-xsrc/usr/targeting/targetservicestart.C67
7 files changed, 237 insertions, 80 deletions
diff --git a/src/usr/isteps/istep06/host_discover_targets.C b/src/usr/isteps/istep06/host_discover_targets.C
index 1bab0216c..36acb9c97 100644
--- a/src/usr/isteps/istep06/host_discover_targets.C
+++ b/src/usr/isteps/istep06/host_discover_targets.C
@@ -164,19 +164,10 @@ void* host_discover_targets( void *io_pArgs )
if (l_pTopLevel->getAttr<TARGETING::ATTR_IS_MPIPL_HB>())
{
TRACFCOMP(ISTEPS_TRACE::g_trac_isteps_trace,
- "host_discover_targets: MPIPL mode");
+ "host_discover_targets: MPIPL mode, targeting"
+ "information has already been loaded from memory"
+ "when the targeting service started");
- if(INITSERVICE::spBaseServicesEnabled())
- {
- // Sync attributes from Fsp
- l_err = TARGETING::syncAllAttributesFromFsp();
- }
- else
- {
- //TODO RTC:157651 we need this to be reading from the FSP
- // For now just discover targets the normal way
- l_err = HWAS::discoverTargets();
- }
}
else
{
diff --git a/src/usr/runtime/hdatservice.C b/src/usr/runtime/hdatservice.C
index 7df89c269..88475e0c4 100644
--- a/src/usr/runtime/hdatservice.C
+++ b/src/usr/runtime/hdatservice.C
@@ -269,13 +269,13 @@ errlHndl_t hdatService::get_standalone_section(
if( RUNTIME::HSVC_SYSTEM_DATA == i_section )
{
o_dataAddr = reinterpret_cast<uint64_t>(iv_mem_regions[0].virt_addr);
- o_dataSize = HSVC_TEST_SYSDATA_SIZE;
+ o_dataSize = MPIPL_SYSDATA_SIZE;
}
else if( RUNTIME::HSVC_NODE_DATA == i_section )
{
o_dataAddr = reinterpret_cast<uint64_t>(iv_mem_regions[0].virt_addr)
- + HSVC_TEST_SYSDATA_SIZE;
- o_dataSize = HSVC_TEST_NODEDATA_SIZE;
+ + MPIPL_SYSDATA_SIZE;
+ o_dataSize = MPIPL_NODEDATA_SIZE;
}
else if( RUNTIME::MS_DUMP_SRC_TBL == i_section )
{
@@ -514,12 +514,12 @@ errlHndl_t hdatService::loadHostData(void)
FakePayload::load();
// Map in some arbitrary memory for the HostServices code to use
- TRACFCOMP( g_trac_runtime, "load_host_data> STANDALONE: Mapping in 0x%X-0x%X (%d MB)", HSVC_TEST_MEMORY_ADDR,
- HSVC_TEST_MEMORY_ADDR+HSVC_TEST_MEMORY_SIZE,
- HSVC_TEST_MEMORY_SIZE);
+ TRACFCOMP( g_trac_runtime, "load_host_data> STANDALONE: Mapping in 0x%X-0x%X (%d MB)", MPIPL_ATTR_DATA_ADDR,
+ MPIPL_ATTR_DATA_ADDR+MPIPL_ATTR_DATA_SIZE,
+ MPIPL_ATTR_DATA_SIZE);
- errhdl = mapRegion(HSVC_TEST_MEMORY_ADDR,
- HSVC_TEST_MEMORY_SIZE, l_dummy);
+ errhdl = mapRegion(MPIPL_ATTR_DATA_ADDR,
+ MPIPL_ATTR_DATA_SIZE, l_dummy);
if(errhdl)
{
break;
diff --git a/src/usr/runtime/populate_hbruntime.C b/src/usr/runtime/populate_hbruntime.C
index 715ce1e4d..828ca0572 100644
--- a/src/usr/runtime/populate_hbruntime.C
+++ b/src/usr/runtime/populate_hbruntime.C
@@ -47,7 +47,8 @@
#include <sys/internode.h>
#include <vpd/vpd_if.H>
#include <targeting/attrrp.H>
-
+#include <sys/mm.h>
+#include <util/align.H>
namespace RUNTIME
{
@@ -151,6 +152,69 @@ errlHndl_t populate_RtDataByNode(uint64_t iNodeId)
// Get ATTRIBUTE data
TARGETING::AttrRP::save(l_hbrtDataAddr);
+ //Create a block map of memory so we can save a copy of the attribute
+ //data incase we need to MPIPL
+ uint64_t l_attrCopyVmemAddr =
+ reinterpret_cast<uint64_t>(mm_block_map(
+ reinterpret_cast<void*>(MPIPL_ATTR_DATA_ADDR),
+ MPIPL_ATTR_VMM_SIZE ));
+
+ //Make sure the address returned from the block map call is not NULL
+ if(l_attrCopyVmemAddr != 0)
+ {
+ //Save the memory map
+ TARGETING::AttrRP::save(l_attrCopyVmemAddr);
+
+ //Make sure to the virtual address because we won't need it anymore
+ int l_rc = mm_block_unmap(reinterpret_cast<void*>(l_attrCopyVmemAddr));
+
+ if(l_rc)
+ {
+ TRACFCOMP( g_trac_runtime,
+ "populate_RtDataByNode fail to unmap physical addr %p, virt addr %p",
+ reinterpret_cast<void*>(MPIPL_ATTR_DATA_ADDR),
+ reinterpret_cast<void*>(l_attrCopyVmemAddr));
+ /*@ errorlog tag
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid RUNTIME::MOD_POPULATE_RTDATABYNODE
+ * @reasoncode RUNTIME::RC_UNMAP_FAIL
+ * @userdata1 Phys address we are trying to unmap
+ * @userdata2 Virtual address we are trying to unmap
+ *
+ * @devdesc Error unmapping a virtual memory map
+ * @custdesc Kernel failed to unmap memory
+ */
+ l_elog = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ RUNTIME::MOD_POPULATE_RTDATABYNODE,
+ RUNTIME::RC_UNMAP_FAIL,
+ MPIPL_ATTR_DATA_ADDR,
+ l_attrCopyVmemAddr,
+ true);
+ }
+ }
+ else
+ {
+ TRACFCOMP( g_trac_runtime,
+ "populate_RtDataByNode fail to map physical addr %p, size %lx",
+ reinterpret_cast<void*>(MPIPL_ATTR_DATA_ADDR),
+ MPIPL_ATTR_VMM_SIZE );
+ /*@ errorlog tag
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid RUNTIME::MOD_POPULATE_RTDATABYNODE
+ * @reasoncode RUNTIME::RC_CANNOT_MAP_MEMORY
+ * @userdata1 Phys address we are trying to unmap
+ * @userdata2 Size of memory we are trying to map
+ *
+ * @devdesc Error unmapping a virtual memory map
+ * @custdesc Kernel failed to map memory
+ */
+ l_elog = new ERRORLOG::ErrlEntry(ERRORLOG::ERRL_SEV_UNRECOVERABLE,
+ RUNTIME::MOD_POPULATE_RTDATABYNODE,
+ RUNTIME::RC_CANNOT_MAP_MEMORY,
+ MPIPL_ATTR_DATA_ADDR,
+ MPIPL_ATTR_VMM_SIZE,
+ true);
+ }
} while(0);
diff --git a/src/usr/targeting/attrrp.C b/src/usr/targeting/attrrp.C
index 86cd1b748..d0cbda1b1 100755
--- a/src/usr/targeting/attrrp.C
+++ b/src/usr/targeting/attrrp.C
@@ -66,12 +66,13 @@ namespace TARGETING
return NULL;
}
- void AttrRP::startup(errlHndl_t& io_taskRetErrl)
+ void AttrRP::startup(errlHndl_t& io_taskRetErrl, bool i_isMpipl)
{
errlHndl_t l_errl = NULL;
do
{
+ iv_isMpipl = i_isMpipl;
// Parse PNOR headers.
l_errl = this->parseAttrSectHeader();
if (l_errl)
@@ -217,8 +218,8 @@ namespace TARGETING
if (rc != 0)
{
/*@
- * @errortype
- * @moduleid TARG_MOD_ATTRRP
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TARG_MSG_SERVICE_TASK
* @reasoncode TARG_RC_ATTR_MSG_FAIL
* @userdata1 Virtual Address
* @userdata2 (Msg Type << 32) | Section #
@@ -229,10 +230,13 @@ namespace TARGETING
* address outside a valid range or a message
* request that is invalid for the attribute
* section containing the address.
+ *
+ * @custdesc Attribute Resource Provider failed to handle
+ * request
*/
const bool hbSwError = true;
errlHndl_t l_errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
- TARG_MOD_ATTRRP,
+ TARG_MSG_SERVICE_TASK,
TARG_RC_ATTR_MSG_FAIL,
vAddr,
TWO_UINT32_TO_UINT64(
@@ -261,13 +265,58 @@ namespace TARGETING
{
// Locate attribute section in PNOR.
PNOR::SectionInfo_t l_pnorSectionInfo;
+ TargetingHeader* l_header = nullptr;
l_errl = PNOR::getSectionInfo(PNOR::HB_DATA,
l_pnorSectionInfo);
if (l_errl) break;
-
- // Find attribute section header.
- TargetingHeader* l_header =
+ if(!iv_isMpipl)
+ {
+ // Find attribute section header.
+ l_header =
reinterpret_cast<TargetingHeader*>(l_pnorSectionInfo.vaddr);
+ }
+ else
+ {
+ TRACFCOMP(g_trac_targeting,
+ "Reading attributes from memory, NOT PNOR");
+ //Create a block map of the address space we used to store
+ //attribute information on the initial IPL
+ l_header = reinterpret_cast<TargetingHeader*>(
+ mm_block_map(reinterpret_cast<void*>(MPIPL_ATTR_DATA_ADDR),
+ MPIPL_ATTR_VMM_SIZE));
+ if(l_header == 0)
+ {
+ TRACFCOMP(g_trac_targeting,
+ "Failed mapping phys addr: %p for %lx bytes",
+ MPIPL_ATTR_DATA_ADDR,
+ MPIPL_ATTR_VMM_SIZE);
+ //Error mm_block_map returned invalid ptr
+ /*@
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TARG_PARSE_ATTR_SECT_HEADER
+ * @reasoncode TARG_RC_MM_BLOCK_MAP_FAIL
+ * @userdata1 physical address of target info
+ * @userdata2 size we tried to map
+ *
+ * @devdesc While attempting to map a phys addr to a virtual
+ * addr for our targeting information the kernel
+ * returned an error
+ * @custdesc Kernel failed to block map memory
+ */
+ l_errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
+ TARG_PARSE_ATTR_SECT_HEADER,
+ TARG_RC_MM_BLOCK_FAIL,
+ MPIPL_ATTR_DATA_ADDR,
+ MPIPL_ATTR_VMM_SIZE,
+ true);
+ break;
+ }
+ TRACFCOMP(g_trac_targeting,
+ "Mapped phys addr: %p to virt addr: %p",
+ reinterpret_cast<void*>(MPIPL_ATTR_DATA_ADDR),
+ l_header);
+ }
+
// Validate eye catch.
if (l_header->eyeCatcher != PNOR_TARG_EYE_CATCHER)
@@ -278,8 +327,8 @@ namespace TARGETING
l_header->eyeCatcher,
PNOR_TARG_EYE_CATCHER);
/*@
- * @errortype
- * @moduleid TARG_MOD_ATTRRP
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TARG_PARSE_ATTR_SECT_HEADER
* @reasoncode TARG_RC_BAD_EYECATCH
* @userdata1 Observed Header Eyecatch Value
* @userdata2 Expected Eyecatch Value
@@ -297,7 +346,7 @@ namespace TARGETING
* to be parsed.
*/
l_errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
- TARG_MOD_ATTRRP,
+ TARG_PARSE_ATTR_SECT_HEADER,
TARG_RC_BAD_EYECATCH,
l_header->eyeCatcher,
PNOR_TARG_EYE_CATCHER);
@@ -308,13 +357,28 @@ namespace TARGETING
iv_sectionCount = l_header->numSections;
iv_sections = new AttrRP_Section[iv_sectionCount];
- // Find start to first section:
- // (PNOR addr + size of header + offset in header).
- TargetingSection* l_section =
+ TargetingSection* l_section = nullptr;
+ if(!iv_isMpipl)
+ {
+ // Find start to first section:
+ // (PNOR addr + size of header + offset in header).
+ l_section =
+ reinterpret_cast<TargetingSection*>(
+ l_pnorSectionInfo.vaddr + sizeof(TargetingHeader) +
+ l_header->offsetToSections
+ );
+ }
+ else
+ {
+ // Find start to first section:
+ // (header address + size of header + offset in header)
+ l_section =
reinterpret_cast<TargetingSection*>(
- l_pnorSectionInfo.vaddr + sizeof(TargetingHeader) +
- l_header->offsetToSections
- );
+ reinterpret_cast<uint64_t>(l_header) +
+ sizeof(TargetingHeader) + l_header->offsetToSections
+ );
+
+ }
// Parse each section.
for (size_t i = 0; i < iv_sectionCount; i++, ++l_section)
@@ -329,8 +393,16 @@ namespace TARGETING
static_cast<uint64_t>(
TARG_TO_PLAT_PTR(l_header->vmmBaseAddress)) +
l_header->vmmSectionOffset*i;
- iv_sections[i].pnorAddress = l_pnorSectionInfo.vaddr +
- l_section->sectionOffset;
+ if(!iv_isMpipl)
+ {
+ iv_sections[i].pnorAddress = l_pnorSectionInfo.vaddr + l_section->sectionOffset;
+ }
+ else
+ {
+ //For MPIPL we are reading from real memory, not pnor flash. Set the real memory address
+ //in place of the pnor address because that is where we are reading the data from
+ iv_sections[i].pnorAddress = reinterpret_cast<uint64_t>(l_header) + l_section->sectionOffset;
+ }
iv_sections[i].size = l_section->sectionSize;
TRACFCOMP(g_trac_targeting,
@@ -383,16 +455,17 @@ namespace TARGETING
default:
/*@
- * @errortype
- * @moduleid TARG_MOD_ATTRRP
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TARG_CREATE_VMM_SECTIONS
* @reasoncode TARG_RC_UNHANDLED_ATTR_SEC_TYPE
* @userdata1 Section type
*
* @devdesc Found unhandled attribute section type
+ * @custdesc FW error, unexpected Attribute section type
*/
const bool hbSwError = true;
l_errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
- TARG_MOD_ATTRRP,
+ TARG_CREATE_VMM_SECTIONS,
TARG_RC_UNHANDLED_ATTR_SEC_TYPE,
iv_sections[i].type,
0, hbSwError);
@@ -420,8 +493,8 @@ namespace TARGETING
if (rc)
{
/*@
- * @errortype
- * @moduleid TARG_MOD_ATTRRP
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TARG_CREATE_VMM_SECTIONS
* @reasoncode TARG_RC_MM_BLOCK_FAIL
* @userdata1 vAddress attempting to allocate.
* @userdata2 RC from kernel.
@@ -429,10 +502,11 @@ namespace TARGETING
* @devdesc While attempting to allocate a virtual
* memory block for an attribute section, the
* kernel returned an error.
+ * @custdesc Kernel failed to block memory
*/
const bool hbSwError = true;
l_errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
- TARG_MOD_ATTRRP,
+ TARG_CREATE_VMM_SECTIONS,
TARG_RC_MM_BLOCK_FAIL,
iv_sections[i].vmmAddress,
rc, hbSwError);
@@ -441,6 +515,8 @@ namespace TARGETING
if(iv_sections[i].type == SECTION_TYPE_PNOR_RW)
{
+ // TODO RTC:164480 For MPIPL we need to map the RW section
+ // in real memory to virtual address of the section in PNOR
/*
* Register this memory range to be FLUSHed during
* a shutdown.
@@ -458,8 +534,8 @@ namespace TARGETING
if (rc)
{
/*@
- * @errortype
- * @moduleid TARG_MOD_ATTRRP
+ * @errortype ERRORLOG::ERRL_SEV_UNRECOVERABLE
+ * @moduleid TARG_CREATE_VMM_SECTIONS
* @reasoncode TARG_RC_MM_PERM_FAIL
* @userdata1 vAddress attempting to allocate.
* @userdata2 (kernel-rc << 32) | (Permissions)
@@ -467,10 +543,13 @@ namespace TARGETING
* @devdesc While attempting to set permissions on
* a virtual memory block for an attribute
* section, the kernel returned an error.
+ *
+ * @custdesc Kernel failed to set permissions on
+ * virtual memory block
*/
const bool hbSwError = true;
l_errl = new ErrlEntry(ERRL_SEV_UNRECOVERABLE,
- TARG_MOD_ATTRRP,
+ TARG_CREATE_VMM_SECTIONS,
TARG_RC_MM_PERM_FAIL,
iv_sections[i].vmmAddress,
TWO_UINT32_TO_UINT64(rc, l_perm),
@@ -478,6 +557,16 @@ namespace TARGETING
break;
}
+ // The volatile sections in MPIPL need to be copied because
+ // on the MPIPL flow we will not run the HWPs that set these attrs
+ if(((iv_sections[i].type == SECTION_TYPE_HEAP_ZERO_INIT) ||
+ (iv_sections[i].type == SECTION_TYPE_HB_HEAP_ZERO_INIT)) &&
+ iv_isMpipl)
+ {
+ memcpy(reinterpret_cast<void*>(iv_sections[i].vmmAddress),
+ reinterpret_cast<void*>(iv_sections[i].pnorAddress),
+ (iv_sections[i].size));
+ }
} // End iteration through each section
if(l_errl)
diff --git a/src/usr/targeting/attrrp_common.C b/src/usr/targeting/attrrp_common.C
index 69810898d..07df1b1e3 100755
--- a/src/usr/targeting/attrrp_common.C
+++ b/src/usr/targeting/attrrp_common.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2015 */
+/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -59,10 +59,10 @@ namespace TARGETING
TARG_ASSERT(false, "Assert to exit ~AttrRP");
}
- void AttrRP::init(errlHndl_t &io_taskRetErrl)
+ void AttrRP::init(errlHndl_t &io_taskRetErrl, bool i_isMpipl)
{
// Call startup on singleton instance.
- Singleton<AttrRP>::instance().startup(io_taskRetErrl);
+ Singleton<AttrRP>::instance().startup(io_taskRetErrl, i_isMpipl);
}
bool AttrRP::writeSectionData(
diff --git a/src/usr/targeting/runtime/attrrp_rt.C b/src/usr/targeting/runtime/attrrp_rt.C
index dde880cc0..cf4370f05 100644
--- a/src/usr/targeting/runtime/attrrp_rt.C
+++ b/src/usr/targeting/runtime/attrrp_rt.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2013,2015 */
+/* Contributors Listed Below - COPYRIGHT 2013,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -36,7 +36,7 @@ using namespace ERRORLOG;
namespace TARGETING
{
- void AttrRP::startup(errlHndl_t& io_taskRetErrl)
+ void AttrRP::startup(errlHndl_t& io_taskRetErrl, bool isMpipl)
{
errlHndl_t l_errl = NULL;
diff --git a/src/usr/targeting/targetservicestart.C b/src/usr/targeting/targetservicestart.C
index 073f70eb5..89874132b 100755
--- a/src/usr/targeting/targetservicestart.C
+++ b/src/usr/targeting/targetservicestart.C
@@ -78,7 +78,10 @@ namespace TARGETING
/*
* @brief Initialize any attributes that need to be set early on
*/
-static void initializeAttributes(TargetService& i_targetService);
+static void initializeAttributes(TargetService& i_targetService,
+ bool i_isMpipl,
+ bool i_istepMode,
+ ATTR_MASTER_MBOX_SCRATCH_type& i_masterScratch);
/**
* @brief Check that at least one processor of our cpu type is being targeted
@@ -101,14 +104,41 @@ static void initTargeting(errlHndl_t& io_pError)
TARG_ENTER();
- AttrRP::init(io_pError);
+ //Need to stash away the master mbox regs as they will
+ //be overwritten
+ bool l_isMpipl = false;
+ bool l_isIstepMode = false;
+ ATTR_MASTER_MBOX_SCRATCH_type l_scratch = {0,0,0,0,0,0,0,0};
+
+ for(size_t i=0; i< sizeof(l_scratch)/sizeof(l_scratch[0]); i++)
+ {
+ l_scratch[i] =
+ Util::readScratchReg(MBOX_SCRATCH_REG1+i);
+ }
+
+ // 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 = l_scratch[SCRATCH_3];
+
+ if(l_scratch3.isMpipl)
+ {
+ TARG_INF("We are running MPIPL mode");
+ l_isMpipl = true;
+ }
+ if(l_scratch3.istepMode)
+ {
+ l_isIstepMode = true;
+ }
+
+ AttrRP::init(io_pError, l_isMpipl);
if (io_pError == NULL)
{
TargetService& l_targetService = targetService();
(void)l_targetService.init();
- initializeAttributes(l_targetService);
+ initializeAttributes(l_targetService, l_isMpipl, l_isIstepMode, l_scratch);
checkProcessorTargeting(l_targetService);
// Print out top-level model value from loaded targeting values.
@@ -209,12 +239,14 @@ static void checkProcessorTargeting(TargetService& i_targetService)
/*
* @brief Initialize any attributes that need to be set early on
*/
-static void initializeAttributes(TargetService& i_targetService)
+static void initializeAttributes(TargetService& i_targetService,
+ bool i_isMpipl,
+ bool i_istepMode,
+ ATTR_MASTER_MBOX_SCRATCH_type& i_masterScratch)
{
#define TARG_FN "initializeAttributes()...)"
TARG_ENTER();
- bool l_isMpipl = false;
Target* l_pTopLevel = NULL;
i_targetService.getTopLevelTarget(l_pTopLevel);
@@ -244,36 +276,17 @@ 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 = l_scratch[SCRATCH_3];
+ l_pTopLevel->setAttr<ATTR_MASTER_MBOX_SCRATCH>(i_masterScratch);
// Targeting data defaults to non istep, only turn "on" if bit
// is set so we don't tromp default setting
- if (l_scratch3.istepMode)
+ if (i_istepMode)
{
l_pTopLevel->setAttr<ATTR_ISTEP_MODE>(1);
}
-
- if (l_scratch3.isMpipl)
- {
- l_isMpipl = true;
- }
}
- if(l_isMpipl)
+ if(i_isMpipl)
{
l_pTopLevel->setAttr<ATTR_IS_MPIPL_HB>(1);
}
OpenPOWER on IntegriCloud