summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrasad Bg Ranganath <prasadbgr@in.ibm.com>2016-10-04 10:24:29 -0500
committerSachin Gupta <sgupta2m@in.ibm.com>2016-10-11 13:42:50 -0400
commitcfffbd57bd1feb4602b386b8ab3912820574293f (patch)
treeabedae5316353174aaab0f01c790020776dc060f
parent338653266e2a4b4bf2218616e210c825975c1889 (diff)
downloadtalos-sbe-cfffbd57bd1feb4602b386b8ab3912820574293f.tar.gz
talos-sbe-cfffbd57bd1feb4602b386b8ab3912820574293f.zip
SBE:PUTRING: Instance repair support
Change-Id: Id0ec9ea3dadff49e785b73669b4e76bba77093b8 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30679 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com> Reviewed-by: Gregory S. Still <stillgs@us.ibm.com> Reviewed-by: Jennifer A. Stofer <stofer@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/30683 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
-rw-r--r--src/hwpf/src/plat_ring_traverse.C37
-rw-r--r--src/import/chips/p9/utils/p9_putRingUtils.C11
-rw-r--r--src/import/chips/p9/utils/p9_putRingUtils.H7
3 files changed, 41 insertions, 14 deletions
diff --git a/src/hwpf/src/plat_ring_traverse.C b/src/hwpf/src/plat_ring_traverse.C
index 86c6515d..f93e566d 100644
--- a/src/hwpf/src/plat_ring_traverse.C
+++ b/src/hwpf/src/plat_ring_traverse.C
@@ -346,6 +346,7 @@ fapi2::ReturnCode getRS4ImageFromTor(
l_cpltRingVariantSz = i_applyOverride ? OVERRIDE_VARIANT_SIZE :
( sizeof(EQ::RingVariants) /
sizeof(l_cpltRingVariantSz));
+
l_sectionOffset = i_sectionTOR->TOC_EQ_COMMON_RING;
if(INSTANCE_RING == l_ringType)
@@ -388,28 +389,48 @@ fapi2::ReturnCode getRS4ImageFromTor(
SBE_TRACE ("l_sectionAddr %08X",l_sectionAddr);
+ uint16_t *l_ringTorAddr = NULL;
+
if(INSTANCE_RING == l_ringType)
{
- if ( l_chipletID > l_chipletData.iv_base_chiplet_number)
+ if ( l_chipletID >= l_chipletData.iv_base_chiplet_number)
{
uint8_t l_chipletOffset =
(l_chipletID - l_chipletData.iv_base_chiplet_number);
- l_sectionAddr += (l_chipletOffset *
- (l_chipletData.iv_num_instance_rings ));
+ if (l_chipLetType == EQ_TYPE)
+ {
+ if (fapi2::TARGET_TYPE_EX & (i_target.get().getFapiTargetType()))
+ {
+ uint32_t l_ex_number = i_target.get().getTargetInstance();
+ l_chipletOffset = l_ex_number;
+ SBE_TRACE ("l_chipletID %d l_ex_number %d",l_chipletID,l_ex_number);
+ }
+ }
+ SBE_TRACE ("l_chipletID %u l_chipletOffset %u",l_chipletID, l_chipletOffset);
+ l_ringTorAddr = reinterpret_cast<uint16_t *>(l_sectionAddr )+ ((l_chipletOffset *
+ (l_chipletData.iv_num_instance_rings *l_cpltRingVariantSz)) + (l_torOffset * l_cpltRingVariantSz));
+
+ }
+ else
+ {
+ l_ringTorAddr = reinterpret_cast<uint16_t *>(l_sectionAddr) +
+ (l_torOffset * l_cpltRingVariantSz);
}
}
+ else
+ {
+ // TOR records of Ring TOR are 2 bytes in size.
+ l_ringTorAddr = reinterpret_cast<uint16_t *>(l_sectionAddr) +
+ (l_torOffset * l_cpltRingVariantSz);
+ }
// The ring variants in section TOR are expected to be in the sequence -
// 1. Base
// 2. Cache-Contained
// 3. Risk Level
- SBE_TRACE ("l_sectionAddr %08X",l_sectionAddr);
- // TOR records of Ring TOR are 2 bytes in size.
- uint16_t *l_ringTorAddr = reinterpret_cast<uint16_t *>(l_sectionAddr) +
- (l_torOffset * l_cpltRingVariantSz);
SBE_TRACE ("ring tor address %04X\n",l_ringTorAddr);
// If there are non-base variants of the ring, we'll have to check
@@ -449,7 +470,7 @@ fapi2::ReturnCode getRS4ImageFromTor(
(l_addr + *l_ringTorAddr);
SBE_TRACE("l_rs4Address %08x",l_rs4Address);
l_rc = rs4DecompressionSvc(i_target,l_rs4Address,
- i_applyOverride,i_ringMode);
+ i_applyOverride,i_ringMode,l_ringType);
if(l_rc != fapi2::FAPI2_RC_SUCCESS)
{
SBE_TRACE("Error from applyRS4_SS");
diff --git a/src/import/chips/p9/utils/p9_putRingUtils.C b/src/import/chips/p9/utils/p9_putRingUtils.C
index ce968190..8273920e 100644
--- a/src/import/chips/p9/utils/p9_putRingUtils.C
+++ b/src/import/chips/p9/utils/p9_putRingUtils.C
@@ -363,7 +363,8 @@ fapi2::ReturnCode standardScan(
fapi2::ReturnCode setupScanRegion(const fapi2::Target<fapi2::TARGET_TYPE_ALL>&
i_target,
uint64_t i_scanRegion,
- const uint8_t i_chipletId)
+ const uint8_t i_chipletId,
+ const RINGTYPE i_ringType)
{
fapi2::ReturnCode l_rc;
uint32_t l_chiplet = i_chipletId << 24;
@@ -376,7 +377,8 @@ fapi2::ReturnCode setupScanRegion(const fapi2::Target<fapi2::TARGET_TYPE_ALL>&
l_chiplet = (l_chipletID << 24);
}
- if (fapi2::TARGET_TYPE_EX & (i_target.get().getFapiTargetType()))
+ if ((fapi2::TARGET_TYPE_EX & (i_target.get().getFapiTargetType())) &&
+ (i_ringType != INSTANCE_RING ))
{
// this gives position of ex (0 or 1)
uint32_t l_ex_number = i_target.get().getTargetInstance();
@@ -1083,7 +1085,8 @@ fapi2::ReturnCode rs4DecompressionSvc(
const fapi2::Target<fapi2::TARGET_TYPE_ALL>& i_target,
const uint8_t* i_rs4,
const bool i_applyOverride,
- const fapi2::RingMode i_ringMode)
+ const fapi2::RingMode i_ringMode,
+ const RINGTYPE i_ringType)
{
FAPI_INF(">> rs4DecompressionSvc");
CompressedScanData* l_rs4Header = (CompressedScanData*) i_rs4;
@@ -1130,7 +1133,7 @@ fapi2::ReturnCode rs4DecompressionSvc(
else
{
// Set up the scan region for the ring.
- l_rc = setupScanRegion(i_target, l_scanRegion, l_chipletId);
+ l_rc = setupScanRegion(i_target, l_scanRegion, l_chipletId, i_ringType);
if(l_rc != fapi2::FAPI2_RC_SUCCESS)
{
diff --git a/src/import/chips/p9/utils/p9_putRingUtils.H b/src/import/chips/p9/utils/p9_putRingUtils.H
index 865a9962..89a72c39 100644
--- a/src/import/chips/p9/utils/p9_putRingUtils.H
+++ b/src/import/chips/p9/utils/p9_putRingUtils.H
@@ -148,7 +148,8 @@ fapi2::ReturnCode standardScan(
fapi2::ReturnCode setupScanRegion(const fapi2::Target<fapi2::TARGET_TYPE_ALL>&
i_target,
uint64_t i_scanRegion,
- const uint8_t i_chipletId);
+ const uint8_t i_chipletId,
+ const RINGTYPE i_ringType = COMMON_RING);
/// @brief Function to write the header data to the ring.
@@ -179,13 +180,15 @@ fapi2::ReturnCode verifyHeader(const fapi2::Target<fapi2::TARGET_TYPE_ALL>&
/// @param[in] i_target Chiplet Target of Scan
/// @param[in] i_rs4 The RS4 compressed string
// @param[in] i_applyOverride: state of the override mode
+// @param[in] i_ringType : Ring type Instance /Common
// @param[in] i_ringMode differnet ring modes operations
/// @return FAPI2_RC_SUCCESS if success, else error code.
fapi2::ReturnCode rs4DecompressionSvc(
const fapi2::Target<fapi2::TARGET_TYPE_ALL>& i_target,
const uint8_t* i_rs4,
const bool i_applyOverride,
- const fapi2::RingMode i_ringMode);
+ const fapi2::RingMode i_ringMode,
+ const RINGTYPE i_ringType = COMMON_RING);
/// @brief Function to clean up the scan region and type
OpenPOWER on IntegriCloud