diff options
author | Sumit Kumar <sumit_kumar@in.ibm.com> | 2017-04-04 06:41:33 -0500 |
---|---|---|
committer | Sachin Gupta <sgupta2m@in.ibm.com> | 2017-05-25 21:54:45 -0400 |
commit | 4e43ed941391a4fbb9ba391807511ec432cd5c10 (patch) | |
tree | 5e44f9146992000afd35f3972c79b25c8c27fd60 /src/import/chips/p9 | |
parent | 59ccf272b0eba53ed68f2a920cf2e7117835f903 (diff) | |
download | talos-sbe-4e43ed941391a4fbb9ba391807511ec432cd5c10.tar.gz talos-sbe-4e43ed941391a4fbb9ba391807511ec432cd5c10.zip |
Enablement of support for Stumped and Cmsk rings
- Currently its enabled for ec_func ring only
- Introduced new function read_scan_data_care_ring()
to read scan data & care bits for rings
- Updated scan address for cmsk ring
- Both ec_func's stumped and cmsk rs4 rings treated as
non-overrides
Change-Id: Id684ecb68d987f6ecd3f2e0476ab9aa2adce338f
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38788
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: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38791
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
Diffstat (limited to 'src/import/chips/p9')
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_ringId.C | 11 | ||||
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_ringId.H | 11 | ||||
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_ring_id.h | 4 | ||||
-rw-r--r-- | src/import/chips/p9/utils/imageProcs/p9_scan_compression.H | 34 | ||||
-rw-r--r-- | src/import/chips/p9/xip/p9_xip_tool.C | 240 |
5 files changed, 207 insertions, 93 deletions
diff --git a/src/import/chips/p9/utils/imageProcs/p9_ringId.C b/src/import/chips/p9/utils/imageProcs/p9_ringId.C index c4fc2d9a..6bcda87c 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_ringId.C +++ b/src/import/chips/p9/utils/imageProcs/p9_ringId.C @@ -435,11 +435,12 @@ namespace EC { const GenRingIdList RING_ID_LIST_COMMON[] = { - { "ec_func" , 0x00, 0x20, 0x20, EKB_RING , 0x2003700F}, - { "ec_gptr" , 0x01, 0x20, 0x20, EKB_RING , 0x20037002}, - { "ec_time" , 0x02, 0x20, 0x20, VPD_RING , 0x20037007}, - { "ec_mode" , 0x03, 0x20, 0x20, EKB_RING , 0x20037001}, - { "ec_abst" , 0x04, 0x20, 0x20, EKB_RING , 0x20037005}, + { "ec_func" , 0x00, 0x20, 0x20, EKB_STUMPED_RING , 0x2003700F}, + { "ec_gptr" , 0x01, 0x20, 0x20, EKB_RING , 0x20037002}, + { "ec_time" , 0x02, 0x20, 0x20, VPD_RING , 0x20037007}, + { "ec_mode" , 0x03, 0x20, 0x20, EKB_RING , 0x20037001}, + { "ec_abst" , 0x04, 0x20, 0x20, EKB_RING , 0x20037005}, + { "ec_cmsk" , 0xFF, 0xFF, 0xFF, EKB_CMSK_RING , 0x2003700A}, }; const GenRingIdList RING_ID_LIST_INSTANCE[] = { diff --git a/src/import/chips/p9/utils/imageProcs/p9_ringId.H b/src/import/chips/p9/utils/imageProcs/p9_ringId.H index af6a25dc..a1e75788 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_ringId.H +++ b/src/import/chips/p9/utils/imageProcs/p9_ringId.H @@ -40,6 +40,8 @@ enum RingClass { EKB_RING, EKB_FSM_RING, + EKB_STUMPED_RING, + EKB_CMSK_RING, VPD_RING, NUM_RING_CLASSES }; @@ -837,6 +839,7 @@ enum RingOffset ec_time = 2, ec_mode = 3, ec_abst = 4, + ec_cmsk = 5, // Instance Rings ec_repr = (0 | INSTANCE_RING_MARK) }; @@ -844,7 +847,7 @@ enum RingOffset static const CHIPLET_DATA g_ecData = { 32, // Core Chiplet ID range is 32-55. The base ID is 32. - 5, // 5 common rings for Core chiplet + 6, // 6 common rings for Core chiplet 1, // 1 instance specific ring for each Core chiplet 1 }; @@ -1124,7 +1127,8 @@ static const ringProperties_t RING_PROPERTIES[NUM_RING_IDS] = { EQ::eq_inex_bucket_1 , "eq_inex_bucket_1" , EQ_TYPE }, // 248 { EQ::eq_inex_bucket_2 , "eq_inex_bucket_2" , EQ_TYPE }, // 249 { EQ::eq_inex_bucket_3 , "eq_inex_bucket_3" , EQ_TYPE }, // 250 - { EQ::eq_inex_bucket_4 , "eq_inex_bucket_4" , EQ_TYPE } // 251 + { EQ::eq_inex_bucket_4 , "eq_inex_bucket_4" , EQ_TYPE }, // 251 + { EC::ec_cmsk , "ec_cmsk" , EC_TYPE }, // 252 }; #endif #ifdef __PPE__ @@ -1381,7 +1385,8 @@ static const ringProperties_t RING_PROPERTIES[NUM_RING_IDS] = { EQ::eq_inex_bucket_1 , EQ_TYPE }, // 248 { EQ::eq_inex_bucket_2 , EQ_TYPE }, // 249 { EQ::eq_inex_bucket_3 , EQ_TYPE }, // 250 - { EQ::eq_inex_bucket_4 , EQ_TYPE } // 251 + { EQ::eq_inex_bucket_4 , EQ_TYPE }, // 251 + { EC::ec_cmsk , EC_TYPE }, // 252 }; #endif diff --git a/src/import/chips/p9/utils/imageProcs/p9_ring_id.h b/src/import/chips/p9/utils/imageProcs/p9_ring_id.h index 1407596e..930664a4 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_ring_id.h +++ b/src/import/chips/p9/utils/imageProcs/p9_ring_id.h @@ -349,6 +349,10 @@ enum RingID eq_inex_bucket_2 = 249, eq_inex_bucket_3 = 250, eq_inex_bucket_4 = 251, + + // CMSK ring + ec_cmsk = 252, + //*************************** // Rings needed for SBE - End //*************************** 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 dfabe482..e26b695a 100644 --- a/src/import/chips/p9/utils/imageProcs/p9_scan_compression.H +++ b/src/import/chips/p9/utils/imageProcs/p9_scan_compression.H @@ -61,7 +61,7 @@ /// 3 - An 8-bit type field distinguishing different scan data types /// (0 for non-CMSK, 1 for CMSK). /// -/// 4:5 - The 16-bit size of the uncompressed scan data with +/// 4:5 - The 16-bit size of the compressed 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. @@ -245,6 +245,38 @@ int rs4_redundant(const CompressedScanData* i_data, int* o_redundant); +/// Check for CMSK ring in RS4 +/// +/// \param[in] i_rs4 A pointer to the RS4 CompressedScanData [header + data] +/// +/// \returns 1 if CMSK ring found, 0 otherwise +int rs4_is_cmsk(CompressedScanData* i_rs4); + + +/// Embed CMSK ring into an RS4 ring +/// +/// \param[inout] io_rs4 A pointer to the CompressedScanData [header + data] +/// +/// \param[in] i_rs4_cmsk A pointer to the cmsk CompressedScanData header + data to be embedded +/// +/// \returns See \ref scan_compression_codes +int rs4_embed_cmsk(CompressedScanData** io_rs4, + CompressedScanData* i_rs4_cmsk); + + +/// Extract Stump & CMSK rings from an RS4 ring +/// +/// \param[in] i_rs4 A pointer to the CompressedScanData [header + data] +/// +/// \param[inout] i_rs4_stump A pointer to the Stump CompressedScanData [header + data] +/// +/// \param[inout] i_rs4_cmsk A pointer to the Cmsk CompressedScanData [header + data] +/// +/// \returns See \ref scan_compression_codes +int rs4_extract_cmsk(CompressedScanData* i_rs4, + CompressedScanData** io_rs4_stump, + CompressedScanData** io_rs4_cmsk); + #endif // __ASSEMBLER__ diff --git a/src/import/chips/p9/xip/p9_xip_tool.C b/src/import/chips/p9/xip/p9_xip_tool.C index 03b8db9b..e219abf4 100644 --- a/src/import/chips/p9/xip/p9_xip_tool.C +++ b/src/import/chips/p9/xip/p9_xip_tool.C @@ -1832,12 +1832,17 @@ int dissectRingSectionTor( void* i_ringSection, char ringName[32]; uint32_t ringSeqNo = 0; // Ring sequence number CompressedScanData* rs4; + CompressedScanData* rs4Stump; + CompressedScanData* rs4Cmsk; + CompressedScanData* rs4Print; uint8_t* data; uint8_t* care; uint32_t bits; int rs4rc; uint16_t ringSize; double comprRate; + uint8_t cmskRingIteration = 0; + char ringSuffix = ' '; if (i_listingModeId != LMID_TABLE) { @@ -1957,105 +1962,172 @@ int dissectRingSectionTor( void* i_ringSection, ringSeqNo++; - // decompress ring to obtain ring length and to verify compressed string - rs4rc = rs4_decompress(&data, &care, &bits, rs4); - comprRate = (double)ringSize / (double)bits * 100.0; + // This do-while loop is for cmsk support to display + // both rs4 stump ring and rs4 cmsk ring else this + // loop would run only once + cmskRingIteration = 0; - // tabular ring list if "table". - if (i_listingModeId == LMID_TABLE) + do { - fprintf(stdout, - "%4i " - "0x%02x " - "%4s " - "%4s " - "0x%02x " - "%7d " - "%6.2f " - "%s ", - ringSeqNo, ddLevel, ppeTypeName[ppeType], - ringVariantName[ringVariant], instanceId, - bits, comprRate, ringName); - - if (rs4rc != SCAN_COMPRESSION_OK) + // decompress ring to obtain ring length and to verify compressed string + // check for cmsk ring + if (rs4_is_cmsk(rs4)) { - fprintf(stdout, "Decompression error %i)", rs4rc); + if (!cmskRingIteration) + { + // Extract Stump & Cmsk rings from large rs4 ring + // decompress each to get ring length and display + // accordingly + rc = rs4_extract_cmsk(rs4, &rs4Stump, &rs4Cmsk); + + if (rc) + { + fprintf(stdout, "CMSK extract error %i)", rc); + } + + cmskRingIteration++; + ringSuffix = 's'; + rs4Print = rs4Stump; //For 'raw' & 'long' display + ringBlockSize = be16toh(rs4Stump->iv_size); + rs4rc = rs4_decompress(&data, &care, &bits, rs4Stump); + } + else + { + cmskRingIteration--; + ringSuffix = 'c'; + rs4Print = rs4Cmsk; //For 'raw' & 'long' display + ringBlockSize = be16toh(rs4Cmsk->iv_size); + rs4rc = rs4_decompress(&data, &care, &bits, rs4Cmsk); + } + } + else + { + ringSuffix = ' '; + rs4Print = rs4; + rs4rc = rs4_decompress(&data, &care, &bits, rs4); } - fprintf(stdout, "\n"); - } - - // Summarize a few key characteristics of the ring block if "short". - if (i_listingModeId == LMID_SHORT) - { - fprintf( stdout, - "-----------------------------\n" - "%i.\n" - "ddLevel = 0x%02x\n" - "ppeType = %s\n" - "ringName = %s\n" - "ringVariant = %s\n" - "instanceId = 0x%02x\n", - ringSeqNo, ddLevel, ppeTypeName[ppeType], ringName, - ringVariantName[ringVariant], instanceId ); - } + comprRate = (double)ringSize / (double)bits * 100.0; - // Summarize all characteristics of the ring block if "normal", "long" or "raw" - if (i_listingModeId == LMID_NORMAL || - i_listingModeId == LMID_LONG || - i_listingModeId == LMID_RAW) - { - fprintf( stdout, - "-----------------------------\n" - "%i.\n" - "ddLevel = 0x%02x\n" - "ppeType = %s\n" - "ringId = %u\n" - "ringName = %s\n" - "ringVariant = %s\n" - "instanceId = 0x%02x\n" - "ringBlockSize = 0x%08x\n" - "raw bit length = %d\n" - "compression [%%] = %6.2f\n", - ringSeqNo, ddLevel, ppeTypeName[ppeType], ringId, ringName, - ringVariantName[ringVariant], instanceId, - ringBlockSize, bits, comprRate); - } + // tabular ring list if "table". + if (i_listingModeId == LMID_TABLE) + { + fprintf(stdout, + "%4i%c " + "0x%02x " + "%4s " + "%4s " + "0x%02x " + "%7d " + "%6.2f " + "%s ", + ringSeqNo, ringSuffix, ddLevel, ppeTypeName[ppeType], + ringVariantName[ringVariant], instanceId, + bits, comprRate, ringName); + + if (rs4rc != SCAN_COMPRESSION_OK) + { + fprintf(stdout, "Decompression error %i)", rs4rc); + } + + fprintf(stdout, "\n"); + } - // Dump ring block if "long" or "raw" - if (i_listingModeId == LMID_LONG || - i_listingModeId == LMID_RAW) - { - fprintf(stdout, "Binary ring block dump (LE format):\n"); + // Summarize a few key characteristics of the ring block if "short". + if (i_listingModeId == LMID_SHORT) + { + fprintf( stdout, + "-----------------------------\n" + "%i.%c\n" + "ddLevel = 0x%02x\n" + "ppeType = %s\n" + "ringName = %s\n" + "ringVariant = %s\n" + "instanceId = 0x%02x\n", + ringSeqNo, ringSuffix, ddLevel, ppeTypeName[ppeType], ringName, + ringVariantName[ringVariant], instanceId ); + } - for (i = 0; i < ringBlockSize / 8; i++) + // Summarize all characteristics of the ring block if "normal", "long" or "raw" + if (i_listingModeId == LMID_NORMAL || + i_listingModeId == LMID_LONG || + i_listingModeId == LMID_RAW) { fprintf( stdout, - "%04x: %04x %04x %04x %04x\n", - i * 8, - (uint16_t)( htobe64(*((uint64_t*)ringBlockPtr + i)) >> 48), - (uint16_t)( htobe64(*((uint64_t*)ringBlockPtr + i)) >> 32), - (uint16_t)( htobe64(*((uint64_t*)ringBlockPtr + i)) >> 16), - (uint16_t)( htobe64(*((uint64_t*)ringBlockPtr + i))) ); + "-----------------------------\n" + "%i.%c\n" + "ddLevel = 0x%02x\n" + "ppeType = %s\n" + "ringId = %u\n" + "ringName = %s\n" + "ringVariant = %s\n" + "instanceId = 0x%02x\n" + "ringBlockSize = 0x%08x\n" + "raw bit length = %d\n" + "compression [%%] = %6.2f\n", + ringSeqNo, ringSuffix, ddLevel, ppeTypeName[ppeType], ringId, ringName, + ringVariantName[ringVariant], instanceId, + ringBlockSize, bits, comprRate); } - } - // Below we dump the raw decompressed ring content in the exact same - // format that it appears as in EKB's ifCompiler generated raw ring - // files, i.e. *.bin.srd (DATA) and *.bin.srd.bitsModified (CARE). - if (i_listingModeId == LMID_RAW) - { - fprintf( stdout, "\nRaw decompressed DATA nibbles:\n"); - printRawRing( data, bits); + // Dump ring block if "long" or "raw" + if (i_listingModeId == LMID_LONG || + i_listingModeId == LMID_RAW) + { + fprintf(stdout, "Binary ring block dump (LE format):\n"); + + // Below code is used to display the stumped and + // cmsk raw|long ring block. + // @FIXME: Tried to display the same by assigning + // rs4Stump and rs4Cmsk to ringBlockPtr but having issue + // with ringBlockPtr being void pointer. + if (rs4_is_cmsk(rs4)) + { + for (i = 0; i < ringBlockSize / 8; i++) + { + fprintf( stdout, + "%04x: %04x %04x %04x %04x\n", + i * 8, + (uint16_t)( htobe64(*((uint64_t*)rs4Print + i)) >> 48), + (uint16_t)( htobe64(*((uint64_t*)rs4Print + i)) >> 32), + (uint16_t)( htobe64(*((uint64_t*)rs4Print + i)) >> 16), + (uint16_t)( htobe64(*((uint64_t*)rs4Print + i))) ); + } + } + else + { + for (i = 0; i < ringBlockSize / 8; i++) + { + fprintf( stdout, + "%04x: %04x %04x %04x %04x\n", + i * 8, + (uint16_t)( htobe64(*((uint64_t*)ringBlockPtr + i)) >> 48), + (uint16_t)( htobe64(*((uint64_t*)ringBlockPtr + i)) >> 32), + (uint16_t)( htobe64(*((uint64_t*)ringBlockPtr + i)) >> 16), + (uint16_t)( htobe64(*((uint64_t*)ringBlockPtr + i))) ); + } + } + } - fprintf( stdout, "\nRaw decompressed CARE nibbles:\n"); - printRawRing( care, bits); + // Below we dump the raw decompressed ring content in the exact same + // format that it appears as in EKB's ifCompiler generated raw ring + // files, i.e. *.bin.srd (DATA) and *.bin.srd.bitsModified (CARE). + if (i_listingModeId == LMID_RAW) + { + fprintf( stdout, "\nRaw decompressed DATA nibbles:\n"); + printRawRing( data, bits); - fprintf( stdout, "\n"); - } + fprintf( stdout, "\nRaw decompressed CARE nibbles:\n"); + printRawRing( care, bits); + + fprintf( stdout, "\n"); + } + + free(data); + free(care); - free(data); - free(care); + } + while (cmskRingIteration); } else if (rc == TOR_RING_NOT_FOUND || rc == TOR_INVALID_INSTANCE_ID || |