summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrachi Gupta <pragupta@us.ibm.com>2016-07-12 11:05:19 -0500
committerSachin Gupta <sgupta2m@in.ibm.com>2017-02-02 23:41:25 -0500
commit45d93b050d4233a596cb1beddf2f70f2c19326fe (patch)
tree9150038d161a0b6c798419e3b4769294d33118c2
parentec0caeeb0d414fa307fd0893c6bdb74959129eb6 (diff)
downloadtalos-sbe-45d93b050d4233a596cb1beddf2f70f2c19326fe.tar.gz
talos-sbe-45d93b050d4233a596cb1beddf2f70f2c19326fe.zip
Add build_tag to xip image header
When releasing an image to FW, we would like to keep track of which release tag was used to build this image. Later on, that release tag can be used to rebuild the same image. Change-Id: I734b9a642e1b1c0a63a1cc25ab9c61beb35b25f3 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/26930 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: Martin Peschke <mpeschke@de.ibm.com> Reviewed-by: Claus M. Olsen <cmolsen@us.ibm.com> Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com> Reviewed-by: Prachi Gupta <pragupta@us.ibm.com> Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/26932 Reviewed-by: Hostboot Team <hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
-rw-r--r--src/build/utils/base_ppe_header.S7
-rw-r--r--src/import/chips/p9/xip/p9_xip_image.c21
-rw-r--r--src/import/chips/p9/xip/p9_xip_image.h6
-rw-r--r--src/import/chips/p9/xip/p9_xip_tool.C1
4 files changed, 17 insertions, 18 deletions
diff --git a/src/build/utils/base_ppe_header.S b/src/build/utils/base_ppe_header.S
index d1e2c474..8242f415 100644
--- a/src/build/utils/base_ppe_header.S
+++ b/src/build/utils/base_ppe_header.S
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2016 */
+/* Contributors Listed Below - COPYRIGHT 2016,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -86,12 +86,15 @@ __build_date:
.long 0
__build_time:
.long 0
+__build_tag:
+ .asciz "unknown " # 16 Characters
__header_32_reserved:
- .long 0, 0, 0, 0, 0
+ .long 0
.xip_toc image_size, P9_XIP_UINT32, __image_size
.xip_toc build_date, P9_XIP_UINT32, __build_date
.xip_toc build_time, P9_XIP_UINT32, __build_time
+ .xip_toc build_tag, P9_XIP_STRING, __build_tag
//////////////////////////////////////////////////////////////////////
diff --git a/src/import/chips/p9/xip/p9_xip_image.c b/src/import/chips/p9/xip/p9_xip_image.c
index bad0ad5f..ed89d0fe 100644
--- a/src/import/chips/p9/xip/p9_xip_image.c
+++ b/src/import/chips/p9/xip/p9_xip_image.c
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER sbe Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2016 */
+/* Contributors Listed Below - COPYRIGHT 2015,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -1474,6 +1474,7 @@ xipHeaderFind(void* i_image, const char* i_id, P9XipItem* o_item)
HEADER_TOC(image_size, iv_imageSize, P9_XIP_UINT32),
HEADER_TOC(build_date, iv_buildDate, P9_XIP_UINT32),
HEADER_TOC(build_time, iv_buildTime, P9_XIP_UINT32),
+ HEADER_TOC(build_tag, iv_buildTag, P9_XIP_STRING),
HEADER_TOC(header_version, iv_headerVersion, P9_XIP_UINT8),
HEADER_TOC(toc_normalized, iv_normalized, P9_XIP_UINT8),
@@ -3068,10 +3069,7 @@ p9_xip_translate_header(P9XipHeader* o_dest, const P9XipHeader* i_src)
o_dest->iv_kernelAddr = htobe64(i_src->iv_kernelAddr);
o_dest->iv_linkAddress = htobe64(i_src->iv_linkAddress);
- for (i = 0; i < 3; i++)
- {
- o_dest->iv_reserved64[i] = 0;
- }
+ memset(o_dest->iv_reserved64, 0, sizeof(i_src->iv_reserved64));
for (i = 0, destSection = o_dest->iv_section,
srcSection = i_src->iv_section;
@@ -3084,20 +3082,16 @@ p9_xip_translate_header(P9XipHeader* o_dest, const P9XipHeader* i_src)
o_dest->iv_imageSize = htobe32(i_src->iv_imageSize);
o_dest->iv_buildDate = htobe32(i_src->iv_buildDate);
o_dest->iv_buildTime = htobe32(i_src->iv_buildTime);
+ memcpy(o_dest->iv_buildTag, i_src->iv_buildTag,
+ sizeof(i_src->iv_buildTag));
- for (i = 0; i < 5; i++)
- {
- o_dest->iv_reserved32[i] = 0;
- }
+ o_dest->iv_reserved32 = 0;
o_dest->iv_headerVersion = i_src->iv_headerVersion;
o_dest->iv_normalized = i_src->iv_normalized;
o_dest->iv_tocSorted = i_src->iv_tocSorted;
- for (i = 0; i < 3; i++)
- {
- o_dest->iv_reserved8[i] = 0;
- }
+ memset(o_dest->iv_reserved8, 0, sizeof(i_src->iv_reserved8));
memcpy(o_dest->iv_buildUser, i_src->iv_buildUser,
sizeof(i_src->iv_buildUser));
@@ -3105,7 +3099,6 @@ p9_xip_translate_header(P9XipHeader* o_dest, const P9XipHeader* i_src)
sizeof(i_src->iv_buildHost));
memcpy(o_dest->iv_reservedChar, i_src->iv_reservedChar,
sizeof(i_src->iv_reservedChar));
-
#else
if (o_dest != i_src)
diff --git a/src/import/chips/p9/xip/p9_xip_image.h b/src/import/chips/p9/xip/p9_xip_image.h
index e25de0bd..97f21d35 100644
--- a/src/import/chips/p9/xip/p9_xip_image.h
+++ b/src/import/chips/p9/xip/p9_xip_image.h
@@ -391,8 +391,11 @@ typedef struct
/// Build time generated by `date +%H%M`, e.g., 0756
uint32_t iv_buildTime;
+ /// Build tag, generated when releasing this image to fw
+ char iv_buildTag[16];
+
/// Reserved for future expansion
- uint32_t iv_reserved32[5];
+ uint32_t iv_reserved32;
//////////////////////////////////////////////////////////////////////
// Other Information - 1-byte aligned; 8 entries
@@ -422,7 +425,6 @@ typedef struct
/// Reserved for future expansion
char iv_reservedChar[8];
-
} P9XipHeader;
diff --git a/src/import/chips/p9/xip/p9_xip_tool.C b/src/import/chips/p9/xip/p9_xip_tool.C
index 27150f55..bfa40cd6 100644
--- a/src/import/chips/p9/xip/p9_xip_tool.C
+++ b/src/import/chips/p9/xip/p9_xip_tool.C
@@ -555,6 +555,7 @@ dumpHeader(void* i_image)
header.iv_buildTime % 100);
printf("Build User : %s\n", header.iv_buildUser);
printf("Build Host : %s\n", header.iv_buildHost);
+ printf("Build Tag : %s\n", header.iv_buildTag);
printf("\n");
printf("Section Table :\n\n");
OpenPOWER on IntegriCloud