summaryrefslogtreecommitdiffstats
path: root/src/usr/hwpf/hwp/build_winkle_images/proc_slw_build/p8_scan_compression.C
diff options
context:
space:
mode:
authorMark Wenning <wenning@us.ibm.com>2012-08-21 17:12:43 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-08-27 17:01:08 -0500
commit149c0e9fc8990bf219d9ba7cd8b91cb9a33006ca (patch)
tree8ac06d667f21ad1d0eaca5390af4c26653d35120 /src/usr/hwpf/hwp/build_winkle_images/proc_slw_build/p8_scan_compression.C
parentc89cb3ef7ec86dbc0585489744092794d3c286da (diff)
downloadtalos-hostboot-149c0e9fc8990bf219d9ba7cd8b91cb9a33006ca.tar.gz
talos-hostboot-149c0e9fc8990bf219d9ba7cd8b91cb9a33006ca.zip
Support for p8_xip_customize
Change-Id: I25f9071250f7330fd0da987e9590c70a89318ce6 RTC: 47293 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1577 Tested-by: Jenkins Server Reviewed-by: Van H. Lee <vanlee@us.ibm.com> Reviewed-by: Thi N. Tran <thi@us.ibm.com> Reviewed-by: Terry J. Opie <opiet@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/hwpf/hwp/build_winkle_images/proc_slw_build/p8_scan_compression.C')
-rw-r--r--src/usr/hwpf/hwp/build_winkle_images/proc_slw_build/p8_scan_compression.C64
1 files changed, 33 insertions, 31 deletions
diff --git a/src/usr/hwpf/hwp/build_winkle_images/proc_slw_build/p8_scan_compression.C b/src/usr/hwpf/hwp/build_winkle_images/proc_slw_build/p8_scan_compression.C
index 1cf8f8f46..339b8da01 100644
--- a/src/usr/hwpf/hwp/build_winkle_images/proc_slw_build/p8_scan_compression.C
+++ b/src/usr/hwpf/hwp/build_winkle_images/proc_slw_build/p8_scan_compression.C
@@ -1,4 +1,4 @@
-/* IBM_PROLOG_BEGIN_TAG
+ /* IBM_PROLOG_BEGIN_TAG
* This is an automatically generated prolog.
*
* $Source: src/usr/hwpf/hwp/build_winkle_images/proc_slw_build/p8_scan_compression.C $
@@ -21,7 +21,7 @@
*
* IBM_PROLOG_END_TAG
*/
-// $Id: p8_scan_compression.C,v 1.3 2012/05/22 15:57:28 bcbrock Exp $
+// $Id: p8_scan_compression.C,v 1.4 2012/08/17 16:19:44 cmolsen Exp $
// $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/utils/p8_scan_compression.C,v $
//------------------------------------------------------------------------------
// *! (C) Copyright International Business Machines Corp. 2011
@@ -31,7 +31,7 @@
// *! OWNER NAME: Bishop Brock Email: Bishop Brock; bcbrock@us.ibm.com
// *!
// *! General Description:
-// *!
+// *!
// *! See below.
//------------------------------------------------------------------------------
//
@@ -39,7 +39,7 @@
// for revision history of p8_scan_compression.c.
/// \file p8_scan_compression.C
-/// \brief APIs related to scan chain compression.
+/// \brief APIs related to scan chain compression.
///
/// RS4 Compression Format
/// ======================
@@ -103,34 +103,34 @@
/// (R S)* (R E) T D?
///
/// \code
-///
+///
/// <rs4_string> ::= <rotate> <terminate> |
/// <rotate> <scan> <rs4_string>
-///
+///
/// <rotate> ::= <octal_stop> |
/// <octal_go> <rotate>
-///
+///
/// <octal_go> ::= '0x0' | ... | '0x7'
-///
+///
/// <octal_stop> ::= '0x8' | ... | '0xf'
-///
+///
/// <scan> ::= <scan_count(N)> <data(N)>
-///
+///
/// <scan_count(N)> ::= * 0bnnnn, for N = 0bnnnn, N != 0 *
-///
+///
/// <data(N)> ::= * N nibbles of uncompressed data *
-///
+///
/// <terminate> ::= '0x0' <terminal_count(0)> |
/// '0x0' <terminal_count(T, T > 0)> <terminal_data(T)>
-///
+///
/// <terminal_count(T)> ::= * 0b00nn, for T = 0bnn *
-///
+///
/// <terminal_data(1)> ::= '0x0' | '0x8'
///
/// <terminal_data(2)> ::= '0x0' | '0x4' | '0x8' | '0xc'
///
/// <terminal_data(3)> ::= '0x0' | '0x2' | '0x4' | ... | '0xe'
-///
+///
/// \endcode
@@ -198,7 +198,7 @@ revle32(const uint32_t i_x)
#endif
return rx;
}
-
+
#if COMPRESSED_SCAN_DATA_VERSION != 1
#error This code assumes CompressedScanData structure version 1 layout
@@ -215,6 +215,7 @@ compressed_scan_data_translate(CompressedScanData* o_data,
o_data->iv_scanSelect = revle32(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;
}
@@ -235,7 +236,7 @@ get_nibble(const uint8_t* i_string, const uint32_t i_i)
}
return nibble;
}
-
+
// Set a big-endian-indexed nibble in a byte string
@@ -256,7 +257,7 @@ set_nibble(uint8_t* io_string, const uint32_t i_i, const int i_nibble)
// Encode an unsigned integer into a 4-bit octal stop code directly into a
// nibble stream at io_string<i_i>, returning the number of nibbles in the
-// resulting code.
+// resulting code.
static int
stop_encode(const uint32_t i_count, uint8_t* io_string, const uint32_t i_i)
@@ -316,7 +317,7 @@ stop_decode(uint32_t* o_count, const uint8_t* i_string, const uint32_t i_i)
return digits;
}
-
+
// RS4 compression algorithm notes:
//
// RS4 compression processes i_string as a string of nibbles. Final
@@ -335,7 +336,7 @@ stop_decode(uint32_t* o_count, const uint8_t* i_string, const uint32_t i_i)
static uint32_t
_rs4_compress(CompressedScanData* o_data,
- const uint8_t* i_string,
+ const uint8_t* i_string,
const uint32_t i_length)
{
int state; /* 0 : Rotate, 1 : Scan */
@@ -355,7 +356,7 @@ _rs4_compress(CompressedScanData* o_data,
data = (uint8_t*)o_data + sizeof(CompressedScanData);
count = 0;
state = 0;
-
+
// Process the bulk of the string. Note that state changes do not
// increment 'i' - the nibble at i_data<i> is always scanned again.
@@ -410,8 +411,8 @@ _rs4_compress(CompressedScanData* o_data,
j++;
// Insert the remainder count nibble, and if non-0, the remainder data
- // nibble.
-
+ // nibble.
+
set_nibble(data, j, r);
j++;
if (r != 0) {
@@ -419,7 +420,7 @@ _rs4_compress(CompressedScanData* o_data,
j++;
}
- // Return the number of nibbles in the compressed string.
+ // Return the number of nibbles in the compressed string.
return j;
}
@@ -435,9 +436,10 @@ _rs4_compress(CompressedScanData* o_data,
int
rs4_compress(CompressedScanData** o_data,
uint32_t* o_size,
- const uint8_t* i_string,
+ const uint8_t* i_string,
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)
{
@@ -464,7 +466,7 @@ rs4_compress(CompressedScanData** o_data,
(*o_data)->iv_scanSelect = revle32((uint32_t)(i_scanSelect >> 32));
(*o_data)->iv_headerVersion = COMPRESSED_SCAN_DATA_VERSION;
(*o_data)->iv_flushOptimization = i_flushOptimization;
- (*o_data)->iv_reserved = 0;
+ (*o_data)->iv_ringId = i_ringId;
(*o_data)->iv_chipletId = i_chipletId;
*o_size = bytes;
@@ -482,8 +484,8 @@ rs4_compress(CompressedScanData** o_data,
// Returns a scan compression return code.
static int
-_rs4_decompress(uint8_t* o_string,
- const uint8_t* i_string,
+_rs4_decompress(uint8_t* o_string,
+ const uint8_t* i_string,
const uint32_t i_length)
{
int rc;
@@ -589,12 +591,12 @@ rs4_decompress(uint8_t** o_string,
break;
}
- rc = _rs4_decompress(*o_string,
+ rc = _rs4_decompress(*o_string,
(uint8_t*)i_data + sizeof(CompressedScanData),
*o_length);
} while (0);
return rc;
}
-
-
+
+
OpenPOWER on IntegriCloud