summaryrefslogtreecommitdiffstats
path: root/src/usr/targeting
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/targeting')
-rw-r--r--src/usr/targeting/common/Targets.pm6
-rwxr-xr-xsrc/usr/targeting/common/genHwsvMrwXml.pl2
-rw-r--r--src/usr/targeting/common/processMrw.pl34
-rw-r--r--src/usr/targeting/common/targetservice.C20
-rw-r--r--src/usr/targeting/common/util.C10
-rw-r--r--src/usr/targeting/common/xmltohb/attribute_types.xml20
-rw-r--r--src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml2
-rwxr-xr-xsrc/usr/targeting/common/xmltohb/target_types.xml3
-rw-r--r--src/usr/targeting/namedtarget.C10
-rw-r--r--src/usr/targeting/runtime/rt_targeting.C65
10 files changed, 96 insertions, 76 deletions
diff --git a/src/usr/targeting/common/Targets.pm b/src/usr/targeting/common/Targets.pm
index dffb5fa8b..102b9a025 100644
--- a/src/usr/targeting/common/Targets.pm
+++ b/src/usr/targeting/common/Targets.pm
@@ -5,7 +5,7 @@
#
# OpenPOWER HostBoot Project
#
-# Contributors Listed Below - COPYRIGHT 2015
+# Contributors Listed Below - COPYRIGHT 2015,2016
# [+] International Business Machines Corp.
#
#
@@ -464,8 +464,8 @@ sub buildAffinity
$self->setAttribute($target, "PHYS_PATH", $parent_physical);
$self->setAttribute($target, "POSITION", $proc);
$self->setAttribute($target, "ENTITY_INSTANCE",$proc);
- $self->setAttribute($target, "FABRIC_NODE_ID",
- $self->getAttribute($socket,"FABRIC_NODE_ID"));
+ $self->setAttribute($target, "FABRIC_GROUP_ID",
+ $self->getAttribute($socket,"FABRIC_GROUP_ID"));
$self->setAttribute($target, "FABRIC_CHIP_ID",
$self->getAttribute($socket,"FABRIC_CHIP_ID"));
diff --git a/src/usr/targeting/common/genHwsvMrwXml.pl b/src/usr/targeting/common/genHwsvMrwXml.pl
index 894a6483a..5f46030a0 100755
--- a/src/usr/targeting/common/genHwsvMrwXml.pl
+++ b/src/usr/targeting/common/genHwsvMrwXml.pl
@@ -3155,7 +3155,7 @@ sub generate_proc
<default>instance:$ipath</default>
</compileAttribute>
<attribute>
- <id>FABRIC_NODE_ID</id>
+ <id>FABRIC_GROUP_ID</id>
<default>$lognode</default>
</attribute>
<attribute>
diff --git a/src/usr/targeting/common/processMrw.pl b/src/usr/targeting/common/processMrw.pl
index 4f877377d..9d21ec101 100644
--- a/src/usr/targeting/common/processMrw.pl
+++ b/src/usr/targeting/common/processMrw.pl
@@ -125,7 +125,7 @@ foreach my $n (keys %{$targetObj->{TOPOLOGY}}) {
foreach my $p (keys %{$targetObj->{TOPOLOGY}->{$n}}) {
if ($targetObj->{TOPOLOGY}->{$n}->{$p} > 1) {
print "ERROR: Fabric topology invalid. 2 targets have same ".
- "FABRIC_NODE_ID,FABRIC_CHIP_ID ($n,$p)\n";
+ "FABRIC_GROUP_ID,FABRIC_CHIP_ID ($n,$p)\n";
$targetObj->myExit(3);
}
}
@@ -614,9 +614,9 @@ sub setupBars
#--------------------------------------------------
## Setup BARs
- my $node = $targetObj->getAttribute($target, "FABRIC_NODE_ID");
+ my $group = $targetObj->getAttribute($target, "FABRIC_GROUP_ID");
my $proc = $targetObj->getAttribute($target, "FABRIC_CHIP_ID");
- $targetObj->{TOPOLOGY}->{$node}->{$proc}++;
+ $targetObj->{TOPOLOGY}->{$group}->{$proc}++;
my @bars=("FSP_BASE_ADDR","PSI_BRIDGE_BASE_ADDR",
"INTP_BASE_ADDR","PHB_MMIO_ADDRS_64","PHB_MMIO_ADDRS_32",
@@ -636,10 +636,10 @@ sub setupBars
foreach my $bar (@bars)
{
- my ($num,$base,$node_offset,$proc_offset,$offset) = split(/,/,
+ my ($num,$base,$group_offset,$proc_offset,$offset) = split(/,/,
$targetObj->getAttribute($target,$bar));
my $i_base = Math::BigInt->new($base);
- my $i_node_offset = Math::BigInt->new($node_offset);
+ my $i_node_offset = Math::BigInt->new($group_offset);
my $i_proc_offset = Math::BigInt->new($proc_offset);
my $i_offset = Math::BigInt->new($offset);
@@ -654,7 +654,7 @@ sub setupBars
{
#Note: Hex convert method avoids overflow on 32bit machine
my $b=sprintf("0x%016s",substr((
- $i_base+$i_node_offset*$node+
+ $i_base+$i_node_offset*$group+
$i_proc_offset*$proc+$i_offset*$i)->as_hex(),2));
my $sep=",";
if ($i==$num-1)
@@ -677,20 +677,20 @@ sub processMcs
my $target = shift;
my $parentTarget = shift;
- my $node = $targetObj->getAttribute($parentTarget, "FABRIC_NODE_ID");
+ my $group = $targetObj->getAttribute($parentTarget, "FABRIC_GROUP_ID");
my $proc = $targetObj->getAttribute($parentTarget, "FABRIC_CHIP_ID");
- my ($base,$node_offset,$proc_offset,$offset) = split(/,/,
+ my ($base,$group_offset,$proc_offset,$offset) = split(/,/,
$targetObj->getAttribute($target,"IBSCOM_MCS_BASE_ADDR"));
my $i_base = Math::BigInt->new($base);
- my $i_node_offset = Math::BigInt->new($node_offset);
+ my $i_node_offset = Math::BigInt->new($group_offset);
my $i_proc_offset = Math::BigInt->new($proc_offset);
my $i_offset = Math::BigInt->new($offset);
my $mcs = $targetObj->getAttribute($target, "MCS_NUM");
#Note: Hex convert method avoids overflow on 32bit machines
my $mcsStr=sprintf("0x%016s",substr((
- $i_base+$i_node_offset*$node+
+ $i_base+$i_node_offset*$group+
$i_proc_offset*$proc+$i_offset*$mcs)->as_hex(),2));
$targetObj->setAttribute($target, "IBSCOM_MCS_BASE_ADDR", $mcsStr);
}
@@ -1071,16 +1071,16 @@ sub processMembufVpdAssociation
"VPD_REC_NUM",$targetObj->{vpd_num});
}
}
- my $node_assocs=$targetObj->findConnections($vpd->{DEST_PARENT},
+ my $group_assocs=$targetObj->findConnections($vpd->{DEST_PARENT},
"LOGICAL_ASSOCIATION","CARD");
- if ($node_assocs ne "") {
- foreach my $node_assoc (@{$node_assocs->{CONN}}) {
- my $mb_target = $node_assoc->{DEST_PARENT};
- my $node_target = $targetObj->getTargetParent($mb_target);
+ if ($group_assocs ne "") {
+ foreach my $group_assoc (@{$group_assocs->{CONN}}) {
+ my $mb_target = $group_assoc->{DEST_PARENT};
+ my $group_target = $targetObj->getTargetParent($mb_target);
setEepromAttributes($targetObj,
- "EEPROM_VPD_PRIMARY_INFO",$node_target,$vpd);
- $targetObj->setAttribute($node_target,
+ "EEPROM_VPD_PRIMARY_INFO",$group_target,$vpd);
+ $targetObj->setAttribute($group_target,
"VPD_REC_NUM",$targetObj->{vpd_num});
}
}
diff --git a/src/usr/targeting/common/targetservice.C b/src/usr/targeting/common/targetservice.C
index cd3870ded..a89a1fd9b 100644
--- a/src/usr/targeting/common/targetservice.C
+++ b/src/usr/targeting/common/targetservice.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -683,16 +683,16 @@ errlHndl_t TargetService::queryMasterProcChipTargetHandle(
targetService().end(),
&actingMasterProcFilter);
- TARGETING::ATTR_FABRIC_NODE_ID_type minFabricNodeId =
- TARGETING::FABRIC_NODE_ID_NOT_FOUND;
+ TARGETING::ATTR_FABRIC_GROUP_ID_type minFabricGroupId =
+ TARGETING::FABRIC_GROUP_ID_NOT_FOUND;
for(; blueprintProcs; ++blueprintProcs)
{
- TARGETING::ATTR_FABRIC_NODE_ID_type fabricNodeId =
+ TARGETING::ATTR_FABRIC_GROUP_ID_type fabricGroupId =
blueprintProcs->getAttr<
- TARGETING::ATTR_FABRIC_NODE_ID>();
- if(fabricNodeId < minFabricNodeId)
+ TARGETING::ATTR_FABRIC_GROUP_ID>();
+ if(fabricGroupId < minFabricGroupId)
{
- minFabricNodeId = fabricNodeId;
+ minFabricGroupId = fabricGroupId;
pMasterProc = *blueprintProcs;
}
}
@@ -1018,11 +1018,11 @@ void TargetService::dump() const
TARG_INF("XSCOM Base Address = 0x%016llX",l_xscomBaseAddr);
}
- uint8_t l_Node_Id = 0;
+ uint8_t l_Group_Id = 0;
if ( l_allTargets->tryGetAttr<
- ATTR_FABRIC_NODE_ID>(l_Node_Id))
+ ATTR_FABRIC_GROUP_ID>(l_Group_Id))
{
- TARG_INF("XSCOM Node ID = 0x%X",l_Node_Id);
+ TARG_INF("XSCOM Node ID = 0x%X",l_Group_Id);
}
uint8_t l_Chip_Id = 0;
diff --git a/src/usr/targeting/common/util.C b/src/usr/targeting/common/util.C
index dd4a7082d..1fbb563f7 100644
--- a/src/usr/targeting/common/util.C
+++ b/src/usr/targeting/common/util.C
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2012,2015 */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -298,16 +298,16 @@ uint64_t get_bottom_mem_addr(void)
bool orderByNodeAndPosition( Target* i_firstProc,
Target* i_secondProc)
{
- uint8_t nodeId0 = i_firstProc->getAttr<ATTR_FABRIC_NODE_ID>();
- uint8_t nodeId1 = i_secondProc->getAttr<ATTR_FABRIC_NODE_ID>();
+ uint8_t groupId0 = i_firstProc->getAttr<ATTR_FABRIC_GROUP_ID>();
+ uint8_t groupId1 = i_secondProc->getAttr<ATTR_FABRIC_GROUP_ID>();
uint8_t fabpos0 = i_firstProc->getAttr<ATTR_FABRIC_CHIP_ID>();
uint8_t fabpos1 = i_secondProc->getAttr<ATTR_FABRIC_CHIP_ID>();
- if (nodeId0 == nodeId1)
+ if (groupId0 == groupId1)
{
return fabpos0 < fabpos1;
}
- return nodeId0 < nodeId1;
+ return groupId0 < groupId1;
}
uint8_t is_fused_mode( )
diff --git a/src/usr/targeting/common/xmltohb/attribute_types.xml b/src/usr/targeting/common/xmltohb/attribute_types.xml
index 813204720..a0228b446 100644
--- a/src/usr/targeting/common/xmltohb/attribute_types.xml
+++ b/src/usr/targeting/common/xmltohb/attribute_types.xml
@@ -2323,6 +2323,7 @@
<attribute>
<id>FABRIC_NODE_ID</id>
<description>
+ DEPRECATED!!!!
Chip attribute.
Logical fabric node the chip belongs to.
Provided by the Machine Readable Workbook.
@@ -2340,6 +2341,25 @@
</attribute>
<attribute>
+ <id>FABRIC_GROUP_ID</id>
+ <description>
+ Chip attribute.
+ Logical fabric group the chip belongs to.
+ Provided by the Machine Readable Workbook.
+ Can vary across drawers.
+ </description>
+ <simpleType><uint8_t>
+ <default>0</default>
+ </uint8_t></simpleType>
+ <persistency>non-volatile</persistency>
+ <readable/>
+ <hwpfToHbAttrMap>
+ <id>ATTR_FABRIC_GROUP_ID</id>
+ <macro>DIRECT</macro>
+ </hwpfToHbAttrMap>
+</attribute>
+
+<attribute>
<id>FABRIC_CHIP_ID</id>
<description>
Chip attribute.
diff --git a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
index 5c13545bc..8b8f680d0 100644
--- a/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
+++ b/src/usr/targeting/common/xmltohb/simics_NIMBUS.system.xml
@@ -188,7 +188,7 @@
</attribute>
<!-- End FSI connections -->
<attribute>
- <id>FABRIC_NODE_ID</id>
+ <id>FABRIC_GROUP_ID</id>
<default>0</default>
</attribute>
<attribute>
diff --git a/src/usr/targeting/common/xmltohb/target_types.xml b/src/usr/targeting/common/xmltohb/target_types.xml
index d6bff1c84..9cf860eaa 100755
--- a/src/usr/targeting/common/xmltohb/target_types.xml
+++ b/src/usr/targeting/common/xmltohb/target_types.xml
@@ -390,7 +390,8 @@
<id>FSI_GP_REG_SCOM_ACCESS</id>
<default>1</default>
</attribute>
- <attribute><id>FABRIC_NODE_ID</id></attribute>
+ <attribute><id>FABRIC_NODE_ID</id></attribute><!-- DEPRECATED -->
+ <attribute><id>FABRIC_GROUP_ID</id></attribute>
<attribute><id>FABRIC_CHIP_ID</id></attribute>
<attribute>
<!-- Processor chips have an SBE -->
diff --git a/src/usr/targeting/namedtarget.C b/src/usr/targeting/namedtarget.C
index 22144bcea..6b247f4d8 100644
--- a/src/usr/targeting/namedtarget.C
+++ b/src/usr/targeting/namedtarget.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2012,2014 */
+/* Contributors Listed Below - COPYRIGHT 2012,2016 */
+/* [+] 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. */
@@ -62,8 +64,8 @@ const TARGETING::Target * getMasterCore( )
TARGETING::Target * l_processor = NULL;
(void)TARGETING::targetService().masterProcChipTargetHandle( l_processor );
- FABRIC_NODE_ID_ATTR l_logicalNodeId =
- l_processor->getAttr<TARGETING::ATTR_FABRIC_NODE_ID>();
+ FABRIC_GROUP_ID_ATTR l_logicalGroupId =
+ l_processor->getAttr<TARGETING::ATTR_FABRIC_GROUP_ID>();
FABRIC_CHIP_ID_ATTR l_chipId =
l_processor->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>();
@@ -89,7 +91,7 @@ const TARGETING::Target * getMasterCore( )
uint64_t pir = l_coreId << 3;
pir |= l_chipId << 7;
- pir |= l_logicalNodeId << 10;
+ pir |= l_logicalGroupId << 10;
if (pir == l_masterCoreID){
TRACFCOMP( g_trac_targeting,
diff --git a/src/usr/targeting/runtime/rt_targeting.C b/src/usr/targeting/runtime/rt_targeting.C
index 4707d63e9..707be836d 100644
--- a/src/usr/targeting/runtime/rt_targeting.C
+++ b/src/usr/targeting/runtime/rt_targeting.C
@@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* COPYRIGHT International Business Machines Corp. 2014 */
+/* Contributors Listed Below - COPYRIGHT 2014,2016 */
+/* [+] 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. */
@@ -32,6 +34,7 @@
#include <targeting/common/utilFilter.H>
#include <targeting/common/trace.H>
#include <targeting/common/targreasoncodes.H>
+#include <arch/pirformat.H>
#include <runtime/rt_targeting.H>
@@ -89,20 +92,19 @@ errlHndl_t getRtTarget(const TARGETING::Target* i_target,
if(target_type == TARGETING::TYPE_PROC)
{
- // use 0b0000.0000.0000.0000.0000.0000.00NN.NCCC:
uint32_t fabId =
- i_target->getAttr<TARGETING::ATTR_FABRIC_NODE_ID>();
+ i_target->getAttr<TARGETING::ATTR_FABRIC_GROUP_ID>();
uint32_t procPos =
i_target->getAttr<TARGETING::ATTR_FABRIC_CHIP_ID>();
- o_chipId = (fabId << CHIPID_NODE_SHIFT) + procPos;
+ o_chipId = PIR_t::createChipId( fabId, procPos );
}
else if( target_type == TARGETING::TYPE_MEMBUF)
{
//MEMBUF
- // 0b1000.0000.0000.0000.0000.00NN.NCCC.MMMM
- // where NNN id node, CCC is chip, MMMM is memory channel
+ // 0b1000.0000.0000.0000.0000.0GGG.GCCC.MMMM
+ // where GGGG is group, CCC is chip, MMMM is memory channel
//
TARGETING::TargetHandleList targetList;
@@ -163,16 +165,15 @@ errlHndl_t getRtTarget(const TARGETING::Target* i_target,
break;
}
- o_chipId = (o_chipId << UNIT_ID_SHIFT);
+ o_chipId = (o_chipId << MEMBUF_ID_SHIFT);
o_chipId += pos;
- o_chipId |= MEMBUF_ID_TYPE;
+ o_chipId |= MEMBUF_TYPE;
}
- else if(target_type == TARGETING::TYPE_EX ||
- target_type == TARGETING::TYPE_CORE)
+ else if(target_type == TARGETING::TYPE_CORE)
{
- // EX/CORE
- // 0b0100.0000.0000.0000.0000.00NN.NCCC.PPPP
- // NNN is node, CCC is chip, PPPP is core
+ // CORE
+ // 0b0100.0000.0000.0000.0000.GGGG.CCCP.PPPP
+ // GGGG is group, CCC is chip, PPPPP is core
uint32_t pos = i_target->getAttr<TARGETING::ATTR_CHIP_UNIT>();
const TARGETING::Target * proc_target = getParentChip(i_target);
@@ -188,9 +189,8 @@ errlHndl_t getRtTarget(const TARGETING::Target* i_target,
break;
}
- o_chipId = (o_chipId << UNIT_ID_SHIFT);
- o_chipId += pos;
- o_chipId |= CORE_ID_TYPE;
+ o_chipId = PIR_t::createCoreId(o_chipId,pos);
+ o_chipId |= CORE_TYPE;
}
else
{
@@ -234,18 +234,18 @@ errlHndl_t getHbTarget(rtChipId_t i_rt_chip_id,
do
{
- uint64_t idType = i_rt_chip_id & CHIPID_ID_MASK;
+ uint64_t idType = i_rt_chip_id & CHIPID_TYPE_MASK;
- if(0 != (idType == MEMBUF_ID_TYPE))
+ if(0 != (idType == MEMBUF_TYPE))
{
//membuf
- uint64_t chip_id = i_rt_chip_id & UNIT_ID_MASK;
- uint32_t unitPos = chip_id & 0x0000000f;
- chip_id >>= UNIT_ID_SHIFT;
+ uint64_t proc_chip_id = i_rt_chip_id & ~CHIPID_TYPE_MASK;
+ uint32_t unitPos = proc_chip_id & MEMBUF_ID_MASK;
+ proc_chip_id >>= MEMBUF_ID_SHIFT;
TARGETING::Target * proc = NULL;
TARGETING::Target * msc = NULL;
- err = getHbTarget(chip_id, proc);
+ err = getHbTarget(proc_chip_id, proc);
if(err)
{
break;
@@ -308,13 +308,11 @@ errlHndl_t getHbTarget(rtChipId_t i_rt_chip_id,
}
}
- else if(0 != (idType == CORE_ID_TYPE))
+ else if(0 != (idType == CORE_TYPE))
{
- // core/ex will alway return EX chiplet as there is no concept
- // (yet) of a core in fapi
- uint64_t chip_id = i_rt_chip_id & UNIT_ID_MASK;
- uint32_t unitPos = chip_id & 0x0000000f;
- chip_id >>= UNIT_ID_SHIFT;
+ uint64_t core_id = i_rt_chip_id & ~CHIPID_TYPE_MASK;
+ uint32_t unitPos = PIR_t::coreFromCoreId(core_id);
+ uint64_t chip_id = PIR_t::chipFromCoreId(core_id);
TARGETING::Target * proc = NULL;
err = getHbTarget(chip_id, proc);
@@ -323,7 +321,7 @@ errlHndl_t getHbTarget(rtChipId_t i_rt_chip_id,
break;
}
- PredicateCTM exFilter(CLASS_UNIT, TYPE_EX);
+ PredicateCTM exFilter(CLASS_UNIT, TYPE_CORE);
PredicateAttrVal<ATTR_CHIP_UNIT> unitAttr(unitPos);
PredicatePostfixExpr exUnitFilter;
exUnitFilter.push(&exFilter).push(&unitAttr).And();
@@ -343,15 +341,14 @@ errlHndl_t getHbTarget(rtChipId_t i_rt_chip_id,
}
// o_target not found caught below..
}
- else if( idType == PROC_ID_TYPE)
+ else if( idType == PROC_TYPE)
{
// assume processor chip
- // chip_id = 'NNNCCC'b
- uint32_t fabId = i_rt_chip_id >> CHIPID_NODE_SHIFT;
- uint32_t procPos = i_rt_chip_id & 0x7;
+ uint32_t fabId = PIR_t::groupFromChipId(i_rt_chip_id);
+ uint32_t procPos = PIR_t::chipFromChipId(i_rt_chip_id);
PredicateCTM procFilter(CLASS_CHIP, TYPE_PROC);
- PredicateAttrVal<ATTR_FABRIC_NODE_ID> nodeFilter(fabId);
+ PredicateAttrVal<ATTR_FABRIC_GROUP_ID> nodeFilter(fabId);
PredicateAttrVal<ATTR_FABRIC_CHIP_ID> chipFilter(procPos);
PredicatePostfixExpr theProc, theAttrs;
OpenPOWER on IntegriCloud