From e7a4e6b61e43caeb44cab0222e9af3b71fbe03ea Mon Sep 17 00:00:00 2001 From: Thi Tran Date: Tue, 18 Aug 2015 13:24:17 -0500 Subject: SW317422: INITPROC: FSP&Hostboot - update to sbe_xip_image.c from SW315832 Change-Id: If0f665d8de601028d7f405c3da5b6f9fa4443099 CQ:SW317422 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/19900 Reviewed-by: Thi N. Tran Tested-by: Thi N. Tran Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/19904 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: Jenkins OP HW Reviewed-by: A. Patrick Williams III --- .../p8_slw_build/sbe_xip_image.c | 32 ++++++++++++---------- .../p8_slw_build/sbe_xip_image.h | 14 ++++++++-- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/sbe_xip_image.c b/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/sbe_xip_image.c index 33cdd77c3..b3b344137 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/sbe_xip_image.c +++ b/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/sbe_xip_image.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: sbe_xip_image.c,v 1.28 2013/12/11 00:12:41 bcbrock Exp $ +// $Id: sbe_xip_image.c,v 1.31 2015/07/29 23:40:06 cmolsen Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/sbe/sbe_xip_image.c,v $ //----------------------------------------------------------------------------- // *! (C) Copyright International Business Machines Corp. 2011 @@ -580,7 +580,7 @@ xipPutSection(const void* i_image, SbeXipSection* i_hostSection) { int rc; - SbeXipSection *imageSection; + SbeXipSection *imageSection = NULL; rc = xipGetSectionPointer(i_image, i_sectionId, &imageSection); @@ -598,7 +598,7 @@ XIP_STATIC int xipSetSectionOffset(void* io_image, const int i_section, const uint32_t i_offset) { - SbeXipSection* section; + SbeXipSection* section = NULL; int rc; rc = xipGetSectionPointer(io_image, i_section, §ion); @@ -614,7 +614,7 @@ xipSetSectionOffset(void* io_image, const int i_section, XIP_STATIC int xipSetSectionSize(void* io_image, const int i_section, const uint32_t i_size) { - SbeXipSection* section; + SbeXipSection* section = NULL; int rc; rc = xipGetSectionPointer(io_image, i_section, §ion); @@ -1030,7 +1030,7 @@ xipHashCollision(SbeXipHashedToc* i_fixedToc, size_t i_entries) for (j = i + 1; j < i_entries; j++) { if (i_fixedToc[i].iv_hash == i_fixedToc[j].iv_hash) { rc = TRACE_ERRORX(SBE_XIP_HASH_COLLISION, - "Hash collision at index %d\n", + "Hash collision at index %zd\n", i); break; } @@ -1372,7 +1372,7 @@ sbe_xip_validate(void* i_image, const uint32_t i_size) if (sizeof(SbeXipSection) != SIZE_OF_SBE_XIP_SECTION) { rc = TRACE_ERRORX(SBE_XIP_BUG, - "C/Assembler size mismatch(%d/%d) " + "C/Assembler size mismatch(%zd/%d) " "for SbeXipSection\n", sizeof(SbeXipSection), SIZE_OF_SBE_XIP_SECTION); break; @@ -1380,7 +1380,7 @@ sbe_xip_validate(void* i_image, const uint32_t i_size) if (sizeof(SbeXipToc) != SIZE_OF_SBE_XIP_TOC) { rc = TRACE_ERRORX(SBE_XIP_BUG, - "C/Assembler size mismatch(%d/%d) " + "C/Assembler size mismatch(%zd/%d) " "for SbeXipToc\n", sizeof(SbeXipToc), SIZE_OF_SBE_XIP_TOC); break; @@ -1388,7 +1388,7 @@ sbe_xip_validate(void* i_image, const uint32_t i_size) if (sizeof(SbeXipHashedToc) != SIZE_OF_SBE_XIP_HASHED_TOC) { rc = TRACE_ERRORX(SBE_XIP_BUG, - "C/Assembler size mismatch(%d/%d) " + "C/Assembler size mismatch(%zd/%d) " "for SbeXipHashedToc\n", sizeof(SbeXipHashedToc), SIZE_OF_SBE_XIP_HASHED_TOC); @@ -1499,7 +1499,7 @@ sbe_xip_validate2(void* i_image, const uint32_t i_size, const uint32_t i_maskIgn if (sizeof(SbeXipSection) != SIZE_OF_SBE_XIP_SECTION) { rc = TRACE_ERRORX(SBE_XIP_BUG, - "C/Assembler size mismatch(%d/%d) " + "C/Assembler size mismatch(%zd/%d) " "for SbeXipSection\n", sizeof(SbeXipSection), SIZE_OF_SBE_XIP_SECTION); break; @@ -1507,7 +1507,7 @@ sbe_xip_validate2(void* i_image, const uint32_t i_size, const uint32_t i_maskIgn if (sizeof(SbeXipToc) != SIZE_OF_SBE_XIP_TOC) { rc = TRACE_ERRORX(SBE_XIP_BUG, - "C/Assembler size mismatch(%d/%d) " + "C/Assembler size mismatch(%zd/%d) " "for SbeXipToc\n", sizeof(SbeXipToc), SIZE_OF_SBE_XIP_TOC); break; @@ -1515,7 +1515,7 @@ sbe_xip_validate2(void* i_image, const uint32_t i_size, const uint32_t i_maskIgn if (sizeof(SbeXipHashedToc) != SIZE_OF_SBE_XIP_HASHED_TOC) { rc = TRACE_ERRORX(SBE_XIP_BUG, - "C/Assembler size mismatch(%d/%d) " + "C/Assembler size mismatch(%zd/%d) " "for SbeXipHashedToc\n", sizeof(SbeXipHashedToc), SIZE_OF_SBE_XIP_HASHED_TOC); @@ -1706,7 +1706,7 @@ sbe_xip_get_section(const void* i_image, SbeXipSection* o_hostSection) { int rc; - SbeXipSection *imageSection; + SbeXipSection *imageSection = NULL; rc = xipGetSectionPointer(i_image, i_sectionId, &imageSection); @@ -2251,7 +2251,8 @@ sbe_xip_append(void* io_image, SbeXipSection section, initialSection; int rc, final, restoreOnError; void* hostAddress; - uint32_t pad, initialSize; + uint32_t pad; + uint32_t initialSize = 0; do { restoreOnError = 0; @@ -2487,8 +2488,9 @@ sbe_xip_translate_header(SbeXipHeader* o_dest, const SbeXipHeader* i_src) o_dest->iv_magic = xipRevLe64(i_src->iv_magic); o_dest->iv_entryOffset = xipRevLe64(i_src->iv_entryOffset); o_dest->iv_linkAddress = xipRevLe64(i_src->iv_linkAddress); + o_dest->iv_ptsVersion = xipRevLe64(i_src->iv_ptsVersion); - for (i = 0; i < 5; i++) { + for (i = 0; i < 4; i++) { o_dest->iv_reserved64[i] = 0; } diff --git a/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/sbe_xip_image.h b/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/sbe_xip_image.h index a2667e7b4..ef6dd236f 100644 --- a/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/sbe_xip_image.h +++ b/src/usr/hwpf/hwp/build_winkle_images/p8_slw_build/sbe_xip_image.h @@ -5,7 +5,7 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2015 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -25,7 +25,7 @@ #ifndef __SBE_XIP_IMAGE_H #define __SBE_XIP_IMAGE_H -// $Id: sbe_xip_image.h,v 1.24 2013/06/13 20:26:33 bcbrock Exp $ +// $Id: sbe_xip_image.h,v 1.26 2015/07/29 23:40:17 cmolsen Exp $ // $Source: /afs/awd/projects/eclipz/KnowledgeBase/.cvsroot/eclipz/chips/p8/working/procedures/ipl/sbe/sbe_xip_image.h,v $ //----------------------------------------------------------------------------- // *! (C) Copyright International Business Machines Corp. 2011 @@ -149,6 +149,11 @@ #endif /* __ASSEMBLER__ */ +/// Define the PTS version +/// +/// Note that this should only be done on per PHYP instruction and only here +#define PTS_VERSION 1 + /// Maximum section alignment for SBE-XIP sections #define SBE_XIP_MAX_SECTION_ALIGNMENT 128 @@ -343,8 +348,11 @@ typedef struct { /// address uint64_t iv_linkAddress; + /// PTS version + uint64_t iv_ptsVersion; + /// Reserved for future expansion - uint64_t iv_reserved64[5]; + uint64_t iv_reserved64[4]; ////////////////////////////////////////////////////////////////////// // Section Table - 4-byte aligned; 16 entries -- cgit v1.2.1