Skip to content

Commit

Permalink
GPTR/Overlays stage-1b support in xip_customize
Browse files Browse the repository at this point in the history
- Enabled to poll Nimbus DD level with support for overlays
  in the XIP.
- Enabled to pass hw image with overlays section populated
  with dd levels.

Change-Id: Ib7de3698ac103b34293115d0b4870afd0e617315
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41407
Reviewed-by: Thi N. Tran <thi@us.ibm.com>
Reviewed-by: Claus M. Olsen <cmolsen@us.ibm.com>
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: Jennifer A. Stofer <stofer@us.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41409
Reviewed-by: Dean Sanner <dsanner@us.ibm.com>
Tested-by: Dean Sanner <dsanner@us.ibm.com>
  • Loading branch information
sumitk56 authored and sannerd committed Jul 14, 2017
1 parent 609e5f1 commit d6ef298
Show file tree
Hide file tree
Showing 8 changed files with 562 additions and 84 deletions.
501 changes: 424 additions & 77 deletions src/import/chips/p9/procedures/hwp/customize/p9_xip_customize.C

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@
<ffdc>CHIP_TARGET</ffdc>
<ffdc>RING_ID</ffdc>
<ffdc>CHIPLET_ID</ffdc>
<ffdc>LOCAL_RC</ffdc>
<ffdc>OCCURRENCE</ffdc>
</hwpError>
<!-- ********************************************************************* -->
<hwpError>
Expand Down Expand Up @@ -334,4 +336,74 @@
<ffdc>OCCURRENCE</ffdc>
</hwpError>
<!-- ********************************************************************* -->
<hwpError>
<rc>RC_XIPC_GPTR_GET_SINGLE_RING_ERROR</rc>
<description>tor_get_single_ring() for gptr failed</description>
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
</callout>
<ffdc>CHIP_TARGET</ffdc>
<ffdc>RING_ID</ffdc>
<ffdc>CHIPLET_ID</ffdc>
<ffdc>LOCAL_RC</ffdc>
<ffdc>OCCURRENCE</ffdc>
</hwpError>
<!-- ********************************************************************* -->
<hwpError>
<rc>RC_XIPC_RS4_DECOMPRESS_ERROR</rc>
<description>rs4_decompress() for gptr failed</description>
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
</callout>
<ffdc>CHIP_TARGET</ffdc>
<ffdc>RING_ID</ffdc>
<ffdc>CHIPLET_ID</ffdc>
<ffdc>LOCAL_RC</ffdc>
<ffdc>OCCURRENCE</ffdc>
</hwpError>
<!-- ********************************************************************* -->
<hwpError>
<rc>RC_XIPC_GPTR_RING_SIZES_MISMATCH_ERROR</rc>
<description>Vpd and Ovly ring sizes mismatch</description>
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
</callout>
<ffdc>CHIP_TARGET</ffdc>
<ffdc>VPD_SIZE</ffdc>
<ffdc>OVLY_SIZE</ffdc>
</hwpError>
<!-- ********************************************************************* -->
<hwpError>
<rc>RC_XIPC_RS4_COMPRESS_ERROR</rc>
<description>rs4_compress() for gptr failed</description>
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
</callout>
<ffdc>CHIP_TARGET</ffdc>
<ffdc>RING_ID</ffdc>
<ffdc>CHIPLET_ID</ffdc>
<ffdc>LOCAL_RC</ffdc>
<ffdc>OCCURRENCE</ffdc>
</hwpError>
<!-- ********************************************************************* -->
<hwpError>
<rc>RC_XIPC_RING_BUFFER_MISMATCH_ERROR</rc>
<description>process_gptr_rings(): Failed with ring buffers mismatch</description>
<callout>
<procedure>CODE</procedure>
<priority>HIGH</priority>
</callout>
<ffdc>CHIP_TARGET</ffdc>
<ffdc>RING_ID</ffdc>
<ffdc>RING_BUF2</ffdc>
<ffdc>RING_BUF2_LOCAL</ffdc>
<ffdc>RING_BUF3</ffdc>
<ffdc>RING_BUF3_LOCAL</ffdc>
<ffdc>OCCURRENCE</ffdc>
</hwpError>
<!-- ********************************************************************* -->
</hwpErrors>
2 changes: 1 addition & 1 deletion src/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ enum MODEBUILD
#if defined(__FAPI)
#include <fapi2.H>
#define MY_INF(_fmt_, _args_...) FAPI_INF(_fmt_, ##_args_)
#define MY_ERR(_fmt_, _args_...) FAPI_INF(_fmt_, ##_args_)
#define MY_ERR(_fmt_, _args_...) FAPI_ERR(_fmt_, ##_args_)
#define MY_DBG(_fmt_, _args_...) FAPI_DBG(_fmt_, ##_args_)
#else
#ifdef WIN32
Expand Down
53 changes: 53 additions & 0 deletions src/import/chips/p9/utils/imageProcs/p9_scan_compression.C
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
#include <string.h>
#include <endian.h>
#include "p9_scan_compression.H"
#include "p9_infrastruct_help.H"

// Diagnostic aids for debugging
#ifdef DEBUG_P9_SCAN_COMPRESSION
Expand Down Expand Up @@ -991,3 +992,55 @@ rs4_extract_cmsk(CompressedScanData* i_rs4,
return SCAN_COMPRESSION_OK;
}


