diff options
Diffstat (limited to 'src')
5 files changed, 76 insertions, 48 deletions
diff --git a/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_delta_scan_rw.h b/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_delta_scan_rw.h index 35f39ea73..83d11d6dd 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_delta_scan_rw.h +++ b/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_delta_scan_rw.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -22,7 +22,7 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: p8_delta_scan_rw.h,v 1.52 2014/09/01 20:00:09 jmcgill Exp $ +// $Id: p8_delta_scan_rw.h,v 1.53 2014/09/11 19:01:13 szhong Exp $ #define OVERRIDE_OFFSET 8 // Byte offset of forward pointer's addr relative // to base forward pointer's addr. #define SIZE_IMAGE_BUF_MAX 5000000 // Max ~5MB image buffer size. @@ -261,7 +261,7 @@ int create_wiggle_flip_prg( uint8_t i_flushOptimization, uint32_t i_scanMaxRotate, uint32_t i_waitsScanDelay, - uint32_t i_ddLevel); + uint8_t i_usePollingProt); uint64_t calc_ring_layout_entry_offset( uint8_t i_typeRingLayout, @@ -337,6 +337,7 @@ int write_vpd_ring_to_slw_image( uint32_t &io_sizeImageOut, CompressedScanData *i_bufRs4Ring, uint32_t i_ddLevel, + uint8_t i_usePollingProt, uint8_t i_sysPhase, char *i_ringName, void *i_bufTmp, diff --git a/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_image_help.C b/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_image_help.C index 0983c977d..8d2988a14 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_image_help.C +++ b/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_image_help.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -22,7 +22,7 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: p8_image_help.C,v 1.61 2014/07/23 20:08:36 jmcgill Exp $ +// $Id: p8_image_help.C,v 1.65 2014/09/11 21:41:26 aalugore Exp $ // /*------------------------------------------------------------------------------*/ /* *! TITLE : p8_image_help.C */ @@ -124,7 +124,7 @@ int create_wiggle_flip_prg( uint32_t *i_deltaRing, // scan ring delta s uint8_t i_flushOptimization, // flush optimize or not uint32_t i_scanMaxRotate, // Max rotate bit len on 38xxx, or polling threshold on 39xxx. uint32_t i_waitsScanDelay, // Temporary debug support. - uint32_t i_ddLevel) // DD level. + uint8_t i_usePollingProt) // Use Polling Protocol( s1, p8>=20, n1>=10) { uint32_t rc=0; uint32_t i=0; @@ -250,8 +250,8 @@ int create_wiggle_flip_prg( uint32_t *i_deltaRing, // scan ring delta s if (rotateLen > 0) { - if (i_ddLevel>=0x20) { // Use polling protocol. - + if (i_usePollingProt!=0x00) { // Use polling protocol. + MY_DBG("create_wiggle_flip: using polling protocol\n"); PoreInlineLocation srcp1=0,tgtp1=0; pore_imm64b = uint64_t(rotateLen)<<32; @@ -272,7 +272,7 @@ int create_wiggle_flip_prg( uint32_t *i_deltaRing, // scan ring delta s } } else { // Do not use polling protocol. - + MY_DBG("create_wiggle_flip: not using polling protocol\n"); scanRing_poreAddr = scanRing_baseAddr | rotateLen; pore_LD(&ctx, D0, scanRing_poreAddr, P1); if (ctx.error > 0) { @@ -359,15 +359,15 @@ int create_wiggle_flip_prg( uint32_t *i_deltaRing, // scan ring delta s else rotateLen = rotateLen + remainingBits; - if (i_ddLevel>=0x20) { // Use polling protocol. - - PoreInlineLocation srcp2=0,tgtp2=0; + if (i_usePollingProt!=0x00) { // Use polling protocol. + MY_DBG("create_wiggle_flip: using polling protocol\n"); + PoreInlineLocation srcp2=0,tgtp2=0; // Max rotate length is 2^20-1, i.e., data BITS(12-31)=>0x000FFFFF - if (rotateLen>=SCAN_MAX_ROTATE_LONG) { - MY_INF("Scanning should never be here since max possible ring length is\n"); - MY_INF("480,000 bits but MAX_LONG_ROTATE=0x%0x and rotateLen=0x%0x\n", - SCAN_MAX_ROTATE_LONG, rotateLen); + if (rotateLen>=SCAN_MAX_ROTATE_LONG) { + MY_INF("Scanning should never be here since max possible ring length is\n"); + MY_INF("480,000 bits but MAX_LONG_ROTATE=0x%0x and rotateLen=0x%0x\n", + SCAN_MAX_ROTATE_LONG, rotateLen); pore_imm64b = uint64_t(SCAN_MAX_ROTATE_LONG)<<32; pore_STI(&ctx, scanRing_baseAddr_long, P0, pore_imm64b); if (ctx.error > 0) { @@ -392,7 +392,7 @@ int create_wiggle_flip_prg( uint32_t *i_deltaRing, // scan ring delta s } else { // Do not use polling protocol. - + MY_DBG("create_wiggle_flip: not using polling protocol\n"); if (rotateLen>i_scanMaxRotate) { scanRing_poreAddr = scanRing_baseAddr | i_scanMaxRotate; pore_LD(&ctx, D0, scanRing_poreAddr, P1); @@ -417,10 +417,11 @@ int create_wiggle_flip_prg( uint32_t *i_deltaRing, // scan ring delta s // If the scan ring has not been rotated to the original position // shift the ring by remaining shift bit length. if (rotateLen>0) { - if (i_ddLevel>=0x20) { // Use polling protocol. - - PoreInlineLocation srcp3=0,tgtp3=0; + if (i_usePollingProt!=0x00) { // Use polling protocol. + PoreInlineLocation srcp3=0,tgtp3=0; + MY_DBG("create_wiggle_flip: using polling protocol\n"); + pore_imm64b = uint64_t(rotateLen)<<32; pore_STI(&ctx, scanRing_baseAddr_long, P0, pore_imm64b); @@ -441,6 +442,7 @@ int create_wiggle_flip_prg( uint32_t *i_deltaRing, // scan ring delta s } else { // Do not use polling protocol. + MY_DBG("create_wiggle_flip: not using polling protocol\n"); scanRing_poreAddr=scanRing_baseAddr | rotateLen; pore_LD(&ctx, D0, scanRing_poreAddr, P1); @@ -800,6 +802,7 @@ int write_wiggle_flip_to_image( void *io_imageOut, deltaLC = (uint32_t)myRev64(i_ringLayout->entryOffset) - bufLC; if (deltaLC<0 || deltaLC>=8) { MY_ERR("Ring layout mess. Check code or delta_scan(). deltaLC=%i",deltaLC); + if(ringsBuffer) free(ringsBuffer); return IMGBUILD_ERR_CHECK_CODE; } if (deltaLC>0) { @@ -998,7 +1001,7 @@ int initialize_slw_section( void *io_image, if (rc) return rc; if (sizeSectionChk!=FIXED_SLW_SECTION_SIZE) { - MY_ERR("Section size of .slw (=%i) not equal to requested size (=%i).\n", + MY_ERR("Section size of .slw (=%i) not equal to requested size (=%zi).\n", sizeSectionChk, FIXED_SLW_SECTION_SIZE); return IMGBUILD_ERR_SECTION_SIZING; } @@ -1143,7 +1146,7 @@ int create_and_initialize_fixed_image( void *io_image) MY_ERR("Size of .fit section (=%i) can not be negative.\n",sizeSectionFit); MY_ERR("Size of fixed image = %i\n",FIXED_SLW_IMAGE_SIZE); MY_ERR("Size of input image = %i\n",sizeImageIn); - MY_ERR("Size of .slw section = %i\n",FIXED_SLW_SECTION_SIZE); + MY_ERR("Size of .slw section = %zi\n",FIXED_SLW_SECTION_SIZE); MY_ERR("Size of .ffdc section = %i\n",FIXED_FFDC_SECTION_SIZE); return IMGBUILD_ERR_SECTION_SIZING; } @@ -1585,13 +1588,14 @@ int write_vpd_ring_to_ipl_image(void *io_image, // Notes: int write_vpd_ring_to_slw_image(void *io_image, uint32_t &io_sizeImageOut, - CompressedScanData *i_bufRs4Ring, // HB buf1. BE format. - uint32_t i_ddLevel, - uint8_t i_sysPhase, - char *i_ringName, - void *i_bufTmp, // HB buf2 - uint32_t i_sizeBufTmp, - uint8_t i_bWcSpace) + CompressedScanData *i_bufRs4Ring, // HB buf1. BE format. + uint32_t i_ddLevel, + uint8_t i_usePollingProt, + uint8_t i_sysPhase, + char *i_ringName, + void *i_bufTmp, // HB buf2 + uint32_t i_sizeBufTmp, + uint8_t i_bWcSpace) { uint32_t rc=0, bufLC; uint8_t chipletId, idxVector=0; @@ -1662,6 +1666,8 @@ int write_vpd_ring_to_slw_image(void *io_image, wfInline = (uint32_t*)i_bufRs4Ring; // Reuse this buffer (HB buf1) for wiggle-flip prg. wfInlineLenInWords = i_sizeBufTmp/4; // Assuming same size of both HB buf1 and buf2. + + rc = create_wiggle_flip_prg((uint32_t*)i_bufTmp, sizeRingRaw, myRev32(i_bufRs4Ring->iv_scanSelect), @@ -1671,7 +1677,7 @@ int write_vpd_ring_to_slw_image(void *io_image, i_bufRs4Ring->iv_flushOptimization, (uint32_t)scanMaxRotate, (uint32_t)waitsScanDelay, - i_ddLevel ); + i_usePollingProt ); if (rc) { MY_ERR("create_wiggle_flip_prg() failed w/rc=%i; ",rc); return IMGBUILD_ERR_WF_CREATE; diff --git a/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_slw_build_fixed.C b/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_slw_build_fixed.C index 18d5a5e76..f823ce874 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_slw_build_fixed.C +++ b/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_slw_build_fixed.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -22,7 +22,7 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: p8_slw_build_fixed.C,v 1.20 2014/07/25 19:42:24 jmcgill Exp $ +// $Id: p8_slw_build_fixed.C,v 1.23 2014/09/11 22:47:00 cmolsen Exp $ /*------------------------------------------------------------------------------*/ /* *! TITLE : p8_slw_build_fixed */ /* *! DESCRIPTION : Extracts and decompresses delta ring states from EPROM */ @@ -102,8 +102,7 @@ ReturnCode p8_slw_build_fixed( const fapi::Target &i_target, uint64_t ptrTmp1, ptrTmp2; uint32_t bufLC; uint8_t ffdc_temp; - - // Sanity checks on buffers and image. + // Sanity checks on buffers and image. // - validate image. // - do pre-allocated buffers exist? // - are pre-allocated buffers the correct size? @@ -368,7 +367,7 @@ ReturnCode p8_slw_build_fixed( const fapi::Target &i_target, FAPI_DBG("--> bSleepEnable = 0x%x ",bSleepEnable); // Obtain ring name and ring's vector location from image. if (bSleepEnable) { - uint8_t chipType; + uint8_t chipType; rc = FAPI_ATTR_GET_PRIVILEGED(ATTR_NAME, &i_target, chipType); if (rc) { FAPI_ERR("FAPI_ATTR_GET_PRIVILEGED() failed w/rc=%i and chipType=0x%02x",(uint32_t)rc,chipType); @@ -631,7 +630,7 @@ ReturnCode p8_slw_build_fixed( const fapi::Target &i_target, // Create Wiggle-Flip Programs (but first resolve max rotate status.) // ========================================================================== FAPI_DBG("--> Creating Wiggle-Flip Program."); - + rcLoc = sbe_xip_get_scalar( (void*)i_imageIn, SCAN_MAX_ROTATE_38XXX_NAME, &scanMaxRotate); if (rcLoc) { FAPI_INF("WARNING: sbe_xip_get_scalar() failed...but we might wing it."); @@ -668,16 +667,25 @@ ReturnCode p8_slw_build_fixed( const fapi::Target &i_target, wfInline = (uint32_t*)i_buf1; wfInlineLenInWords = i_sizeBuf1/4; + //WSZ query ec feature for poolling protocol for Murano/Venice >=20, Naples >=10 + uint8_t usePollingProt = 0x00; //true 0x01 false 0x00 + rc = FAPI_ATTR_GET(ATTR_CHIP_EC_FEATURE_USE_POLLING_PROT, &i_target,usePollingProt); + if (rc) { + FAPI_ERR("p8_slw_build: fapiGetAttribute error (ATTR_CHIP_EC_FEATURE_USE_POLLING_PROT)"); + return rc; + } + FAPI_DBG("p8_slw_build_fixed use PollingProt = 0x%02X (true=0x01, false=0x00)", usePollingProt); + rcLoc = create_wiggle_flip_prg( (uint32_t*)i_buf2, // Input buffer, buf2 ringBitLen, myRev32(deltaRingRS4->iv_scanSelect), (uint32_t)deltaRingRS4->iv_chipletId, &wfInline, // Output buffer, buf1 &wfInlineLenInWords, - deltaRingRS4->iv_flushOptimization, - (uint32_t)scanMaxRotate, + deltaRingRS4->iv_flushOptimization, + (uint32_t)scanMaxRotate, (uint32_t)waitsScanDelay, - ddLevel ); + usePollingProt); if (rcLoc) { FAPI_ERR("create_wiggle_flip_prg() failed w/rcLoc=%i",rcLoc); uint32_t & RC_LOCAL=rcLoc; @@ -768,11 +776,8 @@ ReturnCode p8_slw_build_fixed( const fapi::Target &i_target, FAPI_DBG("\tUpdating image w/WF prg + ring header was successful."); - // Update some variables for debugging and error reporting. -#ifdef IMGBUILD_PPD_IGNORE_XIPC - uint32_t sizeImageOld = sizeImageTmp; -#endif countWF++; + } // End of if (rcSearch!=DSLWB_RING_SEARCH_NO_MATCH) @@ -809,6 +814,7 @@ ReturnCode p8_slw_build_fixed( const fapi::Target &i_target, } FAPI_INF("Xip customization done."); #else + uint32_t sizeImageOld; // // Initialize .slw section, just in case we ignore xip_customize in a build. // @@ -849,6 +855,7 @@ ReturnCode p8_slw_build_fixed( const fapi::Target &i_target, // - Do not append .ffdc. // -------------------------------------------------------------------- case P8_SLW_MODEBUILD_SRAM: // SRAM mode. + sizeImageOld = sizeImageTmp; sizeImageTmp = sizeImageOutMax; rcLoc = initialize_slw_section( i_imageOut, &sizeImageTmp); diff --git a/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_xip_customize.C b/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_xip_customize.C index 22a0f4ada..eabae6667 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_xip_customize.C +++ b/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/p8_xip_customize.C @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -22,7 +22,7 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: p8_xip_customize.C,v 1.72 2014/07/03 19:52:55 jmcgill Exp $ +// $Id: p8_xip_customize.C,v 1.74 2014/09/11 19:10:16 szhong Exp $ /*------------------------------------------------------------------------------*/ /* *! TITLE : p8_xip_customize */ /* *! DESCRIPTION : Obtains repair rings from VPD and adds them to either */ @@ -330,11 +330,22 @@ ReturnCode p8_xip_customize_insert_chiplet_rings( const fapi::Target &i_target, } else { // Add VPD ring to --->>> SLW <<<--- image + //WSZ query ec feature for poolling protocol for Murano/Venice >=20, Naples >=10 + uint8_t usePollingProt = 0x00; //true 0x01 false 0x00 + rc = FAPI_ATTR_GET(ATTR_CHIP_EC_FEATURE_USE_POLLING_PROT, &i_target,usePollingProt); + if (rc) { + FAPI_ERR("p8_xip_customize: fapiGetAttribute error (ATTR_CHIP_EC_FEATURE_USE_POLLING_PROT)"); + return rc; + } + FAPI_DBG("p8_xip_customize usePollingProt = 0x%02X (true=0x01, false=0x00)", usePollingProt); + + rcLoc = write_vpd_ring_to_slw_image( o_imageOut, sizeImageOut, (CompressedScanData*)bufVpdRing, //HB buf1 ddLevel, + usePollingProt, i_sysPhase, (char*)(ring_id_list+iRing)->ringNameImg, (void*)i_buf2, //HB buf2 @@ -346,6 +357,7 @@ ReturnCode p8_xip_customize_insert_chiplet_rings( const fapi::Target &i_target, FAPI_SET_HWP_ERROR(rc, RC_PROC_XIPC_WRITE_VPD_RING_TO_SLW_IMAGE_ERROR); return rc; } + } } //no buffer overflow } //ring found in VPD diff --git a/src/usr/hwpf/hwp/sbe_centaur_init/cen_xip_customize.C b/src/usr/hwpf/hwp/sbe_centaur_init/cen_xip_customize.C index 876c72f80..2e87f36c4 100644 --- a/src/usr/hwpf/hwp/sbe_centaur_init/cen_xip_customize.C +++ b/src/usr/hwpf/hwp/sbe_centaur_init/cen_xip_customize.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2015 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -20,7 +22,7 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -// $Id: cen_xip_customize.C,v 1.14 2014/05/28 21:17:25 thi Exp $ +// $Id: cen_xip_customize.C,v 1.15 2014/09/12 21:29:23 mklight Exp $ /*------------------------------------------------------------------------------*/ /* *! TITLE : cen_xip_customize.C */ /* *! DESCRIPTION : Customizes Centaur images from a Centaur reference image. */ @@ -233,7 +235,7 @@ ReturnCode cen_xip_customize(const fapi::Target &i_target, 1, // Always do flush optimization. (uint32_t)scanMaxRotate, 0, // No need to use waits for Centaur. - 0x00000010); // Centaur doesn't support scan polling. + 0); // Centaur doesn't support scan polling. if (rcLoc) { FAPI_ERR("create_wiggle_flip_prg() failed w/rcLoc=%i",rcLoc); uint32_t &RC_LOCAL=rcLoc; |