diff options
author | Sumit Kumar <sumit_kumar@in.ibm.com> | 2017-06-06 04:18:53 -0500 |
---|---|---|
committer | Joshua Hunsberger <jahunsbe@us.ibm.com> | 2017-10-23 18:19:14 -0500 |
commit | 19e897dd16e86b1d3b3df4e082b6bd5a058eb4b7 (patch) | |
tree | b3818f06d1aa92503cc291b922e4f5b816967013 | |
parent | cbf44abffbfe75e96e1480cd7621f1c0bf0c5976 (diff) | |
download | talos-hcode-19e897dd16e86b1d3b3df4e082b6bd5a058eb4b7.tar.gz talos-hcode-19e897dd16e86b1d3b3df4e082b6bd5a058eb4b7.zip |
GPTR/Overlays stage-1b support in xip_customize
- 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>
-rw-r--r-- | import/chips/p9/utils/imageProcs/p9_infrastruct_help.H | 2 | ||||
-rw-r--r-- | import/chips/p9/utils/imageProcs/p9_scan_compression.C | 53 | ||||
-rw-r--r-- | import/chips/p9/utils/imageProcs/p9_scan_compression.H | 5 | ||||
-rw-r--r-- | import/chips/p9/utils/imageProcs/p9_tor.C | 4 | ||||
-rw-r--r-- | import/chips/p9/xip/p9_xip_image.C | 6 | ||||
-rw-r--r-- | import/chips/p9/xip/p9_xip_image.h | 3 | ||||
-rw-r--r-- | import/chips/p9/xip/p9_xip_tool.C | 58 |
7 files changed, 68 insertions, 63 deletions
diff --git a/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H b/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H index 8061e0db..516f3a35 100644 --- a/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H +++ b/import/chips/p9/utils/imageProcs/p9_infrastruct_help.H @@ -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 diff --git a/import/chips/p9/utils/imageProcs/p9_scan_compression.C b/import/chips/p9/utils/imageProcs/p9_scan_compression.C index 10fdf003..8a245d4c 100644 --- a/import/chips/p9/utils/imageProcs/p9_scan_compression.C +++ b/import/chips/p9/utils/imageProcs/p9_scan_compression.C @@ -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 @@ -990,3 +991,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"); +} diff --git a/import/chips/p9/utils/imageProcs/p9_scan_compression.H b/import/chips/p9/utils/imageProcs/p9_scan_compression.H index 412e7f79..0d399983 100644 --- a/import/chips/p9/utils/imageProcs/p9_scan_compression.H +++ b/import/chips/p9/utils/imageProcs/p9_scan_compression.H @@ -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 /// diff --git a/import/chips/p9/utils/imageProcs/p9_tor.C b/import/chips/p9/utils/imageProcs/p9_tor.C index ea8ecd46..c316fd44 100644 --- a/import/chips/p9/utils/imageProcs/p9_tor.C +++ b/import/chips/p9/utils/imageProcs/p9_tor.C @@ -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) { @@ -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); diff --git a/import/chips/p9/xip/p9_xip_image.C b/import/chips/p9/xip/p9_xip_image.C index 78f1fa10..5bfd130d 100644 --- a/import/chips/p9/xip/p9_xip_image.C +++ b/import/chips/p9/xip/p9_xip_image.C @@ -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) @@ -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; } diff --git a/import/chips/p9/xip/p9_xip_image.h b/import/chips/p9/xip/p9_xip_image.h index 6c0d4e8b..212440ef 100644 --- a/import/chips/p9/xip/p9_xip_image.h +++ b/import/chips/p9/xip/p9_xip_image.h @@ -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. @@ -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 diff --git a/import/chips/p9/xip/p9_xip_tool.C b/import/chips/p9/xip/p9_xip_tool.C index 8b092a5a..8ed1373c 100644 --- a/import/chips/p9/xip/p9_xip_tool.C +++ b/import/chips/p9/xip/p9_xip_tool.C @@ -1742,60 +1742,6 @@ TEST(void* io_image, const int i_argc, const char** i_argv) #ifndef __PPE__ // Needed on the ppe side to avoid TOR API - -// 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). -static -void printRawRing( 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++) - { - fprintf( stdout, "%02x", *(data + i)); - - if (++bytePerWordCount == 4) - { - fprintf( stdout, " "); - bytePerWordCount = 0; - } - - if (++bytePerLineCount == 32) - { - fprintf( stdout, "\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 - fprintf( stdout, "%01x", nibblesToPrint >> 4); - } - else - { - // Content in both nibbles. Dump both nibbles - fprintf( stdout, "%02x", nibblesToPrint); - } - } - - fprintf( stdout, "\n"); -} - - //@FIXME: This should be improved. Probably defined somewhere else. #define CHIPLET_ID_MAX (uint8_t)0x37 @@ -2115,10 +2061,10 @@ int dissectRingSectionTor( void* i_ringSection, if (i_listingModeId == LMID_RAW) { fprintf( stdout, "\nRaw decompressed DATA nibbles:\n"); - printRawRing( data, bits); + print_raw_ring( data, bits); fprintf( stdout, "\nRaw decompressed CARE nibbles:\n"); - printRawRing( care, bits); + print_raw_ring( care, bits); fprintf( stdout, "\n"); } |