// This function prints out the raw decompressed ring content in the same
// format that it appears as in EKB's ifCompiler generated raw ring
// files, i.e. *.bin.srd (DATA) and *.bin.srd.bitsModified (CARE).
void print_raw_ring( uint8_t* data,
uint32_t bits )
{
uint32_t i;
uint8_t bytePerWordCount = 0; // Nibble count in each word
uint32_t bytePerLineCount = 0; // Column count
uint8_t rem = bits % 8; // Rem raw bits beyond 1-byte boundary
uint8_t nibblesToPrint; // The last 1 or 2 nibbles to dump

for (i = 0; i < bits / 8; i++)
{
MY_DBG("%02x", *(data + i));

if (++bytePerWordCount == 4)
{
MY_DBG(" ");
bytePerWordCount = 0;
}

if (++bytePerLineCount == 32)
{
MY_DBG("\n");
bytePerLineCount = 0;
}
}

// Dump remaining bits (in whole nibbles and with any
// unused bits being zeroed)
if (rem)
{
// Ensure the rightmost (8-rem) unused bits are zeroed out
nibblesToPrint = (*(data + i) >> (8 - rem)) << (8 - rem);

if (rem <= 4)
{
// Content only in first nibble. Dump only first nibble
MY_DBG("%01x", nibblesToPrint >> 4);
}
else
{
// Content in both nibbles. Dump both nibbles
MY_DBG("%02x", nibblesToPrint);
}
}

MY_DBG("\n");
}

5 changes: 5 additions & 0 deletions src/import/chips/p9/utils/imageProcs/p9_scan_compression.H
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ int rs4_extract_cmsk(CompressedScanData* i_rs4,

#endif // __ASSEMBLER__

// This function prints out the raw decompressed ring content in the same
// format that it appears as in EKB's ifCompiler generated raw ring
// files, i.e. *.bin.srd (DATA) and *.bin.srd.bitsModified (CARE).
void print_raw_ring( uint8_t* data, uint32_t bits);


/// \defgroup scan_compression_magic Scan Compression Magic Numbers
///
Expand Down
4 changes: 2 additions & 2 deletions src/import/chips/p9/utils/imageProcs/p9_tor.C
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ int get_ring_from_sbe_image( void* i_ringSection, // Ring section
return TOR_INVALID_CHIPLET;
}

l_num_variant = (i_RingVariant == OVERRIDE) ? 1 : l_num_variant;
l_num_variant = (i_RingVariant == OVERRIDE || i_RingVariant == OVERLAY) ? 1 : l_num_variant;

if (i_dbgl > 1)
{
Expand Down Expand Up @@ -157,7 +157,7 @@ int get_ring_from_sbe_image( void* i_ringSection, // Ring section
if ((strcmp( (ring_id_list_common + i)->ringName,
RING_PROPERTIES[i_ringId].iv_name) == 0)
&& ( i_RingVariant == ring_variant_order->variant[iVariant]
|| (i_RingVariant == OVERRIDE && i_magic == P9_XIP_MAGIC_SEEPROM)))
|| ( (i_RingVariant == OVERRIDE || i_RingVariant == OVERLAY) && i_magic == P9_XIP_MAGIC_SEEPROM)))
{
strcpy(o_ringName, RING_PROPERTIES[i_ringId].iv_name);

Expand Down
6 changes: 5 additions & 1 deletion src/import/chips/p9/xip/p9_xip_image.C
Original file line number Diff line number Diff line change
Expand Up @@ -2054,7 +2054,6 @@ p9_xip_get_section(const void* i_image,
{
int rc = 0;
P9XipSection* imageSection;

rc = xipGetSectionPointer(i_image, i_sectionId, &imageSection);

if (!rc)
Expand Down Expand Up @@ -2110,6 +2109,11 @@ p9_xip_get_section(const void* i_image,
}
}
}
else
{
// Invalid arg, caller error or code bug.
rc = P9_XIP_INVALID_ARGUMENT;
}

return rc;
}
Expand Down
3 changes: 0 additions & 3 deletions src/import/chips/p9/xip/p9_xip_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -1506,8 +1506,6 @@ p9_xip_decode_toc_dump(void* i_image, void* i_dump,

/// Code bug in the ddLevel handling codes
#define P9_XIP_DDLEVEL_CODE_BUG 22
/// Temporary error code to help prevent image co-req for stage 2 release of RTC174302
#define P9_XIP_OVERLAYS_NOT_SUPPORTED 23

/// Applications can expand this macro to declare an array of string forms of
/// the error codes if desired.
Expand Down Expand Up @@ -1536,7 +1534,6 @@ p9_xip_decode_toc_dump(void* i_image, void* i_dump,
"P9_XIP_NO_DDLEVEL_SUPPORT", \
"P9_XIP_DDLEVEL_NOT_FOUND", \
"P9_XIP_DDLEVEL_CODE_BUG", \
"P9_XIP_OVERLAYS_NOT_SUPPORTED", \
}

/// Applications can use this macro to safely index the array of error
Expand Down

0 comments on commit d6ef298

Please sign in to comment.