summaryrefslogtreecommitdiffstats
path: root/src/import/chips/p9/utils
diff options
context:
space:
mode:
authorSumit Kumar <sumit_kumar@in.ibm.com>2017-04-04 06:41:33 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-05-31 11:01:52 -0400
commit8898e7a10e9d02406588e320c6ff47f1385c7a30 (patch)
treed39d8ed762d05488cbbd9b6e275db538b16179b2 /src/import/chips/p9/utils
parenta37296cfa80ff8291b715885da79e1fedc23aa7c (diff)
downloadtalos-hostboot-8898e7a10e9d02406588e320c6ff47f1385c7a30.tar.gz
talos-hostboot-8898e7a10e9d02406588e320c6ff47f1385c7a30.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/38792 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> 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: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/import/chips/p9/utils')
-rw-r--r--src/import/chips/p9/utils/imageProcs/p9_ringId.C11
-rw-r--r--src/import/chips/p9/utils/imageProcs/p9_ringId.H11
-rw-r--r--src/import/chips/p9/utils/imageProcs/p9_ring_id.h4
-rw-r--r--src/import/chips/p9/utils/imageProcs/p9_scan_compression.C84
-rw-r--r--src/import/chips/p9/utils/imageProcs/p9_scan_compression.H34
5 files changed, 135 insertions, 9 deletions
diff --git a/src/import/chips/p9/utils/imageProcs/p9_ringId.C b/src/import/chips/p9/utils/imageProcs/p9_ringId.C
index 74abdc45d..ccf7281af 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 8b501bf1e..93927e483 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 98b9d58f3..bcd0b7c59 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.C b/src/import/chips/p9/utils/imageProcs/p9_scan_compression.C
index 871d596fd..b2e3711a7 100644
--- a/src/import/chips/p9/utils/imageProcs/p9_scan_compression.C
+++ b/src/import/chips/p9/utils/imageProcs/p9_scan_compression.C
@@ -902,8 +902,92 @@ rs4_redundant(const CompressedScanData* i_data, int* o_redundant)
return SCAN_COMPRESSION_OK;
}
+// Check for RS4 contains CMSK ring
+int
+rs4_is_cmsk(CompressedScanData* i_rs4)
+{
+ return(i_rs4->iv_type == RS4_SCAN_DATA_TYPE_CMSK);
+}
+
+
+// Embed CMSK ring container into RS4 container:
+// |------RS4 Header------|
+// |-----CMSK Header------|
+// |-----CMSK RS4 Data----|
+// |-------RS4 Data-------|
+int
+rs4_embed_cmsk(CompressedScanData** io_rs4, CompressedScanData* i_rs4_cmsk)
+{
+ char* embedded_addr = (char*)(*io_rs4 + 1);
+ size_t embedded_size = be16toh(i_rs4_cmsk->iv_size);
+ size_t total_size = be16toh((*io_rs4)->iv_size) + embedded_size;
+
+ // Enlarge RS4 container to accomodate cmsk ring
+ *io_rs4 = (CompressedScanData*)realloc(*io_rs4, total_size);
+ if (!*io_rs4)
+ {
+ return BUG(SCAN_COMPRESSION_NO_MEMORY);
+ }
+
+ // Make space for cmsk ring
+ memmove(embedded_addr + embedded_size,
+ embedded_addr,
+ be16toh((*io_rs4)->iv_size) - sizeof(CompressedScanData));
+ // Copy cmsk ring into rs4
+ memcpy(embedded_addr,
+ i_rs4_cmsk,
+ embedded_size);
+
+ // Update header fields
+ (*io_rs4)->iv_size = htobe16(total_size);
+ (*io_rs4)->iv_type = RS4_SCAN_DATA_TYPE_CMSK;
+
+ return SCAN_COMPRESSION_OK;
+}
+// Extract Stump & Cmsk ring containers
+int
+rs4_extract_cmsk(CompressedScanData* i_rs4,
+ CompressedScanData** io_rs4_stump,
+ CompressedScanData** io_rs4_cmsk)
+{
+ CompressedScanData* embedded_addr = (CompressedScanData*)(i_rs4 + 1);
+
+ // Get size of Stump and Cmsk rings
+ size_t embedded_size = be16toh(embedded_addr->iv_size);
+ size_t stump_size = be16toh(i_rs4->iv_size) - embedded_size;
+
+ // Allocate memory for Stump and Cmsk rings
+ *io_rs4_stump = (CompressedScanData*)malloc(stump_size);
+ *io_rs4_cmsk = (CompressedScanData*)malloc(embedded_size);
+
+ if (!*io_rs4_stump || !*io_rs4_cmsk)
+ {
+ return BUG(SCAN_COMPRESSION_NO_MEMORY);
+ }
+
+ // Copy Cmsk ring - (header+data)
+ memcpy(*io_rs4_cmsk,
+ embedded_addr,
+ embedded_size);
+
+ // Copy Stump ring - header
+ memcpy(*io_rs4_stump,
+ i_rs4,
+ sizeof(CompressedScanData));
+
+ // Copy Stump ring - data
+ memcpy(((CompressedScanData*)(*io_rs4_stump) + 1),
+ (uint8_t*)embedded_addr + embedded_size,
+ stump_size - sizeof(CompressedScanData));
+
+ // Update header fields - stump
+ (*io_rs4_stump)->iv_size = htobe16(stump_size);
+ (*io_rs4_stump)->iv_type = RS4_SCAN_DATA_TYPE_NON_CMSK;
+
+ 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 360d70e99..b6fc8ac4c 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__
OpenPOWER on IntegriCloud