diff options
author | Martin Peschke <mpeschke@de.ibm.com> | 2016-10-28 15:37:33 +0200 |
---|---|---|
committer | Christian R. Geddes <crgeddes@us.ibm.com> | 2016-12-19 14:56:19 -0500 |
commit | f4dc308e69fcdadeecc4432e93f9eafd0f64dccb (patch) | |
tree | b14c774807c00bf76259d015dd6c0f70e2977aa8 /src | |
parent | e74e0755f961d9069852fca1fa0e4c4724989e48 (diff) | |
download | talos-hostboot-f4dc308e69fcdadeecc4432e93f9eafd0f64dccb.tar.gz talos-hostboot-f4dc308e69fcdadeecc4432e93f9eafd0f64dccb.zip |
Shrinking RS4 header
Implements a new 12 byte CompressedScanData structure with less
and refined members in order to save space for rings.
Used test tool to verify correctness of p9_scan_compression changes.
Used p9_xip_tool dissect to verify .rings of HW Image with new RS4
header.
Change-Id: I68b3044b62908d013778f87343798ebaa6829923
RTC:158078
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/31551
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: PPE CI <ppe-ci+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Claus M. Olsen <cmolsen@us.ibm.com>
Reviewed-by: Prem Shanker Jha <premjha2@in.ibm.com>
Reviewed-by: Prachi Gupta <pragupta@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/31969
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Diffstat (limited to 'src')
11 files changed, 1029 insertions, 690 deletions
diff --git a/src/import/chips/p9/procedures/hwp/accessors/p9_get_mvpd_ring.C b/src/import/chips/p9/procedures/hwp/accessors/p9_get_mvpd_ring.C index 72f63f030..8fa09557e 100644 --- a/src/import/chips/p9/procedures/hwp/accessors/p9_get_mvpd_ring.C +++ b/src/import/chips/p9/procedures/hwp/accessors/p9_get_mvpd_ring.C @@ -48,17 +48,17 @@ extern "C" const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> & i_fapiTarget, const uint8_t i_chipletId, - const uint64_t i_evenOddMask, + const uint8_t i_evenOdd, const uint8_t i_ringId, uint8_t* i_pRingBuf, uint32_t& io_rRingBufsize ) { fapi2::ReturnCode l_fapirc; - FAPI_DBG("getMvpdRing: Called w/ringId=0x%x, chipletId=0x%x, evenOddMask=0x%016llx, size=0x%x", + FAPI_DBG("getMvpdRing: Called w/ringId=0x%x, chipletId=0x%x, evenOdd=0x%x, size=0x%x", i_ringId, i_chipletId, - i_evenOddMask, + i_evenOdd, io_rRingBufsize ); // common get and set processing @@ -67,7 +67,7 @@ extern "C" i_keyword, i_fapiTarget, i_chipletId, - i_evenOddMask, + i_evenOdd, i_ringId, i_pRingBuf, io_rRingBufsize ); diff --git a/src/import/chips/p9/procedures/hwp/accessors/p9_get_mvpd_ring.H b/src/import/chips/p9/procedures/hwp/accessors/p9_get_mvpd_ring.H index 622c11687..6fe70da71 100644 --- a/src/import/chips/p9/procedures/hwp/accessors/p9_get_mvpd_ring.H +++ b/src/import/chips/p9/procedures/hwp/accessors/p9_get_mvpd_ring.H @@ -65,7 +65,7 @@ extern "C" * MVPD_RECORD_CP00 - MVPD_KEYWORD_PDG * @param i_fapiTarget - cpu target * @param i_chipletId - Chiplet ID - * @param i_evenOddMask - Mask to choose even or odd EX. O for all other chiplets + * @param i_evenOdd - Even (0) or odd (1) EX. Disregarded for other chiplets. * @param i_ringId - Ring ID * @param i_pRingBuf - pointer to a buffer allocated by the caller * to receive the ring header and data. @@ -86,7 +86,7 @@ extern "C" * caller does compression and decompression. * Buffer: io_rRingBufsize returns xNN. * byte x0 CompressedScanData structure (rs4 header) - * byte x18 compressed data (sizeof CompressedScanData is 0x18) + * byte x0C compressed data (sizeof CompressedScanData is 0x0C) * byte xNN last byte of compressed data * * @return fapi2::ReturnCode - FAPI_RC_SUCCESS if success, @@ -97,7 +97,7 @@ extern "C" const Target<TARGET_TYPE_PROC_CHIP>& i_fapiTarget, const uint8_t i_chipletId, - const uint64_t i_evenOddMask, + const uint8_t i_evenOdd, const uint8_t i_ringId, uint8_t* io_pRingBuf, uint32_t& io_rRingBufsize ); diff --git a/src/import/chips/p9/procedures/hwp/accessors/p9_mvpd_ring_funcs.C b/src/import/chips/p9/procedures/hwp/accessors/p9_mvpd_ring_funcs.C index 939ce2619..527a63509 100644 --- a/src/import/chips/p9/procedures/hwp/accessors/p9_mvpd_ring_funcs.C +++ b/src/import/chips/p9/procedures/hwp/accessors/p9_mvpd_ring_funcs.C @@ -41,6 +41,7 @@ // pull in CompressedScanData def from proc_slw_build HWP #include <p9_scan_compression.H> #include <p9_ring_identification.H> +#include <p9_ringId.H> extern "C" @@ -59,7 +60,7 @@ extern "C" fapi2::MvpdRecord i_record, fapi2::MvpdKeyword i_keyword, const uint8_t i_chipletId, - const uint64_t i_evenOddMask, + const uint8_t i_evenOdd, const uint8_t i_ringId, uint8_t* i_pRecordBuf, uint32_t i_recordBufLenfapi, @@ -164,8 +165,9 @@ extern "C" * @param[in] i_chipletId * Chiplet ID for the op * - * @param[in] i_evenOddMask - * Mask to choose even or odd EX. O for all other chiplets + * @param[in] i_evenOdd + * Indicates whether to choose even (0) or odd (1) EX. + * Undefined and to be disregarded for non-EX. * * @param[in] i_ringId * Ring ID for the op @@ -186,7 +188,7 @@ extern "C" const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> & i_fapiTarget, const uint8_t i_chipletId, - const uint64_t i_evenOddMask, + const uint8_t i_evenOdd, const uint8_t i_ringId, uint8_t* i_pRingBuf, uint32_t& io_rRingBufsize ) @@ -198,11 +200,11 @@ extern "C" uint32_t l_ringLen = 0; FAPI_DBG("mvpdRingFunc: Called w/op=0x%x, ringId=0x%x, chipletId=0x%x, " - "evenOddMask=0x%016llx, size=0x%x", + "evenOdd=0x%x, size=0x%x", i_mvpdRingFuncOp, i_ringId, i_chipletId, - i_evenOddMask, + i_evenOdd, io_rRingBufsize ); // do common get and set input parameter error checks @@ -262,9 +264,9 @@ extern "C" l_recordBuf, l_recordLen ), "mvpdRingFunc: getMvpdField failed " - "chipletId=0x%x, evenOddMask=0x%016llx, ringId=0x%x", + "chipletId=0x%x, evenOdd=0x%x, ringId=0x%x", i_chipletId, - i_evenOddMask, + i_evenOdd, i_ringId); // find ring in the record. It is an error if not there for a "get". @@ -274,16 +276,16 @@ extern "C" i_record, i_keyword, i_chipletId, - i_evenOddMask, + i_evenOdd, i_ringId, l_recordBuf, l_recordLen, l_pRing, l_ringLen), "mvpdRingFunc: mvpdRingFuncFind failed " - "chipletId=0x%x, evenOddMask=0x%016llx, ringId=0x%x", + "chipletId=0x%x, evenOdd=0x%x, ringId=0x%x", i_chipletId, - i_evenOddMask, + i_evenOdd, i_ringId); // do the get or set specific operations @@ -315,9 +317,9 @@ extern "C" i_pRingBuf, io_rRingBufsize), "mvpdRingFunc: mvpdRingFuncGet failed " - "chipletId=0x%x, evenOddMask=0x%016llx, ringId=0x%x", + "chipletId=0x%x, evenOdd=0x%x, ringId=0x%x", i_chipletId, - i_evenOddMask, + i_evenOdd, i_ringId); } else // set operation @@ -371,6 +373,279 @@ extern "C" return l_fapirc; } + // Attempts to find the MVPD END marker at given buffer address. + // Returns o_mvpdEnd: true if END marker read, false otherwise. + // Adjusts buffer pointer and length for the consumed portion of buffer, if any. + fapi2::ReturnCode mvpdRingFuncFindEnd( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> + & i_fapiTarget, + uint8_t** io_pBufLeft, + uint32_t* io_pBufLenLeft, + bool* o_mvpdEnd) + { + uint32_t l_mvpdMagic; + const uint8_t l_mvpdMagicLength = 3; // we match against 3 out of 4 bytes + + *o_mvpdEnd = false; + + if (*io_pBufLenLeft < l_mvpdMagicLength) + { + return fapi2::current_err; + } + + l_mvpdMagic = *(reinterpret_cast<uint32_t*>(*io_pBufLeft)); + l_mvpdMagic = be32toh(l_mvpdMagic) & 0xffffff00; + + // Check for end of data magic word + if (l_mvpdMagic == (MVPD_END_OF_DATA_MAGIC & 0xffffff00)) + { + *o_mvpdEnd = true; + + FAPI_DBG("mvpdRingFuncFind: Found end of VPD data " + "at address 0x%x", + *io_pBufLeft); + + *io_pBufLeft += l_mvpdMagicLength; + *io_pBufLenLeft -= l_mvpdMagicLength; + } + + return fapi2::current_err; + } + + + // Returns a matching MVPD ring in RS4 v2 format at given buffer address, + // NULL otherwise. + // Adjusts buffer pointer and remaining length for the consumed portion + // of buffer, that is, for the size of a matching MVPD ring, if any. + // This function is needed only for backward compatibility, and may be + // removed as soon as no RS4 v2 MVPD rings will be available. + fapi2::ReturnCode mvpdRingFuncFindOld( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> + & i_fapiTarget, + const uint8_t i_chipletId, + const uint8_t i_evenOdd, + const uint8_t i_ringId, + uint8_t** io_pBufLeft, + uint32_t* io_pBufLenLeft, + CompressedScanData** o_pScanData) + { + uint64_t l_evenOddMask; + CompressedScanData l_scanData; + + // old CompressedScanData structure + typedef struct + { + uint32_t iv_magic; + uint32_t iv_size; + uint32_t iv_algorithmReserved; + uint32_t iv_length; + uint64_t iv_scanSelect; + uint8_t iv_headerVersion; + uint8_t iv_flushOptimization; + uint8_t iv_ringId; + uint8_t iv_chipletId; + } OldCompressedScanData; + + OldCompressedScanData* l_pScanDataOld = + reinterpret_cast<OldCompressedScanData*>(*io_pBufLeft); + + *o_pScanData = NULL; + + // check if buffer is big enough for old ring header + if (*io_pBufLenLeft < sizeof(OldCompressedScanData)) + { + return fapi2::current_err; + } + + // check magic word assuming an old ring header + if ((be32toh(l_pScanDataOld->iv_magic) & 0xffffff00) != 0x52533400) + { + return fapi2::current_err; + } + + // make sure that buffer is big enough for entire ring + FAPI_ASSERT(*io_pBufLenLeft >= be32toh(l_pScanDataOld->iv_size), + fapi2::MVPD_INSUFFICIENT_RECORD_SPACE(), + "mvpdRingFuncFind: data does not fit " + "into record buffer: ringId=0x%x, chipletId=0x%x", + i_ringId, + i_chipletId ); + + // ok, this is a ring with an old header, + // hence this part of the input buffer can be considered consumed, + // regardless of it being the ring to be found or not + *io_pBufLeft += be32toh(l_pScanDataOld->iv_size); + *io_pBufLenLeft -= be32toh(l_pScanDataOld->iv_size); + + // for a few rings there are two different copies, + // called even and odd, which we need to consider + // as an extra search criterion for those rings (EX only) + switch (i_ringId) + { + case ex_l3_refr_time: + case ex_l3_refr_repr: + l_evenOddMask = 0x0008000000000000 >> i_evenOdd; + break; + + case ex_l2_repr: + l_evenOddMask = 0x0080000000000000 >> i_evenOdd; + break; + + case ex_l3_repr: + l_evenOddMask = 0x0200000000000000 >> i_evenOdd; + break; + + default: + l_evenOddMask = 0; + } + + // check if this ring matches the given criteria + // (ring ID, chiplet Id, and even/odd for EX) + if ( l_pScanDataOld->iv_ringId == i_ringId && + l_pScanDataOld->iv_chipletId == i_chipletId && + (l_evenOddMask == 0 || + be64toh(l_pScanDataOld->iv_scanSelect) & l_evenOddMask) ) + { + // look up ring in p9_ringId and retrieve scanAddr + GenRingIdList* l_ringProp = p9_ringid_get_ring_properties( + (RingID)i_ringId); + FAPI_ASSERT(l_ringProp, + fapi2::MVPD_RINGID_DATA_NOT_FOUND(), + "mvpdRingFuncFind: lookup of scanAddr failed " + "for ringId=0x%x, chipletId=0x%x", + i_ringId, + i_chipletId); + + // update chipletId in iv_scanScomAddress (for instance rings) + uint32_t l_scanScomAddr = l_ringProp->scanScomAddress; + + if (i_chipletId != (l_scanScomAddr & 0xff000000) >> 24) + { + l_scanScomAddr = (l_scanScomAddr & 0x00ffffff) | + (((uint32_t)i_chipletId) << 24); + } + + // translate old ring header to new ring header + l_scanData.iv_magic = htobe16(RS4_MAGIC); + l_scanData.iv_version = RS4_VERSION; + l_scanData.iv_type = RS4_SCAN_DATA_TYPE_NON_CMSK; + l_scanData.iv_size = htobe16( + (be32toh(l_pScanDataOld->iv_size) + - sizeof(OldCompressedScanData) + + sizeof(CompressedScanData))); + l_scanData.iv_ringId = htobe16(i_ringId); + l_scanData.iv_scanAddr = htobe32(l_scanScomAddr); + + // overwrite old ring header with new ring header + memcpy(l_pScanDataOld, &l_scanData, sizeof(l_scanData)); + + // move compressed ring data to position adjacent to new header + memmove((uint8_t*)l_pScanDataOld + sizeof(CompressedScanData), + (uint8_t*)l_pScanDataOld + sizeof(OldCompressedScanData), + be16toh(l_scanData.iv_size) - sizeof(CompressedScanData)); + + // return found ring in new format + *o_pScanData = reinterpret_cast<CompressedScanData*> + (l_pScanDataOld); + + FAPI_DBG("mvpdRingFuncFindOld: found RS4 v2 ring for " + "chipletId 0x%x, evenOdd %d and ringId %d " + "at address 0x%x and with old/translated size %d/%d", + i_chipletId, + i_evenOdd, + i_ringId, + *o_pScanData, + be32toh(l_pScanDataOld->iv_size), + be16toh((*o_pScanData)->iv_size)); + } + + fapi_try_exit: + return fapi2::current_err; + } + + + // Returns a matching MVPD ring in RS4 v3 format at given buffer address, + // NULL otherwise. + // Adjusts buffer pointer and remaining length for the consumed portion + // of buffer, that is, for the size of a matching MVPD ring, if any. + fapi2::ReturnCode mvpdRingFuncFindNew( const fapi2::Target<fapi2::TARGET_TYPE_PROC_CHIP> + & i_fapiTarget, + const uint8_t i_chipletId, + const uint8_t i_evenOdd, + const uint8_t i_ringId, + uint8_t** io_pBufLeft, + uint32_t* io_pBufLenLeft, + CompressedScanData** o_pScanData) + { + uint32_t l_evenOddMask; + + CompressedScanData* l_pScanData = + reinterpret_cast<CompressedScanData*>(*io_pBufLeft); + + *o_pScanData = NULL; + + // check if buffer is big enough for new ring header + if (*io_pBufLenLeft < sizeof(CompressedScanData)) + { + return fapi2::current_err; + } + + // check magic word assuming a new ring header + if (be16toh(l_pScanData->iv_magic) != RS4_MAGIC) + { + return fapi2::current_err; + } + + // make sure that buffer is big enough for entire ring + FAPI_ASSERT(*io_pBufLenLeft >= be16toh(l_pScanData->iv_size), + fapi2::MVPD_INSUFFICIENT_RECORD_SPACE(), + "mvpdRingFuncFind: data does not fit " + "into record buffer: ringId=0x%x, chipletId=0x%x", + i_ringId, + i_chipletId); + + // ok, this is a ring with a new header, + // hence this part of the input buffer can be considered consumed, + // regardless of it being the ring to be found or not + *io_pBufLeft += be16toh(l_pScanData->iv_size); + *io_pBufLenLeft -= be16toh(l_pScanData->iv_size); + + // for a few rings there are two different copies, + // called even and odd, which we need to consider + // as an extra search criterion for those rings (EX only) + switch (i_ringId) + { + case ex_l3_refr_time: + case ex_l3_refr_repr: + case ex_l2_repr: + case ex_l3_repr: + l_evenOddMask = 0x00000800 >> i_evenOdd; + break; + + default: + l_evenOddMask = 0; + } + + if ( be16toh(l_pScanData->iv_ringId) == i_ringId && + (be32toh(l_pScanData->iv_scanAddr) & 0xFF000000UL) >> 24 + == i_chipletId && + ( l_evenOddMask == 0 || + (be32toh(l_pScanData->iv_scanAddr) & l_evenOddMask) ) ) + { + // found it, return pointer to ring + *o_pScanData = l_pScanData; + + FAPI_DBG("mvpdRingFuncFindNew: found RS4 v3 ring for " + "chipletId 0x%x, evenOdd %d and ringId %d " + "at address 0x%x and with size %d", + i_chipletId, + i_evenOdd, + i_ringId, + *o_pScanData, + be16toh((*o_pScanData)->iv_size)); + } + + fapi_try_exit: + return fapi2::current_err; + } /** * @brief MVPD Ring Function Find @@ -381,8 +656,9 @@ extern "C" * @param[in] i_chipletId * Chiplet ID for the op * - * @param[in] i_evenOddMask - * Mask to choose even or odd EX. O for all other chiplets + * @param[in] i_evenOdd + * Indicates whether choose even (0) or odd (1) EX. + * Undefined and to be disregarded for non-EX. * * @param[in] i_ringId * Ring ID for the op @@ -409,149 +685,102 @@ extern "C" fapi2::MvpdRecord i_record, fapi2::MvpdKeyword i_keyword, const uint8_t i_chipletId, - const uint64_t i_evenOddMask, + const uint8_t i_evenOdd, const uint8_t i_ringId, uint8_t* i_pRecordBuf, uint32_t i_recordBufLen, uint8_t*& o_rpRing, uint32_t& o_rRingLen ) { - fapi2::ReturnCode l_fapirc; - uint8_t* l_pRing = NULL; - uint32_t l_offset = 0; - CompressedScanData* l_pScanData = NULL; - bool l_foundflag = false; - - // initialize return fields in case of an error. - o_rpRing = NULL; - o_rRingLen = 0; + fapi2::ReturnCode l_fapirc; + bool l_mvpdEnd; + CompressedScanData* l_pScanData = NULL; + uint32_t l_prevLen; + uint32_t l_recordBufLenLeft = i_recordBufLen; - FAPI_DBG("mvpdRingFuncFind: Called w/chipletId=0x%x, evenOddMask=0x%016llx, ringId=0x%x ", + FAPI_DBG("mvpdRingFuncFind: Called w/chipletId=0x%x, evenOdd=0x%x, ringId=0x%x ", i_chipletId, - i_evenOddMask, + i_evenOdd, i_ringId); + // Find first RSA data block in ring (fixed offset defined by + // MVPD spec) + // + // First byte in record should be the version number, skip + // over this. + // + FAPI_DBG( "mvpdRingFuncFind: record version = 0x%x", *i_pRecordBuf ); + i_pRecordBuf++; + l_recordBufLenLeft--; + do { - // Point to record - l_pRing = i_pRecordBuf; - - // Find first RSA data block in ring (fixed offset defined by - // MVPD spec) - // - // First byte in record should be the version number, skip - // over this. - // - FAPI_DBG( "mvpdRingFuncFind: record version = 0x%x", *l_pRing ); - l_pRing++; - l_offset = 0; - - // point to header of first ring in record - l_pScanData = - reinterpret_cast<CompressedScanData*>( l_pRing + l_offset ); - - l_foundflag = false; - - // be sure that data we will look at is within the passed buffer - while ( (l_offset + be32toh(l_pScanData->iv_size)) < i_recordBufLen ) + // let's track the previous size of the remaining buffer, + // so that we can determine whether we have found anything, + // and bail out if not (= buffer content corrupted) + l_prevLen = l_recordBufLenLeft; + + // first look for vpd end marker + FAPI_TRY(mvpdRingFuncFindEnd(i_fapiTarget, + &i_pRecordBuf, + &l_recordBufLenLeft, + &l_mvpdEnd), + "mvpdRingFuncFind: mvpdRingFuncFindEnd failed"); + + // next look for old ring header, because + // its magic "RS4" is not as ambigiuous as the new "RS" magic + if (!l_mvpdEnd) { + FAPI_TRY(mvpdRingFuncFindOld(i_fapiTarget, + i_chipletId, + i_evenOdd, + i_ringId, + &i_pRecordBuf, + &l_recordBufLenLeft, + &l_pScanData), + "mvpdRingFuncFind: mvpdRingFuncFindOld failed"); + } - // There's only two valid header words that may appear in the Mvpd record: - // - MVPD_END_OF_DATA_MAGIC which indicates end of the data with a record. - // - RS4_MAGIC which indicates the beginning of another VPD ring. - // - Anything else is a catastrophic failure. - - // Check for end of data magic word - if ((be32toh(l_pScanData->iv_magic) & 0xffffff00) == (MVPD_END_OF_DATA_MAGIC & 0xffffff00)) - { - FAPI_DBG("mvpdRingFuncFind: Found end of data magic word (=0x%08X): " - "offset=0x%x, chipletId=0x%x, ringId=0x%x", - be32toh(l_pScanData->iv_magic), - l_offset, - i_chipletId, - i_ringId); - break; - } - - // Check magic word to make sure this is valid data. - FAPI_ASSERT( (be32toh(l_pScanData->iv_magic) & 0xffffff00) == (RS4_MAGIC & 0xffffff00), - fapi2::MVPD_INVALID_RS4_HEADER(). - set_CHIP_TARGET(i_fapiTarget). - set_MVPD_RECORD(i_record). - set_MVPD_KEYWORD(i_keyword), - "mvpdRingFuncFind: Couldn't find RS4 or End-of-data magic word in header: " - "Header=0x%x, offset=0x%x, ringId=0x%x, chipletId=0x%x", - be32toh(l_pScanData->iv_magic), - l_offset, - i_ringId, - i_chipletId ); - - // We can now assume good data... - - // Dump record info for debug - FAPI_DBG("mvpdRingFuncFind:%d ringId=0x%x chipletId=0x%x" - " ringlen=0x%x size=0x%x", - l_offset, - l_pScanData->iv_ringId, - l_pScanData->iv_chipletId, - be32toh(l_pScanData->iv_length), - be32toh(l_pScanData->iv_size) ); - - - if ( l_pScanData->iv_ringId == i_ringId && - l_pScanData->iv_chipletId == i_chipletId && - ( i_evenOddMask == 0 || (be64toh(l_pScanData->iv_scanSelect) & i_evenOddMask) ) ) - { - FAPI_DBG( "mvpdRingFuncFind: Found it: ringId=0x%x, " - "chipletId=0x%x, evenOddMask=0x%016llx, ringlen=0x%x", - i_ringId, - i_chipletId, - i_evenOddMask, - be32toh(l_pScanData->iv_length) ); - - // shouldn't happen, but does not all fit - FAPI_ASSERT(l_offset + be32toh(l_pScanData->iv_size) <= - i_recordBufLen, - fapi2::MVPD_INSUFFICIENT_RECORD_SPACE(), - "mvpdRingFuncFind: data does not fit " - "into record buffer: ringId=0x%x, chipletId=0x%x", - i_ringId, - i_chipletId ); - - l_foundflag = true; - o_rpRing = l_pRing + l_offset; - o_rRingLen = be32toh(l_pScanData->iv_size); - // got it, break out of scan loop - break; - } - - // being defensive. - if ( be32toh(l_pScanData->iv_size) == 0) - { - // size of 0 is invalid, would loop forever. - break; - } - - // bump to next ring - l_offset += be32toh(l_pScanData->iv_size) ; - - // point to header - l_pScanData = - reinterpret_cast<CompressedScanData*>( l_pRing + l_offset ); - - - } // end while scan loop - - // if no other error and not found, indicate with 0 size. - if ( !l_fapirc && ! l_foundflag ) + // last look for new ring header + if (!l_mvpdEnd && !l_pScanData) { - o_rpRing = l_pRing + l_offset; //return pointer to end of list - //incase needed for appending - o_rRingLen = 0; //indicate not found + FAPI_TRY(mvpdRingFuncFindNew(i_fapiTarget, + i_chipletId, + i_evenOdd, + i_ringId, + &i_pRecordBuf, + &l_recordBufLenLeft, + &l_pScanData), + "mvpdRingFuncFind: mvpdRingFuncFindNew failed"); } + FAPI_ASSERT(l_prevLen != l_recordBufLenLeft, + fapi2::MVPD_RING_FUNC_ENDLESS(), + "mvpdRingFuncFind: found neither END marker, nor valid" + " ring at address 0x%x for remaining buffer size 0x%d.", + i_pRecordBuf, + l_recordBufLenLeft); + } + while (!l_mvpdEnd && !l_pScanData && l_recordBufLenLeft); + + if (l_pScanData) + { + o_rpRing = (uint8_t*)l_pScanData; + o_rRingLen = be16toh(l_pScanData->iv_size); + + // Dump record info for debug + FAPI_DBG("mvpdRingFuncFind:ringId=0x%x chipletId=0x%x size=0x%x", + i_ringId, + i_chipletId, + be16toh(l_pScanData->iv_size)); + } + else + { + // if no error and not found, return pointer to end of list + // in case it's needed for appending, and indicate with 0 size + o_rpRing = i_pRecordBuf; + o_rRingLen = 0; } - while ( 0 ); fapi_try_exit: // get current error @@ -586,10 +815,11 @@ extern "C" * * @return fapi2::ReturnCode */ - fapi2::ReturnCode mvpdValidateRingHeader( CompressedScanData* i_pRingBuf, - uint8_t i_chipletId, - uint8_t i_ringId, - uint32_t i_ringBufsize) + fapi2::ReturnCode mvpdValidateRingHeader( + CompressedScanData* i_pRingBuf, + uint8_t i_chipletId, + uint8_t i_ringId, + uint32_t i_ringBufsize) { FAPI_ASSERT(i_ringBufsize > sizeof(CompressedScanData), fapi2::MVPD_RING_FUNC_INVALID_PARAMETER(), @@ -597,25 +827,26 @@ extern "C" "chipletId=0x%x, ringId=0x%x", i_chipletId, i_ringId); - FAPI_ASSERT((be32toh(i_pRingBuf->iv_magic) & 0xffffff00) == (RS4_MAGIC & 0xffffff00), + FAPI_ASSERT(be16toh(i_pRingBuf->iv_magic) == RS4_MAGIC, fapi2::MVPD_RING_FUNC_INVALID_PARAMETER(), "mvpdValidateRingHeader: i_pRingBuf->iv_magic failed " "chipletId=0x%x, ringId=0x%x", i_chipletId, i_ringId); - FAPI_ASSERT(i_pRingBuf->iv_ringId == i_ringId, + FAPI_ASSERT(be16toh(i_pRingBuf->iv_ringId) == i_ringId, fapi2::MVPD_RING_FUNC_INVALID_PARAMETER(), "mvpdValidateRingHeader: i_pRingBuf->iv_ringId failed " "chipletId=0x%x, ringId=0x%x", i_chipletId, i_ringId); - FAPI_ASSERT(i_pRingBuf->iv_chipletId == i_chipletId, + FAPI_ASSERT((be32toh(i_pRingBuf->iv_scanAddr) & 0xFF000000UL) >> 24 + == i_chipletId, fapi2::MVPD_RING_FUNC_INVALID_PARAMETER(), "mvpdValidateRingHeader: i_pRingBuf->iv_chipletId failed " "chipletId=0x%x, ringId=0x%x", i_chipletId, i_ringId); - FAPI_ASSERT(be32toh(i_pRingBuf->iv_size) == i_ringBufsize, + FAPI_ASSERT(be16toh(i_pRingBuf->iv_size) == i_ringBufsize, fapi2::MVPD_RING_FUNC_INVALID_PARAMETER(), "mvpdValidateRingHeader: i_pRingBuf->iv_size failed " "chipletId=0x%x, ringId=0x%x", diff --git a/src/import/chips/p9/procedures/hwp/accessors/p9_mvpd_ring_funcs.H b/src/import/chips/p9/procedures/hwp/accessors/p9_mvpd_ring_funcs.H index 6965d4b1b..396db3419 100644 --- a/src/import/chips/p9/procedures/hwp/accessors/p9_mvpd_ring_funcs.H +++ b/src/import/chips/p9/procedures/hwp/accessors/p9_mvpd_ring_funcs.H @@ -72,7 +72,7 @@ extern "C" * @param i_keyword - Keyword enumerator * @param i_fapiTarget - cpu target * @param i_chipletId - Chiplet ID - * @param i_evenOddMask - Mask to choose even or odd EX. O for all other chiplets + * @param i_evenOddMask - Even (0) or odd (1) EX. Disregarded for other chiplets. * @param i_ringId - Ring ID * @param i_pRingBuf - The buffer to receive or send the ring * @param io_rRingBufsize - Size of ring / ring buffer @@ -86,7 +86,7 @@ extern "C" const Target<TARGET_TYPE_PROC_CHIP>& i_fapiTarget, const uint8_t i_chipletId, - const uint64_t i_evenOddMask, + const uint8_t i_evenOdd, const uint8_t i_ringId, uint8_t* i_pRingBuf, uint32_t& io_rRingBufsize ); diff --git a/src/import/chips/p9/procedures/hwp/accessors/p9_mvpd_ring_funcs.mk b/src/import/chips/p9/procedures/hwp/accessors/p9_mvpd_ring_funcs.mk index 601b92808..e936a8d70 100644 --- a/src/import/chips/p9/procedures/hwp/accessors/p9_mvpd_ring_funcs.mk +++ b/src/import/chips/p9/procedures/hwp/accessors/p9_mvpd_ring_funcs.mk @@ -26,4 +26,5 @@ # Include the macros and things for MVPD ring procedures PROCEDURE=p9_mvpd_ring_funcs $(call ADD_MODULE_INCDIR,$(PROCEDURE),$(ROOTPATH)/chips/p9/utils/imageProcs) +lib$(PROCEDURE)_DEPLIBS+=p9_ringId $(call BUILD_PROCEDURE) diff --git a/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C index 00723dea3..cb50b073e 100644 --- a/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C +++ b/src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C @@ -165,11 +165,9 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings( int l_rc = 0; uint8_t l_chipletId; - uint8_t l_ringsPerChipletId = 0; + uint8_t l_ringsPerChipletId = 1; uint8_t l_instanceIdMax; uint8_t l_evenOdd; - uint64_t l_evenOddMaskStart; - uint64_t l_evenOddMask; // 0:even, 1:odd uint8_t bSkipRing = 0; @@ -191,40 +189,8 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings( if (i_ring.vpdRingClass == VPD_RING_CLASS_EX_INS) { l_ringsPerChipletId = 2; - - switch (i_ring.ringId) - { - case ex_l3_refr_time: - case ex_l3_refr_repr: - l_evenOddMaskStart = ((uint64_t)0x00080000) << 32; - break; - - case ex_l2_repr: - l_evenOddMaskStart = ((uint64_t)0x00800000) << 32; - break; - - case ex_l3_repr: - l_evenOddMaskStart = ((uint64_t)0x02000000) << 32; - break; - - default: - FAPI_ASSERT( false, - fapi2::XIPC_MVPD_RING_ID_MESS(). - set_CHIP_TARGET(i_proc_target). - set_RING_ID(i_ring.ringId), - "Code bug: Wrong assumption about supported ringIds in this context. " - "ringId=%d(=0x%x)(=ringId.ringName) is not allowed here. ", - i_ring.ringId, i_ring.ringId, i_ring.ringName ); - break; - } - } - else - { - l_ringsPerChipletId = 1; - l_evenOddMaskStart = 0; } - // We use ring.instanceIdMax column to govern max value of instanceIdMax (i.e., the // max chipletId). But unlike in P8, in P9 we will not search for chipletId=0xff in P9 // MVPD. It is no longer used in the MVPD. We merely keep the multicast Id, 0xff, in @@ -243,9 +209,6 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings( for (l_evenOdd = 0; l_evenOdd < l_ringsPerChipletId; l_evenOdd++) { - - l_evenOddMask = l_evenOddMaskStart >> l_evenOdd; - FAPI_INF("_fetch_and_insert_vpd_rings: (ringId,chipletId) = (0x%02X,0x%02x)", i_ring.ringId, l_chipletId); @@ -298,7 +261,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings( l_mvpdKeyword, i_proc_target, l_chipletId, - l_evenOddMask, + l_evenOdd, i_ring.ringId, (uint8_t*)i_vpdRing, l_vpdRingSize ); @@ -322,7 +285,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings( l_mvpdKeyword, i_proc_target, l_chipletId, - l_evenOddMask, + l_evenOdd, i_ring.ringId, (uint8_t*)i_vpdRing, l_vpdRingSize ); @@ -345,7 +308,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings( l_mvpdKeyword, i_proc_target, l_chipletId, - l_evenOddMask, + l_evenOdd, i_ring.ringId, (uint8_t*)i_vpdRing, l_vpdRingSize ); @@ -370,7 +333,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings( l_mvpdKeyword, i_proc_target, l_chipletId, - l_evenOddMask, + l_evenOdd, i_ring.ringId, (uint8_t*)i_vpdRing, l_vpdRingSize ); @@ -392,12 +355,12 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings( else if (l_fapiRc == fapi2::FAPI2_RC_SUCCESS) { - auto l_vpdChipletId = ((CompressedScanData*)i_vpdRing)->iv_chipletId; + auto l_scanAddr = + be32toh(((CompressedScanData*)i_vpdRing)->iv_scanAddr); + auto l_vpdChipletId = (l_scanAddr & 0xFF000000UL) >> 24; // Even though success, checking that chipletId didn't somehow get // messed up (code bug). - //@TODO: Modify this when chipletId becomes part of iv_scanAddress - // as part of RS4 shrinkage (RTC158101). FAPI_ASSERT( l_vpdChipletId == l_chipletId, fapi2::XIPC_MVPD_CHIPLET_ID_MESS(). set_CHIP_TARGET(i_proc_target). @@ -426,7 +389,7 @@ fapi2::ReturnCode _fetch_and_insert_vpd_rings( // Also fix p9_mvpd_ring_funcs.C to look for entire RS4_MAGIC string. // Actually, do all the above in connection with RS4 header // shrinkage (RTC158101 and RTC159801). - ((CompressedScanData*)i_vpdRing)->iv_magic = htobe32(RS4_MAGIC); + ((CompressedScanData*)i_vpdRing)->iv_magic = htobe16(RS4_MAGIC); // Check if ring is a flush ring, i.e. if it is redundant, meaning that it will // result in no change. diff --git a/src/import/chips/p9/procedures/xml/error_info/p9_mvpd_ring_funcs_errors.xml b/src/import/chips/p9/procedures/xml/error_info/p9_mvpd_ring_funcs_errors.xml index 4250b2eef..d9258f91e 100644 --- a/src/import/chips/p9/procedures/xml/error_info/p9_mvpd_ring_funcs_errors.xml +++ b/src/import/chips/p9/procedures/xml/error_info/p9_mvpd_ring_funcs_errors.xml @@ -26,6 +26,15 @@ <hwpErrors> <!-- ********************************************************************* --> <hwpError> + <rc>RC_MVPD_RING_FUNC_ENDLESS</rc> + <description>failed to interprete VPD data buffer</description> + <callout> + <procedure>CODE</procedure> + <priority>HIGH</priority> + </callout> + </hwpError> + <!-- ********************************************************************* --> + <hwpError> <rc>RC_MVPD_RING_FUNC_INVALID_PARAMETER</rc> <description>MVPD ring function parameter is not valid</description> <callout> @@ -85,4 +94,13 @@ </callout> </hwpError> <!-- ********************************************************************* --> + <hwpError> + <rc>RC_MVPD_RINGID_DATA_NOT_FOUND</rc> + <description>Data for given ringId missing in p9_ringId</description> + <callout> + <procedure>CODE</procedure> + <priority>HIGH</priority> + </callout> + </hwpError> + <!-- ********************************************************************* --> </hwpErrors> diff --git a/src/import/chips/p9/utils/imageProcs/p9_ringId.C b/src/import/chips/p9/utils/imageProcs/p9_ringId.C index 90f17753e..da31ca45f 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_ringId.C +++ b/src/import/chips/p9/utils/imageProcs/p9_ringId.C @@ -30,29 +30,28 @@ namespace PERV { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"perv_fure" , 0x00, 0x01, 0x01, NON_VPD_RING, 0, 0x0800000000009000}, - {"perv_gptr" , 0x01, 0x01, 0x01, NON_VPD_RING, 0, 0x0800000000002000}, - {"perv_time" , 0x02, 0x01, 0x01, NON_VPD_RING, 0, 0x0800000000000100}, - {"occ_fure" , 0x03, 0x01, 0x01, NON_VPD_RING, 0, 0x0100000000009000}, - {"occ_gptr" , 0x04, 0x01, 0x01, NON_VPD_RING, 0, 0x0100000000002000}, - {"occ_time" , 0x05, 0x01, 0x01, NON_VPD_RING, 0, 0x0100000000000100}, - {"perv_ana_func" , 0x06, 0x01, 0x01, NON_VPD_RING, 0, 0x0080000000008000}, - {"perv_ana_gptr" , 0x07, 0x01, 0x01, NON_VPD_RING, 0, 0x0080000000002000}, - {"perv_pll_gptr" , 0x08, 0x01, 0x01, NON_VPD_RING, 0, 0x0002000000002000}, - {"perv_pll_bndy_bucket_1" , 0x09, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x0002000000000080}, - {"perv_pll_bndy_bucket_2" , 0x0a, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x0002000000000080}, - {"perv_pll_bndy_bucket_3" , 0x0b, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x0002000000000080}, - {"perv_pll_bndy_bucket_4" , 0x0c, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x0002000000000080}, - {"perv_pll_bndy_bucket_5" , 0x0d, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x0002000000000080}, - {"perv_pll_func" , 0x0e, 0x01, 0x01, NON_VPD_RING, 0, 0x0002000000008000}, - + {"perv_fure" , 0x00, 0x01, 0x01, NON_VPD_RING , 0, 0x0103400F}, + {"perv_gptr" , 0x01, 0x01, 0x01, NON_VPD_RING , 0, 0x01034002}, + {"perv_time" , 0x02, 0x01, 0x01, NON_VPD_RING , 0, 0x01034007}, + {"occ_fure" , 0x03, 0x01, 0x01, NON_VPD_RING , 0, 0x0103080F}, + {"occ_gptr" , 0x04, 0x01, 0x01, NON_VPD_RING , 0, 0x01030802}, + {"occ_time" , 0x05, 0x01, 0x01, NON_VPD_RING , 0, 0x01030807}, + {"perv_ana_func" , 0x06, 0x01, 0x01, NON_VPD_RING , 0, 0x01030400}, + {"perv_ana_gptr" , 0x07, 0x01, 0x01, NON_VPD_RING , 0, 0x01030402}, + {"perv_pll_gptr" , 0x08, 0x01, 0x01, NON_VPD_RING , 0, 0x01030012}, + {"perv_pll_bndy_bucket_1", 0x09, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x01030018}, + {"perv_pll_bndy_bucket_2", 0x0a, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x01030018}, + {"perv_pll_bndy_bucket_3", 0x0b, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x01030018}, + {"perv_pll_bndy_bucket_4", 0x0c, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x01030018}, + {"perv_pll_bndy_bucket_5", 0x0d, 0x01, 0x01, NON_VPD_PLL_RING, 5, 0x01030018}, + {"perv_pll_func" , 0x0e, 0x01, 0x01, NON_VPD_RING , 0, 0x01030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"perv_repr" , 0x0f, 0x01, 0x01, NON_VPD_RING, 0, 0x0800000000000200}, - {"occ_repr" , 0x10, 0x01, 0x01, NON_VPD_RING, 0, 0x0100000000000200}, + {"perv_repr" , 0x0f, 0x01, 0x01, NON_VPD_RING , 0, 0x01034006}, + {"occ_repr" , 0x10, 0x01, 0x01, NON_VPD_RING , 0, 0x01030806}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -60,21 +59,21 @@ namespace N0 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"n0_fure" , 0x00, 0x02, 0x02, NON_VPD_RING, 0, 0x09C0000000009000}, - {"n0_gptr" , 0x01, 0x02, 0x02, NON_VPD_RING, 0, 0x09C0000000002000}, - {"n0_time" , 0x02, 0x02, 0x02, NON_VPD_RING, 0, 0x09C0000000000100}, - {"n0_nx_fure" , 0x03, 0x02, 0x02, NON_VPD_RING, 0, 0x0400000000009000}, - {"n0_nx_gptr" , 0x04, 0x02, 0x02, NON_VPD_RING, 0, 0x0400000000002000}, - {"n0_nx_time" , 0x05, 0x02, 0x02, NON_VPD_RING, 0, 0x0400000000000100}, - {"n0_cxa0_fure" , 0x06, 0x02, 0x02, NON_VPD_RING, 0, 0x0200000000009000}, - {"n0_cxa0_gptr" , 0x07, 0x02, 0x02, NON_VPD_RING, 0, 0x0200000000002000}, - {"n0_cxa0_time" , 0x08, 0x02, 0x02, NON_VPD_RING, 0, 0x0200000000000100}, + {"n0_fure" , 0x00, 0x02, 0x02, NON_VPD_RING , 0, 0x02034E0F}, + {"n0_gptr" , 0x01, 0x02, 0x02, NON_VPD_RING , 0, 0x02034E02}, + {"n0_time" , 0x02, 0x02, 0x02, NON_VPD_RING , 0, 0x02034E07}, + {"n0_nx_fure" , 0x03, 0x02, 0x02, NON_VPD_RING , 0, 0x0203200F}, + {"n0_nx_gptr" , 0x04, 0x02, 0x02, NON_VPD_RING , 0, 0x02032002}, + {"n0_nx_time" , 0x05, 0x02, 0x02, NON_VPD_RING , 0, 0x02032007}, + {"n0_cxa0_fure" , 0x06, 0x02, 0x02, NON_VPD_RING , 0, 0x0203100F}, + {"n0_cxa0_gptr" , 0x07, 0x02, 0x02, NON_VPD_RING , 0, 0x02031007}, + {"n0_cxa0_time" , 0x08, 0x02, 0x02, NON_VPD_RING , 0, 0x02031002}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"n0_repr" , 0x09, 0x02, 0x02, NON_VPD_RING, 0, 0x09C0000000000200}, - {"n0_nx_repr" , 0x0a, 0x02, 0x02, NON_VPD_RING, 0, 0x0400000000000200}, - {"n0_cxa0_repr" , 0x0b, 0x02, 0x02, NON_VPD_RING, 0, 0x0200000000000200}, + {"n0_repr" , 0x09, 0x02, 0x02, NON_VPD_RING , 0, 0x02034E06}, + {"n0_nx_repr" , 0x0a, 0x02, 0x02, NON_VPD_RING , 0, 0x02032006}, + {"n0_cxa0_repr" , 0x0b, 0x02, 0x02, NON_VPD_RING , 0, 0x02031006}, }; const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; }; @@ -84,25 +83,25 @@ namespace N1 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"n1_fure" , 0x00, 0x03, 0x03, NON_VPD_RING, 0, 0x0E00000000009000}, - {"n1_gptr" , 0x01, 0x03, 0x03, NON_VPD_RING, 0, 0x0E00000000002000}, - {"n1_time" , 0x02, 0x03, 0x03, NON_VPD_RING, 0, 0x0E00000000000100}, - {"n1_ioo0_fure" , 0x03, 0x03, 0x03, NON_VPD_RING, 0, 0x0100000000009000}, - {"n1_ioo0_gptr" , 0x04, 0x03, 0x03, NON_VPD_RING, 0, 0x0100000000002000}, - {"n1_ioo0_time" , 0x05, 0x03, 0x03, NON_VPD_RING, 0, 0x0100000000000100}, - {"n1_ioo1_fure" , 0x06, 0x03, 0x03, NON_VPD_RING, 0, 0x0080000000009000}, - {"n1_ioo1_gptr" , 0x07, 0x03, 0x03, NON_VPD_RING, 0, 0x0080000000002000}, - {"n1_ioo1_time" , 0x08, 0x03, 0x03, NON_VPD_RING, 0, 0x0080000000000100}, - {"n1_mcs23_fure" , 0x09, 0x03, 0x03, NON_VPD_RING, 0, 0x0040000000009000}, - {"n1_mcs23_gptr" , 0x0a, 0x03, 0x03, NON_VPD_RING, 0, 0x0040000000002000}, - {"n1_mcs23_time" , 0x0b, 0x03, 0x03, NON_VPD_RING, 0, 0x0040000000000100}, + {"n1_fure" , 0x00, 0x03, 0x03, NON_VPD_RING , 0, 0x0303700F}, + {"n1_gptr" , 0x01, 0x03, 0x03, NON_VPD_RING , 0, 0x03037002}, + {"n1_time" , 0x02, 0x03, 0x03, NON_VPD_RING , 0, 0x03037007}, + {"n1_ioo0_fure" , 0x03, 0x03, 0x03, NON_VPD_RING , 0, 0x0303080F}, + {"n1_ioo0_gptr" , 0x04, 0x03, 0x03, NON_VPD_RING , 0, 0x03030802}, + {"n1_ioo0_time" , 0x05, 0x03, 0x03, NON_VPD_RING , 0, 0x03030807}, + {"n1_ioo1_fure" , 0x06, 0x03, 0x03, NON_VPD_RING , 0, 0x0303040F}, + {"n1_ioo1_gptr" , 0x07, 0x03, 0x03, NON_VPD_RING , 0, 0x03030402}, + {"n1_ioo1_time" , 0x08, 0x03, 0x03, NON_VPD_RING , 0, 0x03030407}, + {"n1_mcs23_fure" , 0x09, 0x03, 0x03, NON_VPD_RING , 0, 0x0303020F}, + {"n1_mcs23_gptr" , 0x0a, 0x03, 0x03, NON_VPD_RING , 0, 0x03030202}, + {"n1_mcs23_time" , 0x0b, 0x03, 0x03, NON_VPD_RING , 0, 0x03030207}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"n1_repr" , 0x0c, 0x03, 0x03, NON_VPD_RING, 0, 0x0E00000000000200}, - {"n1_ioo0_repr" , 0x0d, 0x03, 0x03, NON_VPD_RING, 0, 0x0100000000000200}, - {"n1_ioo1_repr" , 0x0e, 0x03, 0x03, NON_VPD_RING, 0, 0x0080000000000200}, - {"n1_mcs23_repr" , 0x0f, 0x03, 0x03, NON_VPD_RING, 0, 0x0040000000000200}, + {"n1_repr" , 0x0c, 0x03, 0x03, NON_VPD_RING , 0, 0x03037006}, + {"n1_ioo0_repr" , 0x0d, 0x03, 0x03, NON_VPD_RING , 0, 0x03030806}, + {"n1_ioo1_repr" , 0x0e, 0x03, 0x03, NON_VPD_RING , 0, 0x03030406}, + {"n1_mcs23_repr" , 0x0f, 0x03, 0x03, NON_VPD_RING , 0, 0x03030206}, }; const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; }; @@ -112,23 +111,23 @@ namespace N2 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"n2_fure" , 0x00, 0x04, 0x04, NON_VPD_RING, 0, 0x0B80000000009000}, - {"n2_gptr" , 0x01, 0x04, 0x04, NON_VPD_RING, 0, 0x0B80000000002000}, - {"n2_time" , 0x02, 0x04, 0x04, NON_VPD_RING, 0, 0x0B80000000000100}, - {"n2_cxa1_fure" , 0x03, 0x04, 0x04, NON_VPD_RING, 0, 0x0400000000009000}, - {"n2_cxa1_gptr" , 0x04, 0x04, 0x04, NON_VPD_RING, 0, 0x0400000000002000}, - {"n2_cxa1_time" , 0x05, 0x04, 0x04, NON_VPD_RING, 0, 0x0400000000000100}, - {"n2_psi_fure" , 0x06, 0x04, 0x04, NON_VPD_RING, 0, 0x0040000000009000}, - {"n2_psi_gptr" , 0x07, 0x04, 0x04, NON_VPD_RING, 0, 0x0040000000002000}, - {"n2_psi_time" , 0x08, 0x04, 0x04, NON_VPD_RING, 0, 0x0040000000000100}, + {"n2_fure" , 0x00, 0x04, 0x04, NON_VPD_RING , 0, 0x04035C0F}, + {"n2_gptr" , 0x01, 0x04, 0x04, NON_VPD_RING , 0, 0x04035C02}, + {"n2_time" , 0x02, 0x04, 0x04, NON_VPD_RING , 0, 0x04035C07}, + {"n2_cxa1_fure" , 0x03, 0x04, 0x04, NON_VPD_RING , 0, 0x0403020F}, + {"n2_cxa1_gptr" , 0x04, 0x04, 0x04, NON_VPD_RING , 0, 0x04030202}, + {"n2_cxa1_time" , 0x05, 0x04, 0x04, NON_VPD_RING , 0, 0x04030207}, + {"n2_psi_fure" , 0x06, 0x04, 0x04, NON_VPD_RING , 0, 0x0403200F}, + {"n2_psi_gptr" , 0x07, 0x04, 0x04, NON_VPD_RING , 0, 0x04032002}, + {"n2_psi_time" , 0x08, 0x04, 0x04, NON_VPD_RING , 0, 0x04032007}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"n2_repr" , 0x09, 0x04, 0x04, NON_VPD_RING, 0, 0x0B80000000000200}, - {"n2_cxa1_repr" , 0x0a, 0x04, 0x04, NON_VPD_RING, 0, 0x0400000000000200}, - {"n2_psi_repr" , 0x0b, 0x04, 0x04, NON_VPD_RING, 0, 0x0040000000000200}, + {"n2_repr" , 0x09, 0x04, 0x04, NON_VPD_RING , 0, 0x04035C06}, + {"n2_cxa1_repr" , 0x0a, 0x04, 0x04, NON_VPD_RING , 0, 0x04030206}, + {"n2_psi_repr" , 0x0b, 0x04, 0x04, NON_VPD_RING , 0, 0x04032006}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -136,23 +135,23 @@ namespace N3 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"n3_fure" , 0x00, 0x05, 0x05, NON_VPD_RING, 0, 0x0CC0000000009000}, - {"n3_gptr" , 0x01, 0x05, 0x05, NON_VPD_RING, 0, 0x0EC0000000002000}, - {"n3_time" , 0x02, 0x05, 0x05, NON_VPD_RING, 0, 0x0EC0000000000100}, - {"n3_mcs01_fure" , 0x03, 0x05, 0x05, NON_VPD_RING, 0, 0x0020000000009000}, - {"n3_mcs01_gptr" , 0x04, 0x05, 0x05, NON_VPD_RING, 0, 0x0020000000002000}, - {"n3_mcs01_time" , 0x05, 0x05, 0x05, NON_VPD_RING, 0, 0x0020000000000100}, - {"n3_np_fure" , 0x06, 0x05, 0x05, NON_VPD_RING, 0, 0x0100000000009000}, - {"n3_np_gptr" , 0x07, 0x05, 0x05, NON_VPD_RING, 0, 0x0100000000002000}, - {"n3_np_time" , 0x08, 0x05, 0x05, NON_VPD_RING, 0, 0x0100000000000100}, + {"n3_fure" , 0x00, 0x05, 0x05, NON_VPD_RING , 0, 0x0503660F}, + {"n3_gptr" , 0x01, 0x05, 0x05, NON_VPD_RING , 0, 0x05037602}, + {"n3_time" , 0x02, 0x05, 0x05, NON_VPD_RING , 0, 0x05037607}, + {"n3_mcs01_fure" , 0x03, 0x05, 0x05, NON_VPD_RING , 0, 0x0503010F}, + {"n3_mcs01_gptr" , 0x04, 0x05, 0x05, NON_VPD_RING , 0, 0x05030102}, + {"n3_mcs01_time" , 0x05, 0x05, 0x05, NON_VPD_RING , 0, 0x05030107}, + {"n3_np_fure" , 0x06, 0x05, 0x05, NON_VPD_RING , 0, 0x0503080F}, + {"n3_np_gptr" , 0x07, 0x05, 0x05, NON_VPD_RING , 0, 0x05030802}, + {"n3_np_time" , 0x08, 0x05, 0x05, NON_VPD_RING , 0, 0x05030807}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"n3_repr" , 0x09, 0x05, 0x05, NON_VPD_RING, 0, 0x0EC0000000000200}, - {"n3_mcs01_repr" , 0x0a, 0x05, 0x05, NON_VPD_RING, 0, 0x0020000000000200}, - {"n3_np_repr" , 0x0b, 0x05, 0x05, NON_VPD_RING, 0, 0x0100000000000200}, + {"n3_repr" , 0x09, 0x05, 0x05, NON_VPD_RING , 0, 0x05037606}, + {"n3_mcs01_repr" , 0x0a, 0x05, 0x05, NON_VPD_RING , 0, 0x05030106}, + {"n3_np_repr" , 0x0b, 0x05, 0x05, NON_VPD_RING , 0, 0x05030806}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -160,30 +159,30 @@ namespace XB { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"xb_fure" , 0x00, 0x06, 0x06, NON_VPD_RING, 0, 0x0880000000009000}, - {"xb_gptr" , 0x01, 0x06, 0x06, NON_VPD_RING, 0, 0x0880000000002000}, - {"xb_time" , 0x02, 0x06, 0x06, NON_VPD_RING, 0, 0x0880000000000100}, - {"xb_io0_fure" , 0x03, 0x06, 0x06, NON_VPD_RING, 0, 0x0440000000009000}, - {"xb_io0_gptr" , 0x04, 0x06, 0x06, NON_VPD_RING, 0, 0x0440000000002000}, - {"xb_io0_time" , 0x05, 0x06, 0x06, NON_VPD_RING, 0, 0x0440000000000100}, - {"xb_io1_fure" , 0x06, 0x06, 0x06, NON_VPD_RING, 0, 0x0220000000009000}, - {"xb_io1_gptr" , 0x07, 0x06, 0x06, NON_VPD_RING, 0, 0x0220000000002000}, - {"xb_io1_time" , 0x08, 0x06, 0x06, NON_VPD_RING, 0, 0x0220000000000100}, - {"xb_io2_fure" , 0x09, 0x06, 0x06, NON_VPD_RING, 0, 0x0110000000009000}, - {"xb_io2_gptr" , 0x0a, 0x06, 0x06, NON_VPD_RING, 0, 0x0110000000002000}, - {"xb_io2_time" , 0x0b, 0x06, 0x06, NON_VPD_RING, 0, 0x0110000000000100}, - {"xb_pll_gptr" , 0x0c, 0x06, 0x06, NON_VPD_RING, 0, 0x0002000000002000}, - {"xb_pll_bndy" , 0x0d, 0x06, 0x06, NON_VPD_RING, 0, 0x0002000000000080}, - {"xb_pll_func" , 0x0e, 0x06, 0x06, NON_VPD_RING, 0, 0x0002000000008000}, + {"xb_fure" , 0x00, 0x06, 0x06, NON_VPD_RING , 0, 0x0603440F}, + {"xb_gptr" , 0x01, 0x06, 0x06, NON_VPD_RING , 0, 0x06034402}, + {"xb_time" , 0x02, 0x06, 0x06, NON_VPD_RING , 0, 0x06034407}, + {"xb_io0_fure" , 0x03, 0x06, 0x06, NON_VPD_RING , 0, 0x0603220F}, + {"xb_io0_gptr" , 0x04, 0x06, 0x06, NON_VPD_RING , 0, 0x06032202}, + {"xb_io0_time" , 0x05, 0x06, 0x06, NON_VPD_RING , 0, 0x06032207}, + {"xb_io1_fure" , 0x06, 0x06, 0x06, NON_VPD_RING , 0, 0x0603110F}, + {"xb_io1_gptr" , 0x07, 0x06, 0x06, NON_VPD_RING , 0, 0x06031102}, + {"xb_io1_time" , 0x08, 0x06, 0x06, NON_VPD_RING , 0, 0x06031107}, + {"xb_io2_fure" , 0x09, 0x06, 0x06, NON_VPD_RING , 0, 0x0603088F}, + {"xb_io2_gptr" , 0x0a, 0x06, 0x06, NON_VPD_RING , 0, 0x06030882}, + {"xb_io2_time" , 0x0b, 0x06, 0x06, NON_VPD_RING , 0, 0x06030887}, + {"xb_pll_gptr" , 0x0c, 0x06, 0x06, NON_VPD_RING , 0, 0x06030012}, + {"xb_pll_bndy" , 0x0d, 0x06, 0x06, NON_VPD_RING , 0, 0x06030018}, + {"xb_pll_func" , 0x0e, 0x06, 0x06, NON_VPD_RING , 0, 0x06030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"xb_repr" , 0x13, 0x06, 0x06, NON_VPD_RING, 0, 0x0880000000000200}, - {"xb_io0_repr" , 0x14, 0x06, 0x06, NON_VPD_RING, 0, 0x0440000000000200}, - {"xb_io1_repr" , 0x15, 0x06, 0x06, NON_VPD_RING, 0, 0x0220000000000200}, - {"xb_io2_repr" , 0x16, 0x06, 0x06, NON_VPD_RING, 0, 0x0110000000000200}, + {"xb_repr" , 0x13, 0x06, 0x06, NON_VPD_RING , 0, 0x06034406}, + {"xb_io0_repr" , 0x14, 0x06, 0x06, NON_VPD_RING , 0, 0x06032206}, + {"xb_io1_repr" , 0x15, 0x06, 0x06, NON_VPD_RING , 0, 0x06031106}, + {"xb_io2_repr" , 0x16, 0x06, 0x06, NON_VPD_RING , 0, 0x06030886}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -191,30 +190,30 @@ namespace MC { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"mc_fure" , 0x00, 0x07, 0x07, NON_VPD_RING, 0, 0x0C00000000009000}, - {"mc_gptr" , 0x01, 0x07, 0x07, NON_VPD_RING, 0, 0x0C00000000002000}, - {"mc_time" , 0x02, 0x07, 0x07, NON_VPD_RING, 0, 0x0C00000000000100}, - {"mc_iom01_fure" , 0x03, 0x07, 0x07, NON_VPD_RING, 0, 0x0200000000009000}, - {"mc_iom01_gptr" , 0x04, 0x07, 0x07, NON_VPD_RING, 0, 0x0200000000002000}, - {"mc_iom01_time" , 0x05, 0x07, 0x07, NON_VPD_RING, 0, 0x0200000000000100}, - {"mc_iom23_fure" , 0x06, 0x07, 0x07, NON_VPD_RING, 0, 0x0100000000009000}, - {"mc_iom23_gptr" , 0x07, 0x07, 0x07, NON_VPD_RING, 0, 0x0100000000002000}, - {"mc_iom23_time" , 0x08, 0x07, 0x07, NON_VPD_RING, 0, 0x0100000000000100}, - {"mc_pll_gptr" , 0x09, 0x07, 0x07, NON_VPD_RING, 0, 0x0002000000002000}, - {"mc_pll_bndy_bucket_1" , 0x0a, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x0002000000000080}, - {"mc_pll_bndy_bucket_2" , 0x0b, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x0002000000000080}, - {"mc_pll_bndy_bucket_3" , 0x0c, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x0002000000000080}, - {"mc_pll_bndy_bucket_4" , 0x0d, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x0002000000000080}, - {"mc_pll_bndy_bucket_5" , 0x0e, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x0002000000000080}, - {"mc_pll_func" , 0x0f, 0x07, 0x07, NON_VPD_RING, 0, 0x0002000000008000}, + {"mc_fure" , 0x00, 0x07, 0x07, NON_VPD_RING, 0, 0x0703600F}, + {"mc_gptr" , 0x01, 0x07, 0x07, NON_VPD_RING, 0, 0x07036002}, + {"mc_time" , 0x02, 0x07, 0x07, NON_VPD_RING, 0, 0x07036007}, + {"mc_iom01_fure" , 0x03, 0x07, 0x07, NON_VPD_RING, 0, 0x0703100F}, + {"mc_iom01_gptr" , 0x04, 0x07, 0x07, NON_VPD_RING, 0, 0x07031002}, + {"mc_iom01_time" , 0x05, 0x07, 0x07, NON_VPD_RING, 0, 0x07031007}, + {"mc_iom23_fure" , 0x06, 0x07, 0x07, NON_VPD_RING, 0, 0x0703080F}, + {"mc_iom23_gptr" , 0x07, 0x07, 0x07, NON_VPD_RING, 0, 0x07030802}, + {"mc_iom23_time" , 0x08, 0x07, 0x07, NON_VPD_RING, 0, 0x07030807}, + {"mc_pll_gptr" , 0x09, 0x07, 0x07, NON_VPD_RING, 0, 0x07030012}, + {"mc_pll_bndy_bucket_1", 0x0a, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x07030018}, + {"mc_pll_bndy_bucket_2", 0x0b, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x07030018}, + {"mc_pll_bndy_bucket_3", 0x0c, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x07030018}, + {"mc_pll_bndy_bucket_4", 0x0d, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x07030018}, + {"mc_pll_bndy_bucket_5", 0x0e, 0x07, 0x07, NON_VPD_PLL_RING, 0, 0x07030018}, + {"mc_pll_func" , 0x0f, 0x07, 0x07, NON_VPD_RING, 0, 0x07030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"mc_repr" , 0x10, 0x07, 0x08, NON_VPD_RING, 0, 0x0C00000000000200}, - {"mc_iom01_repr" , 0x11, 0x07, 0x08, NON_VPD_RING, 0, 0x0200000000000200}, - {"mc_iom23_repr" , 0x12, 0x07, 0x08, NON_VPD_RING, 0, 0x0100000000000200}, + {"mc_repr" , 0x10, 0x07, 0x08, NON_VPD_RING , 0, 0x07036006}, + {"mc_iom01_repr" , 0x11, 0x07, 0x08, NON_VPD_RING , 0, 0x07031006}, + {"mc_iom23_repr" , 0x12, 0x07, 0x08, NON_VPD_RING , 0, 0x07030806}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -222,18 +221,18 @@ namespace OB0 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"ob0_fure" , 0x00, 0x09, 0x09, NON_VPD_RING, 0, 0x0E00000000009000}, - {"ob0_gptr" , 0x01, 0x09, 0x09, NON_VPD_RING, 0, 0x0E00000000002000}, - {"ob0_time" , 0x02, 0x09, 0x09, NON_VPD_RING, 0, 0x0E00000000000100}, - {"ob0_pll_gptr" , 0x03, 0x09, 0x09, NON_VPD_RING, 0, 0x0002000000002000}, - {"ob0_pll_bndy" , 0x04, 0x09, 0x09, NON_VPD_RING, 0, 0x0002000000000080}, - {"ob0_pll_func" , 0x05, 0x09, 0x09, NON_VPD_RING, 0, 0x0002000000008000}, + {"ob0_fure" , 0x00, 0x09, 0x09, NON_VPD_RING , 0, 0x0903700F}, + {"ob0_gptr" , 0x01, 0x09, 0x09, NON_VPD_RING , 0, 0x09037002}, + {"ob0_time" , 0x02, 0x09, 0x09, NON_VPD_RING , 0, 0x09037007}, + {"ob0_pll_gptr" , 0x03, 0x09, 0x09, NON_VPD_RING , 0, 0x09030012}, + {"ob0_pll_bndy" , 0x04, 0x09, 0x09, NON_VPD_RING , 0, 0x09030018}, + {"ob0_pll_func" , 0x05, 0x09, 0x09, NON_VPD_RING , 0, 0x09030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"ob0_repr" , 0x0a, 0x09, 0x09, NON_VPD_RING, 0, 0x0E00000000000200}, + {"ob0_repr" , 0x0a, 0x09, 0x09, NON_VPD_RING , 0, 0x09037006}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -241,18 +240,18 @@ namespace OB1 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"ob1_fure" , 0x00, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0E00000000009000}, - {"ob1_gptr" , 0x01, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0E00000000002000}, - {"ob1_time" , 0x02, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0E00000000000100}, - {"ob1_pll_gptr" , 0x03, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0002000000002000}, - {"ob1_pll_bndy" , 0x04, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0002000000000080}, - {"ob1_pll_func" , 0x05, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0002000000008000}, + {"ob1_fure" , 0x00, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A03700F}, + {"ob1_gptr" , 0x01, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A037002}, + {"ob1_time" , 0x02, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A037007}, + {"ob1_pll_gptr" , 0x03, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A030012}, + {"ob1_pll_bndy" , 0x04, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A030018}, + {"ob1_pll_func" , 0x05, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"ob1_repr" , 0x0a, 0x0a, 0x0a, NON_VPD_RING, 0, 0x0E00000000000200}, + {"ob1_repr" , 0x0a, 0x0a, 0x0a, NON_VPD_RING , 0, 0x0A037006}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -260,18 +259,18 @@ namespace OB2 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"ob2_fure" , 0x00, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0E00000000009000}, - {"ob2_gptr" , 0x01, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0E00000000002000}, - {"ob2_time" , 0x02, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0E00000000000100}, - {"ob2_pll_gptr" , 0x03, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0002000000002000}, - {"ob2_pll_bndy" , 0x04, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0002000000000080}, - {"ob2_pll_func" , 0x05, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0002000000008000}, + {"ob2_fure" , 0x00, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B03700F}, + {"ob2_gptr" , 0x01, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B037002}, + {"ob2_time" , 0x02, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B037007}, + {"ob2_pll_gptr" , 0x03, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B030012}, + {"ob2_pll_bndy" , 0x04, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B030018}, + {"ob2_pll_func" , 0x05, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"ob2_repr" , 0x0a, 0x0b, 0x0b, NON_VPD_RING, 0, 0x0E00000000000200}, + {"ob2_repr" , 0x0a, 0x0b, 0x0b, NON_VPD_RING , 0, 0x0B037006}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -279,18 +278,18 @@ namespace OB3 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"ob3_fure" , 0x00, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0E00000000009000}, - {"ob3_gptr" , 0x01, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0E00000000002000}, - {"ob3_time" , 0x02, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0E00000000000100}, - {"ob3_pll_gptr" , 0x03, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0002000000002000}, - {"ob3_pll_bndy" , 0x04, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0002000000000080}, - {"ob3_pll_func" , 0x05, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0002000000008000}, + {"ob3_fure" , 0x00, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C03700F}, + {"ob3_gptr" , 0x01, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C037002}, + {"ob3_time" , 0x02, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C037007}, + {"ob3_pll_gptr" , 0x03, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C030012}, + {"ob3_pll_bndy" , 0x04, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C030018}, + {"ob3_pll_func" , 0x05, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C030010}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"ob3_repr" , 0x0a, 0x0c, 0x0c, NON_VPD_RING, 0, 0x0E00000000000200}, + {"ob3_repr" , 0x0a, 0x0c, 0x0c, NON_VPD_RING , 0, 0x0C037006}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -298,17 +297,17 @@ namespace PCI0 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"pci0_fure" , 0x00, 0x0d, 0x0d, NON_VPD_RING, 0, 0x0E00000000009000}, - {"pci0_gptr" , 0x01, 0x0d, 0x0d, NON_VPD_RING, 0, 0x0E00000000002000}, - {"pci0_time" , 0x02, 0x0d, 0x0d, NON_VPD_RING, 0, 0x0E00000000000100}, - {"pci0_pll_bndy" , 0x03, 0x0d, 0x0d, NON_VPD_RING, 0, 0x0002000000000080}, - {"pci0_pll_gptr" , 0x04, 0x0d, 0x0d, NON_VPD_RING, 0, 0x0002000000002000}, + {"pci0_fure" , 0x00, 0x0d, 0x0d, NON_VPD_RING , 0, 0x0D03700F}, + {"pci0_gptr" , 0x01, 0x0d, 0x0d, NON_VPD_RING , 0, 0x0D037002}, + {"pci0_time" , 0x02, 0x0d, 0x0d, NON_VPD_RING , 0, 0x0D037007}, + {"pci0_pll_bndy" , 0x03, 0x0d, 0x0d, NON_VPD_RING , 0, 0x0D030018}, + {"pci0_pll_gptr" , 0x04, 0x0d, 0x0d, NON_VPD_RING , 0, 0x0D030012}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"pci0_repr" , 0x05, 0x0d, 0x0d, NON_VPD_RING, 0, 0x0E00000000000200}, + {"pci0_repr" , 0x05, 0x0d, 0x0d, NON_VPD_RING , 0, 0x0D03700F}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -316,17 +315,17 @@ namespace PCI1 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"pci1_fure" , 0x00, 0x0e, 0x0e, NON_VPD_RING, 0, 0x0F00000000009000}, - {"pci1_gptr" , 0x01, 0x0e, 0x0e, NON_VPD_RING, 0, 0x0F00000000002000}, - {"pci1_time" , 0x02, 0x0e, 0x0e, NON_VPD_RING, 0, 0x0F00000000000100}, - {"pci1_pll_bndy" , 0x03, 0x0e, 0x0e, NON_VPD_RING, 0, 0x0002000000000080}, - {"pci1_pll_gptr" , 0x04, 0x0e, 0x0e, NON_VPD_RING, 0, 0x0002000000002000}, + {"pci1_fure" , 0x00, 0x0e, 0x0e, NON_VPD_RING , 0, 0x0E03700F}, + {"pci1_gptr" , 0x01, 0x0e, 0x0e, NON_VPD_RING , 0, 0x0E037002}, + {"pci1_time" , 0x02, 0x0e, 0x0e, NON_VPD_RING , 0, 0x0E037007}, + {"pci1_pll_bndy" , 0x03, 0x0e, 0x0e, NON_VPD_RING , 0, 0x0E030018}, + {"pci1_pll_gptr" , 0x04, 0x0e, 0x0e, NON_VPD_RING , 0, 0x0E030012}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"pci1_repr" , 0x05, 0x0e, 0x0e, NON_VPD_RING, 0, 0x0F00000000000200}, + {"pci1_repr" , 0x05, 0x0e, 0x0e, NON_VPD_RING , 0, 0x0E03700F}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -334,17 +333,17 @@ namespace PCI2 { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"pci2_fure" , 0x00, 0x0f, 0x0f, NON_VPD_RING, 0, 0x0F80000000009000}, - {"pci2_gptr" , 0x01, 0x0f, 0x0f, NON_VPD_RING, 0, 0x0F80000000002000}, - {"pci2_time" , 0x02, 0x0f, 0x0f, NON_VPD_RING, 0, 0x0F80000000000100}, - {"pci2_pll_bndy" , 0x03, 0x0f, 0x0f, NON_VPD_RING, 0, 0x0002000000000080}, - {"pci2_pll_gptr" , 0x04, 0x0f, 0x0f, NON_VPD_RING, 0, 0x0002000000002000}, + {"pci2_fure" , 0x00, 0x0f, 0x0f, NON_VPD_RING , 0, 0x0F03700F}, + {"pci2_gptr" , 0x01, 0x0f, 0x0f, NON_VPD_RING , 0, 0x0F037002}, + {"pci2_time" , 0x02, 0x0f, 0x0f, NON_VPD_RING , 0, 0x0F037007}, + {"pci2_pll_bndy" , 0x03, 0x0f, 0x0f, NON_VPD_RING , 0, 0x0F030018}, + {"pci2_pll_gptr" , 0x04, 0x0f, 0x0f, NON_VPD_RING , 0, 0x0F030012}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"pci2_repr" , 0x05, 0x0F, 0x0F, NON_VPD_RING, 0, 0x0F80000000000200}, + {"pci2_repr" , 0x05, 0x0F, 0x0F, NON_VPD_RING , 0, 0x0F03700F}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, RL, NOT_VALID }; }; @@ -352,64 +351,64 @@ namespace EQ { const GenRingIdList RING_ID_LIST_COMMON[] = { - {"eq_fure" , 0x00, 0x10, 0x10, NON_VPD_RING, 0, 0x0C10000000009000}, - {"eq_gptr" , 0x01, 0x10, 0x10, NON_VPD_RING, 0, 0x0C10000000002000}, - {"eq_time" , 0x02, 0x10, 0x10, NON_VPD_RING, 0, 0x0C10000000000100}, - {"eq_mode" , 0x03, 0x10, 0x10, NON_VPD_RING, 0, 0x0C10000000004000}, - {"ex_l3_fure" , 0x04, 0x10, 0x10, NON_VPD_RING, 0, 0x0200000000009000}, - {"ex_l3_gptr" , 0x05, 0x10, 0x10, NON_VPD_RING, 0, 0x0200000000002000}, - {"ex_l3_time" , 0x06, 0x10, 0x10, NON_VPD_RING, 0, 0x0200000000000100}, - {"ex_l2_mode" , 0x07, 0x10, 0x10, NON_VPD_RING, 0, 0x0080000000004000}, - {"ex_l2_fure" , 0x08, 0x10, 0x10, NON_VPD_RING, 0, 0x0080000000009000}, - {"ex_l2_gptr" , 0x09, 0x10, 0x10, NON_VPD_RING, 0, 0x0080000000002000}, - {"ex_l2_time" , 0x0a, 0x10, 0x10, NON_VPD_RING, 0, 0x0080000000000100}, - {"ex_l3_refr_fure" , 0x0b, 0x10, 0x10, NON_VPD_RING, 0, 0x0008000000009000}, - {"ex_l3_refr_gptr" , 0x0c, 0x10, 0x10, NON_VPD_RING, 0, 0x0008000000002000}, - {"eq_ana_func" , 0x0d, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000008000}, - {"eq_ana_gptr" , 0x0e, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000002000}, - {"eq_dpll_func" , 0x0f, 0x10, 0x10, NON_VPD_RING, 0, 0x0002000000008000}, - {"eq_dpll_gptr" , 0x10, 0x10, 0x10, NON_VPD_RING, 0, 0x0002000000002000}, - {"eq_dpll_mode" , 0x11, 0x10, 0x10, NON_VPD_RING, 0, 0x0002000000004000}, - {"eq_ana_bndy_bucket_0" , 0x12, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_1" , 0x13, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_2" , 0x14, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_3" , 0x15, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_4" , 0x16, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_5" , 0x17, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_6" , 0x18, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_7" , 0x19, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_8" , 0x1a, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_9" , 0x1b, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_10" , 0x1c, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_11" , 0x1d, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_12" , 0x1e, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_13" , 0x1f, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_14" , 0x20, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_15" , 0x21, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_16" , 0x22, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_17" , 0x23, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_18" , 0x24, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_19" , 0x25, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_20" , 0x26, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_21" , 0x27, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_22" , 0x28, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_23" , 0x29, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_24" , 0x2a, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_bucket_25" , 0x2b, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_bndy_l3dcc_bucket_26", 0x2c, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000000080}, - {"eq_ana_mode" , 0x2d, 0x10, 0x10, NON_VPD_RING, 0, 0x0020000000004000}, - {"ex_l2_fure_1" , 0x2e, 0x10, 0x10, NON_VPD_RING, 0, 0x0080000000009000}, - {"ex_l3_fure_1" , 0x2f, 0x10, 0x10, NON_VPD_RING, 0, 0x0200000000009000}, + {"eq_fure" , 0x00, 0x10, 0x10, NON_VPD_RING, 0, 0x1003608F}, + {"eq_gptr" , 0x01, 0x10, 0x10, NON_VPD_RING, 0, 0x10036082}, + {"eq_time" , 0x02, 0x10, 0x10, NON_VPD_RING, 0, 0x10036087}, + {"eq_mode" , 0x03, 0x10, 0x10, NON_VPD_RING, 0, 0x10036081}, + {"ex_l3_fure" , 0x04, 0x10, 0x10, NON_VPD_RING, 0, 0x1003100F}, + {"ex_l3_gptr" , 0x05, 0x10, 0x10, NON_VPD_RING, 0, 0x10031002}, + {"ex_l3_time" , 0x06, 0x10, 0x10, NON_VPD_RING, 0, 0x10031007}, + {"ex_l2_mode" , 0x07, 0x10, 0x10, NON_VPD_RING, 0, 0x10030401}, + {"ex_l2_fure" , 0x08, 0x10, 0x10, NON_VPD_RING, 0, 0x1003040F}, + {"ex_l2_gptr" , 0x09, 0x10, 0x10, NON_VPD_RING, 0, 0x10030402}, + {"ex_l2_time" , 0x0a, 0x10, 0x10, NON_VPD_RING, 0, 0x10030407}, + {"ex_l3_refr_fure" , 0x0b, 0x10, 0x10, NON_VPD_RING, 0, 0x1003004F}, + {"ex_l3_refr_gptr" , 0x0c, 0x10, 0x10, NON_VPD_RING, 0, 0x10030042}, + {"eq_ana_func" , 0x0d, 0x10, 0x10, NON_VPD_RING, 0, 0x10030100}, + {"eq_ana_gptr" , 0x0e, 0x10, 0x10, NON_VPD_RING, 0, 0x10030102}, + {"eq_dpll_func" , 0x0f, 0x10, 0x10, NON_VPD_RING, 0, 0x10030010}, + {"eq_dpll_gptr" , 0x10, 0x10, 0x10, NON_VPD_RING, 0, 0x10030012}, + {"eq_dpll_mode" , 0x11, 0x10, 0x10, NON_VPD_RING, 0, 0x10030011}, + {"eq_ana_bndy_bucket_0" , 0x12, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_1" , 0x13, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_2" , 0x14, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_3" , 0x15, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_4" , 0x16, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_5" , 0x17, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_6" , 0x18, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_7" , 0x19, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_8" , 0x1a, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_9" , 0x1b, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_10" , 0x1c, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_11" , 0x1d, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_12" , 0x1e, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_13" , 0x1f, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_14" , 0x20, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_15" , 0x21, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_16" , 0x22, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_17" , 0x23, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_18" , 0x24, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_19" , 0x25, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_20" , 0x26, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_21" , 0x27, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_22" , 0x28, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_23" , 0x29, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_24" , 0x2a, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_bucket_25" , 0x2b, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_bndy_l3dcc_bucket_26", 0x2c, 0x10, 0x10, NON_VPD_RING, 0, 0x10030108}, + {"eq_ana_mode" , 0x2d, 0x10, 0x10, NON_VPD_RING, 0, 0x10030101}, + {"ex_l2_fure_1" , 0x2e, 0x10, 0x10, NON_VPD_RING, 0, 0x1003040F}, + {"ex_l3_fure_1" , 0x2f, 0x10, 0x10, NON_VPD_RING, 0, 0x1003100F}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - {"eq_repr" , 0x30, 0x10, 0x1b, NON_VPD_RING, 0, 0x0C10000000000200}, - {"ex_l3_repr" , 0x31, 0x10, 0x1b, NON_VPD_RING, 0, 0x0200000000000200}, - {"ex_l2_repr" , 0x32, 0x10, 0x1b, NON_VPD_RING, 0, 0x0080000000000200}, - {"ex_l3_refr_repr" , 0x33, 0x10, 0x1b, NON_VPD_RING, 0, 0x0008000000000200}, - {"ex_l3_refr_time" , 0x34, 0x10, 0x1b, NON_VPD_RING, 0, 0x0008000000000100}, + {"eq_repr" , 0x30, 0x10, 0x1b, NON_VPD_RING , 0, 0x10036086}, + {"ex_l3_repr" , 0x31, 0x10, 0x1b, NON_VPD_RING , 0, 0x10031006}, + {"ex_l2_repr" , 0x32, 0x10, 0x1b, NON_VPD_RING , 0, 0x10030406}, + {"ex_l3_refr_repr" , 0x33, 0x10, 0x1b, NON_VPD_RING , 0, 0x10030046}, + {"ex_l3_refr_time" , 0x34, 0x10, 0x1b, NON_VPD_RING , 0, 0x10030047}, }; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, CC, RL}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, CC, RL }; }; @@ -417,15 +416,202 @@ namespace EC { const GenRingIdList RING_ID_LIST_COMMON[] = { - { "ec_func" , 0x00, 0x20, 0x20, NON_VPD_RING, 0, 0x0E00000000009000}, - { "ec_gptr" , 0x01, 0x20, 0x20, NON_VPD_RING, 0, 0x0E00000000002000}, - { "ec_time" , 0x02, 0x20, 0x20, NON_VPD_RING, 0, 0x0E00000000000100}, - { "ec_mode" , 0x03, 0x20, 0x20, NON_VPD_RING, 0, 0x0E00000000004000}, + { "ec_func" , 0x00, 0x20, 0x20, NON_VPD_RING , 0, 0x2003700F}, + { "ec_gptr" , 0x01, 0x20, 0x20, NON_VPD_RING , 0, 0x20037002}, + { "ec_time" , 0x02, 0x20, 0x20, NON_VPD_RING , 0, 0x20037007}, + { "ec_mode" , 0x03, 0x20, 0x20, NON_VPD_RING , 0, 0x20037001}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { - { "ec_repr" , 0x04, 0x20, 0x37, NON_VPD_RING, 0, 0x0E00000000000200}, -}; -const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, CC, RL}; -}; - + { "ec_repr" , 0x04, 0x20, 0x37, NON_VPD_RING , 0, 0x20037006}, +}; +const RingVariantOrder RING_VARIANT_ORDER[] = { BASE, CC, RL }; +}; + +CHIPLET_TYPE p9_ringid_get_chiplet(RingID i_ringId) +{ + return RING_PROPERTIES[i_ringId].iv_type; +} + +void p9_ringid_get_chiplet_properties( + CHIPLET_TYPE i_chiplet, + CHIPLET_DATA** o_cpltData, + GenRingIdList** o_ringComm, + GenRingIdList** o_ringInst, + RingVariantOrder** o_varOrder, + uint8_t* o_varNumb) +{ + switch (i_chiplet) + { + case PERV_TYPE : + *o_cpltData = (CHIPLET_DATA*) &PERV::g_pervData; + *o_ringComm = (GenRingIdList*) PERV::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) PERV::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) PERV::RING_VARIANT_ORDER; + *o_varNumb = sizeof(PERV::RingVariants) / sizeof(uint16_t); + break; + + case N0_TYPE : + *o_cpltData = (CHIPLET_DATA*) &N0::g_n0Data; + *o_ringComm = (GenRingIdList*) N0::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) N0::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) N0::RING_VARIANT_ORDER; + *o_varNumb = sizeof(N0::RingVariants) / sizeof(uint16_t); + break; + + case N1_TYPE : + *o_cpltData = (CHIPLET_DATA*) &N1::g_n1Data; + *o_ringComm = (GenRingIdList*) N1::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) N1::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) N1::RING_VARIANT_ORDER; + *o_varNumb = sizeof(N1::RingVariants) / sizeof(uint16_t); + break; + + case N2_TYPE : + *o_cpltData = (CHIPLET_DATA*) &N2::g_n2Data; + *o_ringComm = (GenRingIdList*) N2::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) N2::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) N2::RING_VARIANT_ORDER; + *o_varNumb = sizeof(N2::RingVariants) / sizeof(uint16_t); + break; + + case N3_TYPE : + *o_cpltData = (CHIPLET_DATA*) &N3::g_n3Data; + *o_ringComm = (GenRingIdList*) N3::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) N3::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) N3::RING_VARIANT_ORDER; + *o_varNumb = sizeof(N3::RingVariants) / sizeof(uint16_t); + break; + + case XB_TYPE : + *o_cpltData = (CHIPLET_DATA*) &XB::g_xbData; + *o_ringComm = (GenRingIdList*) XB::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) XB::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) XB::RING_VARIANT_ORDER; + *o_varNumb = sizeof(XB::RingVariants) / sizeof(uint16_t); + break; + + case MC_TYPE : + *o_cpltData = (CHIPLET_DATA*) &MC::g_mcData; + *o_ringComm = (GenRingIdList*) MC::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) MC::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) MC::RING_VARIANT_ORDER; + *o_varNumb = sizeof(MC::RingVariants) / sizeof(uint16_t); + break; + + case OB0_TYPE : + *o_cpltData = (CHIPLET_DATA*) &OB0::g_ob0Data; + *o_ringComm = (GenRingIdList*) OB0::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) OB0::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) OB0::RING_VARIANT_ORDER; + *o_varNumb = sizeof(OB0::RingVariants) / sizeof(uint16_t); + break; + + case OB1_TYPE : + *o_cpltData = (CHIPLET_DATA*) &OB1::g_ob1Data; + *o_ringComm = (GenRingIdList*) OB1::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) OB1::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) OB1::RING_VARIANT_ORDER; + *o_varNumb = sizeof(OB1::RingVariants) / sizeof(uint16_t); + break; + + case OB2_TYPE : + *o_cpltData = (CHIPLET_DATA*) &OB2::g_ob2Data; + *o_ringComm = (GenRingIdList*) OB2::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) OB2::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) OB2::RING_VARIANT_ORDER; + *o_varNumb = sizeof(OB2::RingVariants) / sizeof(uint16_t); + break; + + case OB3_TYPE : + *o_cpltData = (CHIPLET_DATA*) &OB3::g_ob3Data; + *o_ringComm = (GenRingIdList*) OB3::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) OB3::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) OB3::RING_VARIANT_ORDER; + *o_varNumb = sizeof(OB3::RingVariants) / sizeof(uint16_t); + break; + + case PCI0_TYPE : + *o_cpltData = (CHIPLET_DATA*) &PCI0::g_pci0Data; + *o_ringComm = (GenRingIdList*) PCI0::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) PCI0::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) PCI0::RING_VARIANT_ORDER; + *o_varNumb = sizeof(PCI0::RingVariants) / sizeof(uint16_t); + break; + + case PCI1_TYPE : + *o_cpltData = (CHIPLET_DATA*) &PCI1::g_pci1Data; + *o_ringComm = (GenRingIdList*) PCI1::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) PCI1::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) PCI1::RING_VARIANT_ORDER; + *o_varNumb = sizeof(PCI1::RingVariants) / sizeof(uint16_t); + break; + + case PCI2_TYPE : + *o_cpltData = (CHIPLET_DATA*) &PCI2::g_pci2Data; + *o_ringComm = (GenRingIdList*) PCI2::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) PCI2::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) PCI2::RING_VARIANT_ORDER; + *o_varNumb = sizeof(PCI2::RingVariants) / sizeof(uint16_t); + break; + + case EQ_TYPE : + *o_cpltData = (CHIPLET_DATA*) &EQ::g_eqData; + *o_ringComm = (GenRingIdList*) EQ::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) EQ::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) EQ::RING_VARIANT_ORDER; + *o_varNumb = sizeof(EQ::RingVariants) / sizeof(uint16_t); + break; + + case EC_TYPE : + *o_cpltData = (CHIPLET_DATA*) &EC::g_ecData; + *o_ringComm = (GenRingIdList*) EC::RING_ID_LIST_COMMON; + *o_ringInst = (GenRingIdList*) EC::RING_ID_LIST_INSTANCE; + *o_varOrder = (RingVariantOrder*) EC::RING_VARIANT_ORDER; + *o_varNumb = sizeof(EC::RingVariants) / sizeof(uint16_t); + break; + + default : + *o_cpltData = NULL; + *o_ringComm = NULL; + *o_ringInst = NULL; + *o_varOrder = NULL; + *o_varNumb = 0; + break; + } +} + +GenRingIdList* p9_ringid_get_ring_properties(RingID i_ringId) +{ + CHIPLET_DATA* l_cpltData; + GenRingIdList* l_ringList[2]; // 0: common, 1: instance + RingVariantOrder* l_varOrder; + uint8_t l_varNumb; + int i, j, n; + + p9_ringid_get_chiplet_properties( + p9_ringid_get_chiplet(i_ringId), + &l_cpltData, &l_ringList[0], &l_ringList[1], &l_varOrder, &l_varNumb); + + if (!l_ringList[0]) + { + return NULL; + } + + for (j = 0; j < 2; j++) // 0: common, 1: instance + { + n = (j ? l_cpltData->iv_num_instance_rings + : l_cpltData->iv_num_common_rings); + + for (i = 0; i < n; i++) + { + if (!strcmp(l_ringList[j][i].ringName, + RING_PROPERTIES[i_ringId].iv_name)) + { + return &(l_ringList[j][i]); + } + } + } + + return NULL; +} diff --git a/src/import/chips/p9/utils/imageProcs/p9_ringId.H b/src/import/chips/p9/utils/imageProcs/p9_ringId.H index d8bdda634..a52fb1b1c 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_ringId.H +++ b/src/import/chips/p9/utils/imageProcs/p9_ringId.H @@ -27,6 +27,8 @@ #define _P9_RINGID_H_ #include <stdint.h> +#include <stddef.h> + #include <p9_ring_id.h> // General Ring ID list structure @@ -38,7 +40,7 @@ typedef struct uint8_t instanceIdMax; // the max instanceId uint8_t vpdKeyword; uint8_t pllCopy; // 0,1,2,3,4,5 -- No of PLL copies required - uint64_t scanRegionType; + uint32_t scanScomAddress; } GenRingIdList; typedef enum RingVariant // Base variables @@ -1303,4 +1305,25 @@ static const ringProperties_t RING_PROPERTIES[NUM_RING_IDS] = }; #endif +// returns our own chiplet enum value for this ringId +CHIPLET_TYPE +p9_ringid_get_chiplet( + RingID i_ringId); + +// returns data structures defined for chiplet type +// as determined by ringId +void +p9_ringid_get_chiplet_properties( + CHIPLET_TYPE i_chiplet, + CHIPLET_DATA** o_cpltData, + GenRingIdList** o_ringComm, + GenRingIdList** o_ringInst, + RingVariantOrder** o_varOrder, + uint8_t* o_varNumb); + +// returns properties of a ring as determined by ringId +GenRingIdList* +p9_ringid_get_ring_properties( + RingID i_ringId); + #endif diff --git a/src/import/chips/p9/utils/imageProcs/p9_scan_compression.C b/src/import/chips/p9/utils/imageProcs/p9_scan_compression.C index 8eb29d230..80f0f052c 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_scan_compression.C +++ b/src/import/chips/p9/utils/imageProcs/p9_scan_compression.C @@ -30,9 +30,7 @@ /// /// Scan strings are compressed using a simple run-length encoding called /// RS4. The string to be decompressed and scanned is the difference between -/// the current state of the ring and the desired final state of the ring. A -/// run-time optimization supports the case that the current state of the ring -/// is the flush state. +/// the current state of the ring and the desired final state of the ring. /// /// Both the data to be compressed and the final compressed data are treated /// as strings of 4-bit nibbles. When packaged in the scan data structure @@ -193,23 +191,20 @@ // unique names to support concurrent update. Most routines defined here have // some variant of 'rs4' in their names; others should be inherently unique. -#if COMPRESSED_SCAN_DATA_VERSION != 2 - #error This code assumes CompressedScanData structure version 2 layout +#if RS4_VERSION != 3 + #error This code assumes CompressedScanData structure version 3 layout #endif void -compressed_scan_data_translate(CompressedScanData* o_data, - CompressedScanData* i_data) +compressed_scan_data_translate(CompressedScanData* o_rs4, + CompressedScanData* i_rs4) { - o_data->iv_magic = htobe32(i_data->iv_magic); - o_data->iv_size = htobe32(i_data->iv_size); - o_data->iv_algorithmReserved = htobe32(i_data->iv_algorithmReserved); - o_data->iv_length = htobe32(i_data->iv_length); - o_data->iv_scanSelect = htobe64(i_data->iv_scanSelect); - o_data->iv_headerVersion = i_data->iv_headerVersion; - o_data->iv_flushOptimization = i_data->iv_flushOptimization; - o_data->iv_ringId = i_data->iv_ringId; - o_data->iv_chipletId = i_data->iv_chipletId; + o_rs4->iv_magic = htobe16(i_rs4->iv_magic); + o_rs4->iv_version = i_rs4->iv_version; + o_rs4->iv_type = i_rs4->iv_type; + o_rs4->iv_size = htobe16(i_rs4->iv_size); + o_rs4->iv_ringId = htobe16(i_rs4->iv_ringId); + o_rs4->iv_scanAddr = htobe32(i_rs4->iv_scanAddr); } @@ -350,7 +345,7 @@ stop_decode(uint32_t* o_count, const uint8_t* i_string, const uint32_t i_i) // Returns a scan compression return code. static int -__rs4_compress(CompressedScanData* o_data, +__rs4_compress(uint8_t* o_rs4_str, uint32_t* o_nibbles, const uint8_t* i_data_str, const uint8_t* i_care_str, @@ -360,10 +355,9 @@ __rs4_compress(CompressedScanData* o_data, uint32_t n; /* Number of whole nibbles in i_data */ uint32_t r; /* Number of reminaing bits in i_data */ uint32_t i; /* Nibble index in i_data_str/i_care_str */ - uint32_t j; /* Nibble index in data */ + uint32_t j; /* Nibble index in o_rs4_str */ uint32_t k; /* Location to place <scan_count(N)> */ uint32_t count; /* Counts rotate/scan nibbles */ - uint8_t* data; /* The compressed scan data area */ int care_nibble; int data_nibble; @@ -372,7 +366,6 @@ __rs4_compress(CompressedScanData* o_data, i = 0; j = 0; k = 0; /* Makes GCC happy */ - data = (uint8_t*)o_data + sizeof(CompressedScanData); care_nibble = 0; data_nibble = 0; count = 0; @@ -404,7 +397,7 @@ __rs4_compress(CompressedScanData* o_data, } else { - j += rs4_stop_encode(count, data, j); + j += rs4_stop_encode(count, o_rs4_str, j); count = 0; k = j; j++; @@ -432,7 +425,7 @@ __rs4_compress(CompressedScanData* o_data, { // Set the <scan_count(N)> in nibble k since no more data in // current AND next nibble (or next nibble might be last). - rs4_set_nibble(data, k, count); + rs4_set_nibble(o_rs4_str, k, count); count = 0; state = 0; } @@ -441,7 +434,7 @@ __rs4_compress(CompressedScanData* o_data, // Whether next nibble is last nibble or contains data, lets include the // current empty nibble in the scan_data(N) count because its // more efficient than inserting rotate go+stop nibbles. - rs4_set_nibble(data, j, 0); + rs4_set_nibble(o_rs4_str, j, 0); count++; i++; j++; @@ -450,7 +443,7 @@ __rs4_compress(CompressedScanData* o_data, else if ((care_nibble ^ data_nibble) == 0) { // Only one-data in nibble. Continue pilling on one-data nibbles. - rs4_set_nibble(data, j, data_nibble); + rs4_set_nibble(o_rs4_str, j, data_nibble); count++; i++; j++; @@ -460,14 +453,14 @@ __rs4_compress(CompressedScanData* o_data, // There is zero-data in nibble. // First set the <scan_count(N)> in nibble k to end current // sequence of one-data nibbles. - rs4_set_nibble(data, k, count); + rs4_set_nibble(o_rs4_str, k, count); count = 0; state = 0; } if ((state == 1) && (count == 14)) { - rs4_set_nibble(data, k, 14); + rs4_set_nibble(o_rs4_str, k, 14); count = 0; state = 0; } @@ -477,10 +470,10 @@ __rs4_compress(CompressedScanData* o_data, // Zero-data section // //-------------------// { - rs4_set_nibble(data, k, 15); - rs4_set_nibble(data, j, care_nibble); + rs4_set_nibble(o_rs4_str, k, 15); + rs4_set_nibble(o_rs4_str, j, care_nibble); j++; - rs4_set_nibble(data, j, data_nibble); + rs4_set_nibble(o_rs4_str, j, data_nibble); i++; j++; count = 0; @@ -493,12 +486,12 @@ __rs4_compress(CompressedScanData* o_data, if (state == 0) { - j += rs4_stop_encode(count, data, j); + j += rs4_stop_encode(count, o_rs4_str, j); } else if (state == 1) { - rs4_set_nibble(data, k, count); - j += rs4_stop_encode(0, data, j); + rs4_set_nibble(o_rs4_str, k, count); + j += rs4_stop_encode(0, o_rs4_str, j); } else { @@ -507,14 +500,14 @@ __rs4_compress(CompressedScanData* o_data, } // Indicate termination start - rs4_set_nibble(data, j, 0); + rs4_set_nibble(o_rs4_str, j, 0); j++; // Insert the remainder count nibble, and if r>0, the remainder data // nibble. Note that here we indicate the number of bits (0<=r<4). if (r == 0) { - rs4_set_nibble(data, j, r); + rs4_set_nibble(o_rs4_str, j, r); j++; } else @@ -531,19 +524,19 @@ __rs4_compress(CompressedScanData* o_data, if ((care_nibble ^ data_nibble) == 0) { // Only one-data in rem nibble. - rs4_set_nibble(data, j, r); + rs4_set_nibble(o_rs4_str, j, r); j++; - rs4_set_nibble(data, j, data_nibble); + rs4_set_nibble(o_rs4_str, j, data_nibble); j++; } else { // Zero-data in rem nibble. - rs4_set_nibble(data, j, r + 8); + rs4_set_nibble(o_rs4_str, j, r + 8); j++; - rs4_set_nibble(data, j, care_nibble); + rs4_set_nibble(o_rs4_str, j, care_nibble); j++; - rs4_set_nibble(data, j, data_nibble); + rs4_set_nibble(o_rs4_str, j, data_nibble); j++; } } @@ -622,45 +615,42 @@ rs4_max_compressed_bytes(uint32_t nibbles) // Returns a scan compression return code. int -_rs4_compress(CompressedScanData* io_data, - uint32_t i_dataSize, - uint32_t* o_imageSize, +_rs4_compress(CompressedScanData* io_rs4, + const uint32_t i_size, const uint8_t* i_data_str, const uint8_t* i_care_str, const uint32_t i_length, - const uint64_t i_scanSelect, - const uint8_t i_ringId, - const uint8_t i_chipletId, - const uint8_t i_flushOptimization) + const uint32_t i_scanAddr, + const uint8_t i_ringId) { int rc; uint32_t nibbles = rs4_max_compressed_nibbles(i_length); uint32_t bytes = rs4_max_compressed_bytes(nibbles); + uint8_t* rs4_str = (uint8_t*)io_rs4 + sizeof(CompressedScanData); - if (i_dataSize < bytes) + if (bytes > i_size) { return BUG(SCAN_COMPRESSION_BUFFER_OVERFLOW); } - memset(io_data, 0, bytes); + memset(io_rs4, 0, i_size); - rc = __rs4_compress(io_data, &nibbles, i_data_str, i_care_str, i_length); + rc = __rs4_compress(rs4_str, &nibbles, i_data_str, i_care_str, i_length); if (rc == SCAN_COMPRESSION_OK) { bytes = rs4_max_compressed_bytes(nibbles); - io_data->iv_magic = htobe32(RS4_MAGIC); - io_data->iv_size = htobe32(bytes); - io_data->iv_algorithmReserved = htobe32(nibbles); - io_data->iv_scanSelect = htobe64(i_scanSelect); - io_data->iv_length = htobe32(i_length); - io_data->iv_headerVersion = COMPRESSED_SCAN_DATA_VERSION; - io_data->iv_flushOptimization = i_flushOptimization; - io_data->iv_ringId = i_ringId; - io_data->iv_chipletId = i_chipletId; - - *o_imageSize = bytes; + io_rs4->iv_magic = htobe16(RS4_MAGIC); + io_rs4->iv_version = RS4_VERSION; + // For now this assumes non-CMSK scan data. + // For CMSK support, we would need to: + // - either add a CMSK function parameter and set type here, + // - or rely on caller to set type later. + io_rs4->iv_type = RS4_SCAN_DATA_TYPE_NON_CMSK; + io_rs4->iv_size = htobe16(bytes); + io_rs4->iv_ringId = htobe16(i_ringId); + io_rs4->iv_scanAddr = htobe32(i_scanAddr); } return rc; @@ -675,29 +665,26 @@ _rs4_compress(CompressedScanData* io_data, // Returns a scan compression return code. int -rs4_compress(CompressedScanData** o_data, - uint32_t* o_size, +rs4_compress(CompressedScanData** o_rs4, const uint8_t* i_data_str, const uint8_t* i_care_str, const uint32_t i_length, - const uint64_t i_scanSelect, - const uint8_t i_ringId, - const uint8_t i_chipletId, - const uint8_t i_flushOptimization) + const uint32_t i_scanAddr, + const uint8_t i_ringId) { uint32_t nibbles = rs4_max_compressed_nibbles(i_length); uint32_t bytes = rs4_max_compressed_bytes(nibbles); - *o_data = (CompressedScanData*)malloc(bytes); + *o_rs4 = (CompressedScanData*)malloc(bytes); - if (*o_data == 0) + if (*o_rs4 == 0) { return BUG(SCAN_COMPRESSION_NO_MEMORY); } - return _rs4_compress(*o_data, bytes, o_size, i_data_str, - i_care_str, i_length, i_scanSelect, - i_ringId, i_chipletId, i_flushOptimization); + return _rs4_compress(*o_rs4, bytes, + i_data_str, i_care_str, i_length, + i_scanAddr, i_ringId); } @@ -709,8 +696,9 @@ rs4_compress(CompressedScanData** o_data, static int __rs4_decompress(uint8_t* io_data_str, uint8_t* io_care_str, - const uint8_t* i_rs4_str, - const uint32_t i_length) + uint32_t i_size, + uint32_t* o_length, + const uint8_t* i_rs4_str) { int state; /* 0 : Rotate, 1 : Scan */ uint32_t i; /* Nibble index in i_rs4_str */ @@ -738,9 +726,9 @@ __rs4_decompress(uint8_t* io_data_str, bits += 4 * count; - if (bits > i_length) + if (bits > i_size * 8) { - return BUG(SCAN_DECOMPRESSION_SIZE_ERROR); + return BUG(SCAN_COMPRESSION_BUFFER_OVERFLOW); } // keep 'count' zero care and data nibbles @@ -763,9 +751,9 @@ __rs4_decompress(uint8_t* io_data_str, nibbles = (masked ? 1 : nibbles); bits += 4 * nibbles; - if (bits > i_length) + if (bits > i_size * 8) { - return BUG(SCAN_DECOMPRESSION_SIZE_ERROR); + return BUG(SCAN_COMPRESSION_BUFFER_OVERFLOW); } for (k = 0; k < nibbles; k++) @@ -791,9 +779,9 @@ __rs4_decompress(uint8_t* io_data_str, r = nibbles & 0x3; bits += r; - if (bits != i_length) + if (bits > i_size * 8) { - return BUG(SCAN_DECOMPRESSION_SIZE_ERROR); + return BUG(SCAN_COMPRESSION_BUFFER_OVERFLOW); } if (r != 0) @@ -803,6 +791,7 @@ __rs4_decompress(uint8_t* io_data_str, rs4_set_nibble(io_data_str, j, rs4_get_nibble(i_rs4_str, i)); } + *o_length = bits; return SCAN_COMPRESSION_OK; } @@ -810,31 +799,27 @@ __rs4_decompress(uint8_t* io_data_str, int _rs4_decompress(uint8_t* io_data_str, uint8_t* io_care_str, - uint32_t i_stringSize, + uint32_t i_size, uint32_t* o_length, const CompressedScanData* i_rs4) { - uint32_t bytes; + uint8_t* rs4_str = (uint8_t*)i_rs4 + sizeof(CompressedScanData); - if (htobe32(i_rs4->iv_magic) != RS4_MAGIC) + if (htobe16(i_rs4->iv_magic) != RS4_MAGIC) { return BUG(SCAN_DECOMPRESSION_MAGIC_ERROR); } - *o_length = htobe32(i_rs4->iv_length); - bytes = (*o_length + 7) / 8; - - if (i_stringSize < bytes) + if (i_rs4->iv_version != RS4_VERSION) { - return BUG(SCAN_COMPRESSION_BUFFER_OVERFLOW); + return BUG(SCAN_COMPRESSION_VERSION_ERROR); } - memset(io_data_str, 0, bytes); - memset(io_care_str, 0, bytes); + memset(io_data_str, 0, i_size); + memset(io_care_str, 0, i_size); - return __rs4_decompress(io_data_str, io_care_str, - (uint8_t*)i_rs4 + sizeof(CompressedScanData), - *o_length); + return __rs4_decompress(io_data_str, io_care_str, i_size, + o_length, rs4_str); } @@ -844,25 +829,36 @@ rs4_decompress(uint8_t** o_data_str, uint32_t* o_length, const CompressedScanData* i_rs4) { - uint32_t length, bytes; + uint32_t size = 65536; + int rc; - if (htobe32(i_rs4->iv_magic) != RS4_MAGIC) + *o_data_str = (uint8_t*)malloc(size); + + if (*o_data_str == NULL) { - return BUG(SCAN_DECOMPRESSION_MAGIC_ERROR); + return BUG(SCAN_COMPRESSION_NO_MEMORY); } - length = htobe32(i_rs4->iv_length); - bytes = (length + 7) / 8; - - *o_data_str = (uint8_t*)malloc(bytes); - *o_care_str = (uint8_t*)malloc(bytes); + *o_care_str = (uint8_t*)malloc(size); - if (*o_data_str == 0 || *o_care_str == 0) + if (*o_care_str == NULL) { + free(*o_data_str); + *o_data_str = NULL; return BUG(SCAN_COMPRESSION_NO_MEMORY); } - return _rs4_decompress(*o_data_str, *o_care_str, bytes, o_length, i_rs4); + rc = _rs4_decompress(*o_data_str, *o_care_str, size, o_length, i_rs4); + + if (rc != SCAN_COMPRESSION_OK) + { + free(*o_data_str); + free(*o_care_str); + *o_data_str = NULL; + *o_care_str = NULL; + } + + return rc; } @@ -870,17 +866,16 @@ int rs4_redundant(const CompressedScanData* i_data, int* o_redundant) { uint8_t* data; - uint32_t length, stringLength, pos; + uint32_t length, pos; *o_redundant = 0; - if (htobe32(i_data->iv_magic) != RS4_MAGIC) + if (htobe16(i_data->iv_magic) != RS4_MAGIC) { return BUG(SCAN_DECOMPRESSION_MAGIC_ERROR); } data = (uint8_t*)i_data + sizeof(CompressedScanData); - stringLength = htobe32(i_data->iv_length); // A compressed scan string is redundant if the initial rotate is // followed by the end-of-string marker, and any remaining mod-4 bits @@ -906,12 +901,6 @@ rs4_redundant(const CompressedScanData* i_data, int* o_redundant) } } - if ((length > stringLength) || - (*o_redundant && (length != stringLength))) - { - return SCAN_DECOMPRESSION_SIZE_ERROR; - } - return SCAN_COMPRESSION_OK; } diff --git a/src/import/chips/p9/utils/imageProcs/p9_scan_compression.H b/src/import/chips/p9/utils/imageProcs/p9_scan_compression.H index 6845fc50d..bda54434a 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_scan_compression.H +++ b/src/import/chips/p9/utils/imageProcs/p9_scan_compression.H @@ -36,92 +36,49 @@ /// Compressed Scan Chain Data Structure Format /// /// The compressed scan ring data structure must be 8-byte aligned in -/// memory. The container data structure consists of this 24-byte header +/// memory. The container data structure consists of a header /// followed by an arbitrary number of 8 byte doublewords containing the -/// compressed scan data. Images are always stored and processed in -/// big-endian byte order. This container format is common across all +/// compressed scan data. Images are always stored and processed in +/// big-endian byte order. The header format is common across all /// decompression algorithms. /// -/// Bytes - Content -/// -/// 0:3 - A 32-bit "magic number" that identifies and validates the -/// compression algorithm and algorithm version used to compress the data. -/// -/// 4:7 - The 32-bit size of the entire data structure in \e bytes. Thi -/// consists of this 24-byte header plus the compressed scan data. This value -/// is always a multiple of 8. +/// ATTENTION: +/// The RS4v2 CompressedScanData had a 4 byte magic value with 0x34 ("4") +/// within its third byte, which is at the same byte position as iv_version +/// now. Users of CompressedScanData which use the magic value to detect +/// a ring data structure won't be able to distingish old and new +/// CompressedScanData for iv_version being 0x34. In the very unlikely case +/// that we would have that many versions of ComprossedScanData, it is +/// strongly suggested to simply skip 0x34 as version number. /// -/// 8:11 - This 32-bit value is reserved to the compression -/// algorithm. Typically this field is used to record the 'size' of the -/// compressed string in units specific to each algorithm. -/// -/// 12:15 - The length of the original scan chain in \e bits. -/// -/// 16:23 - The 64 bit scan Region and type details +/// Bytes - Content /// +/// 0:1 - A 16-bit "magic number" that identifies and validates the +/// compression algorithm used to compress the data ("RS"). /// -/// 24:27 - The 32 high-order bits of the value written to the Scan Select -/// register to set up the scan. The Scan Select register only defines these -/// bits. (Planned to use scan scom register value) +/// 2 - An 8-bit version number (3 for the time being). /// -/// 28 - The Scan Chain Data Structure version number +/// 3 - An 8-bit type field distinguishing different scan data types +/// (0 for non-CMSK, 1 for CMSK). /// -/// 29 - Flush-optimize : Is this byte is non-zero, the ring state to be -/// modified is the flush state of the ring. +/// 4:5 - The 16-bit size of the uncompressed scan data with +/// this header in \e bytes. This is not the exact length of actual scan data +/// in bits, but the number of bytes used by the RS4 encoding to store those +/// compressed scan bits. /// -/// 30 - The ring ID uniquely identifying the repair ring name. +/// 6:7 - The 16-bit ring ID uniquely identifying the ring. /// -/// 31 - The 7-bit pervasive chiplet Id + Multicast bit of the chiplet to -/// scan. This value is loaded directly into P0. The decompression -/// algorithms provide two entry points - one that uses this value as the -/// chiplet Id, and another that allows the caller to specify the chiplet Id -/// in the call. - +/// 8:11 - scan scom register value typedef struct { - - /// Magic number - See \ref scan_compression_magic - uint32_t iv_magic; - - /// Total size in bytes, including the container header - uint32_t iv_size; - - /// Reserved to the algorithm - uint32_t iv_algorithmReserved; - - /// Length of the original scan chain in bits - uint32_t iv_length; - - /// 64 bit scan select register value - uint64_t iv_scanSelect; - - /// Data structure (header) version - uint8_t iv_headerVersion; - - /// Flush-state optimization - /// - /// Normally, modifying the state of the ring requires XOR-ing the - /// difference state (the compressed state) with the current ring state as - /// it will appear in the Scan Data Register. If the current state of the - /// ring is the scan-0 flush state, then by definition the Scan Data - /// Register is always 0. Therefore we can simply write the difference to - /// the Scan Data Register rather than using a read-XOR-write. - uint8_t iv_flushOptimization; - - /// Ring ID uniquely identifying the repair name. (See the list of ring - /// name vs ring IDs in p8_ring_identification.c). - uint8_t iv_ringId; - - /// 7-bit pervasive chiplet Id + Multicast bit - /// - /// This field is right-justified in an 8-byte aligned doubleword so that - /// the P0 register can be directly updated from the doubelword value in a - /// data register. - uint8_t iv_chipletId; - + uint16_t iv_magic; + uint8_t iv_version; + uint8_t iv_type; + uint16_t iv_size; + uint16_t iv_ringId; + uint32_t iv_scanAddr; } CompressedScanData; - /// Endian-translate a CompressedScanData structure /// /// \param o_data A pointer to a CompressedScanData structure to receive the @@ -141,17 +98,14 @@ compressed_scan_data_translate(CompressedScanData* o_data, /// Compress a scan string using the RS4 compression algorithm /// -/// \param[in,out] io_data This is a pointer to a memory area which must be -/// large enough to hold the worst-case result of compressing \a i_string (see -/// below). Note that the CompressedScanData is always created in big-endian -/// format, however the caller can use compresed_scan_data_translate() to -/// create a copy of the header in host format. -/// -/// \param[in] i_dataSize The size of \a io_data in bytes. +/// \param[in,out] io_rs4 This is a pointer to a memory area which must be +/// large enough to hold the worst-case result of compressing \a i_data_str +/// and \a i_care_str (see below). Note that the CompressedScanData is +/// always created in big-endian format, however the caller can use +/// compresed_scan_data_translate() to create a copy of the header in +/// host format. /// -/// \param[out] o_imageSize The effective size of the entire compressed scan -/// data structure (header + compressed data) created in \a io_data, in bytes. -/// This value will always be a multiple of 8. +/// \param[in] i_size The size of the buffer pointed to by \a io_rs4. /// /// \param[in] i_data_str The string to compress. Scan data to compress is /// left-justified in this input string. @@ -162,61 +116,42 @@ compressed_scan_data_translate(CompressedScanData* o_data, /// \param[in] i_length The length of the input string in \e bits. It is /// assumed the \a i_string contains at least (\a i_length + 7) / 8 bytes. /// -/// \param[in] i_scanSelect The 64-bit value written to the Scan Select -/// register to set up for the scan. +/// \param[in] i_scanAddr The 32-bit scan address. /// /// \param[in] i_ringId The ring ID that uniquely identifies the ring name of -/// a repair ring. (See p8_ring_identification.c for more info.) -/// -/// \param[in] i_chipletId The 7-bit value for the iv_chipletId field of the -/// CompressedScanData. -/// -/// \param[in] i_flushOptimization This input parameter should be set to a -/// non-0 value if it is known that this ring difference will be applied to a -/// scan-0 flush state. This will improve the performance of the -/// decompress-scan routine. If the initial state of the ring is unknown, set -/// this parameter to 0. +/// a repair ring. (See p9_ring_id.h for more info.) /// /// This API is required for integration with PHYP which does not support /// malloc(). Applications in environments supporting malloc() can use /// rs4_compress() instead. /// -/// The worst-case compression for RS4 requires 2 nibbles of control overhead -/// per 15 nibbles of data (17/15), plus a maximum of 2 nibbles of termination. -/// We always require this worst-case amount of memory including the header and +/// We always require the worst-case amount of memory including the header and /// any rounding required to guarantee that the data size is a multiple of 8 /// bytes. The final image size is also rounded up to a multiple of 8 bytes. -/// If the \a i_dataSize is less than this amount (based on \a i_length) the +/// If the \a io_size is less than this amount (based on \a i_length) the /// call will fail. /// /// \returns See \ref scan_compression_codes int -_rs4_compress(CompressedScanData* io_data, - uint32_t i_dataSize, - uint32_t* o_imageSize, +_rs4_compress(CompressedScanData* io_rs4, + const uint32_t i_size, const uint8_t* i_data_str, const uint8_t* i_care_str, const uint32_t i_length, - const uint64_t i_scanSelect, - const uint8_t i_ringId, - const uint8_t i_chipletId, - const uint8_t i_flushOptimization); + const uint32_t i_scanAddr, + const uint16_t i_ringId); /// Compress a scan string using the RS4 compression algorithm /// -/// \param[out] o_data This algorithm uses malloc() to allocate memory for the -/// compresed data, and returns a pointer to this memory in \a o_data. After +/// \param[out] o_rs4 This algorithm uses malloc() to allocate memory for the +/// compressed data, and returns a pointer to this memory in \a o_rs4. After /// the call this memory is owned by the caller who is responsible for /// free()-ing the data area once it is no longer required. Note that the /// CompressedScanData is always created in big-endian format, however the /// caller can use compresed_scan_data_translate() to create a copy of the /// header in host format. /// -/// \param[out] o_size The effective size of the entire compressed scan data -/// structure (header + compressed data) pointed to by \a o_data, in bytes. -/// This value will always be a multiple of 8. -/// /// \param[in] i_data_str The string to compress. Scan data to compress is /// left-justified in this input string. /// @@ -226,33 +161,19 @@ _rs4_compress(CompressedScanData* io_data, /// \param[in] i_length The length of the input string in \e bits. It is /// assumed the \a i_string contains at least (\a i_length + 7) / 8 bytes. /// -/// \param[in] i_scanSelect The 64-bit value written to the Scan Select -/// register to set up for the scan. Only the 32 high-order bits are actually -/// stored. +/// \param[in] i_scanAddr The 32-bit scan address. /// /// \param[in] i_ringId The ring ID that uniquely identifies the ring name of -/// a repair ring. (See p8_ring_identification.c for more info.) -/// -/// \param[in] i_chipletId The 7-bit value for the iv_chipletId field of the -/// CompressedScanData. -/// -/// \param[in] i_flushOptimization This input parameter should be set to a -/// non-0 value if it is known that this ring difference will be applied to a -/// scan-0 flush state. This will improve the performance of the -/// decompress-scan routine. If the initial state of the ring is unknown, set -/// this parameter to 0. +/// a repair ring. (See p9_ring_id.c for more info.) /// /// \returns See \ref scan_compression_codes int -rs4_compress(CompressedScanData** o_data, - uint32_t* o_size, +rs4_compress(CompressedScanData** o_rs4, const uint8_t* i_data_str, const uint8_t* i_care_str, const uint32_t i_length, - const uint64_t i_scanSelect, - const uint8_t i_ringId, - const uint8_t i_chipletId, - const uint8_t i_flushOptimization); + const uint32_t i_scanAddr, + const uint8_t i_ringId); /// Decompress a scan string compressed using the RS4 compression algorithm @@ -267,8 +188,7 @@ rs4_compress(CompressedScanData** o_data, /// the decompressed care mask, which is the size of the original string in /// bits rounded up to the nearest byte. /// -/// \param[in] i_stringSize The size (in bytes) of \a io_data_str and -/// \a io_care_str. +/// \param[in] i_size The size in \e bytes of \a io_data_str and \a io_care_str. /// /// \param[out] o_length The length of the decompressed string in \e bits. /// @@ -283,7 +203,7 @@ rs4_compress(CompressedScanData** o_data, int _rs4_decompress(uint8_t* io_data_str, uint8_t* io_care_str, - uint32_t i_stringSize, + uint32_t i_size, uint32_t* o_length, const CompressedScanData* i_rs4); @@ -302,7 +222,7 @@ _rs4_decompress(uint8_t* io_data_str, /// in \e bits. The caller may assume that \a o_data_str and o_care_str each /// contain at least (\a o_length + 7) / 8 \e bytes. /// -/// \param[in] i_rs4 A pointer to the CompressedScanData header + data to be +/// \param[in] i_rs4 A pointer to the CompressedScanData header and data to be /// decompressed. /// /// \returns See \ref scan_compression_codes @@ -328,25 +248,30 @@ rs4_redundant(const CompressedScanData* i_data, int* o_redundant); #endif // __ASSEMBLER__ -/// The current version of the CompressedScanData structure -/// -/// This constant is required to be a #define to guarantee consistency between -/// the header format and cmopiled code. -#define COMPRESSED_SCAN_DATA_VERSION 2 - -/// The size of the CompressedScanData structure -#define COMPRESSED_SCAN_DATA_SIZE (uint8_t)24 - - /// \defgroup scan_compression_magic Scan Compression Magic Numbers -///// +/// /// @ { /// RS4 Magic -#define RS4_MAGIC (uint32_t)0x52533402 /* "RS4" + Version 0x02 */ +#define RS4_MAGIC 0x5253 /* "RS" */ /// @} +/// \defgroup scan_compression_version_type version and type accessors +/// +/// @{ + +/// The current version of the CompressedScanData structure +/// +/// This constant is required to be a #define to guarantee consistency between +/// the header format and compiled code. +#define RS4_VERSION 3 + +/// Scan data types +#define RS4_SCAN_DATA_TYPE_CMSK 1 +#define RS4_SCAN_DATA_TYPE_NON_CMSK 0 + +/// @} /// \defgroup scan_compression_codes Scan Compression Return Codes /// @@ -388,6 +313,9 @@ rs4_redundant(const CompressedScanData* i_data, int* o_redundant); /// Invalid transition in state machine #define SCAN_COMPRESSION_STATE_ERROR 6 +/// wrong compression version +#define SCAN_COMPRESSION_VERSION_ERROR 7 + /// @} #endif // __P9_SCAN_COMPRESSION_H__ |