Skip to content

Commit 5825828

Browse files
wghoffadcrowell77
authored andcommitted
Fix MMIO Addressing and Attributes on Non-Master Proc
- MMIOs to the MC/OMI space to a non-master proc were incorrectly using a base address pointing to proc0 - The OMI_INBAND_BAR_BASE_ADDR_OFFSET attribute MRW processing was incorrect for MC and OMI targets behind the 2nd proc Change-Id: Ife440541642463e11d4146157d568f8cd4440877 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/82234 Tested-by: Jenkins Server <[email protected]> Tested-by: Jenkins OP Build CI <[email protected]> Reviewed-by: Christian R Geddes <[email protected]> Tested-by: Jenkins OP HW <[email protected]> Tested-by: FSP CI Jenkins <[email protected]> Reviewed-by: Michael Baiocchi <[email protected]> Reviewed-by: Daniel M Crowell <[email protected]>
1 parent 51b7478 commit 5825828

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

src/usr/mmio/mmio.C

+13-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,19 @@ errlHndl_t mmioSetup()
108108
auto l_omiBaseAddr =
109109
l_mcTarget->getAttr<ATTR_OMI_INBAND_BAR_BASE_ADDR_OFFSET>();
110110

111-
// Apply the MMIO base offset so we get the real address
112-
uint64_t l_realAddr = ( l_omiBaseAddr | MMIO_BASE );
111+
// Build up the full address with group/chip address considerations
112+
auto l_procType = TARGETING::TYPE_PROC;
113+
TARGETING::Target* l_parentChip = getParent(l_mcTarget, l_procType);
114+
uint8_t l_groupId =
115+
l_parentChip->getAttr<ATTR_PROC_EFF_FABRIC_GROUP_ID>();
116+
uint8_t l_chipId =
117+
l_parentChip->getAttr<ATTR_PROC_EFF_FABRIC_CHIP_ID>();
118+
uint64_t l_realAddr = computeMemoryMapOffset( MMIO_BASE,
119+
l_groupId,
120+
l_chipId );
121+
122+
// Apply the MMIO base offset so we get the final address
123+
l_realAddr += l_omiBaseAddr;
113124

114125
// Map the device with a kernal call, each device, the MC, is 32 GB
115126
uint64_t l_virtAddr = reinterpret_cast<uint64_t>

src/usr/targeting/common/processMrw.pl

+4-4
Original file line numberDiff line numberDiff line change
@@ -1662,9 +1662,9 @@ sub processMcbist
16621662
##
16631663
sub processMc
16641664
{
1665-
# TODO, work needs to be done for OMI_INBAND_BAR_BASE_ADDR_OFFSET
1666-
# Will be added in a later commit along with the other BARs
1667-
# RTC:210315
1665+
# NOTE: OMI_INBAND_BAR_BASE_ADDR_OFFSET will be set for the MC
1666+
# targets via a specific child OMI Target. View the
1667+
# processOmi function for further details.
16681668
my $targetObj = shift;
16691669
my $target = shift;
16701670
@@ -1765,7 +1765,7 @@ sub processOmi
17651765
$value = "physical:sys-0/node-0/proc-$proc_num/" . $omi_map{$num};
17661766
$targetObj->setAttribute($target, "OMIC_PARENT", $value);
17671767
1768-
my $omi = Math::BigInt->new($targetObj->getAttribute($target,"FAPI_POS"));
1768+
my $omi = Math::BigInt->new($targetObj->getAttribute($target,"CHIP_UNIT"));
17691769
# Base omi bar offset
17701770
# We use this base address in simics_AXONE.system.xml and want our
17711771
# addresses to match the ones in that xml

0 commit comments

Comments
 (0)